csc2001f 2024 9 Graphs
csc2001f 2024 9 Graphs
2024
(Based on slides from Hussein Suleman)
Graphs
A graph is a set of nodes/vertices and a set of edges connecting
vertices
V: set of all vertices/nodes
E: set of all edges. Each edge (v,w) ∈E connects two nodes v and w
G = (V, E)
E
|E|=9
F
https://groundup.org.za/article/which-parts-of-metrorail-are-still-closed/
department of computer science
Graph Examples
Knowledge graphs
https://upload.wikimedia.org/wikipedia/commons/9/9b/Social_Network_Analysis_Visualization.png
D D
4 B 4 B
A A
2 2
5 5
D D
4 A B D E F G
B
A A 4 1 5
1
1 2 B 1
D G D 2 3 8
5
8
E 4
3
2
F
E F
4 G 2
Queue: B, D, E
E F
1,A
E F
1,A
E F 2,D
1,A
From Weiss