Unravelling Cubes of Size 2x2x2 and Above
The Rubik's cube and its extensions have been around for a long time and provide perennial fascination. They come in both hardware and interactive software forms. Well-known hardware forms of the cube come in sizes 2x2x2 (Pocket Cube), 3x3x3 (standard Rubik's cube), 4x4x4 (Rubik's Revenge) and 5x5x5 (Professor's Cube). Hardware sizes 6x6x6 and 7x7x7 have also become available in recent times. For simplicity I will refer to such cubes as being of size 2, 3, 4, 5, 6 and 7 respectively.
A common but by no means universal approach for software forms is to emulate the cube by:
Other interactive software approaches that don't emulate a three-dimensional cube are also used by some programmers.
A brief review of the status of the Rubik's family cubes (size 2 and above), with special emphasis on cubes of large size, is provided in the Rubik's n x n x n Cube Family file.
Unravel Interactive Software Program
My interest in cubes arose from a desire to solve cubes too large and complex to consider for manufacture in physical form. Interactive software I have developed for this purpose is referred to under the name Unravel. Freeware versions of Unravel are available for download.
Unravel Program Development History
The original version of Unravel was written pre-1991 in Fortran for use with monochrome monitors in common use at the time of the initial development. It used a numerical representation for the cube elements and catered for cubes in the size 2 to 11 range. If anybody has special needs or who may be interested in program history, email me and I will send you Rubknn.exe (dated 21-Oct-1991) which retains monochrome capability, handles cubes of size 2 to 11 and can run under Windows XP (but not later versions). The first version using colour graphics was also written in Fortran and the final Fortran version was produced in 1991. It catered for cubes in the size 2 to 15 range. Later versions written in C, C++ and Java included incremental improvements, with the current C++ version (available as a Windows executable) catering for a cube size range of 2 to 16. The Java version has the same lower limit but has a settable upper limit ranging upwards from 16 but never exceeding 95. The Java version's upper limit is subject to restraints imposed by the monitor's resolution, the height of the Task Bar, and the user's visual acuity. Usually the available vertical pixels set the limit in respect of resolution. Typical values of the cube size limit for the Java version are tabulated below.
Both versions of the software allow the cube size to be selected in increments of one within the available cube size range. Both versions of the software are available for download.
Standard and Marked Centres' Unravel Program Options
A "standard" cube has no makings on centre cubies and individual cubies can end up in varying positions for the solved state. For cubes with marked centres there is only one correct arrangement of centre cubies that satisfies a solved state.
The Java version of the Unravel program has a marked centres' option which is settable at run time. When set, the program implements marked centre cubies in the size 3 to 16 range. The maximum size setting (16) is an arbitrary one but centre markings do impose a pixel penalty that places a restriction on he maximum cube size that can be accommodated.
Unravel Program Features
The first thing to observe is that the state of a cube is completely defined by what can be seen on its six external surfaces. For a cube of size n, the state is completely defined by the colours of n x n x 6 miniature squares. It follows that the current state of the cube can be simply observed on a computer screen by displaying six flat two-dimensional faces each with n x n elements. This approach has been adopted for the Unravel software available for download and has also been used by some other programmers. While the two-dimensional display lacks a real-world look, it actually makes solving the cube easier than some other implementations because all cube elements are visible all the time. Of course, all the rules that apply to the real-world cube have to be implemented in the software.
Central to the Unravel cube solution software is the adoption of keyboard text entry as the means by which the user manipulates the state of the cube. A useful addition to the cube software is the introduction of some shortcuts. The conventional approach is to advance in 90 degree rotation steps of one or more layers throughout the solution process. Computers are ideally set up to allow sequences to be defined in "macros". The term "macro" as used in computer science is a rule or pattern that specifies how a certain input sequence should be mapped into an output sequence. Macros are normally used to map a short string to a longer string (sequence of instructions). Macros simplify things in Unravel by providing short-cuts for long sets (or frequently used short sets) of instructions on how to rotate the cube. Implementation of macros is achieved via keyboard entry. On average, macros are not of much use until about 40% of the cube is in place and most are used for centre element placement (centre elements become numerically dominant for n greater than 4). The default macro set included with the Unravel software provides just one of many paths to a solution. The macro sequences provided for cubes of size 4 and above may not be as short as some published sequences. It needs to be emphasized that I was looking for "a" solution, not necessarily the solution with the least number of moves. From a computer standpoint, short or long macro sequences can be executed "instantly". Users can write and use their own macros, or not use any macros, if they wish.
An essential addition to cube software, particularly for cubes of large size, is the provision of the capability for users to save the state of their partially arranged cube on their disk or other storage medium, and be able to readily recover it at a later time. For cubes of large size it would be safe to say that non-specialist cubists would not want to rely on being able to solve the cube in one sitting. I have used the Unravel program to unscramble cubes only up to size 15 as my interest has been more in programming the means to solve the cubes rather than in implementing the means.
For those who have an interest in the time they take to solve a cube, an elapsed timer is provided. "Processor" time is logged separately to "user" time, so a slower computer does not give rise to any penalty. Elapsed time is also saved when the cube state is saved. The elapsed time display can be turned off if desired.
The Unravel program can be run directly from this website in either Applet or Web Start mode. If the Web Start mode is selected the Java program will be downloaded to the user's computer and can subsequently be run off-line if desired. Users who experience difficulties with Web Start or who wish to download just the basic program and run it direct from the program's Java Archive (jar) file can achieve this with an alternative download referred to on the Programs for Unravelling Cubes page as Java Archive (JAR) Direct Mode. For users who have a Windows operating system, the earlier version developed using C++ is available for download as an alternative to the Java implementation, if preferred. For the C++ version, there are some advantages in respect of start-up speed, neatness of graphics, and program installation, but the 16 size limit may be unacceptable for a small number of cubists. Also, some options available in the later Java version are not available in the C++ version. For discussion on and implementation of the software options, go to the Programs for Unravelling Cubes page.
The main features of the software including those expanded upon above are:
Supplementary help, particularly for beginners, in solving standard cubes of various sizes using my Unravel program, is available in document form from the Instructions for Solving Rubik Family Cubes of Any Size file cubesolving.pdf. Supplementary help in solving the more complex marked centres' style cubes is available in document form from the Implementing and Solving Rubik's Family Cubes with Marked Centres file markctr.pdf.
In summary, my motivation for developing the program, referred to by the name Unravel, was to develop my own methods, including macros, to facilitate the solving cubes of size n = 4 and above. I realize that hardware cubes are still likely to be preferred by many people. It needs to be stressed that the supplied program does not make it overly simple to solve complex cubes but it makes it fairly straight forward for an amateur cubist to do so. There are plenty of challenges along the way, and users can decide how far they want to go - from simple and quick to complex and long-winded.
The number of reachable states possible for cubes in the size range 2 to 25 was
calculated as a separate exercise. This has nothing to do with solving the
cube. If you manage to solve the size 16 cube (with unmarked centres) you will have arrived at the one
in 10933.175 possible states that represents the solution to
the standard size 16 cube.
A full list of my supporting documents relating to Rubik's family cubes is provided on the Cube Publications page.