61 points · by lispybanana · 2y ago · 40 comments
For example, you find a way to swap two pieces on the top layer and mangle the bottom (f), turn the top (g), and then do the opposite (f^-1), swapping a different pair and un-mangling the bottom. Between complementary swaps, edge flips, and corner rotations, you can build an entire solution with this technique. (My current version of this does the edges first, ignoring any damage to corners and then does corners.)
Somewhat related - many years ago there was a tutorial of the Gap computer algebra system that analyzed the rubik's cube group. I can't find the original, but there is a translation to Julia here: https://oscar-system.github.io/GAP.jl/stable/examples/
You eventually develop the intuition to solve any move without having to "memorize" anything.
(ps.: after a quick search I see that one can buy replacement stickers for a few bucks on Amazon :D)
Can a Rubik's Cube be brute-forced? - https://news.ycombinator.com/item?id=36645846 - July 2023 (108 comments)
(Reposts are fine after a year or so; links to past threads are just to satisfy extra-curious readers)
Reposts are fine after a year or so. This is in the FAQ: https://news.ycombinator.com/newsfaq.html.
Links to past threads are just to satisfy extra-curious readers. Edit: I guess I already said that above.
Edit: I appreciate my comment being hidden to reduce distraction for others, and to (selfishly) to prevent downvoting (not that I'm collecting MIPs or anything! <sweatsmile>)
Hm, so something akin to a bidirectional path-finding problem, where one can still call it "brute force" because both known positions (start and goal) are each doing a breadth-first search, as opposed to something fancier than picks a direction.
If insead you want to find the shortest possible solution for any giveb configuration, that indeed is much harder! The best optimal solvers at the moment use very large pruning tables to help the brute-force search.
A nice exercise could be solving a 2x2x2 cube. That one is much more manageable.
This page is great is you want to learn more: https://www.jaapsch.net/puzzles/compcube.htm
I wonder if just making random moves over and over would be faster.
Amazingly this means we can solve a Rubik's Cube without ever knowing what the original configuration is, as long as we can ask at any time if the cube is solved or not.
[0] https://bruce.cubing.net/ham333/rubikhamiltonexplanation.htm...
i = 0
while not solved
apply move(i)
Interestingly, there is no constant function `move(i) = x` that makes this algorithm correct.If there was, there would be a single element x of the rubik's cube group that generates the entire group (every element could be written as x^n)
This would imply that the group is commutative (x^n * x^m = x^(n+m) = x^(m+n) = x^m * x^n), which every cuber knows is false from experience (permuting moves does not lead to the same final configuration)
An interesting question would then be: whats the simplest piecewise-constant function that makes this algorithm work?
I.e. is it possible to use move x1 for the first n1 steps, then x2 for the second n2, then x3 for the next n3, ..., then xk for the next nk? And if so, what is the smallest k that makes it so?
Or more specifically, there is a fixed sequence of moves that will traverse through every possible configuration of a Rubik's cube then take you back to whereveryou started. One of those states is the solved state. Meaning whenever you complete this sequence you will have done a full loop of all possible cube states.
The interesting thing is that it doesn't matter where you start, you can follow this same sequence. So you can be blindfolded, never see the cube, perform the sequence and one of those states will be a solved Rubik's cube.
That I believe is OPs point.
Say we have an array p[1], p[2], ..., p[n] with all possible rubiks cube configurations
Then this function will solve the cube:
move(1) = p[1]^(-1)
move(i) = p[i]^(-1) * p[i-1]
In laymans terms, the resulting algorithm is: assume the initial configuration is p[1], then solve it. If it wasn't, undo those moves then solve as if the initial position was p[2], etc...So, yeah. Those fixed solving sequences / hamiltonian paths are actually very common. We can make one for any permutation of the group elements.
So I posed a more interesting question: what is the simplest sequence of moves that has this property?
I think you mean current configuration? Otherwise it's kind of silly, the original configuration is irrelevant once you know the configuration you are currently at.
But reassembling is the true brute.