Download presentation
Presentation is loading. Please wait.
Published byὙάκινθος Καραμανλής Modified over 5 years ago
1
Graphs G = (V, E) V are the vertices; E are the edges.
Edges are of the form (v, w), where v, w V. ordered pair: directed graph or digraph unordered pair: undirected graph weighted graph: A weight or cost can be associated with each edge.
2
Graph Examples v9 v8 v10 v6 v7 v1 v3 v4 v2 v5 4 D F 1 8 10 4 A C 3 E G
B
3
Terminology w is adjacent to v iff (v, w) E.
edge e = (v,w) is incident to vertex v e is also incident to vertex w degree of a vertex: number of incident edges. path: sequence of vertices and edges connected together. length of a path: number of edges in the path. simple path: all vertices are distinct.
4
Representation adjacency matrix: (|V|2) space.
adjacency list (sparse graphs): 1 2 3 4 2 3 4 3 1 2 1 2 3 4
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.