How to draw a graph
June 22, 2026
This entry was last updated on August 9th, 2026
For any representation of a graph in , we can imagine a mapping
which assigns each vertex of a position. Since we are dealing with a finite number of points in , we can represent with a matrix .
We call balanced iff . In English, this just means averaging the position of the vertices gives the origin. Informally, we can always translate our graph so the "middle" is on the origin, we can assume all representations we'll work with are balanced. We can also assume that the columns of the matrix are linearly independent, since otherwise we are looking at some lower dimensional subspace, and we could just look at .
It's natural to place our vertices where R tells us to and imagine our edges are springs, then check the "stretching" of strings between vertices. We will want to minimize this stretching for a "good" drawing, but also ignore having 0 distance between vertices, as it's (obviously) not a very impressive drawing although it minimizes energy.
To capture the amount of stretching lets define the energy of
where is the Euclidean norm. If we want to allow some springs to matter more than others, we can introduce a weight function
that assigns a weight to each edge uv E(G).
So we end up with the updated energy function
Some expansion and book-keeping verifies the following.
Lemma. The energy is a Laplacian quadratic form,
where , the weighted degree matrix minus the weighted adjacency matrix, finally bringing out the familiar (weighted) Laplacian.
This identity gives us our main result.
Theorem. Let be a connected graph of order (given by ) with weighted Laplacian . If are the eigenvalues of , then the minimum energy of a balanced, orthogonal representation of in is
Proof Sketch. By the lemma we're minimizing , and for any orthogonal representation this is at least the sum of the smallest that many eigenvalues of .
Since the rows of sum to zero, is the eigenvector for , so gluing it onto a balanced as an extra column costs 0 energy and hands us a representation forcing . Similarly, we can add a vector to a minimum representation in to get a representation in with equal energy.
If we are drawing a graph on paper or something like , this is . Finally, this yields our algorithm given a graph G:
-
Compute the two smallest non-zero eigenvalues of the weighted Laplacian.
-
Compute eigenvectors and for , and normalize to get the unit eigenvectors and .
-
This gives , where each pair is a coordinate to be plotted to give drawing.
Example:
2.26× minimum
Source
C. Godsil and G. Royle, Algebraic Graph Theory, Graduate Texts in Mathematics 207, Springer, 2001.