# Algorithm to make two scrambled Rubik's cubes be exactly the same on all faces

There are millions of Rubik's cube combinations possible. If I have two 3×3 Rubik's cubes and both are scrambled, I want to make one scrambled cube exactly the same as the other without solving them. Is it possible? Is there any algorithm that can solve this problem using computer programs?

Apart from the visual appeal, there's nothing special about the "single colour on each side" configuration, or why it should be the only possible "solved" state. As a hand-wavy thought experiment proof: take two solved cubes, and scramble one of them into any position. Then, remove all the stickers from the scrambled cube and glue in new ones that make each side single coloured again. After that is done, you'd expect both cubes to work exactly alike, and if didn't do too sloppy of a job when placing the new stickers, you probably couldn't even tell which cube was which.

This means you can just define one of the scrambled cubes as solved, and then solve the other cube to that state.

What I mean is that every piece in a Rubik's cube is uniquely identifiable from their stickers alone, so do exactly what you would usually do, but instead of starting with "build a white cross at the bottom, with the other edge colours matching the neighbouring centres", you look at your target cube, and then build the "blue-red, white-green, white-blue, green-orange cross around the white centre piece", if that happens to be how the pieces were placed there.

This will royally mess up your usual solving habits, because nothing looks like it did on those 1000s of other times you solved the cube, but it's a fun exercise nevertheless. (Or maybe, exactly because of that.)

Let Cube1 be mixed cube you start with, and Cube2 be the mixed cube that you want to achieve. You want to scramble Cube1 further until it resembles Cube2.

Imagine putting new temporary stickers on top of the stickers of Cube2. Do it in such a way that the new stickers make Cube2 look solved. Now put new stickers on top of the stickers of Cube1, but such that the pieces exactly match those of Cube2. For example, if Cube2's red-yellow edge piece now looks like a white-orange edge piece, then you must also change Cube1's red-yellow edge piece to look like a white-orange piece.

Now just solve cube1 according to the stickers. It will look exactly like Cube2, even after you remove the temporary stickers.

With practice you don't need the stickers. Just solve Cube1 location by location, but instead of the correct piece for each location just use the piece that Cube2 has at that location.

Most cube-solving computer programs allow you to enter a move sequence instead of a cube position. First use the program to solve Cube1, i.e. make it calculate Solution1, a move sequence that solves Cube1. Then use it to calculate Solution2, a move sequence that solves Cube2. Finally enter the move sequence Solution1+(Solution2)', i.e. the move sequence Solution1 followed by the inverse of Solution2. This is a long move sequence that takes you from Cube1 to Cube2 via the solved state. Let the program optimise that to give you a short move sequence to get you from Cub1 to Cube2 directly.

Use stickers as replacement tokens.

If you put temporarily stickers on top of the colors, you can solve it using the normal solving algorithm. When finished, just remove the stickers, and then it is an exact replica.

'Solving a cube' is just transforming any given permutation of elements into another one, which you consider 'the solution', S. But, if any two given permutation P and Q are available from the 'solved' one S, then Q is available from P, too. A simplest way (not necessarily the shortest) would be transforming P→S and then S→Q.

So the answer is: YES, for any two legal states (that is, states reachable from S) you can transform a cube from one of them into the other by any standard algorithm of solving the cube.