Details




- A graph layout is typically computed using several stages. With GraphLayout->{s1->m1,…}, stage si is handled by method mi.
- Possible graph layout stages si are:
-
"VertexLayout" how to embed vertices "EdgeLayout" how to route edges "PackingLayout" how to place connected components of vertices - "VertexLayout" methods include:
-
Automatic automatically select a layout None do not compute a layout "emb" named embedding - Possible special embeddings "emb" include:
-
"BipartiteEmbedding" vertices on two parallel lines "CircularEmbedding" vertices on a circle "CircularMultipartiteEmbedding" vertices on segments of a circle "DiscreteSpiralEmbedding" vertices on a discrete spiral "GridEmbedding" vertices on a grid "LinearEmbedding" vertices on a line "MultipartiteEmbedding" vertices on several parallel lines "SpiralEmbedding" vertices on a 3D spiral projected to 2D "StarEmbedding" vertices on a circle with a center - Possible structured embeddings "emb" for layered graphs such as trees and directed acyclic graphs include:
-
"BalloonEmbedding" vertices on a circle with the center at the parent vertex "RadialEmbedding" vertices on a circular segment "LayeredDigraphEmbedding" vertices on parallel lines for directed acyclic graphs "LayeredEmbedding" vertices on parallel lines "SymmetricLayeredEmbedding" vertices on symmetric parallel lines - Possible optimizing embeddings "emb" all minimize a quantity and include:
-
"GravityEmbedding" energy with vertices as mass points and edges as springs "HighDimensionalEmbedding" energy for spring-electrical in high dimension "PlanarEmbedding" number of edge crossings "SpectralEmbedding" weighted sum of squares distances "SphericalEmbedding" energy with vertices on a sphere and edges as springs "SpringElectricalEmbedding" energy with edges as springs and vertices as charges "SpringEmbedding" energy with edges as springs "TutteEmbedding" number of edge crossings and distance to neighbors - "EdgeLayout" methods include:
-
"DividedEdgeBundling" divide edges into segments bundle "HierarchicalEdgeBundling" bundle edges following a hierarchical tree structure "StraightLine" straight lines between edges - "PackingLayout" methods include:
-
"ClosestPacking" approximate closest packing from the top left "ClosestPackingCenter" approximate closest packing from the center "Layered" arrange in layers starting at the top left "LayeredLeft" arrange in layers starting at the left "LayeredTop" arrange in layers starting at the top "NestedGrid" arrange on a nested grid
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (113)Survey of the scope of standard use cases
Basic Use (3)
Change the default layout for Graph:

https://wolfram.com/xid/0cg5b79gi-bj1kox


https://wolfram.com/xid/0cg5b79gi-emivow


https://wolfram.com/xid/0cg5b79gi-p15xa


https://wolfram.com/xid/0cg5b79gi-6kqi4t


https://wolfram.com/xid/0cg5b79gi-gzajlu


https://wolfram.com/xid/0cg5b79gi-h2cbw


https://wolfram.com/xid/0cg5b79gi-b1kn5q


https://wolfram.com/xid/0cg5b79gi-eyfal8


https://wolfram.com/xid/0cg5b79gi-cv6scu


https://wolfram.com/xid/0cg5b79gi-h9iycy


https://wolfram.com/xid/0cg5b79gi-dna5t5

Specify a layout for parametric graphs:

https://wolfram.com/xid/0cg5b79gi-7lu91y


https://wolfram.com/xid/0cg5b79gi-7nc4c


https://wolfram.com/xid/0cg5b79gi-gi2xh1


https://wolfram.com/xid/0cg5b79gi-muxq2j

Vertex Layout (98)
"BalloonEmbedding" (8)
Place each vertex in an enclosing circle centered at its parent vertex:

https://wolfram.com/xid/0cg5b79gi-nbz2f7

"BalloonEmbedding" works best for tree graphs:

https://wolfram.com/xid/0cg5b79gi-8ufl0n

