Euler's Formula for Planar Graphs
In one sentence: Euler’s formula says that if you draw a connected network on a flat sheet with no crossing lines, then corners minus lines plus regions always comes to 2.
Read it out loud: “V minus E plus F equals 2. V is the number of vertices, the corner points or dots of the drawing. E is the number of edges, the lines that join the vertices. F is the number of faces, the regions the drawing cuts the paper into, counting the outside too. Work from left to right: take the lines away from the corners, then add the regions.”
Before you start
The ideas and signs this page uses, explained from zero. For powers of ten, Greek letters and other notation in general, see Math basics.
- Graph, vertex and edge
A graph is a set of vertices, which are dots or corners, joined by edges, which are lines. A graph records which corners are joined, not the exact length or shape of the lines. A map of roads, with the junctions as corners and the roads as lines, is a graph.
- Planar and connected
A graph is planar when you can draw it on a flat sheet so that no two edges cross, except where they meet at a shared vertex. A graph is connected when you can walk from any vertex to any other by following the edges. A drawing made of two separate pieces is not connected.
- Faces, the regions of a drawing
A face is one region of the flat paper that is enclosed by lines, with no line passing through it. A single closed loop, such as a triangle, cuts the paper into two faces: the inside and the outside. The region outside the whole drawing counts as a face as well, so it is always included in the count .
- Reading with plus and minus signs
The formula combines three counts with a minus sign and a plus sign. Work from left to right: first subtract from , then add . A minus sign takes a quantity away, and a plus sign adds it back. The middle step can be below zero, such as , which is a number to the left of zero on the number line. That is allowed.
- Sphere and the number 2
A sphere is a ball shape, like a globe, with no holes in its surface. A flat map can be wrapped onto the surface of a sphere. Mathematicians measure the shape of a surface with a single number, the Euler characteristic, and for a sphere that number is 2. The formula’s answer of 2 comes from this fact about the sphere.
What each symbol means
| Symbol | Meaning |
|---|---|
| The number of vertices: the corner points or dots of the drawing, the places where lines meet. It is a plain count with no unit. The cube example has 8 vertices, one at each corner of the cube. | |
| The number of edges: the lines that join the vertices, with each edge joining two vertices. It is a plain count with no unit. The cube example has 12 edges, one for each edge of the cube’s frame. | |
| The number of faces: the regions the drawing divides the flat paper into, with the outside region counted as one of them. It is a plain count with no unit. The cube example has 6 faces: an inner square, four trapezoids between the squares, and the outside. |
The formula piece by piece
Start with the corners. counts the dots of the drawing, the places where lines meet. Each corner is one vertex. In the cube example, , one for each corner of the cube.
The lines. counts the edges, the segments of line between corners. A cube’s frame has 12 such segments, so . Each edge is counted once, however the drawing is shaped.
The regions. counts the faces, the pieces of paper enclosed by the lines, plus the outside. For the cube drawing it is 6: the inner square, four trapezoids between the squares, and the outside region.
Corners minus lines. Starting from the corners and taking away the lines gives for the cube. The result is negative, which is allowed, because the next step adds the faces back.
The corners, minus the lines, plus the regions. Adding the faces to the corners-minus-lines total gives for the cube. For any connected planar drawing, this total is also 2.
The whole formula as one sentence: the number of corners, minus the number of lines, plus the number of regions, always equals 2 for a connected drawing with no crossing lines.
A standard rearrangement of the same law. If you know the corners and the lines, the faces are . For a drawing with 8 corners and 12 lines, that is faces, which is the cube’s count.
What the formula is doing, and why
A graph is a set of vertices joined by edges. It is planar when it can be drawn on a flat sheet so that no two edges cross, except where they meet at a shared vertex. It is connected when you can walk from any vertex to any other along the edges.
What to count. Draw the graph on paper and count three things: the dots, the lines and the regions the drawing cuts the paper into. The regions are the faces, and the big region outside the drawing counts as one too. A triangle has 3 vertices, 3 edges and 2 faces: the inside and the outside.
Why this balance? The three counts always balance in the same way. Adding a new line that cuts a region in two adds one edge and one face, so stays the same. Adding a new corner in the middle of a line adds one vertex and one edge, which also keeps the balance. That is why the answer does not change when the drawing is moved or stretched.
Where the 2 comes from. A flat drawing can be wrapped onto the surface of a ball, like a map on a globe, and that surface has no holes. Mathematicians describe this kind of shape with the number 2. That is why the same count of corners, lines and faces gives 2 for a flat drawing, and also for solid shapes such as cubes.
The graph must be connected. If the graph falls into several separate pieces, the total becomes 1 plus the number of pieces, not 2. Check that the graph is connected before you use the value 2.
An everyday picture
Think of a map of a few countries drawn on a flat sheet. The borders are edges, the points where borders meet are vertices, and each country is a face. The sea outside the map is one more face. Counting the meeting points, the borders and the regions, including the sea, gives the same total of 2 that Euler’s formula predicts, however the countries are drawn.
Worked example: A cube drawn flat
A cube, such as a box or a die, has 8 corners, 12 edges and 6 square faces. To draw its frame on paper, draw one square, then a second, smaller square inside it, and join each corner of the outer square to the matching corner of the inner square. The drawing has no crossing lines. The region outside the outer square counts as one face. The cube is a real shape, and the counts below come from counting that drawing.
- Write down the three counts for the drawing. The drawing has corners, lines and regions. The regions are the inner square, four trapezoids between the two squares, and the outside. The outside region is easy to forget, so count it on purpose.
- Check the corners. The outer square has 4 corners and the inner square has 4 corners, and each outer corner is joined to its matching inner corner. That makes corners, one for each corner of the cube.
- Check the lines. The outer square has 4 lines, the inner square has 4 lines, and the 4 joining lines link the two squares. That makes edges, one for each edge of the cube’s frame.
- Put the counts into the formula. . Work from left to right. , which is below zero, and then . So the total is 2, as the formula says it must be.
- Test a second shape. A triangle drawn on paper has 3 corners, 3 edges and 2 faces: the inside and the outside. Then . The same total of 2 appears again, even though the shape is different, which is the point of the formula.
- Use the formula to find a missing count. Rearranging the formula gives . For a connected drawing with 8 corners and 12 lines, faces. So the faces do not have to be counted when the corners and lines are known.
- Say the rule plainly. Any two of the three counts give the third, so the formula is a shortcut as well as a check. It works for the cube’s flat drawing and for the triangle, which are very different pictures with the same total.
Answer: The cube frame gives , as the formula says. Because any two counts give the third, a connected planar drawing with 8 corners and 12 lines must have 6 faces.
The numbers in this example are recomputed by script every time the site is built.
Common mistakes
- Leaving out the outer face. A triangle has 2 faces, not 1, because the outside is a face too. With only 1 face the total would be , which is wrong.
- Using the formula on a graph that is not connected. Then the total is 1 plus the number of separate pieces, not 2.
- Using the formula on a drawing where two lines cross. A crossing that is not counted as a vertex makes the counts wrong, so use a drawing in which no lines cross.
- Mixing up faces and edges. Edges are the lines, and faces are the regions between them, so the two counts are never the same thing.
Where you will meet it
- Checking whether a network can be laid out on a flat sheet without crossings, which is a central question in graph theory.
- Proving facts about polyhedra, which are solid shapes with flat faces, since the cube, the tetrahedron and the icosahedron all satisfy the formula.
- Mesh processing in computer graphics, where a count like this checks the shape of a 3D surface made of many small flat pieces.
- Proofs that some graphs cannot be drawn without crossings, such as the complete graph , which has 5 vertices with every pair joined.
Questions people ask
Why does a triangle have 2 faces?
The triangle’s three edges split the paper into two regions, the inside and the outside. Both count as faces, so , and .
Does the drawing change the answer?
No. You can move or stretch the drawing, and its three counts stay the same. Any valid flat drawing of a connected graph gives .
What if the graph is not connected?
Then the total is 1 plus the number of separate pieces, not 2. So check that every corner can be reached from every other corner before you use the value 2.
Related formulas
- Complete Graph Edges: A complete graph joins every pair of points with one line, and this formula counts how many lines that takes, given how many points there are.
- PageRank: PageRank gives each web page a score based on which other pages link to it, and a link from a page with a high score counts for more.
- Perfect Binary Tree Nodes: The formula counts every node in a perfect binary tree, a branching diagram in which each row is completely full, using only the number of rows below the top.