Tool guide

BFS and DFS: Visit Order, Layers, Preorder and Back Edges

The Traversal panel answers two questions about the same canvas. Breadth-first search reports the visit order, the layer (hop distance) of every node, any unreachable nodes and the number of tree edges. Depth-first search reports preorder, postorder and how many edges led back to an ancestor. Both share the graph edited in the graph workbench — presets, Move / connect, the edge list and the adjacency matrix — and both can be played back step by step below the canvas.

Updated Reviewed by CalcX Editorial Team3 sources4 min read