Kirchhoff Circuits & Squared Rectangles

How electrical networks, the Laplacian, and the sum of squares come together in the geometry of squared tilings.

01 Kirchhoff's Laws as Linear Algebra

Kirchhoff's two circuit laws are the two fundamental subspaces of the incidence matrix \(B\), now carrying physical units.

Kirchhoff's Current Law (KCL): at every node, currents in equal currents out. If \(\mathbf{i}\) is the vector of edge currents (with a chosen orientation):

$$B \,\mathbf{i} = \mathbf{0} \quad \text{at interior nodes}$$

The current vector lives in the kernel of the (oriented) incidence matrix. We showed earlier that ker(\(B\)) over \(\mathbb{F}_2\) is the cycle space. Over \(\mathbb{R}\) the same structure holds: the current distribution is a superposition of loop currents.

Kirchhoff's Voltage Law (KVL): voltage drops around any closed loop sum to zero. If \(\mathbf{v}\) is the vector of node potentials, the voltage drop across edge \(e = (a,b)\) is \(v_a - v_b\). In matrix form the drops are \(B^\top \mathbf{v}\), and KVL says this is consistent with Ohm's law: \(\mathbf{i} = G\, B^\top \mathbf{v}\), where \(G\) is the diagonal conductance matrix.

Substituting into KCL gives the network equation:

$$B\, G\, B^\top \mathbf{v} = \mathbf{j}$$

where \(\mathbf{j}\) is the vector of external current injections. With unit conductances (\(G = I\)), this becomes \(L\, \mathbf{v} = \mathbf{j}\). Solving Kirchhoff's circuit is solving a Laplacian system.

The two subspaces, physically. The current space (ker \(B\) over \(\mathbb{R}\)) and the voltage space (im \(B^\top\)) are orthogonal complements. KCL constrains currents to the cycle space. KVL constrains voltages to the cut space. These are the same two subspaces from the incidence matrix theory, now carrying amps and volts.

02 Squared Rectangles from Circuits

In 1940, Brooks, Smith, Stone and Tutte discovered that squared rectangles — rectangles partitioned into non-overlapping squares — correspond exactly to planar electrical networks.

The construction: take a planar graph, assign 1Ω to every edge, inject current from a source node to a sink node, and solve Kirchhoff's equations. The current through each edge gives the side length of a square. Horizontal cuts through the rectangle are nodes; the squares between adjacent cuts are edges (resistors).

The worked example: 3×2 rectangle

Consider a graph with three nodes (0, 1, 2) and three edges, each of resistance 1Ω. Edge A runs directly from node 0 to node 2. Edge B runs from node 0 to node 1. Edge C runs from node 1 to node 2. This is a parallel-series topology: the direct edge A is in parallel with the series pair B + C.

Three edges, each 1Ω. The path through A has resistance 1Ω. The path through B then C has resistance 1Ω + 1Ω = 2Ω. These paths are in parallel.

Total resistance: \(R_{\text{total}} = \frac{1}{\frac{1}{1} + \frac{1}{2}} = \frac{2}{3}\,\Omega\).

Choose height = 2 (voltage across the network). Total current = \(V / R = 3\)A = width of the rectangle.

Edge A (node 0 → 2, 1Ω): voltage drop = 2V, current \(I_A = 2/1 = 2\)A. Since \(R = 1\Omega\), the drop equals the current: \(V_A = I_A = 2\). This edge produces a square of side 2.

Edges B and C (node 0 → 1 → 2, each 1Ω): the series pair shares current \(I = 1\)A. Each edge drops 1V across 1Ω: \(V_B = I_B = 1\), \(V_C = I_C = 1\). Each produces a square of side 1, stacked vertically.

Every edge is 1Ω. For each individual edge, Ohm's law gives \(V_e = I_e \times 1\Omega = I_e\). The voltage drop across the edge equals the current through it. In the rectangle, voltage drop = height of the piece and current = width of the piece. Equal height and width: a square. The series path through B and C has total resistance 2Ω as a path, but each individual edge within it is still 1Ω and produces its own square.

Circuit ↔ RectangleHover over a square to highlight its resistor
Left: resistor network. Right: squared rectangle. Each edge (1Ω) → one square. Current = side length.
Why 1Ω per edge? The BSST construction assigns 1Ω to every edge of the graph. Each edge becomes one square. For that edge, \(V = IR = I \times 1 = I\), so the voltage drop (height of the square) equals the current (width of the square). That is the entire reason the pieces are squares, not rectangles. The path resistance through a series chain of \(k\) edges is \(k\,\Omega\), but each of the \(k\) edges separately satisfies \(V_e = I_e\), producing \(k\) unit-aspect-ratio squares stacked vertically with the same width.

