On this page
Three houses each need a line to water, gas and electricity: nine lines, none crossing. Henry Dudeney published the puzzle in The Strand Magazine in 1913 and again in his 1917 book Amusements in Mathematics, and even then he called it an old problem (Three utilities problem, Wikipedia). On flat paper it has no solution, and a short count proves it.
What is a planar graph?
A graph is a set of points (vertices) joined by lines (edges). A planar graph is a graph that can be drawn in a plane without any edges crossing (Wolfram MathWorld, Planar graph).
The houses-and-utilities puzzle is the utility graph, K₃,₃: two groups of three vertices, with every vertex in one group joined to every vertex in the other (Wolfram MathWorld, Utility graph). K₅ is its cousin: five vertices, each joined to the other four, which makes 10 edges.
A crossing-free drawing cuts the paper into regions called faces, and the outside counts as one.
What does Euler's formula V − E + F = 2 say?
For a finite, connected graph drawn in the plane without crossings, vertices minus edges plus faces always equals 2: V − E + F = 2 (Planar graph, Wikipedia).
Check it on a square: 4 vertices, 4 edges and 2 faces (inside and outside), so 4 − 4 + 2 = 2. Add a diagonal and it splits one face in two: 4 − 5 + 3 = 2.
Where does E ≤ 3V − 6 come from?
Take a simple, connected graph (no loops, no repeated edges) with at least 3 vertices, drawn flat. Every face is bordered by at least 3 edges, and every edge borders at most 2 faces. Counting edge-face contacts both ways gives 3F ≤ 2E. Now replace F using Euler's formula, F = 2 − V + E:
3(2 − V + E) ≤ 2E
6 − 3V + 3E ≤ 2E
E ≤ 3V − 6
A planar graph with v ≥ 3 vertices therefore has at most 3v − 6 edges (Planar graph, Wikipedia). If the graph has no triangles, every face needs at least 4 edges, so 4F ≤ 2E, and the same algebra gives E ≤ 2V − 4.
Why can't K₅ and K₃,₃ be drawn flat?
Here is the worked example, using the two bounds above (Planar graph, Wikipedia).
K₅. V = 5 and E = 10. A planar graph on 5 vertices may have at most 3 × 5 − 6 = 9 edges. Ten is one too many, so K₅ is not planar.
K₃,₃. V = 6 and E = 9. The first bound does not catch it: 3 × 6 − 6 = 12, and 9 is less than 12. But K₃,₃ has no triangles: any three vertices include two houses or two utilities, and a house is never joined to a house. So the sharper bound applies, 2 × 6 − 4 = 8, and the puzzle needs 9 edges. One line too many, so at least one crossing is forced (Three utilities problem, Wikipedia).
The paper matters too. K₃,₃ can be drawn without crossings on a torus, which is why the puzzle can be solved when the houses and companies are drawn on a coffee mug (Three utilities problem, Wikipedia). The count above is for the flat plane.
Why do K₅ and K₃,₃ matter so much?
In 1930, Kazimierz Kuratowski proved that these two graphs are the only obstructions: a finite graph is planar if and only if it does not contain a subdivision of K₅ or K₃,₃ (Wolfram MathWorld, Planar graph; original paper in Fundamenta Mathematicae, volume 15). (A subdivision is the same graph with extra vertices placed along its edges.) Every non-planar graph hides one of these two shapes.
How do you test whether a graph can be drawn flat?
Cheapest step first:
Count V and E. If V ≥ 3 and E > 3V − 6, stop: not planar.
Look for triangles. If there are none and E > 2V − 4, stop: not planar.
If it passes both, search for a hidden K₅ or K₃,₃ (allowing extra vertices along the edges). If you find one, it is not planar.
If there is none, Kuratowski's theorem says a flat drawing exists. Draw it, then confirm with V − E + F = 2.
Try it on a cube's skeleton: 8 vertices, 12 edges, 6 faces. 12 ≤ 18, and 8 − 12 + 6 = 2.
If the step from 3F ≤ 2E to E ≤ 3V − 6 loses you, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For the ideas underneath, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing, each with its own lesson.
Next time someone hands you the puzzle, count the edges and show them why the ninth line has nowhere to go.



