Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Enumerate possible foliations of a directed acyclic graph
ResourceFunction["GraphFoliations"][g] returns the foliations of a graph g. |
| "IncludePermutations" | False | whether to include permutations of parallel (antichain) vertices |
| "BundleFoliations" | True | whether to bundle vertices into one foliation whenever possible |
| Direction | Automatic | the direction to start building foliations (Automatic,Top or Bottom) |
| MaxItems | ∞ | set the upper limit of returned foliations |
Enumerate the foliations of a graph:
| In[1]:= | ![]() |
| Out[1]= |
| In[2]:= | ![]() |
| Out[2]= |
| In[3]:= | ![]() |
| Out[3]= |
Bundling will combine vertices into one slice when possible; turning this off results in a greater number of foliations:
| In[4]:= | ![]() |
| Out[4]= |
Return foliations with all possible slice permutations:
| In[5]:= | ![]() |
| Out[5]= |
| In[6]:= | ![]() |
| Out[6]= |
Building foliations from bottom to top may result in different foliations:
| In[7]:= | ![]() |
| In[8]:= | ![]() |
| In[9]:= |
| Out[9]= |
Direction will not matter when all permutations are included:
| In[10]:= | ![]() |
| In[11]:= |
| Out[11]= |
Limit the enumeration with an upper bound:
| In[12]:= | ![]() |
| Out[12]= |
Use foliations for a graph generated with the resource function LayeredLayoutGraph:
| In[13]:= | ![]() |
| Out[13]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License