1 / 6

Graphs

Graphs. Ruth Anderson CSE 140 University of Washington. A graph contains nodes and edges. Chicago. Seattle. Salt Lake City. San Francisco. Dallas. + 350 students in no romantic and/or sexual relationship

istas
Download Presentation

Graphs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graphs Ruth Anderson CSE 140 University of Washington

  2. A graph contains nodes and edges Chicago Seattle Salt Lake City San Francisco Dallas

  3. + 350 students in no romantic and/or sexual relationship From: “Chains of Affection: The Structure of Adolescent Romantic and Sexual Networks”, American Journal of Sociology,by Peter Bearmanof (Columbia), James Moody (Ohio State), and Katherine Stovel (U. of Washngton);

  4. Graphs • A graph can be thought of as either of: • a collection of edges • Each edge represents some relationship • for each node, a collection of neighbors • The neighbors are those connected by an edge

  5. Operations on a graph Creation: • Create an empty graph Querying: • Look up a node: Does it exist? What are its neighbors? • Look up an edge (= a pair of nodes): does it exist? (You know the nodes it connects.) • Iterate through the nodes or edges Modification: • Add/remove a node • Add/remove an edge

More Related