The idea: count dots, lines and regions

Draw a connected graph on paper so that no two edges cross. Count the vertices V, the edges E and the faces F, the regions the edges cut the paper into. The region outside the drawing is a face too: the outer face. Then V − E + F = 2, whatever you drew. The house on the page has 5 vertices, 7 edges and 4 faces: 5 − 7 + 4 = 2.

Left: an edge from a drawn vertex to a new vertex, marked V plus 1 and E plus 1, F unchanged. Right: an edge between two drawn vertices that closes a triangle, marked E plus 1 and F plus 1, V unchanged. Both say V minus E plus F does not change.
Every edge does one of two things, and both keep V − E + F the same.

Two moves, one invariant

Build the drawing one edge at a time, always touching what is already there. Start with a single dot: V = 1, E = 0 and the whole plane is one face, so 1 − 0 + 1 = 2. Each new edge then either

  • reaches a new vertex: V + 1 and E + 1, F stays the same, or
  • joins two vertices already drawn: it splits one region in two, so E + 1 and F + 1.

In both cases a +1 and a −1 cancel, so the sum stays 2 to the end. That is the whole proof. A tree uses only the first move: E = V − 1 and F = 1. Every extra edge closes exactly one face. (Demo: build a house, one edge at a time)

Why the outer face counts

Without the outer face a single dot would give 1 − 0 + 0 = 1, and a triangle 3 − 3 + 1 = 1: still constant, just a different number. Counting the outside makes the plane behave like a sphere. On a ball there is no "outside": the outer face is just one more region.

From a solid to a flat drawing

A convex polyhedron has vertices, edges and faces too. Put your eye just above one face and look through it: the other faces appear inside it, and nothing crosses. This flat picture is a Schlegel diagram. The face you looked through becomes the outer face, so the counts are the same and V − E + F = 2 holds for every convex solid. (Demo: cube flattened)

Left: a cube drawn in perspective with its front face shaded as the face you look through. Right: the same cube as a flat drawing, a big square around a small square with four corner edges; the shaded front face is now the region outside the big square.
Look through one face and the cube lies flat; that face becomes the outer face: 8 − 12 + 6 = 2.
solidfacesat each cornerVEFV − E + F
tetrahedrontriangles34642
cubesquares381262
octahedrontriangles461282
dodecahedronpentagons32030122
icosahedrontriangles51230202

The cube and the octahedron swap V and F, and so do the dodecahedron and the icosahedron: put a dot in the middle of each face and join dots of neighbouring faces, and you get the dual solid.

Why only five regular solids

A regular solid has the same regular p-gon on every face and q faces at every corner. Each edge lies on two faces and has two ends, so pF = 2E and qV = 2E. Put V = 2E/q and F = 2E/p into Euler's formula and divide by 2E:

1p+1q=12+1E>12

With p, q ≥ 3 only five pairs work: (3, 3), (3, 4), (4, 3), (3, 5) and (5, 3). The angles tell the same story: the q corners meeting at a vertex must add to less than 360°, or they lie flat. (Demo: why only five regular solids)

Top row, marked with a tick: corners made of 3, 4 and 5 triangles (180, 240, 300 degrees), 3 squares (270 degrees) and 3 pentagons (324 degrees). Bottom row, marked with a cross: 6 triangles, 4 squares and 3 hexagons, each exactly 360 degrees, lying flat.
Under 360° a corner can fold into a solid; at exactly 360° it lies flat and tiles the plane instead.
p, qcorner angle sum1/p + 1/qresult
3, 3180°0.667tetrahedron, E = 6
3, 4240°0.583octahedron, E = 12
4, 3270°0.583cube, E = 12
3, 5300°0.533icosahedron, E = 30
5, 3324°0.533dodecahedron, E = 30
3, 6 · 4, 4 · 6, 3360°0.5flat tilings (triangles, squares, hexagons)
anything elseover 360°below 0.5impossible

How many edges fit: K5 and K3,3

In a planar graph with at least 3 vertices every face has at least 3 sides, and each edge borders two faces, so 3F ≤ 2E. Put that into Euler's formula and you get E ≤ 3V − 6. The complete graph K5 has V = 5 and E = 10, but 3 · 5 − 6 = 9. On the page, 9 of its edges fit (every face then is a triangle), and the 10th must cross. (Demo: K5 can't be drawn flat)

K3,3 (three houses, each joined to gas, water and electricity) has no triangles, because houses only join utilities. So every face has at least 4 sides, 4F ≤ 2E, and E ≤ 2V − 4 = 8. It has 9 edges. (Demo: three houses, three utilities (K3,3))

Kuratowski's theorem says these two are the only obstacles: a graph is planar exactly when it doesn't contain a subdivided K5 or K3,3. Another consequence of E ≤ 3V − 6: the average degree is below 6, so every planar graph has a vertex with at most 5 neighbours. That is the first step in proving that maps can be coloured with few colours; see Graph Coloring.

Several pieces

If the drawing falls into C separate pieces, a lone new dot adds V + 1 and nothing else. So the sum is V − E + F = 1 + C. Two separate triangles give 6 − 6 + 3 = 3. Joining the pieces with one edge (E + 1, F unchanged) brings it back to 2. Counting pieces is what Connected Components does. (Demo: two separate pieces)

See also Euler Path and Circuit (another theorem by Euler about graphs: degrees and walks that use every edge once), Kruskal's spanning tree (a spanning tree has E = V − 1) and Proofs Without Words.

What the page leaves out

On a torus (a doughnut) the sum is 0, not 2: a 3 × 3 grid wrapped around it has 9 vertices, 18 edges and 9 faces, 9 − 18 + 9 = 0. A surface with g holes gives 2 − 2g, the Euler characteristic, and a picture-frame polyhedron with a hole also gives 0. The page leaves out non-convex solids, Descartes' theorem that the angle defects of a convex solid add to 720°, the proof of Kuratowski's theorem, linear-time planarity tests (Hopcroft–Tarjan), the Archimedean solids, and higher dimensions, where 4D polytopes have V − E + F − C = 0 (C = 3D cells). Every planar graph can also be drawn with straight edges only (Fáry's theorem); the curved edge in the K3,3 scene is just a choice.