directed acyclic depth-first steps
Updated on August 22, 2024Source codeTests
createDirectedAcyclicDepthFirstSteps is a pipe that transforms a directed acyclic graph to depth-first steps through the graph.
Your created directedAcyclicDepthFirstSteps function is a generator that yields each step separately.
Create depth-first steps
Call createDirectedAcyclicDepthFirstSteps with no parameters to create your directedAcyclicDepthFirstSteps function.
Call createDirectedAcyclicDepthFirstSteps with these parameters to create your directedAcyclicDepthFirstSteps function:
optionsdirectedAcyclicDepthFirstSteps function. See the Options section for more guidance.Options
rootThe root node where directedAcyclicDepthFirstSteps should start its traversal.
If you don't pass a root node, directedAcyclicDepthFirstSteps will default to searching the array of nodes to find the first root node, as defined by createRoot.
toSetMetadata(node, totalConnectionsTraversed) => totalConnectionsTraversedWhen stepping through the graph