Is there (or can there be) a general algorithm to solve Rubik's cubes of any dimension?

The algorithmic problem is a special case of ``constructive membership test in permutation groups'' -- given a permutation (you label every face of the cube with a number, then every slice rotation corresponds to a permutation of the numbers, as does the mixed state), write it as a product of generators. This does not care for the dimension of the cube you work in, you just get more and more labels.

The generic solution to the problem is called the Schreier-Sims algorithm (https://en.wikipedia.org/wiki/Schreier–Sims_algorithm). However in its naive form, it produces very long solutions (length >100k for the $3\times3\times 3$ cube).

One can add heuristics (basically to pre-seed with short products as "extra" generators), see for example: https://doi.org/10.1006/jsco.1998.0202 . With such heuristics, the $3\times3\times 3$ cube gets solutions of length $\sim 40-100$, so a magnitude too large, but not astronomically so. One can tune heuristics (use more memory) to get better solutions, though the only (known) way to find a shortest solution is brute-force.


Here is a very simple (and very inefficient) algorithm:

The set of finite sequences of moves is countable, so we can enumerate such sequences $s_1, s_2, \ldots$ (specifically, we can do so in a computable manner). Then execute the following algorithm:

i=1
while cube is not yet solved:
  execute move sequence s_i
  if cube is solved:
    return s_i
  else
    undo move sequence s_i
  i = i+1

Since every finite sequence of moves appears in our enumeration, this algorithm will always terminate in finite time (and in fact for a fixed puzzle with finitely many configurations, its runtime will necessarily be bounded).

For a more "reasonable" algorithm, some kind of bound needs to be put on the runtime; this one is at least exponential in the dimension of the cube, which I suspect is very suboptimal.

Edit: This answer seems to have gotten a lot of attention by virtue of being the earliest one to the question, but the other answers to this question are significantly more interesting; go upvote them instead!