Skip to content

← Lab · Chapter: Graphs

Graph search: BFS and DFS

The generic search one iteration at a time, with LIST as a queue (BFS) or as a stack (DFS): labelling order, predecessor tree and levels d(j). Choose BFS or DFS and the source; ◀ ▶ one iteration at a time, «Run» to watch them all; the «Instance» menu, «Random» and «Edit…» change the graph.