Spectral Graph Layout Method
Options
Description
Examples
largest=truefalse
By default, the spectral method uses the eigenvectors corresponding to the smallest eigenvalues. If this option is true then the eigenvectors corresponding to the largest eigenvalues are used.
logdegree=truefalse
If this option is true then instead of using the Laplacian of the graph, a modified version of the Laplacian is used with the log of the degree of each vertex on the diagonal instead of the degree. This can help prevent clustering near the origin in graphs with a lot of variation in the degrees of vertices.
normalized=truefalse
By default the normalized form of the LaplacianMatrix is used when logdegree=false and the unnormalized form otherwise. This option can force use of the other form.
The spectral layout method is so named because it uses the eigenvectors of the normalized LaplacianMatrix of the Graph to choose the positions of the points.
For a given graph, this layout is unique, unless the LaplacianMatrix has a smallest (or largest if largest=true) eigenvalue of multiplicity greater than one. In that case, the eigenvector basis of the associated eigenspace may differ between sessions, leading to very different graph layouts. This is uncommon for random graphs, but extremely common for highly structured graphs.
This layout method works in two and three dimensions.
with⁡GraphTheory:
with⁡SpecialGraphs:
with⁡RandomGraphs:
G≔Graph⁡undirected,1,2,1,4,2,3,3,4
G≔Graph 1: an undirected graph with 4 vertices and 4 edge(s)
DrawGraph⁡G,layout=spectral
DrawGraph⁡G,layout=spectral,layoutoptions=largest=true
DrawGraph⁡G,layout=spectral,layoutoptions=largest=true,normalized=false
H≔HypercubeGraph⁡3
H≔Graph 2: an undirected graph with 8 vertices and 12 edge(s)
DrawGraph⁡H,layout=spectral,dimension=3
K≔RandomGraph⁡50,125
K≔Graph 3: an undirected graph with 50 vertices and 125 edge(s)
DrawGraph⁡K,layout=spectral,dimension=3,layoutoptions=logdegree=true
See Also
GraphTheory[DrawGraph]
Download Help Document