Foundations to Frontier
Tests
A. Mathematical Foundations › A11 Graph Theory and Discrete Math

Graphs, Adjacency and Laplacian Matrices

Graphs model anything made of things and connections: communication links between drones, road networks, molecules, social networks, the pose graph in SLAM. Writing a graph as a matrix turns questions about connections into linear algebra. This topic covers vertices, edges, degrees and weights; the adjacency, incidence and Laplacian matrices; what powers of A count; why the Laplacian is positive semidefinite and why its zero eigenvalues count connected components; and how the Laplacian drives diffusion and consensus. In the research exercise ten drones agree on a shared value, and the graph's algebraic connectivity predicts how fast.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Dots and lines

Draw some dots and join some of them with lines. That’s a graph. The dots (vertices) can be cities, robots or atoms; the lines (edges) are roads, radio links or bonds. A graph can be written as a table: put a 1 where two dots are joined and a 0 where they aren’t. That table, the adjacency matrix, lets a computer answer questions like “is everyone connected?” or “how fast does news spread?” with matrix maths.

Graphs as matrices: click two nodes to add or remove an edge
01234567
Laplacian L = D − A
2 -1 0 -1 0 0 0 0
-1 2 -1 0 0 0 0 0
0 -1 2 -1 0 0 0 0
-1 0 -1 2 0 0 0 0
0 0 0 0 1 -1 0 0
0 0 0 0 -1 2 -1 0
0 0 0 0 0 -1 2 -1
0 0 0 0 0 0 -1 1
consensus ẋ = −Lx
eigenvalues of L: -0.00, 0.00, 0.59, 2.00, 2.00, 2.00, 3.41, 4.00 · components 2 · algebraic connectivity λ₂ = 0.000 · edges 7
Row i of A lists node i's neighbours; L = D − A has zero row sums, so the all-ones vector has eigenvalue 0. Each connected component contributes one zero eigenvalue. λ₂ (the Fiedler value) measures how well connected the graph is: in the consensus plot, values agree faster when λ₂ is larger, and separate components settle at separate averages.
Why engineers care

Drone swarms and satellite constellations share information over a communication graph, and its structure decides whether they can agree and how fast. SLAM back-ends, power grids, and graph neural networks for molecules or point clouds are all built on adjacency and Laplacian matrices.

📝 Quick check (Level 0)
0/3 answered
  1. 1. In a graph, vertices are connected by…
  2. 2. An adjacency matrix entry of 1 means…
  3. 3. If a swarm's communication graph splits into two pieces, the two groups…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Definitions

A graph G=(V,E)G = (V, E) has n=∣V∣n = \lvert V\rvert vertices and m=∣E∣m = \lvert E\rvert edges. It can be undirected or directed, unweighted or weighted.

  • Adjacency: Aij=1A_{ij} = 1 (or weight wijw_{ij}) if i∼ji\sim j. For undirected graphs, A=A⊤A = A^\top.
  • Degree: di=∑jAijd_i = \sum_jA_{ij}, and ∑idi=2m\sum_id_i = 2m (handshake lemma).
  • Laplacian: L=D−AL = D - A with D=diag⁡(d)D = \operatorname{diag}(d).
  • Incidence: B∈Rn×mB\in\mathbb R^{n\times m}, with +1 and −1 at the two ends of each edge. Then L=BB⊤L = BB^\top.

Counting with powers

(Ak)ij(A^k)_{ij} is the number of walks of length k from i to j, and tr⁡(A3)/6\operatorname{tr}(A^3)/6 is the number of triangles.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Sum of degrees in a graph with 10 edges:
  2. 2. Laplacian row sums are…
  3. 3. (A²)ᵢᵢ equals…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

The Laplacian quadratic form

x⊤Lx=∑(i,j)∈Ewij(xi−xj)2≥0x^\top Lx = \sum_{(i,j)\in E}w_{ij}(x_i - x_j)^2\ge0

So L is positive semidefinite, and L1=0L\mathbf 1 = 0. x⊤Lxx^\top Lx measures how much a signal on the vertices varies across edges: its smoothness on the graph.

Components and connectivity

The eigenvalue 0 has multiplicity equal to the number of connected components (the indicator vector of each component is in the null space). The second-smallest eigenvalue λ2\lambda_2 is the algebraic connectivity (Fiedler, 1973). It’s positive iff the graph is connected, and larger means better connected.

Laplacian dynamics

  • Diffusion or heat on graphs: x˙=−Lx\dot x = -Lx.
  • Consensus: each agent moves toward its neighbours’ values: x˙i=∑jAij(xj−xi)\dot x_i = \sum_jA_{ij}(x_j - x_i). The sum 1⊤x\mathbf 1^\top x is conserved, so on a connected graph every xix_i converges to the average. The error decays like e−λ2te^{-\lambda_2t}.
  • Normalized Laplacian: I−D−1/2AD−1/2I - D^{-1/2}AD^{-1/2} (used in GNNs and spectral clustering).
