On this page
Instant Insanity gives you four cubes, each face painted one of four colours. Stack them into a column so that every long side (front, back, left and right) shows all four colours exactly once. Graph theory solves it, for any set of four cubes, with pencil and paper.
What is the Instant Insanity puzzle?
Instant Insanity is the name Parker Brothers gave its 1967 version of a much older puzzle, recreated by Franz Owen Armbruster. The first known patented version, Frederick Alvin Schossow's Katzenjammer puzzle, dates from 1900, according to Wikipedia's article on Instant Insanity. The same article puts the number of configurations of the four cubes at 41,472, too many to try by hand.
How does the graph theory solution work?
The method, as set out in the MAS341 Graph Theory notes on Instant Insanity, builds one graph. The four colours are the vertices. Every pair of opposite faces on a cube becomes an edge between its two colours, labelled with the cube's number. Each cube has three opposite pairs, so the graph has twelve edges, three with each label. A pair with the same colour on both faces becomes a loop, and a loop adds 2 to the degree of its vertex.
Now look at the front and back of a finished column. Each cube shows one opposite pair there, so the front-back pairs form a subgraph with one edge from each cube. Each colour appears once on the front and once on the back, so every vertex of that subgraph has degree 2. The left-right pairs behave the same way, and no pair can serve both. So a solution needs two subgraphs that:
use exactly one edge with each label 1, 2, 3 and 4
give every colour degree 2
share no edge
Can you see it work on a real set of cubes?
Here is a set we built, each cube written as its three opposite pairs (R red, B blue, G green, W white).
Cube 1: R-B, G-W, B-W
Cube 2: B-G, G-W, R-R
Cube 3: G-W, R-R, R-B
Cube 4: R-W, B-B, G-G
Step 1: draw the graph. The diagram at the top of this post shows its twelve labelled edges.
Step 2: list every degree-2 subgraph. White has no loop, so exactly two cubes must give an edge that touches W. Try each pair of cubes in turn, then fill the rest. Only four subgraphs survive:
A: G-W (1), G-W (2), R-R (3), B-B (4)
B: R-B (1), B-G (2), G-W (3), R-W (4)
C: G-W (1), R-R (2), G-W (3), B-B (4)
D: G-W (1), B-G (2), R-B (3), R-W (4)
Step 3: find two that share no edge. A, C and D all use cube 1's G-W edge, so no two of them can pair up. B shares cube 3's G-W with C and cube 2's B-G with D. That leaves A and B, the only pair that works for this set.
Step 4: turn the cubes. Walk B round its cycle, R to B to G to W and back to R, putting the first colour of each edge on the front. For A, run the double edge between G and W from G to W on cube 1 and from W to G on cube 2; a loop puts the same colour on both sides.
Cube 1: front R, back B, left G, right W
Cube 2: front B, back G, left W, right G
Cube 3: front G, back W, left R, right R
Cube 4: front W, back R, left B, right B
Each side of the column now shows every colour once.
Why not just try every stack?
With n cubes and n colours, deciding whether a stack exists is NP-complete, according to Wikipedia's Instant Insanity article. With four colours the graph keeps the search small: the MAS341 notes list just five shapes a degree-2 subgraph can take (a loop at every vertex; one loop and a triangle; two loops and a double edge; two double edges; one four-cycle), so you check shapes, not stacks.
To practise, build your own set: draw the two subgraphs first, add a third pair to each cube, then hand the cubes to a friend. If you get stuck on a step, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For vertices, degree and cycles, the Fermi Concept Library gives each concept in mathematics its own lesson.
Read next: graph isomorphism invariants, Burnside's lemma for colourings and the eight queens puzzle.



