directed acyclic common ancestors
Updated on August 22, 2024Source codeTests
createDirectedAcyclicCommonAncestors
is a pipe that transforms two nodes in a directed acyclic graph to all of the common ancestors of both.
Your created directedAcyclicCommonAncestors
function is a generator that yields each common ancestor separately, starting with the one that is deepest in the graph (closest to the two nodes) and ending with the one that is shallowest in the graph (furthest from the two nodes).
Create common ancestors
Call createDirectedAcyclicCommonAncestors
with no parameters to create your directedAcyclicCommonAncestors
function.
Call createDirectedAcyclicCommonAncestors
with these parameters to create your directedAcyclicCommonAncestors
function:
Parameter
Type
Required
Description
directedAcyclic
Graph
yes
The directed acyclic graph to analyze.