"LayeredDigraphEmbedding" (Graph Layout Method)
"LayeredDigraphEmbedding" (Graph Layout Method)
- Vertex layout for GraphLayout.
- Use layered digraph embedding to lay out vertices of a graph.
Details & Suboptions
- The layered digraph embedding is a graph-drawing technique to position vertices of a graph on parallel lines.
- The layered digraph embedding is typically used to lay out directed acyclic graphs.
- Possible settings to control the layout include:
-
"Orientation" Automatic layout orientation "RootVertex" Automatic root vertex "Rotation" Automatic layout rotation "VertexLayerPosition" Automatic position of the layers
Examples
open all close allBasic Examples (3)
Place vertices in a series of layers:
Graph[{12, 13, 23, 14, 24, 15}, GraphLayout -> "LayeredDigraphEmbedding"]"LayeredDigraphEmbedding" works best for directed acyclic graphs:
TreeGraph[RandomInteger[{1, #}] # + 1 & /@ Range[20], GraphLayout -> "LayeredDigraphEmbedding"]The layered digraph drawing works on arbitrary graphs:
RandomGraph[{20, 35}, GraphLayout -> "LayeredDigraphEmbedding"]Options (4)
"Orientation" (1)
"RootVertex" (1)
"Rotation" (1)
"VertexLayerPosition" (1)
Use the option "VertexLayerPosition"positions to specify the positions of layers:
Table[Graph[{12, 13, 23, 14, 24, 15}, GraphLayout -> {"LayeredDigraphEmbedding", "VertexLayerPosition" -> pos}], {pos, {{1, 3, 4, 5, 6}, {2, 1, 3, 4, 5}, {5, 4, 2, 1, 3}, {3, 6, 1, 2, 4}}}]