Use the option "EvenAngle"->True to place vertices evenly in an enclosing circle:

https://wolfram.com/xid/0cg5b79gi-kwbqgo

With the setting "OptimalOrder"->True, the vertex ordering optimizes the angular resolution and the aspect ratio:

https://wolfram.com/xid/0cg5b79gi-uvg4ev

Use the option "RootVertex"->v to set the root vertex:

https://wolfram.com/xid/0cg5b79gi-1eeop6

Use the option "Rotation"->r to rotate the layout:

https://wolfram.com/xid/0cg5b79gi-2n7w56

Use "SectorAngles"->s to control the size of each sector:

https://wolfram.com/xid/0cg5b79gi-ojpa37

The balloon layout works with arbitrary graphs:

https://wolfram.com/xid/0cg5b79gi-9od2ko

"BipartiteEmbedding" (2)
"CircularEmbedding" (4)

https://wolfram.com/xid/0cg5b79gi-7r1e5

"CircularEmbedding" works best for circulant graphs, LCF notation embeddings and cycle graphs:

https://wolfram.com/xid/0cg5b79gi-ype786

Use the option "Offset"->offset to specify the offset angles:

https://wolfram.com/xid/0cg5b79gi-e5r0wp

With the setting "OptimalOrder"->True, vertices are reordered so that they lie nicely on a circle:

https://wolfram.com/xid/0cg5b79gi-b4sib0

"CircularMultipartiteEmbedding" (3)
Place vertices on polygon lines based on a vertex partition:

https://wolfram.com/xid/0cg5b79gi-toa8ih

"CircularMultipartiteEmbedding" works best for k-partite graphs:

https://wolfram.com/xid/0cg5b79gi-i6s2pf

Use "VertexPartition"->partition to specify a partition of vertices:

https://wolfram.com/xid/0cg5b79gi-bmew69

"DiscreteSpiralEmbedding" (3)
Place vertices on a discrete spiral:

https://wolfram.com/xid/0cg5b79gi-ociz1f

"DiscreteSpiralEmbedding" works best for path graphs:

https://wolfram.com/xid/0cg5b79gi-erfyib

With the setting "OptimalOrder"->True, vertices are reordered so that they lie nicely on a discrete spiral:

https://wolfram.com/xid/0cg5b79gi-7zxrnm

"GravityEmbedding" (2)
Place vertices so that they minimize mechanical, electrical and gravitational energy when each vertex has a charge and a mass, and each edge corresponds to a spring:

https://wolfram.com/xid/0cg5b79gi-oyytxh

Use the option "RootVertex"->v to set the root vertex:

https://wolfram.com/xid/0cg5b79gi-gf9aiw

"GridEmbedding" (3)
"HighDimensionalEmbedding" (3)
Place vertices in high dimension according to spring-electrical embedding and project down:

https://wolfram.com/xid/0cg5b79gi-xl28fv

"HighDimensionalEmbedding" works best for large graphs:

https://wolfram.com/xid/0cg5b79gi-0lmie7

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

https://wolfram.com/xid/0cg5b79gi-xa2mwc

https://wolfram.com/xid/0cg5b79gi-xlfz2e

"LayeredEmbedding" (7)
Place vertices in several layers in such a way as to minimize edges between nonadjacent layers:

https://wolfram.com/xid/0cg5b79gi-jz9m2n

"LayeredEmbedding" works best for tree graphs:

https://wolfram.com/xid/0cg5b79gi-s85lds

Use the option "LayerSizeFunction"->func to specify the relative height:

https://wolfram.com/xid/0cg5b79gi-c5i4rh

Use the option "RootVertex"->v to set the root vertex:

https://wolfram.com/xid/0cg5b79gi-1e4g1s

Use the option "LeafDistance"->d to specify the leaf distance:

https://wolfram.com/xid/0cg5b79gi-v5dp5p

Use the option "Orientation"->o to draw a tree with different orientations:

https://wolfram.com/xid/0cg5b79gi-uuxtyo

