I want to write cubesolver for a Rubik cube of any size.
I know how to solve cubes larger than 3x3x3:
- First we need to solve the central (flat) fields of the cube so that they look like in the picture.

- Secondly, we will solve the edges:

- And finally, we can reduce the whole problem to solving a 3x3x3 cube:

It sounds very simple, but the problem is that the methods for solving centers and edges depend on the size of the cube. For the 3x3x3 algorithm for solving centers and edges, it has 0 moves, for 4x4x4 it is longer, and for 5x5x5 it is even longer.
But how can I calculate these steps? Is there an easy way?
Thanks in advance!
source share