Be able to trace breadth-first and depth-first search algorithms and describe typical applications of both.
- Shortest Path and Minimum Spanning Tree for unweighted graph
- P2P networks - used to find all neighbour nodes
- Social Networking Websites - finding people who are k away from you (friend of a friend etc)
- Solving puzzles with only one solution - e.g. mazes
- Detecting cycle in a graph - A graph has cycle if and only if we see a back edge during DFS. So we can run DFS for the graph and check for back edges.
Breadth-first: shortest path for an unweighted graph. Depth-first: Navigating a maze.