Graph traversal explores a tree or graph by visiting nodes according to a specific, well-defined rule. It seeks a path between nodes rather than optimizing the final route’s length. section 3.3
Common traversal rules include:
- Breadth-first search examines every node at one level before moving to the next. section 3.2
- Depth-first search follows one branch as far as possible, then backtracks to explore alternatives. section 3.6
- Depth-limited search constrains DFS with a maximum depth, while iterative deepening increases that limit until reaching the goal. section 3.2
- Bidirectional search explores forward from the start and backward from the goal at the same time. section 3.6
Where traversal helps
Apply traversal to explore a maze, solve an n-puzzle, determine relationships in a family or social graph, or find a route between an origin and destination. These searches can find feasible paths without necessarily selecting the shortest one. section 3.0 section 3.3
Figure 3.10 Graph search methods
Compare the main graph-search methods and their exploration patterns. section 3.2


