0
$\begingroup$

For a $3 \times 3 \times 3$ cube, there are several known algorithms to go from any valid state of the cube to the solved state, $S$, of the cube (same color on each side).

How about a more general question: an algorithm to go from any valid starting state $A$ to any valid end state $B$

i.e. $B \in \{ $ Set of all valid $3 \times 3 \times 3$ rubiks cube configs $\} - \{A\}$.

A trivial algorithm would be: go from $A$ to $S$ and then reverse the steps required to go from $B$ to $S$

However this algorithm is stupid. Can we do better?

$\endgroup$
3
  • 1
    $\begingroup$ Are you familiar with group theory? It gives a nice way of thinking about the Rubik's cube and other such puzzles with reversible steps. $\endgroup$
    – aschepler
    Commented Jul 27, 2023 at 13:56
  • 1
    $\begingroup$ It's not that stupid, in my opinion. It's the obvious solution, and it's slightly suboptimal. But it works just fine. $\endgroup$
    – Arthur
    Commented Jul 27, 2023 at 13:59
  • 1
    $\begingroup$ Write down the moves of that trivial but non-optimal solution that takes you from A to S to B. Call this move sequence X. You want a shorter move sequence that does the same as what X does. So apply the reverse of X to a solved cube, and try to solve that directly. The move sequence you get is your answer. This is equivalent to Karl's solution. $\endgroup$ Commented Jul 27, 2023 at 15:34

1 Answer 1

3
$\begingroup$

Imagine repainting the cube in state $B$ to make it look like $S$, and keep track of how you paint each piece. Now apply these repaintings of the individual pieces to the cube in state $A$. This gives you a new cube state $C$. Apply the cube-solving algorithm to $C$; the steps that turn $C$ into $S$ will also turn $A$ into $B$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .