1 / 60

600 likes | 860 Vues

Graphs. Ed. 2. and 3.: Chapter 12 Ed. 4.: Chapter 13. Graphs Graph ADT - What is a graph? - Graph methods Data structure for graphs - Edge list structure, adjacency list structure, adjacency matrix Graph Traversal - Depth-first search - Breadth-first search Directed graphs.

Télécharger la présentation
## 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

**Graphs**• Ed. 2. and 3.: Chapter 12 • Ed. 4.: Chapter 13**Graphs**• Graph ADT • - What is a graph? • - Graph methods • Data structure for graphs • - Edge list structure, adjacency list • structure, adjacency matrix • Graph Traversal • - Depth-first search • - Breadth-first search • Directed graphs**(u, v)**u v (Toronto) (Winnipeg) (v, u)**u**v (New York) (Winnipeg) (v, u)**element**c1 c2 rank c3**Edge Objects**The edge object for an edge e storing element o has data fields for A reference to o · A Boolean indicator of whether e is directed or not · · References to the vertex objects in V associated with the endpoint vertices of e (if the edge e is undir ected) or to the origin and destination vertices of e (if the edge e is directed) · A reference to the position of the edge - object in container E Note: The last data field is the rank of the edge object in the container E if E is a vector.**element**With an edge list, some methods (edge - based) are fast while others need some efforts. For example, methods endVertices(), origin(), and destination() are fast because we can access edges directly. end vertex 1 or 0 end vertex

More Related