{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec0425-GraphImplementations

# lec0425-GraphImplementations - Announcements MP 7 available...

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

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 _________

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

View Full Document
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);
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)

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

View Full Document
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)
Graphs: Adjacency List v u w a c b z d a b c d u

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}