Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Render a graph with vertices at heights based on their distance from the root
ResourceFunction["DistanceLayeredGraph"][g] renders the graph g so that nodes that are a distance d from node 1 are at position d below the root. | |
ResourceFunction["DistanceLayeredGraph"][g,root] uses the specified node root as the root. |
Organize nodes in a graph based on distance from node 1:
In[1]:= |
Out[1]= |
Create a layered rendering of a 2D grid graph:
In[2]:= |
Out[2]= |
In a complete graph, all nodes are distance one from node 1:
In[3]:= |
Out[3]= |
This work is licensed under a Creative Commons Attribution 4.0 International License