chickadee » graph-dfs » graph-dfs-depth


Depth-first search depth; given a list of initial nodes, this procedure computes shortest DFS depth for each nodes traversed, and the number of nodes visited while traversing the successors of each node. NODE-DEPTH is an array that contains the corresponding DFS depth for each node; TRAVERSAL-TIME is also an array, where each value is the number of nodes visited in the sub-graph of that node.