The Moron network

For the 33×32 rectangle, the circuit has 6 nodes (horizontal cuts at \(y = 0, 15, 18, 22, 23, 32\)) and 9 edges (one per square). Current conservation holds at every internal node:

Node \(y\!=\!15\): in = 15 (from square s=15), out = 8 + 7 = 15 ✓
Node \(y\!=\!18\): in = 18 (from square s=18), out = 4 + 14 = 18 ✓
Node \(y\!=\!22\): in = 7 + 4 = 11, out = 1 + 10 = 11 ✓
Node \(y\!=\!23\): in = 8 + 1 = 9, out = 9 ✓

The total current entering node 0 (top) is \(15 + 18 = 33\) = width. The total voltage drop from top to bottom is 32 = height. The tiny 1A current through the 1×1 square is forced by the topology: without it, KCL fails at nodes 22 and 23.

The tiling gallery

Squared Rectangle GalleryVerified tilings
Each square's side length = current through the corresponding edge.

03 Backtracking Square Tilings

Finding a valid squared tiling of a given rectangle is a constraint satisfaction problem. Not every sum-of-squares decomposition of an area \(W \times H\) corresponds to a valid tiling: the squares must physically fit without overlapping. The approach is a backtracking algorithm that scans the rectangle left-to-right, bottom-to-top, and at each empty cell tries the largest square that fits. If it reaches a dead end (an empty cell where no square fits), it backtracks and tries the next smaller size.

Backtracking TilerEnter dimensions and tile
×
Click "Tile it" to find a square tiling by backtracking.

The 14×3 rectangle (area 42) decomposes as \(4 \cdot 3^2 + 2^2 + 2 \cdot 1^2 = 36 + 4 + 2 = 42\). The algorithm finds this tiling by placing four 3×3 squares, then a 2×2, then filling the remaining two 1×1 gaps. For 10×3 (area 30), the tiling uses three 3×3 squares and three 1×1 squares: \(3 \cdot 3^2 + 3 \cdot 1^2 = 27 + 3 = 30\).

Connection to circuits. Each valid tiling defines a planar electrical network (the BSST construction in reverse). The horizontal cuts become nodes, the squares become 1Ω resistors, and KCL at each node is the geometric constraint that widths sum correctly. The backtracking algorithm is, in effect, searching for a valid Kirchhoff solution.

04 Sum of Squares and the Matrix-Tree Theorem

The total area of a squared rectangle is the sum of the squares of the side lengths:

$$\sum_{\text{squares}} s_i^2 = W \times H$$

Each square of side \(s\) has area \(s^2\). The total area is width times height. The side lengths come from Kirchhoff's equations (= the Laplacian), and whether they come out as integers is controlled by the determinant of the reduced Laplacian. By Kirchhoff's Matrix-Tree theorem, this determinant equals the number of spanning trees.

For the 3×2 rectangle with squares of sides 2, 1, 1: the sum of squares is \(4 + 1 + 1 = 6 = 3 \times 2\). For Moron's 33×32: the sum \(15^2 + 18^2 + 8^2 + 7^2 + 1^2 + 9^2 + 10^2 + 4^2 + 14^2 = 1056 = 33 \times 32\).

The connection closes. The number of spanning trees (a topological invariant computed from the Laplacian determinant) controls whether a graph produces an integer squared rectangle. The effective resistance between two nodes is \(R_{ab} = (\mathbf{e}_a - \mathbf{e}_b)^\top L^+ (\mathbf{e}_a - \mathbf{e}_b)\), where \(L^+\) is the pseudoinverse. The total effective resistance \(\sum_{a < b} R_{ab} = n \sum_{i=2}^n \frac{1}{\lambda_i}\) ties the circuit back to the Laplacian spectrum.
From Fibonacci to Kirchhoff. The Fibonacci matrix had \(\det(Q^n) = (-1)^n\), always \(\pm 1\). The graph Laplacian's cofactor determinant counts spanning trees. Both are determinantal invariants. The Fibonacci recurrence is a 1D circuit (a chain of unit resistors). Kirchhoff's theorem generalises the determinant-as-invariant idea from a single recurrence to an arbitrary network. The sum of squares identity for squared rectangles is the geometric manifestation of this algebraic fact.