{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec0425-GraphImplementations - Announcements MP 7 available...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Announcements: MP 7 available. Due 5/2, 11:59p. Today: Graphs - Weiss, Chapter 9 Implementation Traversal Q: if this graph is simple and connected, how many edges does it have? A: at least ________, at most _________
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Graphs: Toward implementation…(ADT) Data: Vertices Edges + some structure that reflects the connectivity of the graph X V W Z Y b e d f g h Functions: (merely a smattering…) insertVertex(pair keyData) insertEdge(vertex v1, vertex v2, pair keyData) removeEdge(edge e); removeVertex(vertex v); incidentEdges(vertex v); areAdjacent(vertex v1, vertex v2); origin(edge e); destination(edge e);
Background image of page 2
Graphs: Edge List (a first implementation) v u w a c b z d a b c d u v w z Some functions we’ll compare: insertVertex(vertex v) removeVertex(vertex v) areAdjacent(vertex v, vertex u) incidentEdges(vertex v)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Graphs: Adjacency Matrix v u w a c b z d a b c d u v w z u v w z u v w z Some functions we’ll compare: insertVertex(vertex v) removeVertex(vertex v) areAdjacent(vertex v, vertex u) incidentEdges(vertex v)
Background image of page 4
Graphs: Adjacency List v u w a c b z d a b c d u
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}