6502's cornerThree houses, water, light and gas [Solution]
2002-12-28
Index

Welcome!
Who am I
Demo
Documents
Small ones
Problems
Chess
Images
Music
My blog
Write me

Versione italiana 


Three houses, water, light and gas [Solution]

This is a very difficult problem and the solution I know is rather long and complex, but doesn't require any high math background to be understood.

First the bad news. There is no solution to the problem or, speaking more abstract, there is no way to connect on the plane each of a group of three points to every of a group of another three points without crossing lines. This kind of connection scheme (two groups of three points with every possible connection between points of the two groups) is called in graph theory K3,3 and the ability to draw a graph on the plane without crossing lines is called the planarity of the graph.

With these definitions the solution will be a demonstration that K3,3 is not planar.

Step 1: Euler's formula for the plane

If we consider a generic connected graph (i.e. from every point you can go to every other point moving along lines) on the plane (i.e. there are no crossing of lines) and we name V the number of nodes (vertices), E the number of lines (edges) and F the number of faces (separate part in which we divided the plane into, including the "exterior") then V - E + F is always 2.

An example of Euler's formula: in this case V=7, E=10 and F=5. As for all connected planar graphs we have V-E+F = 7-10+5 = 2

To understand why this formula is always true for a planar connected graph consider the graph composed by a single point on the plane. In this case the formula holds as V=1, E=0 and F=1 (the exterior) and so V-E+F=1-0+1=2. Now it's easy to see that every connected planar graph can be constructed starting from this single point by two kind of operation: the addition of another vertex connected to an existing one and the addition of a new line between two existing points.

Both these two operations however don't change the result of the formula as the first one increases by one both V and E and the second type adds a line and closes an area so both E and F are incremented by one. Neither of the two operations can so change the value of V-E+F.

Step 2: In our case 2E can't be less than 4F

Consider a planar graph and draw two small dot near the middle of every line (one per side). This way you've drawn 2E dots but looking at the faces you'll see that every face received as many dots as are the lines bounding it.

Drawing two dots for every line makes evident that the sum of the number of lines bounding a face is exactly twice the number of lines.

We also can note that in any hypothetical drawing of K3,3 on the plane there can be no faces bounded with just tree lines; in other words there can be no triangles. To see why note that a triangle means finding three vertices with every one connected to the other two and traslating this in the original problem domain it means that we should have lines between two houses or two supplies.

If we have no triangles, multiple connections or loops however this also means that the sum of the number of sides of all the faces is at least 4F as no face with less than 4 sides can exists.

Step 3: K3,3 isn't planar

Now we can put togheter the two considerations expressed above and come to the conclusion that there can exist no drawing of K3,3 on the plane without crossing lines.

V - E + F = 2      // Euler's formula
2V - 2E + 2F = 4   // Multiplied by two
2E >= 4F           // No triangle condition
E >= 2F            // Divided by two
2V - 2E + E >= 4   // Substituting 2F with E
2V - E >= 4        // Simplifying
2V - 4 >= E        // Isolate E

The above computations and the final condition are valid for any connected planar graph with no triangles, multiple connection or loops. If we substitute for V the value we have for k3,3 (i.e. 6) then we end up with a condition that limits the maximum number of lines to 2x6-4=8.

This means that K3,3 (that is connected and has no triangles) must be not planar because it has too many lines; to be precise one line more than the maximum allowed of 8.

With K3,3 this is also kind of frustrating because it's easy to draw on the plane all the connections but the last one; in other words K3,3 is planar once you remove a line (see next figure).

An embedding of K33 in the plane once we remove a line (the middle house has no electricity)