Lecture 13.1
Lecture 13.1
1. Breadth-First-Search (BFS)
2. BFS Example
Breadth-First Search (BFS)
Visit
start vertex and put into a FIFO queue.
Repeatedly
remove a vertex from the queue,
visit its unvisited adjacent vertices,
put newly visited vertices into the queue.
Breadth-First Search Example
2
3
8
1
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
6
7
4
5
9
2
3
8
6 1
7
4
5
9
To find Shortest Path and Minimum Spanning Tree for unweighted graph
To find all neighbor nodes in Peer to Peer Networks.
Crawlers in Search Engines
Social Networking Websites
GPS Navigation systems
Broadcasting in Network
In Garbage Collection
Cycle detection in undirected graph:
Finding all nodes within one connected component:
Ford–Fulkerson algorithm
To test if a graph is Bipartite
Path Finding
Books
1. https://en.wikipedia.org/wiki/Data_structure
2. https://visualgo.net/en/dfsbfs?slide=1