🐍 Exercise 1: building and reading graph matrices
Build adjacency, Laplacian and incidence matrices from an edge list. Check L = BBᵀ and the quadratic-form identity, positive semidefiniteness, the component count from zero eigenvalues, the triangle count, and walk counts against brute-force enumeration.
📝 Quick check (Level 2)
0/3 answered
  1. 1. xᵀLx equals…
  2. 2. A graph with 3 connected components has how many zero Laplacian eigenvalues?
  3. 3. Consensus on a connected graph converges to…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

L = BBᵀ and the quadratic form

(B⊤x)e=xi−xj(B^\top x)_e = x_i - x_j for edge e = (i, j). So x⊤BB⊤x=∥B⊤x∥2=∑e(xi−xj)2x^\top BB^\top x = \lVert B^\top x\rVert^2 = \sum_e(x_i - x_j)^2. And (BB⊤)ii=di(BB^\top)_{ii} = d_i, (BB⊤)ij=−1(BB^\top)_{ij} = -1 for each edge. ∎

Zero eigenvalues count components

Lx=0  ⟺  x⊤Lx=0  ⟺  xi=xjLx = 0\iff x^\top Lx = 0\iff x_i = x_j across every edge, i.e. x is constant on each component. The null space is spanned by the component indicators. ∎

Consensus convergence

Decompose x(0)=xˉ1+∑k≥2ckvkx(0) = \bar x\mathbf 1 + \sum_{k\ge2}c_kv_k in Laplacian eigenvectors. Then x(t)=xˉ1+∑cke−λktvkx(t) = \bar x\mathbf 1 + \sum c_ke^{-\lambda_kt}v_k, so ∥x−xˉ1∥≤e−λ2t∥x(0)−xˉ1∥\lVert x - \bar x\mathbf 1\rVert\le e^{-\lambda_2t}\lVert x(0) - \bar x\mathbf 1\rVert. ∎

Exercise 3.1: λ₂ for a ring of n nodes

The ring Laplacian is circulant with eigenvalues 2−2cos⁡(2πk/n)2 - 2\cos(2\pi k/n). So λ2=2−2cos⁡(2π/n)≈(2π/n)2\lambda_2 = 2 - 2\cos(2\pi/n)\approx(2\pi/n)^2: rings get slow quickly as n grows.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The null space of L on a connected graph is spanned by…
  2. 2. Consensus error decays like…
  3. 3. λ₂ for a 10-node ring:

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Distributed agreement in a drone swarm

Ten drones must agree on a shared value (a rendezvous altitude, a clock offset, an averaged sensor reading), exchanging data only with radio neighbours. Each runs xi←xi−Δt∑j(xi−xj)x_i\leftarrow x_i - \Delta t\sum_j(x_i - x_j). The swarm converges to the exact average for any connected topology. The speed is set by λ₂:

Topology λ₂ Time to 1% spread
line 0.098 ≈ 34
ring 0.382 ≈ 7.4
complete 10 ≈ 0.27

Settling time scales like 1/λ21/\lambda_2. That’s why formation and communication planners maximize algebraic connectivity (Olfati-Saber and Murray, 2004).

🐍 Exercise 2 (research): consensus speed and algebraic connectivity
Run discrete-time Laplacian consensus for 10 agents on line, ring and complete graphs. Verify convergence to the average, compute λ₂ for each, and show that the 1% settling time scales like 1/λ₂.

Graph matrices in AI, robotics and aerospace

  • Multi-agent systems: consensus, formation control, distributed Kalman filtering and time synchronization over communication graphs.
  • Constellations: inter-satellite link topologies; connectivity under occlusion and link outages.
  • SLAM: the pose-graph information matrix has the sparsity of the graph Laplacian; its connectivity bounds estimation accuracy (Khosoussi et al., 2019).
  • Graph neural networks: message passing with normalized adjacency (GCN; Kipf and Welling, 2017).

References

  1. F. Chung (1997). Spectral Graph Theory. AMS.
  2. M. Fiedler (1973). “Algebraic connectivity of graphs.” Czechoslovak Mathematical Journal, 23(2).
  3. R. Olfati-Saber, R. Murray (2004). “Consensus problems in networks of agents with switching topology and time-delays.” IEEE TAC, 49(9).
  4. M. Mesbahi, M. Egerstedt (2010). Graph Theoretic Methods in Multiagent Networks. Princeton.
  5. T. Kipf, M. Welling (2017). “Semi-supervised classification with graph convolutional networks.” ICLR.
  6. K. Khosoussi, M. Giamou, G. Sukhatme, S. Huang, G. Dissanayake, J. How (2019). “Reliable graphs for SLAM.” IJRR, 38(2–3).
  7. D. Spielman (2019). Spectral and Algebraic Graph Theory (lecture notes, Yale).