Search for Soma Cube Solutions

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

The Soma cube consists of seven polycubes with three or four small cubes each that can be assembled into a cube. This Demonstration allows you to watch the progress of an exhaustive search to find all solutions. At each step, the next piece is put into one of all possible orientations and a solution is searched recursively. The controls allow you to single-step through the search, advance to the next solution, let it run to completion or start over. The slider allows you to dissect the assembled pieces.

Contributed by: Roman E. Maeder (January 2020)
Open content licensed under CC BY-NC-SA


The search generates all solutions that are distinct up to a rotation of the cube as a whole. There are 480 such solutions. The first piece is placed in one of four positions; the remaining pieces are tried in all possible translations and rotations. It turns out that only the first placement of the first piece admits any solutions, due to parity considerations.

The first control triggers a single step of adding another piece or removing one piece when backtracking. The second control runs the animation until a solution is found. It introduces a variable delay after each step. The third control continues the search to completion and introduces delays only when a solution has been found. Clicking a control again stops the animation. The two counters count the number of solutions found and the total number of steps tried.

The natural search algorithm is recursive. To allow single-stepping and maintaining state in the notebook, it was converted into an iterative version.


Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.