Course notes for ESC190 Computer Algorithms and Data Structures
Two of the most fundamental classes of algorithms on graphs are
Graph exploration algorithms allows us to visit each node in a graph exactly once. Given a graph, that is a set of nodes and a set of edges, we can generally describe an exploration as follows
1
2
3
4
5
6
7
8
9
10
11
Initialise a list of visited nodes VN
while (not all nodes are visited)
Initialise data structure DS
Add a non visited node, v_i, to DS
Mark v_i as visited in VN
while (DS is not empty)
Remove a node, v_j, from DS
Mark v_j as visited
# Print node v_j
Add non visited nodes that are adjacent to v_j to DS