Function Repository Resource:

# BranchialGraphs

Depict branch-like connections between components of a directed acyclic graph

 ResourceFunction["BranchialGraphs"][g] returns an Association of time-indexed graphs, whose edges indicate which simultaneous vertices of g have branch-like separation. ResourceFunction["BranchialGraphs"][g,{t1,t2,…,tn}] only computes components at times ti.

## Details

ResourceFunction["BranchialGraphs"] takes the same options as Graph.
Two vertices vj and vk are have branch-like separation if g contains a vertex vi and a pair of edges vivj and vivk.
Branch-like separation is necessary, but not sufficient, for an edge between vj and vk to appear in a branchial graph of g.
A foliation of the vertices of g is a partitioning of g-vertices into time-ordered subsets (preferably also an exact cover).
Vertices vj and vk must also satisfy a simultaneity condition, which depends on choice of a foliation.
ResourceFunction["BranchialGraphs"] takes an additional option of the form: "Foliation" → {{v1,v2,…,vn}, {vn+1,vn+2,…,vn+m}, …, {vx,vx+1,…,vx+y}}.
The default "Foliation" lists a vertex in a subset as soon as its entire VertexInComponent is covered by preceding subsets.
If a specified "Foliation" lists a vertex before its entire VertexInComponent is covered by preceding subsets, the algorithm will not give a valid result.
The positions of subsets in the foliation determine their Keys in the output of ResourceFunction["BranchialGraphs"].
Provided the foliation subset at time ti includes vertices vj and vk from g, then the branchial graph at time ti will have an edge between vj and vk if and only if vj and vk have branch-like separation.

## Examples

### Basic Examples (4)

Obtain the branchial graphs of a complete binary tree with four levels:

 In:= Out= Branchial graphs of a complete tertiary tree with four levels:

 In:= Out= Plot a disc graph alongside its branchial graphs:

 In:= Out= And changing definition slightly, plot another:

 In:= Out= Obtain the branchial graphs for a RandomGraph with almost 100 vertices:

 In:= Out= Only compute the sixth branchial graph:

 In:= Out= ### Options (2)

Specify foliations directly using the "Foliation" option:

 In:= Out= Compare to the default foliations in a grid:

 In:= Out= BranchialGraphs accepts the same style options as Graph:

 In:= Out= ### Possible Issues (2)

BranchialGraphs expects the input graph to be directed and acyclic:

 In:=  Out= Input foliations can not include a vertex in a subset before all earlier vertices are listed in preceding subsets:

 In:=  Out= ### Neat Examples (3)

Calculate the "mergial graphs" of the nine-layer RandomGraph above:

 In:= Out= The mergial graphs are not simply the branchial graphs of a ReverseGraph:

 In:= Out= Compare where forward and reverse foliations agree:

 In:= Out= 