# 5x5x5 last four edges move count



## xyzzy (Jun 17, 2017)

Let's say you're doing freeslice and you have your first eight tredges formed in the U and D layers, and you're wondering if there's a way of doing L4E that doesn't involve so much of slice-flip-unslice. Slice-flip-unslice costs 7 moves optimally and having to do it multiple times means your L4E would take 7 moves × however many times you need to slice-flip-unslice.

That's a lot of moves, but imagine if, like for L2E, we could solve L4E in a single alg. This post is about that.

tl;dr: takes at most 14 moves OBTM, regardless of parity

I had the code to do this lying around for quite a while (wrote it when Shiv3r asked for an L4E scrambler) and didn't bother to actually generate the statistics, but here you go.

As a simplifying assumption, assume the four edges are in the E slice and the centres are already aligned. There's a similarity to the second phase of Kociemba's algorithm here: we can identify the outer centre bars with the U/D edges, the midges with the E-slice edges, and the wings with corners. Under this mapping, the {U, D, L2, R2, F2, B2} moves on a 3×3×3 become {Uw, Dw, L2, R2, F2, B2} on a 5×5×5. This immediately gives an upper bound of 18 moves, from earlier analyses of Kociemba's algorithm.

However, there is considerably more freedom in solving the pieces here. Assuming scramble orientation, the white-green and yellow-green pieces are distinguishable in the second phase of Kociemba's algorithm, but on a 5×5×5 the analogue of these pieces aren't distinguishable. Furthermore, we only need the "corners" in the U and D layers to match with the E-slice edges, not for them to be fully solved.

Abstract algebra ahead; skip to the end if you haven't taken an introductory group theory course before. (But if you haven't learnt group theory, you should. To quote 4Chan, _stay in school, kids_.)



Spoiler: algebra



Rather than looking at all \( 4!\cdot8!=967680 \) ways of permuting the wings and midges (or \( (4!\cdot2^4)\cdot8!=15482880 \) if we also allow for flipping edges, which breaks the direct correspondence with Kociemba phase 2), we can reduce this to looking at only the 8!=40320 "relative permutations" of the wings wrt the midges.

Rather than expressing the permutation of the midges as an element of \( S_4 \), we can consider the permutation of the eight facelets on the midges as \( m\in S_8 \). We also have \( w\in S_8 \) for the permutation of the eight wings; the relative permutation is then defined as \( m^{-1}w \). The idea is that the midges and wings are permuted in exactly the same way, if and only if the edges are fully paired, if and only if \( m^{-1}w \) is the identity permutation.

The set of relative permutations \( R:=\{m^{-1}w:m,w\in S_8\} \) _does not_ have a meaningful group structure, but there is a natural group action defined on it. Let \( G:=\langle Uw,Dw,L2,R2,F2,B2\rangle \) be the free group with six generators, and define the following homomorphisms \( G\to S_8 \).

\( \begin{align}M&:g\mapsto(\text{how }g\text{ permutes the midge facelets})\\
W&:g\mapsto(\text{how }g\text{ permutes the wings})\end{align} \)

These homomorphisms correspond to applying a move sequence, specified as an element of the free group \( G \), to the identity permutation of the midges/wings. Furthermore, these canonically give right actions of \( G \) on \( S_8 \), where \( \pi._Mg=\pi M(g) \) and \( \pi._Wg=\pi W(g) \), corresponding to applying a move sequence to any permutation (not necessarily identity) of the midges or wings (respectively).

We then define the right action of \( G \) on \( R \) as \( r.g:=M(g)^{-1}rW(g) \), where \( r\in R,g\in G \). It's easy to check that this action respects the map mapping the permutations of the midges and wings (in \( S_8\times S_8 \)) to the relative permutations (in \( R \)):

Let \( r=m^{-1}w \) for some \( m,w\in S_8 \). Then \( r.g=M(g)^{-1}m^{-1}wW(g)=(mM(g))^{-1}(wW(g))=(m._Mg)^{-1}(w._Wg) \).



With the mathematical background out of the way, we note that \( R \), _as a set_, is exactly the same as \( S_8 \), and so we have only 8! = 40320 cases to consider. Exactly half of those have parity, and exactly half of those don't. This first table includes all cases:


depthcases0151064571968452915561037401110188121677813686614488
Average move count: 11.563

This one is for the non-parity cases:


depthcases0151064571968452915081029681147441273141328741448
Average move count: 11.237

And the last one is for the parity cases:


depthcases9481077211544412946413399214440
Average move count: 11.888

Note that these move counts _are not necessarily optimal_. For instance, the solution for a simple slice-flip-unslice is seven moves optimally, but counts as a 9-mover in these tables, as this analysis restricts the allowed moves to just Uw, Dw, L2, R2, F2 and B2. Optimally solving L4E with all moves allowed is far too computationally expensive—I ran my optimal solver on this non-parity case for hours before it finally ruled out the existence of a 9-move solution.


----------

