Applications of

Depth First Search

COMP3506

Benjamin Martin

How to find path between cells?

Represent maze as graph and apply DFS.

Examples

https://cloudstor.aarnet.edu.au/plus/index.php/s/wWBsFYgsReWlXPg​
(Neighbour precedence: NORTH > EAST > SOUTH > WEST)

1. find-goal-undirected: Find goal in an undirected graph.

 

2. find-goal-directed-a-b: Get from a to b in a directed graph.

 

3. find-goal-directed-b-a: Reverse of #2.

 

4. detect-cycle: Detect a cycle (not DAG).

 

Source used to generate images: https://github.com/athleticus/graph-search-visualizer​

Made with Slides.com