The layered drawing works on arbitrary graphs:

https://wolfram.com/xid/0cg5b79gi-ui95hl

"LayeredDigraphEmbedding" (7)
Place vertices in a series of layers:

https://wolfram.com/xid/0cg5b79gi-nkj7be

"LayeredDigraphEmbedding" works best for directed acyclic graphs:

https://wolfram.com/xid/0cg5b79gi-9gh27c

Use the option "RootVertex"->v to set the root vertex:

https://wolfram.com/xid/0cg5b79gi-6f04i

Use the option "Rotation"r to rotate the layout:

https://wolfram.com/xid/0cg5b79gi-198c5k

Use the option "Orientation"->o to draw a tree with different orientations:

https://wolfram.com/xid/0cg5b79gi-c76mto

Use the option "VertexLayerPosition"->positions to specify the positions of layers:

https://wolfram.com/xid/0cg5b79gi-2i1d67

The layered digraph drawing works on arbitrary graphs:

https://wolfram.com/xid/0cg5b79gi-ly30jd

"LinearEmbedding" (2)

https://wolfram.com/xid/0cg5b79gi-8pwjrw

Use the option Method->m to specify the algorithm:

https://wolfram.com/xid/0cg5b79gi-ioh8ie

"MultipartiteEmbedding" (3)
Place vertices on multiple line grids based on a vertex partition:

https://wolfram.com/xid/0cg5b79gi-74b75y

"MultipartiteEmbedding" works best for k-partite graphs:

https://wolfram.com/xid/0cg5b79gi-bzf8w

Use "VertexPartition"->partition to specify a partition of vertices:

https://wolfram.com/xid/0cg5b79gi-41v6mz

"PlanarEmbedding" (2)
"RadialEmbedding" (5)
Place vertices in concentric circles:

https://wolfram.com/xid/0cg5b79gi-l9pix6

"RadialEmbedding" works best for tree graphs:

https://wolfram.com/xid/0cg5b79gi-8n1e1j

Use the option "RootVertex"->v to set the root vertex:

https://wolfram.com/xid/0cg5b79gi-nu3wvt

Use the option "Rotation"r to rotate the layout:

https://wolfram.com/xid/0cg5b79gi-6pqu9x

The radial drawing works on arbitrary graphs:

https://wolfram.com/xid/0cg5b79gi-ce6mke

"RandomEmbedding" (1)
"SpectralEmbedding" (3)
Place vertices so the weighted sum of squares of mutual distances is minimized:

https://wolfram.com/xid/0cg5b79gi-07urxv

"SpectralEmbedding" works best for well-structured graphs:

https://wolfram.com/xid/0cg5b79gi-41m9me

Use the option "RelaxationFactor"->r to get the layout based on a relaxed Laplace matrix:

https://wolfram.com/xid/0cg5b79gi-2pn79u

"SphericalEmbedding" (2)
"SpiralEmbedding" (3)

https://wolfram.com/xid/0cg5b79gi-gavq9g

"SpiralEmbedding" works best for path graphs:

https://wolfram.com/xid/0cg5b79gi-ixqwoa

With the setting "OptimalOrder"->True, vertices are reordered so that they lie on the spiral nicely:

https://wolfram.com/xid/0cg5b79gi-otgemm

"SpringElectricalEmbedding" (15)
Place vertices so that they minimize mechanical and electrical energy when each vertex has a charge and each edge corresponds to a spring:

https://wolfram.com/xid/0cg5b79gi-66vox6

"SpringElectricalEmbedding" works best for most graphs:

https://wolfram.com/xid/0cg5b79gi-d51os7

With the setting "EdgeWeighted"->True, edge weights are used:

https://wolfram.com/xid/0cg5b79gi-pcwxis

https://wolfram.com/xid/0cg5b79gi-ycr55

Use the option "EnergyControl"->e to specify limitations on the total energy of the system during minimization:

https://wolfram.com/xid/0cg5b79gi-frmrff

