Some algorithms in the Rubik's cube may not be too easy to decompose.

For example, actually D F' R U' R' D' R D U R' F R D' R' can be decomposed as D:[F' R U' R',D' R D R'], R' U S' U' S R U' R S R' S' U can be decomposed as [R' U S',U' S R S'].

Recently I made a tool to decompose algorithms in commutator notation.

You can view the website here.

It is mainly based on the following methods.

For an algorithm s in the Rubik's cube, suppose n is the length of s.

Firstly, since c a b a' b' c'=c:[a,b]=[c a c',c b c'], we only need to calculate the case when the first step and the last step of the algorithm cannot be offset.

Secondly, let i from 1 to n, j is the number of length of the i+1 th to nth string that can be offset, k from 1 to i. Let X=the first ith char of s ,Y=the (i+1)th char to the (i+j)th char of s add the (i-k)th char to the (i-1)th char of s.

Thirdly, do some post-processing to make the length of X and Y as small as possible.

Let me explain the second step with the example R' U S' U' S R U' R S R' S' U

In this example, we have i=3 by loop, X=R' U S', in U' S R U' R S R' S' U the first 3 steps and the last 3 steps can be offset, so j=1, and we have k=1 by loop, Y=U' S R S'

After checking, R' U S' U' S R U' R S R' S' U=[R' U S',U' S R S']

Another example U R S R' S' U2 R' S R S' U

We only need to decompose R S R' S' U2 R' S R S' U2 because of the first step.

In this example, we have i=4 by loop, X=R S R' S', in U2 R' S R S' U2 the first 1 step and the last 1 step can be offset, so j=1, and we have k=3 by loop,Y=U2 S R' S'

After checking, U R S R' S' U2 R' S R S' U=U:[R S R' S',U2 S R' S']=U:[R U2,U2 S R' S'] (since [a,b]=[a b',b])

Currently, the time complexity of the main parts (the second step) of this algorithm is O(n^2). It is still unknown if there is a faster algorithm or if this algorithm can detect all possible commutators. But this algorithm seems to perform well after much testing.

For example, actually D F' R U' R' D' R D U R' F R D' R' can be decomposed as D:[F' R U' R',D' R D R'], R' U S' U' S R U' R S R' S' U can be decomposed as [R' U S',U' S R S'].

Recently I made a tool to decompose algorithms in commutator notation.

You can view the website here.

It is mainly based on the following methods.

For an algorithm s in the Rubik's cube, suppose n is the length of s.

Firstly, since c a b a' b' c'=c:[a,b]=[c a c',c b c'], we only need to calculate the case when the first step and the last step of the algorithm cannot be offset.

Secondly, let i from 1 to n, j is the number of length of the i+1 th to nth string that can be offset, k from 1 to i. Let X=the first ith char of s ,Y=the (i+1)th char to the (i+j)th char of s add the (i-k)th char to the (i-1)th char of s.

Thirdly, do some post-processing to make the length of X and Y as small as possible.

Let me explain the second step with the example R' U S' U' S R U' R S R' S' U

In this example, we have i=3 by loop, X=R' U S', in U' S R U' R S R' S' U the first 3 steps and the last 3 steps can be offset, so j=1, and we have k=1 by loop, Y=U' S R S'

After checking, R' U S' U' S R U' R S R' S' U=[R' U S',U' S R S']

Another example U R S R' S' U2 R' S R S' U

We only need to decompose R S R' S' U2 R' S R S' U2 because of the first step.

In this example, we have i=4 by loop, X=R S R' S', in U2 R' S R S' U2 the first 1 step and the last 1 step can be offset, so j=1, and we have k=3 by loop,Y=U2 S R' S'

After checking, U R S R' S' U2 R' S R S' U=U:[R S R' S',U2 S R' S']=U:[R U2,U2 S R' S'] (since [a,b]=[a b',b])

Currently, the time complexity of the main parts (the second step) of this algorithm is O(n^2). It is still unknown if there is a faster algorithm or if this algorithm can detect all possible commutators. But this algorithm seems to perform well after much testing.

Last edited: Mar 24, 2022