Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the lowest common ancestors for pairs of vertices in a graph
ResourceFunction["LowestCommonAncestors"][g,v,w] returns a list of the lowest common ancestors of vertices v and w in a graph g. | |
ResourceFunction["LowestCommonAncestors"][g] returns an Association of lowest common ancestors for each distinct pair of vertices in a graph g. | |
ResourceFunction["LowestCommonAncestors"][g,{{v1,w1},{v2,w2},…}] returns the common ancestors for each vertex pair {vi,wi}. | |
ResourceFunction["LowestCommonAncestors"][g,v] returns lowest common ancestors for a vertex v with all other vertices in a graph g. |
Find a list of lowest common ancestors for a pair of vertices in a graph:
In[1]:= |
Out[1]= |
Find all lowest common ancestors for a list of pairs of vertices:
In[2]:= |
Out[2]= |
Find all lowest common ancestors for all pairs that contain a given vertex:
In[3]:= |
Out[3]= |
Find all lowest common ancestors for every pair of vertices:
In[4]:= |
Out[4]= |
In[5]:= |
Out[5]= |
Measure an average time and spatial distance between pairs of events in a causal graph using longest distance to their lowest common ancestor:
In[6]:= |
Out[6]= |
This work is licensed under a Creative Commons Attribution 4.0 International License