HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Cube 3x3: Using just face rotations, transform the cube from configuration A to B

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
the3x3justconfigurationrotationsfaceusingcubetransformfrom

Problem

I'm looking for some tips on how to best implement the algorithm to accomplish the following:

  • Imagine a 3×3 cube with a rubik's cube mechanism, i.e. you can freely rotate any of the 6 faces.



  • You don't care about colors.



  • Instead you index the component 26 cubes A–Z and ignore the middle.



Illustration image (component cubes): https://paste.pics/AOYUS

Now, I would like to generate a list of face rotations that would get me from this configuration to some other configuration. E. g. this: https://paste.pics/AOYWM

Note: I don't care which component cubes end up in positions labeled as *

Ideally the algorithm produces the shortest list of transformations necessary, but it's not a firm condition. Any suggestions welcome, thanks!

Solution

If the number of "don't care" colours is large, as it is in this example, you probably can't do much better than A* search.

One simple heuristic function is the minimum number of moves required to move the currently-least-correct piece to its correct position. Since you're willing to tolerate some non-optimality, summing over all pieces that are not in their correct locations will probably do quite well in practice.

Context

StackExchange Computer Science Q#132266, answer score: 2

Revisions (0)

No revisions yet.