https://wolfram.com/xid/0cg5b79gi-5gf4l0

Use "InferentialDistance"->d to specify a cutoff distance beyond which the interaction between vertices is assumed to be nonexistent:

https://wolfram.com/xid/0cg5b79gi-7y6k6p

https://wolfram.com/xid/0cg5b79gi-rsd5kl

Use "MaxIteration"->it to specify a maximum number of iterations to be used in attempting to minimize the energy:

https://wolfram.com/xid/0cg5b79gi-zt30w6

https://wolfram.com/xid/0cg5b79gi-ny81th

Use "Multilevel"->method to specify a method used during a recursive procedure of coarsening a graph:

https://wolfram.com/xid/0cg5b79gi-bkryd8

https://wolfram.com/xid/0cg5b79gi-e3ocs3

With the setting "Octree"->True, an octree data structure (in three dimensions) or a quadtree data structure (in two dimensions) is used in the calculation of repulsive force:

https://wolfram.com/xid/0cg5b79gi-2s8917

https://wolfram.com/xid/0cg5b79gi-4hsej8

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

https://wolfram.com/xid/0cg5b79gi-pienrf

https://wolfram.com/xid/0cg5b79gi-h1779y

Use "RepulsiveForcePower"->r to control how fast the repulsive force decays over distance:

https://wolfram.com/xid/0cg5b79gi-cne41e

https://wolfram.com/xid/0cg5b79gi-em0025

Use the option "Rotation"r to rotate the layout:

https://wolfram.com/xid/0cg5b79gi-ea3ss

https://wolfram.com/xid/0cg5b79gi-5j3qwc

Use "SpringConstant"r to control the constant in the attractive force:

https://wolfram.com/xid/0cg5b79gi-muik7t

https://wolfram.com/xid/0cg5b79gi-zb6q2j

Use "StepControl"->method to define how step length is modified during energy minimization:

https://wolfram.com/xid/0cg5b79gi-lsbsuc

https://wolfram.com/xid/0cg5b79gi-zcbotu

Use "StepLength"->r to specify the initial step length used in moving the vertices around:

https://wolfram.com/xid/0cg5b79gi-ov5k0g

https://wolfram.com/xid/0cg5b79gi-zftq5g

Use "Tolerance"->r to specify the tolerance used in terminating the energy minimization process:

https://wolfram.com/xid/0cg5b79gi-rltxny

https://wolfram.com/xid/0cg5b79gi-yw9m8a

"SpringEmbedding" (12)
Place vertices so that they minimize mechanical energy when each edge corresponds to a spring:

https://wolfram.com/xid/0cg5b79gi-s5baes

"SpringEmbedding" works best for regular structured graphs:

https://wolfram.com/xid/0cg5b79gi-f01pj0

With the setting "EdgeWeighted"->True, edge weights are used:

https://wolfram.com/xid/0cg5b79gi-x4uvqp

https://wolfram.com/xid/0cg5b79gi-gs5vmp

Use the option "EnergyControl"->e to specify limitations on the total energy of the system during minimization:

https://wolfram.com/xid/0cg5b79gi-ih0fzt

https://wolfram.com/xid/0cg5b79gi-oza266

Use "InferentialDistance"->d to specify a cutoff distance beyond which the interaction between vertices is assumed to be nonexistent:

https://wolfram.com/xid/0cg5b79gi-pgxo89

https://wolfram.com/xid/0cg5b79gi-5k3wpc

Use "MaxIteration"->it to specify a maximum number of iterations to be used in attempting to minimize the energy:

https://wolfram.com/xid/0cg5b79gi-3ya7yg

https://wolfram.com/xid/0cg5b79gi-sms8wz

Use "Multilevel"->method to specify a method used during a recursive procedure of coarsening a graph:

https://wolfram.com/xid/0cg5b79gi-zmy9dc

https://wolfram.com/xid/0cg5b79gi-wls559

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

https://wolfram.com/xid/0cg5b79gi-1dvu0n

