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:
options
directedAcyclicDepthFirstSteps
function. See the Options section for more guidance.Options
root
The 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) => totalConnectionsTraversed
When stepping through the graph