Loading

Accessibility

Option Missing?
Leave Feedback
Engraved gold model of the cube

Engraved gold model of the cube.

Alhambra 4D Cube Puzzle

schedule
1 Month
person
Solo

Skills Used:

Python Logo
Python

After finishing college I was invited to attempt to solve the Alhambra Puzzle by its inventor.

I was the first to solve it so despite a number of previous attempts, including the maths department at Sussex University.

What is the Alhambra Puzzle?

The puzzle is an award winning ornate hand-crafted gold piece made of 8 unique cubes (the harder version has a extra cube). These sub-cubes are assembled together to form the mega cube.
The sub-cubes have a triangle on each of their faces, that form a pattern on each face of the mega cube when assembled. To check if the puzzle if solved all the faces on the mega cube need to match a set of allowed pattens. However you also need to check the inside faces of the mega cube. This means that there are 12 faces on themega cube that need to have the correct patten.

Complexity

The inventor thought that there was 480,000 possible permutations, and only one correct solution.

My analysis revealed there was over 4 quadrillion permutations for the simple version (8 cubes), and over 39 quadrillion for the complex version (9-cubes).

Even if you tried a new cube 1000 times per second, then it would take 140 thousand years to try all of them. Therefore, I set my goal to simplify the problem to allow it to be solved without checking all these permutations.

Results

Running my algorithm on a laptop found 1,636 solutions in 6 hours, taking an average of 12 seconds per solution.