Depth-First Search

When visualizing networks, different graph traversal algorithms are needed. Implementing the depth-first search algorithm is intended to review techniques that any computer science student already knows.

Description

Characteristics

Note:

Select and click a node to start traversal. Click the background to reset. Depth is measured in the number of edges (edge weight is 1) and visualized using colors. The computed spanning tree is visualized. Nodes of the same color are at the same distance from the selected source node.



The JavaScript Code