https://wolfram.com/xid/0cg5b79gi-th0tg9

Use the option "Rotation"r to rotate the layout:

https://wolfram.com/xid/0cg5b79gi-vk0wom

https://wolfram.com/xid/0cg5b79gi-v0s55

Use "StepControl"->method to define how step length is modified during energy minimization:

https://wolfram.com/xid/0cg5b79gi-desuuz

https://wolfram.com/xid/0cg5b79gi-b7tb38

Use "StepLength"->r to specify the initial step length used in moving the vertices around:

https://wolfram.com/xid/0cg5b79gi-ub618a

https://wolfram.com/xid/0cg5b79gi-z2cb07

Use "Tolerance"->r to specify the tolerance used in terminating the energy minimization process:

https://wolfram.com/xid/0cg5b79gi-gvtgsl

https://wolfram.com/xid/0cg5b79gi-pu79d1

"StarEmbedding" (4)
Place vertices on a star shape:

https://wolfram.com/xid/0cg5b79gi-je2zlx

"StarEmbedding" works best for star-like graphs:

https://wolfram.com/xid/0cg5b79gi-w5m7k

Use the option "Offset"->offset to specify the offset angles:

https://wolfram.com/xid/0cg5b79gi-p7zdm2

Use the option "Center"->center to specify the center:

https://wolfram.com/xid/0cg5b79gi-7suw46

"TutteEmbedding" (2)
Edge Layout (3)
"DividedEdgeBundling" (1)
"HierarchicalEdgeBundling" (1)
Packing Layout (6)
"ClosestPacking" (1)
"ClosestPackingCenter" (1)
"Layered" (1)
"LayeredLeft" (1)
"LayeredTop" (1)
Rendering Order (3)
"VertexFirst" (1)
"EdgeFirst" (1)
Applications (2)Sample problems that can be solved with this function
Layout of Wolfram System installation directory:

https://wolfram.com/xid/0cg5b79gi-hw3gj

https://wolfram.com/xid/0cg5b79gi-mkxkg9

Show the relationships between early versions of the Unix operating system:

https://wolfram.com/xid/0cg5b79gi-ngtaqz
Automatically use the layered digraph embedding:

https://wolfram.com/xid/0cg5b79gi-bpmpln

Properties & Relations (6)Properties of the function, and connections to other functions
GraphLayout can be used for general graphs:

https://wolfram.com/xid/0cg5b79gi-w9j3f


https://wolfram.com/xid/0cg5b79gi-fi80b1


https://wolfram.com/xid/0cg5b79gi-xwdja


https://wolfram.com/xid/0cg5b79gi-kjdxrt

VertexCoordinates overrides GraphLayout coordinates:

https://wolfram.com/xid/0cg5b79gi-kmmsdp

Use AbsoluteOptions to extract VertexCoordinates computed using a layout algorithm:

https://wolfram.com/xid/0cg5b79gi-gbw20j


https://wolfram.com/xid/0cg5b79gi-ee38ye

Wolfram Research (2010), GraphLayout, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphLayout.html (updated 2025).
Text
Wolfram Research (2010), GraphLayout, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphLayout.html (updated 2025).
Wolfram Research (2010), GraphLayout, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphLayout.html (updated 2025).
CMS
Wolfram Language. 2010. "GraphLayout." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/GraphLayout.html.
Wolfram Language. 2010. "GraphLayout." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/GraphLayout.html.
APA
Wolfram Language. (2010). GraphLayout. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphLayout.html
Wolfram Language. (2010). GraphLayout. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphLayout.html
BibTeX
@misc{reference.wolfram_2025_graphlayout, author="Wolfram Research", title="{GraphLayout}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/GraphLayout.html}", note=[Accessed: 09-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_graphlayout, organization={Wolfram Research}, title={GraphLayout}, year={2025}, url={https://reference.wolfram.com/language/ref/GraphLayout.html}, note=[Accessed: 09-July-2025
]}