(index ("graph-dfs-foreach" 0) ("graph-dfs-fold" 710) ("graph-dfs-depth" 1767) ("graph-preorder" 2293) ("graph-postorder" 2484))
(def (sig (procedure "graph-dfs-foreach:: G FNODE FEDGE ROOTS -> UNDEFINED" (id graph-dfs-foreach))) (p "Depth-first search iterator; given a list of initial nodes, " (tt "ROOTS") ", the successors of each initial node are visited in depth-first search order, and procedures " (tt "FNODE") " and " (tt "FEDGE") " are applied to each node or edge, respectively, as the graph is traversed. " (tt "FNODE") " is of the form " (tt "LAMBDA N -> _") " where " (tt "N") " is node number; and " (tt "FEDGE") " is of the form " (tt "LAMBDA EDGE") " where " (tt "EDGE") " is a list of the form " (tt "(I J INFO)") "; " (tt "I") " and " (tt "J") " are the nodes defining the edge, and " (tt "INFO") " is edge metadata."))
(def (sig (procedure "graph-dfs-fold:: G FNODE FEDGE ROOTS NODE-INIT EDGE-INIT -> NODE-STATE EDGE-STATE" (id graph-dfs-fold))) (p "Depth-first search iterator with state; given a list of initial nodes, " (tt "ROOTS") ", and initial node state and edge state, " (tt "NODE-INIT") " and " (tt "EDGE-INIT") " the successors of each initial node are visited in depth-first search order, and procedures " (tt "FNODE") " and " (tt "FEDGE") " are applied to each node and the node state, or edge and the edge state, respectively, as the graph is traversed. " (tt "FNODE") " is of the form " (tt "LAMBDA N NODE-STATE -> NODE-STATE") " where " (tt "N") " is node number, and NODE-STATE can be of arbitrary type and must of the same type as " (tt "NODE-INIT") ". " (tt "FEDGE") " is of the form " (tt "LAMBDA EDGE EDGE-STATE") " where " (tt "EDGE") " is a list of the form " (tt "(I J INFO)") "; " (tt "I") " and " (tt "J") " are the nodes defining the edge, and " (tt "INFO") " is edge metadata; " (tt "EDGE-STATE") " must be of the same type as " (tt "EDGE-INIT")))
(def (sig (procedure "graph-dfs-depth:: G ROOTS -> NODE-DEPTH TRAVERSAL-TIME" (id graph-dfs-depth))) (p "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. " (tt "NODE-DEPTH") " is an array that contains the corresponding DFS depth for each node; " (tt "TRAVERSAL-TIME") " is also an array, where each value is the number of nodes visited in the sub-graph of that node."))
(def (sig (procedure "graph-preorder:: G ROOT -> ((NODE NUM) ... )" (id graph-preorder))) (p "Computes the preorder traversal sequence number for each successor of the given initial node."))
(def (sig (procedure "graph-postorder:: G ROOT -> ((NODE NUM) ... )" (id graph-postorder))) (p "Computes the postorder traversal sequence number for each successor of the given initial node."))
