# Announcing: New 4x4x4 Brute Force Solver



## unsolved (Mar 27, 2014)

*Thread closed*:
This thread has been closed as requested by unsolved
---

For those who are interested in seeing if they have the correct hardware to run my Windows 7 64-bit brute force 4x4x4 solver console application, here is the link to download and test it:

*UPDATE: April 03, 2015: Version 3.0.2 now online*

High Performance
Medium Performance
Low Performance

High Performance Version = 20 GB RAM required
Med Performance Version = 7 GB RAM required
Low Performance Version = 2 GB RAM required

Latest High Performance version is always uploaded to this shorter link:
www.lightningcloudcomputing.com/OO_4x4x4.zip

I named the program *Omnia Obtorquebantur 4x4x4* (Latin for All (sides) will be turned). A logical nickname for it is *OO 4x4x4* (since I may make a 5x5x5 solver if this proves successful in terms of speed/performance). I pronounce this nickname as "Oh Oh 4 by 4 by 4."








The newest version of *OO_4x4x4* has the following features:

1. Up to *8-Turns-From-Solved* databases for centers-only needed to be solved
2. Up to *6-Turns-From-Solved* databases for every cube position.
3. When a sequence of moves leads to a shorter solve, then only moves of that length or shorter will be printed out subsequently (see the image above).
4. *Theoretical Minimum Search Tree* is now being generated, a fairly large improvement over prior versions.
5. All solves are logged to a "solved_cubes.txt" file, with an ASCII drawing of the starting cube along with the moves of every solution.

Several people I would like to thank already for their input. The following have already shared information that made this program much, much faster:

uberCuber

Jakube

cuBerBruce

Lucas-Garron

cmhardw

irontwig

Enjoy


----------



## brian724080 (Mar 27, 2014)

I don't quite understand, how do you plan to implement the 4x4x4 solver if the search doesn't go deeper than 10 moves?


----------



## unsolved (Mar 27, 2014)

Swapping two centers, top to bottom: U b2 U' f2 U b2 U' f2 (I hope I got your notation correct, I made up my own a while ago)



brian724080 said:


> I don't quite understand, how do you plan to implement the 4x4x4 solver if the search doesn't go deeper than 10 moves?



This is just the first iteration, to make sure things are working properly. Optimization and speed comes later. It's a brute-force solver so it was designed for searching for algs mostly, not solving completely scrambled cubes from the start. If there is a solution within its search horizon, however, it will find it. A good way to test to see if an alg is the fewest number of moves.

Edit:
I just benchmarked the speed of the program tonight on my 3.1 GHz Intel E5-2687W. It averages 92,000,000 turns/second. The problem is, the branching factor is so large.

1st level = 36 moves (I use U,U'U2,u,u' and u2 moves for the Up side, and similar moves for the other 5 sides).
2nd level = 1188 (only 33 moves are needed for each level after the first, since there is no need to generate U' if the move at level one is U, otherwise you just undo it. No need for U or U2 either after U move is made).
3rd level = 39,204
4th level = 1,293,732
5th level = 42,693,156
6th level = 1,408,874,148
7th level = 46,492,846,884
8th level = 1,534,263,947,172 = 4 hours 36 minutes to complete.

Does anyone know how fast any other 4x4x4 solvers are? I probably have to implement a hash table to prune similar positions created from other move orders.


----------



## uberCuber (Mar 27, 2014)

unsolved said:


> 1st level = 36 moves (I use U,U'U2,u,u' and u2 moves for the Up side, and similar moves for the other 5 sides).
> 2nd level = 1188 (only 33 moves are needed for each level after the first, since there is no need to generate U' if the move at level one is U, otherwise you just undo it. No need for U or U2 either after U move is made).
> 3rd level = 39,204
> ...



1. You don't need 36 different moves for 4x4. The l,d,b wide/slice turns aren't necessary, just u,r,f are sufficient.
2. Your count is including useless things like U D u D' U' u'.


----------



## qqwref (Mar 28, 2014)

It's cool that you started this project, but I hope you realize you have a long way to go (in terms of understanding the theory, and in terms of improving the program itself) to catch up with existing tools. The 8-move alg you gave (U b2 U' f2 U b2 U' f2) is a commutator that should be obvious to an experienced solver. Even your upper limit of 10 moves is way too short to solve the kind of situations people would want algs for, like OLL parity, most last layer algs, or situations that normally require two commutators. Well, at least now you are using more standard notation rather than the T- stuff.


----------



## unsolved (Mar 28, 2014)

uberCuber said:


> 1. You don't need 36 different moves for 4x4. The l,d,b wide/slice turns aren't necessary, just u,r,f are sufficient.
> 2. Your count is including useless things like U D u D' U' u'.



I gave this some thought, so perhaps you can weigh in on this subject and see if my reasoning makes sense.

I set up the move generator to generate all U,F, and R moves first, but in triplets.

Move 1 = U
Move 2 = U'
Move 3 = U2

Move 4 = R
Move 5 = R'
Move 6 = R2

.....

Move 31 = b
Move 32 = b'
Move 33 = b2

Move 34 = l
Move 35 = l'
Move 36 = l2

My logic was this:

For every one of those 36 possible moves, I only have to generate 33 moves from now on.

Why?

If I make U on the original position of the cube, at the "next level" of search, I can omit U, U', and U2. That's because U @ level 2 after U @ level 1 = just U2 @ level 1. U' @ level 2 after U @ level 1 = no net move made at all, and it just a waste of a move. Likewise, U2 @ level 2 after U @ level 1 = the same as U' at level 1, so, again, a duplicate position is generated, and the search tree is bloated.

If I make R on the original position of the cube, at the "next level" of search, I can omit R, R', and R2 (same reasons).

So my search would look like this (simplified for means of clearer explanation):

for(i = 1; i<= 36; i++)
for(j = 1; j<= 36; j++)
{
if((i/3) == (j/3)) continue;

//more code here to follow
}

Every "clump of 3" in the lower loop can be skipped without effecting the search, and trimming the tree automatically. This perpetuates on down the loops.

If I generated only U and U' at each level, I would generate the U2 position twice on each and every even level of the search.

Level 1 = U
Level 2 = U

That is the same as just Level 1 = U2, and I saved myself an additional depth of search.

Level 1 = U'
Level 2 = U'

That duplicates the U2 position, took 1 additional level to reach, and is superfluous.

I think it is more important to create positions early in the tree, rather than deal with generating duplicate branches that bloat the tree and result in having to examine more nodes to get to the same position.



qqwref said:


> It's cool that you started this project, but I hope you realize you have a long way to go



Yes, that was a "given" and something I accepted from the start. 



qqwref said:


> The 8-move alg you gave (U b2 U' f2 U b2 U' f2) is a commutator that should be obvious to an experienced solver.



Yes but I was pleasantly surprised when it spit this one out  It was my first concrete example of a solved cube.



qqwref said:


> Even your upper limit of 10 moves is way too short to solve the kind of situations people would want algs for...



Yes, indeed. But it is a start and it can only improve from here. You have to understand, I am programming on a computer that has a total of 16 CPU cores (Dual Intel E5-2687W with 8 CPU cores per chip) and I am running this in single-core mode. Once I get it to run as a parallel search, the speedup in nodes/second is guaranteed to be linear (16x faster or 1.6 billion turns/second) but the time-to-depth will not be as fortunate (branching factor of 33 means I will be lucky to cut search times in half to each given depth with 16 cores running).

Adding a hash table to prune redundant positions from the tree will be a big help. Changing the move generator over to a bitboard implementation will be about a 4x speed increase. I compiled with optimized 64-bit code and saw the speed more than double, for example, and this is without even using 64-bit data structures. The 16 squares per side of the 4x4x4 cube make it perfect to represent 2 squares per byte, using a nice native 8-byte = 64-bit variable per side of the cube.

I expect, with every programming trick in the book added to the code, then turning on hyperthreading to turn my machine into 32 virtual cores, I should be able to complete 18-move brute force searches on the 4x4x4 within a reasonable amount of time.

After a considerable amount of effort 



uberCuber said:


> 2. Your count is including useless things like U D u D' U' u'.



Dude! You just gave me a brilliant idea! I know how to prune away every such position without having to call the move generator!!!

And, the beauty of it is, the mathematical construct is so similar to a "3-cycle" it is not funny!

I need to multiply numbers together for each triplet of moves in such a way, that when the same position is created, the answer = 1.

For U I will use 2.0
For U' I will use 0.5
For U2 I will use -1.0

So say I have the move sequence U U' ..... some other moves .... U ..... some other moves.... U2 ...... some other moves .... U' ....... some other moves ...... U2.

(2.0)(.5)(2.0)(-1.0)(0.5)(-1.0) = 1.0

That means all of the U moves are "back to normal."

I do the same thing for D moves, but I use 0 for the other moves to make this invalid.

That way, if the product = 1.0, I know that parallel, non-intersecting faces were just slid back and forth without changing the parent position!


----------



## Jakube (Mar 28, 2014)

Try something else than this product idea. 

What if you have somethink like U D U. This position can also reach by U2 D2. Your product would be 2*2=4. So you would search twice the same position. 

An idea would be, that you order the moves on an axis: U,U',U2 > u,u',u2 > d,d',d2 > D,D',D2. This should mean, if you last move was U,U',U2 you don't allow U,U',U2 for the next. If your last move was u,u',u2 than you don't allow U,U',U2,u,u',u2. If your last move was d,d',d2 you don't allow U,U',U2,u,u',u2,d,d',d2 and if your last move was D,D',D2 you don't allow any of these moves. 
In this way you won't look for d U2 d u, but you would look for U2 u d2, which is the same. 
This also solves the U2 D = D U2 problem.


----------



## qqwref (Mar 28, 2014)

unsolved said:


> Dude! You just gave me a brilliant idea! I know how to prune away every such position without having to call the move generator!!!
> 
> And, the beauty of it is, the mathematical construct is so similar to a "3-cycle" it is not funny!
> 
> ...


WTF. Not only will this not work (U U U U = 16.0?) but floating point multiplication is one of the slowest possible commands for a computer. If you are going to do this kind of thing (and I don't recommend it, do what Jakube mentioned), just use an integer counter where U=+1 U'=-1 U2=+2, and check its value modulo 4 if you want to know if the U layer is back to normal.

Also this has nothing to do with a 3-cycle


----------



## unsolved (Mar 29, 2014)

qqwref said:


> WTF. Not only will this not work (U U U U = 16.0?) but floating point multiplication is one of the slowest possible commands for a computer. If you are going to do this kind of thing (and I don't recommend it, do what Jakube mentioned), just use an integer counter where U=+1 U'=-1 U2=+2, and check its value modulo 4 if you want to know if the U layer is back to normal.
> 
> Also this has nothing to do with a 3-cycle



I never had to worry about the case of U U U ... since my move generator skips moves in triplets on the subsequent depth of search.

I generate U, U', and U2 as a triplet, and in the next level of search, F, F, and F2 are next. U U never occurs, neither does U U' nor U U2 nor U' U2 and all other permutations possible with the other faces and slices.

I finally settled on:

signed short GLOBAL_TOP_FACE_PLUS_MINUS_TRACKER[36] = {-1,-1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short GLOBAL_TOP_FACE_DOUBLE_SPIN_TRACKER[36] = {1,1,-1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short global_top_face_plus_minus_unchanged_tracker;
signed short global_top_face_double_spin_unchanged_tracker;

signed short GLOBAL_TOP_SLICE_PLUS_MINUS_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, -1,-1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short GLOBAL_TOP_SLICE_DOUBLE_SPIN_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,-1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short global_top_slice_plus_minus_unchanged_tracker;
signed short global_top_slice_double_spin_unchanged_tracker;

signed short GLOBAL_BOTTOM_FACE_PLUS_MINUS_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, -1,-1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short GLOBAL_BOTTOM_FACE_DOUBLE_SPIN_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, 1,1,-1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0};
signed short global_bottom_face_plus_minus_unchanged_tracker;
signed short global_bottom_face_double_spin_unchanged_tracker;

signed short GLOBAL_BOTTOM_SLICE_PLUS_MINUS_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, -1,-1,1, 0,0,0, 0,0,0};
signed short GLOBAL_BOTTOM_SLICE_DOUBLE_SPIN_TRACKER[36] = {1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,1, 0,0,0, 0,0,0, 1,1,-1, 0,0,0, 0,0,0};
signed short global_bottom_slice_plus_minus_unchanged_tracker;
signed short global_bottom_slice_double_spin_unchanged_tracker;

... etc., for all of the different faces and slices. That way, all I have to do is this:

unsigned short level_4_prune(unsigned short i, unsigned short j, unsigned short k, unsigned short m)
{
global_top_face_plus_minus_unchanged_tracker = GLOBAL_TOP_FACE_PLUS_MINUS_TRACKER_ * GLOBAL_TOP_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_TOP_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_TOP_FACE_PLUS_MINUS_TRACKER[m];
global_top_face_double_spin_unchanged_tracker = GLOBAL_TOP_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_TOP_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_TOP_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_TOP_FACE_DOUBLE_SPIN_TRACKER[m];
global_bottom_face_plus_minus_unchanged_tracker = GLOBAL_BOTTOM_FACE_PLUS_MINUS_TRACKER * GLOBAL_BOTTOM_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_BOTTOM_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_BOTTOM_FACE_PLUS_MINUS_TRACKER[m];
global_bottom_face_double_spin_unchanged_tracker = GLOBAL_BOTTOM_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_BOTTOM_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_BOTTOM_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_BOTTOM_FACE_DOUBLE_SPIN_TRACKER[m];

global_front_face_plus_minus_unchanged_tracker = GLOBAL_FRONT_FACE_PLUS_MINUS_TRACKER * GLOBAL_FRONT_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_FRONT_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_FRONT_FACE_PLUS_MINUS_TRACKER[m];
global_front_face_double_spin_unchanged_tracker = GLOBAL_FRONT_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_FRONT_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_FRONT_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_FRONT_FACE_DOUBLE_SPIN_TRACKER[m];
global_back_face_plus_minus_unchanged_tracker = GLOBAL_BACK_FACE_PLUS_MINUS_TRACKER * GLOBAL_BACK_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_BACK_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_BACK_FACE_PLUS_MINUS_TRACKER[m];
global_back_face_double_spin_unchanged_tracker = GLOBAL_BACK_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_BACK_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_BACK_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_BACK_FACE_DOUBLE_SPIN_TRACKER[m];

global_right_face_plus_minus_unchanged_tracker = GLOBAL_RIGHT_FACE_PLUS_MINUS_TRACKER * GLOBAL_RIGHT_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_RIGHT_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_RIGHT_FACE_PLUS_MINUS_TRACKER[m];
global_right_face_double_spin_unchanged_tracker = GLOBAL_RIGHT_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_RIGHT_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_RIGHT_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_RIGHT_FACE_DOUBLE_SPIN_TRACKER[m];
global_left_face_plus_minus_unchanged_tracker = GLOBAL_LEFT_FACE_PLUS_MINUS_TRACKER * GLOBAL_LEFT_FACE_PLUS_MINUS_TRACKER[j] * GLOBAL_LEFT_FACE_PLUS_MINUS_TRACKER[k] * GLOBAL_LEFT_FACE_PLUS_MINUS_TRACKER[m];
global_left_face_double_spin_unchanged_tracker = GLOBAL_LEFT_FACE_DOUBLE_SPIN_TRACKER * GLOBAL_LEFT_FACE_DOUBLE_SPIN_TRACKER[j] * GLOBAL_LEFT_FACE_DOUBLE_SPIN_TRACKER[k] * GLOBAL_LEFT_FACE_DOUBLE_SPIN_TRACKER[m];

if((global_top_face_plus_minus_unchanged_tracker + global_top_face_double_spin_unchanged_tracker + global_bottom_face_plus_minus_unchanged_tracker + global_bottom_face_double_spin_unchanged_tracker) == 4) return 1;
if((global_front_face_plus_minus_unchanged_tracker + global_front_face_double_spin_unchanged_tracker + global_back_face_plus_minus_unchanged_tracker + global_back_face_double_spin_unchanged_tracker) == 4) return 1;
if((global_right_face_plus_minus_unchanged_tracker + global_right_face_double_spin_unchanged_tracker + global_left_face_plus_minus_unchanged_tracker + global_left_face_double_spin_unchanged_tracker) == 4) return 1;

return 0;
}

Basically, I track the faces and slices with different variables. I give a clockwise turn a score of -1, and likewise for a counterclockwise turn. I then compute the products. If the answer is -1, then I know they did not cancel out. If it is +1, then I know the starting position has occurred again. If I get a 0 value, that means in the middle of all of the U u d U' d' D u' there must have also been an F,R,B, etc., somewhere along the way, which invalidates the whole thing.

Only parallel faces and slices have the +1/-1 values, the others have zeros.

My move generator can't produce a cycle back to the original position in fewer than 4 plies. Here is the data I collected on the positions that were pruned from the tree:

1st level = 36
2nd level = 1188 
3rd level = 39,204
4th level = 1,293,732
5th level = 42,693,156
6th level = 1,408,874,148

With no net progress detection

1st level = 36
2nd level = 1188 
3rd level = 39,204
4th level = 1,290,396
5th level = 42,570,468
6th level = 1,404,723,924

The problem was, when pruning at a leaf node (the deepest spot in the tree) you get no further reductions since you are done and the search retreats one ply to start back down with a new move. Also, it took longer to evaluate a leaf node for a no-net-progress scenario than it to would have to just generate the node at the leaf. So, I removed pruning at the leaf nodes, and left pruning in for plies 4 and up. The result: It ran faster, examined slightly fewer nodes, and was an overall winner.

With no net progress detection except leaf nodes

1st level = 36
2nd level = 1188 
3rd level = 39,204
4th level = 1,293,732*
5th level = 42,583,068
6th level = 1,404,825,444_


----------



## Jakube (Mar 29, 2014)

I don't think, you really understand, which sequences you have to filter. The idea here is, that you don't search for a sequence of moves multiple times. For instance, you don't have to try the sequence d2 U d', when you have have already checked the sequence d U (You can cancel d2 and d', because the U doesn't move any pieces of the d-Layer). I have the impression, that you try to only look for moves that cancel themselves completely, like U2 d U D2 U (U2 + U + U = nothing). At least the "Multiplication-Idea" implies this. I haven't look at your recent code, because the amount of variables and especially the length of the variable names scared me off. 

At least from the statistic I can see, that you don't filter out all unnecessary sequences. 
It should filter out sequences even from the 2nd level. If you tried U D, you don't have to try D U. If I count correctly, there are only 1026 different unique sequences of length 2, way less than 36*33 = 1188
The same with sequences of the 3rd level. You don't have to check F r R2, if you already checked F R2 r, or you don't have to check sequences like U2 D U', because it is the same sequence as U D, you you checked this sequence already in level 2. 
I'm too lazy to calculate the exact numbers, but I'll rewrite my only own 4x4x4 solver (unfinished), so it output's the correct numbers.

edit: So I have the correct numbers:

Level 0: 1 sequences
Level 1: 36 sequences
Level 2: 1.026 sequences
Level 3: 28.836 sequences
Level 4: 810.891 sequences
Level 5: 22.803.120 sequences
Level 6: 641.245.896 sequences

You see, you only have to check less than half of the sequences at level 6. 

@qqwref: Are these numbers realistic? I was quite surprised, that you can save that much.


----------



## qqwref (Mar 29, 2014)

Yep, those numbers are correct. Using unsolved's 36 turns, the recurrence looks like this:


Spoiler



Let a, b, c, d be the number of sequences that currently have 1, 2, 3, or 4 (respectively) turns on the same axis
a(1) = 36, b(1) = 0, c(1) = 0, d(1) = 0
a(n) = 24*(a(n-1) + b(n-1) + c(n-1) + d(n-1))
b(n) = (9/2)*a(n-1)
c(n) = (6/3)*b(n-1)
d(n) = (3/4)*c(n-1)
moves(n) = a(n) + b(n) + c(n) + d(n)

So moves(10) = 401001809545944. The growth factor is ~28.1209788, and moves(n) is roughly 1.29670744 * 28.1209788^n.



And I agree that his code and variable names are extremely long. For computers, multiplying is still slow (even if they are shorts, and even if they are small numbers). Whatever he's doing (I can't tell) there is definitely a clearer and more efficient way to code it.


----------



## cuBerBruce (Mar 29, 2014)

Jakube said:


> So I have the correct numbers:
> 
> Level 0: 1 sequences
> Level 1: 36 sequences
> ...


I would say you could even save more. Assuming the Singmaster convention where u is single inner layer move, U u can be regarded the to be the same as D d, as the resulting states will be the same except for the orientation of the puzzle. Likewise, U is essentially the same as D d u' and two moves fewer in single-slice turn metric. Of course, this would require considering all 24 cube orientations of the canonical solved state as being solved states (which should be considered in any case).


----------



## Jakube (Mar 29, 2014)

@qqwref: Thanks for the nice recursion. I thought quite a while about a recursion, but couldn't find it. 

@cuBerBruce: Such a simple idea, but it's actually quite hard to implement it correctly. But I think I figured out the three necessary rules. 


if there are 2 moves on the same axis, both turn in the same direction (U is the same direction as d') and one of the moves is of <D>, then ignore the case. 
if there are 3 moves on the same axis, and >=2 moves turn in the same direction, then ignore the case. 
ignore all cases with 4 moves on the same axis. 

Using this rules, if get the following numbers of valid sequences: 


nall
36*33^(n-1)canceling moves
(U d U = U2 d)cancel by rotation
(U u = d D)01​1​1​136​36​36​21.188​1.026​999​339.204​28.836​27.288​41.293.732​810.891​746.562​542.693.156​22.803.120​20.421.648​61.408.874.148​641.245.896​558.627.948​

As it turns out, there is not much difference. 2nd column has a grow rate of ~28.12, 3rd has ~27.35. It only has an impact for searches with >> 6 moves. 



Spoiler: recursion



You can simplify the recursion: 
Let a, b, c be the number of sequences that currently have 1, 2, 3 (respectively) turns on the same axis
seqCnt(n) = a(n) + b(n) + c(n)
a(1) = 36, b(1) = 0, c(1) = 0
b(2) = 3*(12*9/2-3*3) = 135
c(2) = 0
c(3) = 3*(12*9*6/6-4*7*3) = 72
a(n) = seqCnt(n-1) * 24
b(n) = seqCnt(n-2)*2*(12*9/2 - 3*3) = seqCnt(n-2)*90
c(n) = seqCnt(n-3)*2*(12*9*6/6-4*7*3) = seqCnt(n-3)*48

Therefore seqCnt(n) = seqCnt(n-1) * 24 + seqCnt(n-2)*90 + seqCnt(n-3)*48 with seqCnt(1) = 36, seqCnt(2) = 999, seqCnt(3) = 27288. 

seqCnt(10) = 312757467379056, which is approximately 3/4 of the last implementation. 
seqCnt(n) ~= 1.332886714636981*27.3543072482344^n. => Grow factor is ~ 27.3543072482344. Not much difference.


----------



## unsolved (Mar 29, 2014)

Jakube said:


> I don't think, you really understand, which sequences you have to filter. The idea here is, that you don't search for a sequence of moves multiple times.



I understand that repeated positions are the ones to filter out ideally, but that would require a hashing algorithm, and I am nowhere near ready for that yet. Down the road when I switch to a bitwise move generator, yes, absolutely, you are correct.
For now, I am just filtering out the starting position from moves that reproduce it by moving parallel faces and/or slices.

I had another idea that worked out much better than expected. I added more moves to the move generator, to treat Uu, Rr, Ff as one move. That increases the legal move count to 45 from 36, but it has some nice benefits when you couple it with another great piece of technology: pre-solved cube endings.

I generated every one of the (including superfluous positions for now) 140,026,320 cube arrangements possible from 5 turns, @ 48 bytes per cube position, and load them into a huge 6.25 GB database in RAM. When I search 6 moves or deeper, I probe this database at the leaf nodes, and look for solutions. This slows down the search tremendously, but with the new "2 moves in 1" added to the move generator, I am able to solve the dreaded single dedge flip during an overnight run.

My apologies for the notation, I was writing it before I experienced this forum and have it in my program:

[Rr]- (tb)- R+ [Bb]+ [Rr]- t- [Rr]+ [Bb]- [Rr]- [Bb]2 [Kk]+ t- [Kk]- [Tt]- T- l- (fk)+ [Rr]+

[Rr]- means a face and a slice turn for the right side in the counterclockwise direction.
(tb)- means turn both the top and bottom slices in the same direction, - from the perspective of the top side. I guess this is u'd in your notation.
K is the letter I use for Back, and B is the letter I use for bottom.
T is top.
(fk)+ means turn both the front and back slices in the same direction, + from the perspective of the front slice. So this is fb' in your notation.

And one other thing that you guys will hate: My l- is in the same direction as r-, so it is really like l and not l'. I could never get used to l and r spinning in different directions. I treat everything as a move being made by a right hand, "reaching through" the cube to get to the left side. Ditto for my T and B which is your U and D. My T+ = your U, and my B+ = your D'.

*edit: so that makes the solution:

R'r' u'd R D'd' R'r' u' Rr Dd R'r' D2d2 B'b' u' Bb U'u' U' l fb' Rr*


----------



## Jakube (Mar 30, 2014)

I can't get your algorithm to work. Nevertheless, the speed is really impressive. Even if you prune 5 moves, you have to search up to 13 moves, to find a 18 move solution. 

For the idea above: you don't need a hashing algorithm or anything complicated. Just use this idea: http://www.speedsolving.com/forum/showthread.php?46925-Announcing-New-4x4x4-Brute-Force-Solver&p=964879&viewfull=1#post964879. You basically just need to remember the last move.


----------



## unsolved (Mar 30, 2014)

Jakube said:


> I can't get your algorithm to work. Nevertheless, the speed is really impressive. Even if you prune 5 moves, you have to search up to 13 moves, to find a 18 move solution.



Actually, with all of the [] attempted in pairs, there was only 9 "nominal" depths probed. Actually, my code had a bug in it, so I was lucky to hit on this by virtue of the move generator hitting on the correct move to make early on in the game tree. In some parts of the code I did not change the [36] dimension properly! It is a miracle it did not crash.

I had another crazy thought: Generate 15 "moves" per cube side, as pseudo 1- and 2-ply move combinations that could actually be 3 moves in 1 in some cases. Example:

U,u,[Uu],[U2u],[Uu2],[Uu]2,U2,u2,U',u',[Uu]',[U2u'],[U'u2],Uu',U'u

That way, on level 2, you can eliminate all 15 of these, since they are there own "2-move" combinations, inclusive, without duplicates.

So if "i" is the move index at level 1 and "j" is the move index at level 2, then if((i/15) == (j/15)) you can eliminate all of these nodes with one simple instruction. 

So, with 15x6 = 90 nodes @ level 1, you really did a 2-ply and partial 3-ply search, if you think about it.

And, it is much easier to code which moves to eliminate for later levels also.

If i = 1,2, or 3 and j = 9,10, or 11, then you have U,u,[Uu] vs. U', u', and [Uu]'. With the right intermediate turn, you can skip these as well.


----------



## Lucas Garron (Mar 30, 2014)

I was originally quite skeptical, since it looked like you were trying to write something where you didn't really understand what you were doing, and what others have done before. But I like that you're staying determined and learning things. 



unsolved said:


> I generated every one of the (including superfluous positions for now) 140,026,320 cube arrangements possible from 5 turns, @ 48 bytes per cube position, and load them into a huge 6.25 GB database in RAM. When I search 6 moves or deeper, I probe this database at the leaf nodes, and look for solutions. This slows down the search tremendously, but with the new "2 moves in 1" added to the move generator, I am able to solve the dreaded single dedge flip during an overnight run.


It seems you've discovered a classic meet-in-the-middle technique.
A good technique (that works on 3x3x3 stages) is to use the forward calculations at the same time as the backwards calculations. Each "backwards" probe can also be interpreted as a "forwards" probe (if you're working with permutations), and eventually two of them have to collide around half the search depth. This gets trickier on 4x4x4 due to centers, and maybe your solver isn't quite set up for it.

In any case, consider how hard it is to brute-force anything near 18 moves for 3x3x3. Even if you can push your solver to the mid-tens to moves, getting to 18 will require a nearly impossible push if you don't have clever techniques.
Even with clever enumeration, exponentiation base 45-ish is *huge*.




unsolved said:


> My apologies for the notation, I was writing it before I experienced this forum and have it in my program:
> 
> [Rr]- (tb)- R+ [Bb]+ [Rr]- t- [Rr]+ [Bb]- [Rr]- [Bb]2 [Kk]+ t- [Kk]- [Tt]- T- l- (fk)+ [Rr]+
> 
> ...




Any chance you're willing to use SiGN?
It will make some parts of your solution longer, and some shorter, but at least it's some sort of notation standard. Plus then you can link your solutions to alg.cubing.net. ;-)


----------



## unsolved (Mar 30, 2014)

Lucas Garron said:


> I was originally quite skeptical, since it looked like you were trying to write something where you didn't really understand what you were doing, and what others have done before.



So is there another 4x4x4 solver program out there? I would be anxious to see/try it. Please let me know.



Lucas Garron said:


> It seems you've discovered a classic meet-in-the-middle technique.



I've written chess and checkers programs and probed pre-computed databases before. It seems like it would be perfect for the cube. I need a better way to index/retrieve positions. That is what I am experimenting with now.



Lucas Garron said:


> This gets trickier on 4x4x4 due to centers, and maybe your solver isn't quite set up for it.



Right now, centers just bloat the database. Even though they are 4 "of the same" piece, my program as of yet considers them as center #1, center #2, center #3, and center #4. This means 1234 is considered different from 2143 even though they are identical looking. Once I get rid of this issue, the database sizes will be small enough to distribute with the program.



Lucas Garron said:


> Even if you can push your solver to the mid-tens to moves, getting to 18 will require a nearly impossible push if you don't have clever techniques.
> Even with clever enumeration, exponentiation base 45-ish is *huge*.



That one dedge result was a fluke and should be discarded. I re-ordered the move generator to perform _pairs_ of moves with them first, so whenever you saw two of my [][] moves back to back, that was accomplished via one ply of nominal depth and not two plies as would have been normal. Combined with the pre-computed database, it was only a search through an exhaustive depth of 9 plies.

I have since reverted back to the 36/33 move generator, with non-leaf node pruning + superfluous 5-turn database probing.

My goal for today is to remove the superfluous positions and see if a 6-turn database would fit in RAM on my 32 GB box with 16 cores. I'd also love it if someone could translate the duplicate moves previously cited by others into an indexing function. That way, I pass in a move index (1-36) and the move history (1 to whatever depth) and it can prune that node, and all of the other branches springing forth from that node.



Lucas Garron said:


> Any chance you're willing to use SiGN?
> It will make some parts of your solution longer, and some shorter, but at least it's some sort of notation standard. Plus then you can link your solutions to alg.cubing.net. ;-)



Ha, then I would know "SiGN" language 

Yes, at some point, I will learn how it is you guys communicate.

I use the notation {t/f} to refer to your M. It is the center slice from the top to the front. I call {t/f}+ a move of that center slice in the direction from t (the top) towards f (the front). So {t/f}- is a turn in the opposite direction.

So f2 B- {t/r}2 B+ f2 B- {t/r}2 B+ is the way to exchange 2 centers on a 5x5x5 cube from the top and bottom faces, which you guys would write as f2 D E2 D' f2 D E2 D' I think.




Jakube said:


> For the idea above: you don't need a hashing algorithm or anything complicated. Just use this idea: http://www.speedsolving.com/forum/showthread.php?46925-Announcing-New-4x4x4-Brute-Force-Solver&p=964879&viewfull=1#post964879. You basically just need to remember the last move.



I finally implemented your awesome idea, and it is way, way, waaaaay faster than my older code! Thanks!!!

You need to get the last few moves, not just one, but I knew what you meant. This is the code (mostly comments) and it has been truncated immensely. Many of the permutations are not even shown, but you get the idea:


```
unsigned short prune_T_parallel_rotations(unsigned short i, unsigned short j, unsigned short k, unsigned short m)
{
	if((i >= T___PLUS____) && (i <= T___TWICE___))
	{
		if(((j >= B___PLUS____) && (j <= B___TWICE___)) || ((j >= b___PLUS____) && (j <= b___TWICE___)))
		{
			/***********************************/
			/* prunes T+ B+ T+ (same as T2 B+) */
			/*        T+ B+ T- (same as B+)    */
			/*        T+ B+ T2 (same as T- B+) */
			/*                                 */
			/*        T- B+ T+ (same as B+)    */
			/*        T- B+ T- (same as T2 B+) */
			/*        T- B+ T2 (same as T+ B+) */
			/*                                 */
			/*        T2 B+ T+ (same as T- B+) */
			/*        T2 B+ T- (same as T+ B+) */
			/*        T2 B+ T2 (same as B+)    */
			/*                                 */
			/*        T+ B- T+ (same as T2 B-) */
			/*        T+ B- T- (same as B-)    */
			/*        T+ B- T2 (same as T- B-) */
			/*                                 */
			/*        T- B- T+ (same as B-)    */
			/*        T- B- T- (same as T2 B-) */
			/*        T- B- T2 (same as T+ B-) */
			/*                                 */
			/*        T2 B- T+ (same as T- B-) */
			/*        T2 B- T- (same as T+ B-) */
			/*        T2 B- T2 (same as B-)    */
			/*                                 */
			/*        T+ B2 T+ (same as T2 B2) */
			/*        T+ B2 T- (same as B2)    */
			/*        T+ B2 T2 (same as T- B2) */
			/*                                 */
			/*        T- B2 T+ (same as B2)    */
			/*        T- B2 T- (same as T2 B2) */
			/*        T- B2 T2 (same as T+ B2) */
			/*                                 */
			/*        T2 B2 T+ (same as T- B2) */
			/*        T2 B2 T- (same as T+ B2) */
			/*        T2 B2 T2 (same as B2)    */
			/***********************************/
			if((k >= T___PLUS____) && (k <= T___TWICE___))
				return 1;

			/*****************************************/
			/* prunes T+ B+ b+ T+ (same as T2 B+ b+) */
			/*        T+ B+ b+ T- (same as B+ b+)    */
			/*        T+ B+ b+ T2 (same as T- B+ b+) */
			/*                                       */
			/*        T- B+ b+ T+ (same as B+ b+)    */
			/*        T- B+ b+ T- (same as T2 B+ b+) */
			/*        T- B+ b+ T2 (same as T+ B+ b+) */
			/*                                       */
			/*        T2 B+ b+ T+ (same as T- B+ b+) */
			/*        T2 B+ b+ T- (same as T+ B+ b+) */
			/*        T2 B+ b+ T2 (same as B+ b+)    */
			/*                                       */
			/*        T+ B- b+ T+ (same as T2 B- b+) */
			/*        T+ B- b+ T- (same as B- b+)    */
			/*        T+ B- b+ T2 (same as T- B- b+) */
			/*                                       */
			/*        T- B- b+ T+ (same as B- b+)    */
			/*        T- B- b+ T- (same as T2 B- b+) */
			/*        T- B- b+ T2 (same as T+ B- b+) */
			/*                                       */
			/*        T2 B- b+ T+ (same as T- B- b+) */
			/*        T2 B- b+ T- (same as T+ B- b+) */
			/*        T2 B- b+ T2 (same as B- b+)    */
			/*                                       */
			/*        T+ B2 b+ T+ (same as T2 B2 b+) */
			/*        T+ B2 b+ T- (same as B2 b+)    */
			/*        T+ B2 b+ T2 (same as T- B2 b+) */
			/*                                       */
			/*        T- B2 b+ T+ (same as B2 b+)    */
			/*        T- B2 b+ T- (same as T2 B2 b+) */
			/*        T- B2 b+ T2 (same as T+ B2 b+) */
			/*                                       */
			/*        T2 B2 b+ T+ (same as T- B2 b+) */
			/*        T2 B2 b+ T- (same as T+ B2 b+) */
			/*        T2 B2 b+ T2 (same as B2 b+)    */
			/*                                       */
			/*        T+ B+ b- T+ (same as T2 B+ b-) */
			/*        T+ B+ b- T- (same as B+ b-)    */
			/*        T+ B+ b- T2 (same as T- B+ b-) */
			/*                                       */
			/*        T- B+ b- T+ (same as B+ b-)    */
			/*        T- B+ b- T- (same as T2 B+ b-) */
			/*        T- B+ b- T2 (same as T+ B+ b-) */
			/*                                       */
			/*        T2 B+ b- T+ (same as T- B+ b-) */
			/*        T2 B+ b- T- (same as T+ B+ b-) */
			/*        T2 B+ b- T2 (same as B+ b-)    */
			/*                                       */
			/*        T+ B- b- T+ (same as T2 B- b-) */
			/*        T+ B- b- T- (same as B- b-)    */
			/*        T+ B- b- T2 (same as T- B- b-) */
			/*                                       */
			/*        T- B- b- T+ (same as B- b-)    */
			/*        T- B- b- T- (same as T2 B- b-) */
			/*        T- B- b- T2 (same as T+ B- b-) */
			/*                                       */
			/*        T2 B- b- T+ (same as T- B- b-) */
			/*        T2 B- b- T- (same as T+ B- b-) */
			/*        T2 B- b- T2 (same as B- b-)    */
			/*                                       */
			/*        T+ B2 b- T+ (same as T2 B2 b-) */
			/*        T+ B2 b- T- (same as B2 b-)    */
			/*        T+ B2 b- T2 (same as T- B2 b-) */
			/*                                       */
			/*        T- B2 b- T+ (same as B2 b-)    */
			/*        T- B2 b- T- (same as T2 B2 b-) */
			/*        T- B2 b- T2 (same as T+ B2 b-) */
			/*                                       */
			/*        T2 B2 b- T+ (same as T- B2 b-) */
			/*        T2 B2 b- T- (same as T+ B2 b-) */
			/*        T2 B2 b- T2 (same as B2 b-)    */
			/*                                       */
			/*        T+ b+ B+ T+ (same as T2 b+ B+) */
			/*        T+ b+ B+ T- (same as b+ B+)    */
			/*        T+ b+ B+ T2 (same as T- b+ B+) */
			/*                                       */
			/*        T- b+ B+ T+ (same as b+ B+)    */
			/*        T- b+ B+ T- (same as T2 b+ B+) */
			/*        T- b+ B+ T2 (same as T+ b+ B+) */
			/*                                       */
			/*        T2 b+ B+ T+ (same as T- b+ B+) */
			/*        T2 b+ B+ T- (same as T+ b+ B+) */
			/*        T2 b+ B+ T2 (same as b+ B+)    */
			/*                                       */
			/*        T+ b+ B- T+ (same as T2 b+ B-) */
			/*        T+ b+ B- T- (same as b+ B-)    */
			/*        T+ b+ B- T2 (same as T- b+ B-) */
			/*                                       */
			/*        T- b+ B- T+ (same as b+ B-)    */
			/*        T- b+ B- T- (same as T2 b+ B-) */
			/*        T- b+ B- T2 (same as T+ b+ B-) */
			/*                                       */
			/*        T2 b+ B- T+ (same as T- b+ B-) */
			/*        T2 b+ B- T- (same as T+ b+ B-) */
			/*        T2 b+ B- T2 (same as b+ B-)    */
			/*                                       */
			/*        T+ b+ B2 T+ (same as T2 b+ B2) */
			/*        T+ b+ B2 T- (same as b+ B2)    */
			/*        T+ b+ B2 T2 (same as T- b+ B2) */
			/*                                       */
			/*        T- b+ B2 T+ (same as b+ B2)    */
			/*        T- b+ B2 T- (same as T2 b+ B2) */
			/*        T- b+ B2 T2 (same as T+ b+ B2) */
			/*                                       */
			/*        T2 b+ B2 T+ (same as T- b+ B2) */
			/*        T2 b+ B2 T- (same as T+ b+ B2) */
			/*        T2 b+ B2 T2 (same as b+ B2)    */
			/*                                       */
			/*        T+ b- B+ T+ (same as T2 b- B+) */
			/*        T+ b- B+ T- (same as b- B+)    */
			/*        T+ b- B+ T2 (same as T- b- B+) */
			/*                                       */
			/*        T- b- B+ T+ (same as b- B+)    */
			/*        T- b- B+ T- (same as T2 b- B+) */
			/*        T- b- B+ T2 (same as T+ b- B+) */
			/*                                       */
			/*        T2 b- B+ T+ (same as T- b- B+) */
			/*        T2 b- B+ T- (same as T+ b- B+) */
			/*        T2 b- B+ T2 (same as b- B+)    */
			/*                                       */
			/*        T+ b- B- T+ (same as T2 b- B-) */
			/*        T+ b- B- T- (same as b- B-)    */
			/*        T+ b- B- T2 (same as T- b- B-) */
			/*                                       */
			/*        T- b- B- T+ (same as b- B-)    */
			/*        T- b- B- T- (same as T2 b- B-) */
			/*        T- b- B- T2 (same as T+ b- B-) */
			/*                                       */
			/*        T2 b- B- T+ (same as T- b- B-) */
			/*        T2 b- B- T- (same as T+ b- B-) */
			/*        T2 b- B- T2 (same as b- B-)    */
			/*                                       */
			/*        T+ B2 b- T+ (same as T2 B2 b-) */
			/*        T+ B2 b- T- (same as B2 b-)    */
			/*        T+ B2 b- T2 (same as T- B2 b-) */
			/*                                       */
			/*        T- B2 b- T+ (same as B2 b-)    */
			/*        T- B2 b- T- (same as T2 B2 b-) */
			/*        T- B2 b- T2 (same as T+ B2 b-) */
			/*                                       */
			/*        T2 B2 b- T+ (same as T- B2 b-) */
			/*        T2 B2 b- T- (same as T+ B2 b-) */
			/*        T2 B2 b- T2 (same as B2 b-)    */
			/*****************************************/
			if(((k >= B___PLUS____) && (k <= B___TWICE___)) || ((k >= b___PLUS____) && (k <= b___TWICE___)))
			{
				if((m >= T___PLUS____) && (m <= T___TWICE___))
					return 1;
			}
		}
	}
}
```


----------



## cuBerBruce (Mar 30, 2014)

unsolved said:


> So is there another 4x4x4 solver program out there? I would be anxious to see/try it. Please let me know.



I believe Clément Gallet had once made an optimal solver, good enough to solve dedge flip. I also several years ago, hacked up an optimal solver of limited use (fairly limited search depth in a reasonable amount of time) and no way to enter a scramble or position to be solved. (I needed to edit/recompile the program to specify the scramble and/or what moves are allowed.)

There are a few multi-phase solvers that do not generate optimal solutions. C.W. Tsai had 7- and 8-phase solvers (http://www.cubing.net/software/). I have a 5-phase solver (http://www.speedsolving.com/forum/showthread.php?18615-Five-Step-4x4x4-Solver). And of course the WCA scramble program uses an internal multi-phase solver. I believe it uses 3 phases to reduce to a pseudo-3x3x3, and then invokes a 2-phase 3x3x3 solver.

I have also made custom solvers for optimally changing OLL parity while preserving reduction. I used both depth-first search and meet-in-the-middle breadth-first search approaches. These programs did not need to use full 4x4x4 state information. The meet-in-the-middle solver used a big hash table to store the positions. Because the two trees were symmetrically related, I only actually had to build (and store) one tree. I discussed the results in this thread: http://www.speedsolving.com/forum/s...e-a-shorter-alg-that-doesn-t-preserve-corners


----------



## ch_ts (Mar 30, 2014)

There's also IAssemble's solver (another efficient but not optimal)


----------



## unsolved (Mar 31, 2014)

cuBerBruce said:


> I believe Clément Gallet had once made an optimal solver, good enough to solve dedge flip. I also several years ago, hacked up an optimal solver of limited use (fairly limited search depth in a reasonable amount of time) and no way to enter a scramble or position to be solved. (I needed to edit/recompile the program to specify the scramble and/or what moves are allowed.)
> 
> There are a few multi-phase solvers that do not generate optimal solutions. C.W. Tsai had 7- and 8-phase solvers (http://www.cubing.net/software/). I have a 5-phase solver (http://www.speedsolving.com/forum/showthread.php?18615-Five-Step-4x4x4-Solver). And of course the WCA scramble program uses an internal multi-phase solver. I believe it uses 3 phases to reduce to a pseudo-3x3x3, and then invokes a 2-phase 3x3x3 solver.
> 
> I have also made custom solvers for optimally changing OLL parity while preserving reduction. I used both depth-first search and meet-in-the-middle breadth-first search approaches. These programs did not need to use full 4x4x4 state information. The meet-in-the-middle solver used a big hash table to store the positions. Because the two trees were symmetrically related, I only actually had to build (and store) one tree. I discussed the results in this thread: http://www.speedsolving.com/forum/s...e-a-shorter-alg-that-doesn-t-preserve-corners



I was amazed at what I saw. Thank you!

And, since it is against the 10 commandments to make a new post, God forbid, here is a dump of moves actually pruned during the search. I think this covers most of the bases that were discussed earlier, but my game tree is not nearly as trimmed as has been suggested. Anybody see anything obvious that I am missing?


```
U D' U 
 U D' U- 
 U D' U2 
 U D' d' U 
 U D' d' U- 
 U D' d' U2 
 U D' d U 
 U D' d U- 
 U D' d U2 
 U D' d2 U 
 U D' d2 U- 
 U D' d2 U2 
 U D U 
 U D U- 
 U D U2 
 U D d' U 
 U D d' U- 
 U D d' U2 
 U D d U 
 U D d U- 
 U D d U2 
 U D d2 U 
 U D d2 U- 
 U D d2 U2 
 U D2 U 
 U D2 U- 
 U D2 U2 
 U D2 d' U 
 U D2 d' U- 
 U D2 d' U2 
 U D2 d U 
 U D2 d U- 
 U D2 d U2 
 U D2 d2 U 
 U D2 d2 U- 
 U D2 d2 U2 
 U d' U 
 U d' U- 
 U d' U2 
 U d' D' U 
 U d' D' U- 
 U d' D' U2 
 U d' D U 
 U d' D U- 
 U d' D U2 
 U d' D2 U 
 U d' D2 U- 
 U d' D2 U2 
 U d U 
 U d U- 
 U d U2 
 U d D' U 
 U d D' U- 
 U d D' U2 
 U d D U 
 U d D U- 
 U d D U2 
 U d D2 U 
 U d D2 U- 
 U d D2 U2 
 U d2 U 
 U d2 U- 
 U d2 U2 
 U d2 D' U 
 U d2 D' U- 
 U d2 D' U2 
 U d2 D U 
 U d2 D U- 
 U d2 D U2 
 U d2 D2 U 
 U d2 D2 U- 
 U d2 D2 U2 
 U- D' U 
 U- D' U- 
 U- D' U2 
 U- D' d' U 
 U- D' d' U- 
 U- D' d' U2 
 U- D' d U 
 U- D' d U- 
 U- D' d U2 
 U- D' d2 U 
 U- D' d2 U- 
 U- D' d2 U2 
 U- D U 
 U- D U- 
 U- D U2 
 U- D d' U 
 U- D d' U- 
 U- D d' U2 
 U- D d U 
 U- D d U- 
 U- D d U2 
 U- D d2 U 
 U- D d2 U- 
 U- D d2 U2 
 U- D2 U 
 U- D2 U- 
 U- D2 U2 
 U- D2 d' U 
 U- D2 d' U- 
 U- D2 d' U2 
 U- D2 d U 
 U- D2 d U- 
 U- D2 d U2 
 U- D2 d2 U 
 U- D2 d2 U- 
 U- D2 d2 U2 
 U- d' U 
 U- d' U- 
 U- d' U2 
 U- d' D' U 
 U- d' D' U- 
 U- d' D' U2 
 U- d' D U 
 U- d' D U- 
 U- d' D U2 
 U- d' D2 U 
 U- d' D2 U- 
 U- d' D2 U2 
 U- d U 
 U- d U- 
 U- d U2 
 U- d D' U 
 U- d D' U- 
 U- d D' U2 
 U- d D U 
 U- d D U- 
 U- d D U2 
 U- d D2 U 
 U- d D2 U- 
 U- d D2 U2 
 U- d2 U 
 U- d2 U- 
 U- d2 U2 
 U- d2 D' U 
 U- d2 D' U- 
 U- d2 D' U2 
 U- d2 D U 
 U- d2 D U- 
 U- d2 D U2 
 U- d2 D2 U 
 U- d2 D2 U- 
 U- d2 D2 U2 
 U2 D' U 
 U2 D' U- 
 U2 D' U2 
 U2 D' d' U 
 U2 D' d' U- 
 U2 D' d' U2 
 U2 D' d U 
 U2 D' d U- 
 U2 D' d U2 
 U2 D' d2 U 
 U2 D' d2 U- 
 U2 D' d2 U2 
 U2 D U 
 U2 D U- 
 U2 D U2 
 U2 D d' U 
 U2 D d' U- 
 U2 D d' U2 
 U2 D d U 
 U2 D d U- 
 U2 D d U2 
 U2 D d2 U 
 U2 D d2 U- 
 U2 D d2 U2 
 U2 D2 U 
 U2 D2 U- 
 U2 D2 U2 
 U2 D2 d' U 
 U2 D2 d' U- 
 U2 D2 d' U2 
 U2 D2 d U 
 U2 D2 d U- 
 U2 D2 d U2 
 U2 D2 d2 U 
 U2 D2 d2 U- 
 U2 D2 d2 U2 
 U2 d' U 
 U2 d' U- 
 U2 d' U2 
 U2 d' D' U 
 U2 d' D' U- 
 U2 d' D' U2 
 U2 d' D U 
 U2 d' D U- 
 U2 d' D U2 
 U2 d' D2 U 
 U2 d' D2 U- 
 U2 d' D2 U2 
 U2 d U 
 U2 d U- 
 U2 d U2 
 U2 d D' U 
 U2 d D' U- 
 U2 d D' U2 
 U2 d D U 
 U2 d D U- 
 U2 d D U2 
 U2 d D2 U 
 U2 d D2 U- 
 U2 d D2 U2 
 U2 d2 U 
 U2 d2 U- 
 U2 d2 U2 
 U2 d2 D' U 
 U2 d2 D' U- 
 U2 d2 D' U2 
 U2 d2 D U 
 U2 d2 D U- 
 U2 d2 D U2 
 U2 d2 D2 U 
 U2 d2 D2 U- 
 U2 d2 D2 U2 
 F B' F 
 F B' F' 
 F B' F2 
 F B' b' F 
 F B' b' F' 
 F B' b' F2 
 F B' b F 
 F B' b F' 
 F B' b F2 
 F B' b2 F 
 F B' b2 F' 
 F B' b2 F2 
 F B F 
 F B F' 
 F B F2 
 F B b' F 
 F B b' F' 
 F B b' F2 
 F B b F 
 F B b F' 
 F B b F2 
 F B b2 F 
 F B b2 F' 
 F B b2 F2 
 F B2 F 
 F B2 F' 
 F B2 F2 
 F B2 b' F 
 F B2 b' F' 
 F B2 b' F2 
 F B2 b F 
 F B2 b F' 
 F B2 b F2 
 F B2 b2 F 
 F B2 b2 F' 
 F B2 b2 F2 
 F b' F 
 F b' F' 
 F b' F2 
 F b' B' F 
 F b' B' F' 
 F b' B' F2 
 F b' B F 
 F b' B F' 
 F b' B F2 
 F b' B2 F 
 F b' B2 F' 
 F b' B2 F2 
 F b F 
 F b F' 
 F b F2 
 F b B' F 
 F b B' F' 
 F b B' F2 
 F b B F 
 F b B F' 
 F b B F2 
 F b B2 F 
 F b B2 F' 
 F b B2 F2 
 F b2 F 
 F b2 F' 
 F b2 F2 
 F b2 B' F 
 F b2 B' F' 
 F b2 B' F2 
 F b2 B F 
 F b2 B F' 
 F b2 B F2 
 F b2 B2 F 
 F b2 B2 F' 
 F b2 B2 F2 
 F' B' F 
 F' B' F' 
 F' B' F2 
 F' B' b' F 
 F' B' b' F' 
 F' B' b' F2 
 F' B' b F 
 F' B' b F' 
 F' B' b F2 
 F' B' b2 F 
 F' B' b2 F' 
 F' B' b2 F2 
 F' B F 
 F' B F' 
 F' B F2 
 F' B b' F 
 F' B b' F' 
 F' B b' F2 
 F' B b F 
 F' B b F' 
 F' B b F2 
 F' B b2 F 
 F' B b2 F' 
 F' B b2 F2 
 F' B2 F 
 F' B2 F' 
 F' B2 F2 
 F' B2 b' F 
 F' B2 b' F' 
 F' B2 b' F2 
 F' B2 b F 
 F' B2 b F' 
 F' B2 b F2 
 F' B2 b2 F 
 F' B2 b2 F' 
 F' B2 b2 F2 
 F' b' F 
 F' b' F' 
 F' b' F2 
 F' b' B' F 
 F' b' B' F' 
 F' b' B' F2 
 F' b' B F 
 F' b' B F' 
 F' b' B F2 
 F' b' B2 F 
 F' b' B2 F' 
 F' b' B2 F2 
 F' b F 
 F' b F' 
 F' b F2 
 F' b B' F 
 F' b B' F' 
 F' b B' F2 
 F' b B F 
 F' b B F' 
 F' b B F2 
 F' b B2 F 
 F' b B2 F' 
 F' b B2 F2 
 F' b2 F 
 F' b2 F' 
 F' b2 F2 
 F' b2 B' F 
 F' b2 B' F' 
 F' b2 B' F2 
 F' b2 B F 
 F' b2 B F' 
 F' b2 B F2 
 F' b2 B2 F 
 F' b2 B2 F' 
 F' b2 B2 F2 
 F2 B' F 
 F2 B' F' 
 F2 B' F2 
 F2 B' b' F 
 F2 B' b' F' 
 F2 B' b' F2 
 F2 B' b F 
 F2 B' b F' 
 F2 B' b F2 
 F2 B' b2 F 
 F2 B' b2 F' 
 F2 B' b2 F2 
 F2 B F 
 F2 B F' 
 F2 B F2 
 F2 B b' F 
 F2 B b' F' 
 F2 B b' F2 
 F2 B b F 
 F2 B b F' 
 F2 B b F2 
 F2 B b2 F 
 F2 B b2 F' 
 F2 B b2 F2 
 F2 B2 F 
 F2 B2 F' 
 F2 B2 F2 
 F2 B2 b' F 
 F2 B2 b' F' 
 F2 B2 b' F2 
 F2 B2 b F 
 F2 B2 b F' 
 F2 B2 b F2 
 F2 B2 b2 F 
 F2 B2 b2 F' 
 F2 B2 b2 F2 
 F2 b' F 
 F2 b' F' 
 F2 b' F2 
 F2 b' B' F 
 F2 b' B' F' 
 F2 b' B' F2 
 F2 b' B F 
 F2 b' B F' 
 F2 b' B F2 
 F2 b' B2 F 
 F2 b' B2 F' 
 F2 b' B2 F2 
 F2 b F 
 F2 b F' 
 F2 b F2 
 F2 b B' F 
 F2 b B' F' 
 F2 b B' F2 
 F2 b B F 
 F2 b B F' 
 F2 b B F2 
 F2 b B2 F 
 F2 b B2 F' 
 F2 b B2 F2 
 F2 b2 F 
 F2 b2 F' 
 F2 b2 F2 
 F2 b2 B' F 
 F2 b2 B' F' 
 F2 b2 B' F2 
 F2 b2 B F 
 F2 b2 B F' 
 F2 b2 B F2 
 F2 b2 B2 F 
 F2 b2 B2 F' 
 F2 b2 B2 F2 
 R L' R 
 R L' R' 
 R L' R2 
 R L' l' R 
 R L' l' R' 
 R L' l' R2 
 R L' l R 
 R L' l R' 
 R L' l R2 
 R L' l2 R 
 R L' l2 R' 
 R L' l2 R2 
 R L R 
 R L R' 
 R L R2 
 R L l' R 
 R L l' R' 
 R L l' R2 
 R L l R 
 R L l R' 
 R L l R2 
 R L l2 R 
 R L l2 R' 
 R L l2 R2 
 R L2 R 
 R L2 R' 
 R L2 R2 
 R L2 l' R 
 R L2 l' R' 
 R L2 l' R2 
 R L2 l R 
 R L2 l R' 
 R L2 l R2 
 R L2 l2 R 
 R L2 l2 R' 
 R L2 l2 R2 
 R l' R 
 R l' R' 
 R l' R2 
 R l' L' R 
 R l' L' R' 
 R l' L' R2 
 R l' L R 
 R l' L R' 
 R l' L R2 
 R l' L2 R 
 R l' L2 R' 
 R l' L2 R2 
 R l R 
 R l R' 
 R l R2 
 R l L' R 
 R l L' R' 
 R l L' R2 
 R l L R 
 R l L R' 
 R l L R2 
 R l L2 R 
 R l L2 R' 
 R l L2 R2 
 R l2 R 
 R l2 R' 
 R l2 R2 
 R l2 L' R 
 R l2 L' R' 
 R l2 L' R2 
 R l2 L R 
 R l2 L R' 
 R l2 L R2 
 R l2 L2 R 
 R l2 L2 R' 
 R l2 L2 R2 
 R' L' R 
 R' L' R' 
 R' L' R2 
 R' L' l' R 
 R' L' l' R' 
 R' L' l' R2 
 R' L' l R 
 R' L' l R' 
 R' L' l R2 
 R' L' l2 R 
 R' L' l2 R' 
 R' L' l2 R2 
 R' L R 
 R' L R' 
 R' L R2 
 R' L l' R 
 R' L l' R' 
 R' L l' R2 
 R' L l R 
 R' L l R' 
 R' L l R2 
 R' L l2 R 
 R' L l2 R' 
 R' L l2 R2 
 R' L2 R 
 R' L2 R' 
 R' L2 R2 
 R' L2 l' R 
 R' L2 l' R' 
 R' L2 l' R2 
 R' L2 l R 
 R' L2 l R' 
 R' L2 l R2 
 R' L2 l2 R 
 R' L2 l2 R' 
 R' L2 l2 R2 
 R' l' R 
 R' l' R' 
 R' l' R2 
 R' l' L' R 
 R' l' L' R' 
 R' l' L' R2 
 R' l' L R 
 R' l' L R' 
 R' l' L R2 
 R' l' L2 R 
 R' l' L2 R' 
 R' l' L2 R2 
 R' l R 
 R' l R' 
 R' l R2 
 R' l L' R 
 R' l L' R' 
 R' l L' R2 
 R' l L R 
 R' l L R' 
 R' l L R2 
 R' l L2 R 
 R' l L2 R' 
 R' l L2 R2 
 R' l2 R 
 R' l2 R' 
 R' l2 R2 
 R' l2 L' R 
 R' l2 L' R' 
 R' l2 L' R2 
 R' l2 L R 
 R' l2 L R' 
 R' l2 L R2 
 R' l2 L2 R 
 R' l2 L2 R' 
 R' l2 L2 R2 
 R2 L' R 
 R2 L' R' 
 R2 L' R2 
 R2 L' l' R 
 R2 L' l' R' 
 R2 L' l' R2 
 R2 L' l R 
 R2 L' l R' 
 R2 L' l R2 
 R2 L' l2 R 
 R2 L' l2 R' 
 R2 L' l2 R2 
 R2 L R 
 R2 L R' 
 R2 L R2 
 R2 L l' R 
 R2 L l' R' 
 R2 L l' R2 
 R2 L l R 
 R2 L l R' 
 R2 L l R2 
 R2 L l2 R 
 R2 L l2 R' 
 R2 L l2 R2 
 R2 L2 R 
 R2 L2 R' 
 R2 L2 R2 
 R2 L2 l' R 
 R2 L2 l' R' 
 R2 L2 l' R2 
 R2 L2 l R 
 R2 L2 l R' 
 R2 L2 l R2 
 R2 L2 l2 R 
 R2 L2 l2 R' 
 R2 L2 l2 R2 
 R2 l' R 
 R2 l' R' 
 R2 l' R2 
 R2 l' L' R 
 R2 l' L' R' 
 R2 l' L' R2 
 R2 l' L R 
 R2 l' L R' 
 R2 l' L R2 
 R2 l' L2 R 
 R2 l' L2 R' 
 R2 l' L2 R2 
 R2 l R 
 R2 l R' 
 R2 l R2 
 R2 l L' R 
 R2 l L' R' 
 R2 l L' R2 
 R2 l L R 
 R2 l L R' 
 R2 l L R2 
 R2 l L2 R 
 R2 l L2 R' 
 R2 l L2 R2 
 R2 l2 R 
 R2 l2 R' 
 R2 l2 R2 
 R2 l2 L' R 
 R2 l2 L' R' 
 R2 l2 L' R2 
 R2 l2 L R 
 R2 l2 L R' 
 R2 l2 L R2 
 R2 l2 L2 R 
 R2 l2 L2 R' 
 R2 l2 L2 R2 
 D' U D' 
 D' U D 
 D' U D2 
 D' U u D' 
 D' U u D 
 D' U u D2 
 D' U u' D' 
 D' U u' D 
 D' U u' D2 
 D' U u2 D' 
 D' U u2 D 
 D' U u2 D2 
 D' U- D' 
 D' U- D 
 D' U- D2 
 D' U- u D' 
 D' U- u D 
 D' U- u D2 
 D' U- u' D' 
 D' U- u' D 
 D' U- u' D2 
 D' U- u2 D' 
 D' U- u2 D 
 D' U- u2 D2 
 D' U2 D' 
 D' U2 D 
 D' U2 D2 
 D' U2 u D' 
 D' U2 u D 
 D' U2 u D2 
 D' U2 u' D' 
 D' U2 u' D 
 D' U2 u' D2 
 D' U2 u2 D' 
 D' U2 u2 D 
 D' U2 u2 D2 
 D' u U D' 
 D' u U D 
 D' u U D2 
 D' u U- D' 
 D' u U- D 
 D' u U- D2 
 D' u U2 D' 
 D' u U2 D 
 D' u U2 D2 
 D' u D' 
 D' u D 
 D' u D2 
 D' u' U D' 
 D' u' U D 
 D' u' U D2 
 D' u' U- D' 
 D' u' U- D 
 D' u' U- D2 
 D' u' U2 D' 
 D' u' U2 D 
 D' u' U2 D2 
 D' u' D' 
 D' u' D 
 D' u' D2 
 D' u2 U D' 
 D' u2 U D 
 D' u2 U D2 
 D' u2 U- D' 
 D' u2 U- D 
 D' u2 U- D2 
 D' u2 U2 D' 
 D' u2 U2 D 
 D' u2 U2 D2 
 D' u2 D' 
 D' u2 D 
 D' u2 D2 
 D U D' 
 D U D 
 D U D2 
 D U u D' 
 D U u D 
 D U u D2 
 D U u' D' 
 D U u' D 
 D U u' D2 
 D U u2 D' 
 D U u2 D 
 D U u2 D2 
 D U- D' 
 D U- D 
 D U- D2 
 D U- u D' 
 D U- u D 
 D U- u D2 
 D U- u' D' 
 D U- u' D 
 D U- u' D2 
 D U- u2 D' 
 D U- u2 D 
 D U- u2 D2 
 D U2 D' 
 D U2 D 
 D U2 D2 
 D U2 u D' 
 D U2 u D 
 D U2 u D2 
 D U2 u' D' 
 D U2 u' D 
 D U2 u' D2 
 D U2 u2 D' 
 D U2 u2 D 
 D U2 u2 D2 
 D u U D' 
 D u U D 
 D u U D2 
 D u U- D' 
 D u U- D 
 D u U- D2 
 D u U2 D' 
 D u U2 D 
 D u U2 D2 
 D u D' 
 D u D 
 D u D2 
 D u' U D' 
 D u' U D 
 D u' U D2 
 D u' U- D' 
 D u' U- D 
 D u' U- D2 
 D u' U2 D' 
 D u' U2 D 
 D u' U2 D2 
 D u' D' 
 D u' D 
 D u' D2 
 D u2 U D' 
 D u2 U D 
 D u2 U D2 
 D u2 U- D' 
 D u2 U- D 
 D u2 U- D2 
 D u2 U2 D' 
 D u2 U2 D 
 D u2 U2 D2 
 D u2 D' 
 D u2 D 
 D u2 D2 
 D2 U D' 
 D2 U D 
 D2 U D2 
 D2 U u D' 
 D2 U u D 
 D2 U u D2 
 D2 U u' D' 
 D2 U u' D 
 D2 U u' D2 
 D2 U u2 D' 
 D2 U u2 D 
 D2 U u2 D2 
 D2 U- D' 
 D2 U- D 
 D2 U- D2 
 D2 U- u D' 
 D2 U- u D 
 D2 U- u D2 
 D2 U- u' D' 
 D2 U- u' D 
 D2 U- u' D2 
 D2 U- u2 D' 
 D2 U- u2 D 
 D2 U- u2 D2 
 D2 U2 D' 
 D2 U2 D 
 D2 U2 D2 
 D2 U2 u D' 
 D2 U2 u D 
 D2 U2 u D2 
 D2 U2 u' D' 
 D2 U2 u' D 
 D2 U2 u' D2 
 D2 U2 u2 D' 
 D2 U2 u2 D 
 D2 U2 u2 D2 
 D2 u U D' 
 D2 u U D 
 D2 u U D2 
 D2 u U- D' 
 D2 u U- D 
 D2 u U- D2 
 D2 u U2 D' 
 D2 u U2 D 
 D2 u U2 D2 
 D2 u D' 
 D2 u D 
 D2 u D2 
 D2 u' U D' 
 D2 u' U D 
 D2 u' U D2 
 D2 u' U- D' 
 D2 u' U- D 
 D2 u' U- D2 
 D2 u' U2 D' 
 D2 u' U2 D 
 D2 u' U2 D2 
 D2 u' D' 
 D2 u' D 
 D2 u' D2 
 D2 u2 U D' 
 D2 u2 U D 
 D2 u2 U D2 
 D2 u2 U- D' 
 D2 u2 U- D 
 D2 u2 U- D2 
 D2 u2 U2 D' 
 D2 u2 U2 D 
 D2 u2 U2 D2 
 D2 u2 D' 
 D2 u2 D 
 D2 u2 D2 
 B' F B' 
 B' F B 
 B' F B2 
 B' F f B' 
 B' F f B 
 B' F f B2 
 B' F f' B' 
 B' F f' B 
 B' F f' B2 
 B' F f2 B' 
 B' F f2 B 
 B' F f2 B2 
 B' F' B' 
 B' F' B 
 B' F' B2 
 B' F' f B' 
 B' F' f B 
 B' F' f B2 
 B' F' f' B' 
 B' F' f' B 
 B' F' f' B2 
 B' F' f2 B' 
 B' F' f2 B 
 B' F' f2 B2 
 B' F2 B' 
 B' F2 B 
 B' F2 B2 
 B' F2 f B' 
 B' F2 f B 
 B' F2 f B2 
 B' F2 f' B' 
 B' F2 f' B 
 B' F2 f' B2 
 B' F2 f2 B' 
 B' F2 f2 B 
 B' F2 f2 B2 
 B' f F B' 
 B' f F B 
 B' f F B2 
 B' f F' B' 
 B' f F' B 
 B' f F' B2 
 B' f F2 B' 
 B' f F2 B 
 B' f F2 B2 
 B' f B' 
 B' f B 
 B' f B2 
 B' f' F B' 
 B' f' F B 
 B' f' F B2 
 B' f' F' B' 
 B' f' F' B 
 B' f' F' B2 
 B' f' F2 B' 
 B' f' F2 B 
 B' f' F2 B2 
 B' f' B' 
 B' f' B 
 B' f' B2 
 B' f2 F B' 
 B' f2 F B 
 B' f2 F B2 
 B' f2 F' B' 
 B' f2 F' B 
 B' f2 F' B2 
 B' f2 F2 B' 
 B' f2 F2 B 
 B' f2 F2 B2 
 B' f2 B' 
 B' f2 B 
 B' f2 B2 
 B F B' 
 B F B 
 B F B2 
 B F f B' 
 B F f B 
 B F f B2 
 B F f' B' 
 B F f' B 
 B F f' B2 
 B F f2 B' 
 B F f2 B 
 B F f2 B2 
 B F' B' 
 B F' B 
 B F' B2 
 B F' f B' 
 B F' f B 
 B F' f B2 
 B F' f' B' 
 B F' f' B 
 B F' f' B2 
 B F' f2 B' 
 B F' f2 B 
 B F' f2 B2 
 B F2 B' 
 B F2 B 
 B F2 B2 
 B F2 f B' 
 B F2 f B 
 B F2 f B2 
 B F2 f' B' 
 B F2 f' B 
 B F2 f' B2 
 B F2 f2 B' 
 B F2 f2 B 
 B F2 f2 B2 
 B f F B' 
 B f F B 
 B f F B2 
 B f F' B' 
 B f F' B 
 B f F' B2 
 B f F2 B' 
 B f F2 B 
 B f F2 B2 
 B f B' 
 B f B 
 B f B2 
 B f' F B' 
 B f' F B 
 B f' F B2 
 B f' F' B' 
 B f' F' B 
 B f' F' B2 
 B f' F2 B' 
 B f' F2 B 
 B f' F2 B2 
 B f' B' 
 B f' B 
 B f' B2 
 B f2 F B' 
 B f2 F B 
 B f2 F B2 
 B f2 F' B' 
 B f2 F' B 
 B f2 F' B2 
 B f2 F2 B' 
 B f2 F2 B 
 B f2 F2 B2 
 B f2 B' 
 B f2 B 
 B f2 B2 
 B2 F B' 
 B2 F B 
 B2 F B2 
 B2 F f B' 
 B2 F f B 
 B2 F f B2 
 B2 F f' B' 
 B2 F f' B 
 B2 F f' B2 
 B2 F f2 B' 
 B2 F f2 B 
 B2 F f2 B2 
 B2 F' B' 
 B2 F' B 
 B2 F' B2 
 B2 F' f B' 
 B2 F' f B 
 B2 F' f B2 
 B2 F' f' B' 
 B2 F' f' B 
 B2 F' f' B2 
 B2 F' f2 B' 
 B2 F' f2 B 
 B2 F' f2 B2 
 B2 F2 B' 
 B2 F2 B 
 B2 F2 B2 
 B2 F2 f B' 
 B2 F2 f B 
 B2 F2 f B2 
 B2 F2 f' B' 
 B2 F2 f' B 
 B2 F2 f' B2 
 B2 F2 f2 B' 
 B2 F2 f2 B 
 B2 F2 f2 B2 
 B2 f F B' 
 B2 f F B 
 B2 f F B2 
 B2 f F' B' 
 B2 f F' B 
 B2 f F' B2 
 B2 f F2 B' 
 B2 f F2 B 
 B2 f F2 B2 
 B2 f B' 
 B2 f B 
 B2 f B2 
 B2 f' F B' 
 B2 f' F B 
 B2 f' F B2 
 B2 f' F' B' 
 B2 f' F' B 
 B2 f' F' B2 
 B2 f' F2 B' 
 B2 f' F2 B 
 B2 f' F2 B2 
 B2 f' B' 
 B2 f' B 
 B2 f' B2 
 B2 f2 F B' 
 B2 f2 F B 
 B2 f2 F B2 
 B2 f2 F' B' 
 B2 f2 F' B 
 B2 f2 F' B2 
 B2 f2 F2 B' 
 B2 f2 F2 B 
 B2 f2 F2 B2 
 B2 f2 B' 
 B2 f2 B 
 B2 f2 B2 
 L' R L' 
 L' R L 
 L' R L2 
 L' R r L' 
 L' R r L 
 L' R r L2 
 L' R r' L' 
 L' R r' L 
 L' R r' L2 
 L' R r2 L' 
 L' R r2 L 
 L' R r2 L2 
 L' R' L' 
 L' R' L 
 L' R' L2 
 L' R' r L' 
 L' R' r L 
 L' R' r L2 
 L' R' r' L' 
 L' R' r' L 
 L' R' r' L2 
 L' R' r2 L' 
 L' R' r2 L 
 L' R' r2 L2 
 L' R2 L' 
 L' R2 L 
 L' R2 L2 
 L' R2 r L' 
 L' R2 r L 
 L' R2 r L2 
 L' R2 r' L' 
 L' R2 r' L 
 L' R2 r' L2 
 L' R2 r2 L' 
 L' R2 r2 L 
 L' R2 r2 L2 
 L' r R L' 
 L' r R L 
 L' r R L2 
 L' r R' L' 
 L' r R' L 
 L' r R' L2 
 L' r R2 L' 
 L' r R2 L 
 L' r R2 L2 
 L' r L' 
 L' r L 
 L' r L2 
 L' r' R L' 
 L' r' R L 
 L' r' R L2 
 L' r' R' L' 
 L' r' R' L 
 L' r' R' L2 
 L' r' R2 L' 
 L' r' R2 L 
 L' r' R2 L2 
 L' r' L' 
 L' r' L 
 L' r' L2 
 L' r2 R L' 
 L' r2 R L 
 L' r2 R L2 
 L' r2 R' L' 
 L' r2 R' L 
 L' r2 R' L2 
 L' r2 R2 L' 
 L' r2 R2 L 
 L' r2 R2 L2 
 L' r2 L' 
 L' r2 L 
 L' r2 L2 
 L R L' 
 L R L 
 L R L2 
 L R r L' 
 L R r L 
 L R r L2 
 L R r' L' 
 L R r' L 
 L R r' L2 
 L R r2 L' 
 L R r2 L 
 L R r2 L2 
 L R' L' 
 L R' L 
 L R' L2 
 L R' r L' 
 L R' r L 
 L R' r L2 
 L R' r' L' 
 L R' r' L 
 L R' r' L2 
 L R' r2 L' 
 L R' r2 L 
 L R' r2 L2 
 L R2 L' 
 L R2 L 
 L R2 L2 
 L R2 r L' 
 L R2 r L 
 L R2 r L2 
 L R2 r' L' 
 L R2 r' L 
 L R2 r' L2 
 L R2 r2 L' 
 L R2 r2 L 
 L R2 r2 L2 
 L r R L' 
 L r R L 
 L r R L2 
 L r R' L' 
 L r R' L 
 L r R' L2 
 L r R2 L' 
 L r R2 L 
 L r R2 L2 
 L r L' 
 L r L 
 L r L2 
 L r' R L' 
 L r' R L 
 L r' R L2 
 L r' R' L' 
 L r' R' L 
 L r' R' L2 
 L r' R2 L' 
 L r' R2 L 
 L r' R2 L2 
 L r' L' 
 L r' L 
 L r' L2 
 L r2 R L' 
 L r2 R L 
 L r2 R L2 
 L r2 R' L' 
 L r2 R' L 
 L r2 R' L2 
 L r2 R2 L' 
 L r2 R2 L 
 L r2 R2 L2 
 L r2 L' 
 L r2 L 
 L r2 L2 
 L2 R L' 
 L2 R L 
 L2 R L2 
 L2 R r L' 
 L2 R r L 
 L2 R r L2 
 L2 R r' L' 
 L2 R r' L 
 L2 R r' L2 
 L2 R r2 L' 
 L2 R r2 L 
 L2 R r2 L2 
 L2 R' L' 
 L2 R' L 
 L2 R' L2 
 L2 R' r L' 
 L2 R' r L 
 L2 R' r L2 
 L2 R' r' L' 
 L2 R' r' L 
 L2 R' r' L2 
 L2 R' r2 L' 
 L2 R' r2 L 
 L2 R' r2 L2 
 L2 R2 L' 
 L2 R2 L 
 L2 R2 L2 
 L2 R2 r L' 
 L2 R2 r L 
 L2 R2 r L2 
 L2 R2 r' L' 
 L2 R2 r' L 
 L2 R2 r' L2 
 L2 R2 r2 L' 
 L2 R2 r2 L 
 L2 R2 r2 L2 
 L2 r R L' 
 L2 r R L 
 L2 r R L2 
 L2 r R' L' 
 L2 r R' L 
 L2 r R' L2 
 L2 r R2 L' 
 L2 r R2 L 
 L2 r R2 L2 
 L2 r L' 
 L2 r L 
 L2 r L2 
 L2 r' R L' 
 L2 r' R L 
 L2 r' R L2 
 L2 r' R' L' 
 L2 r' R' L 
 L2 r' R' L2 
 L2 r' R2 L' 
 L2 r' R2 L 
 L2 r' R2 L2 
 L2 r' L' 
 L2 r' L 
 L2 r' L2 
 L2 r2 R L' 
 L2 r2 R L 
 L2 r2 R L2 
 L2 r2 R' L' 
 L2 r2 R' L 
 L2 r2 R' L2 
 L2 r2 R2 L' 
 L2 r2 R2 L 
 L2 r2 R2 L2 
 L2 r2 L' 
 L2 r2 L 
 L2 r2 L2 
 u D' u 
 u D' u' 
 u D' u2 
 u D' d' u 
 u D' d' u' 
 u D' d' u2 
 u D' d u 
 u D' d u' 
 u D' d u2 
 u D' d2 u 
 u D' d2 u' 
 u D' d2 u2 
 u D u 
 u D u' 
 u D u2 
 u D d' u 
 u D d' u' 
 u D d' u2 
 u D d u 
 u D d u' 
 u D d u2 
 u D d2 u 
 u D d2 u' 
 u D d2 u2 
 u D2 u 
 u D2 u' 
 u D2 u2 
 u D2 d' u 
 u D2 d' u' 
 u D2 d' u2 
 u D2 d u 
 u D2 d u' 
 u D2 d u2 
 u D2 d2 u 
 u D2 d2 u' 
 u D2 d2 u2 
 u d' D' u 
 u d' D' u' 
 u d' D' u2 
 u d' D u 
 u d' D u' 
 u d' D u2 
 u d' D2 u 
 u d' D2 u' 
 u d' D2 u2 
 u d' u 
 u d' u' 
 u d' u2 
 u d D' u 
 u d D' u' 
 u d D' u2 
 u d D u 
 u d D u' 
 u d D u2 
 u d D2 u 
 u d D2 u' 
 u d D2 u2 
 u d u 
 u d u' 
 u d u2 
 u d2 D' u 
 u d2 D' u' 
 u d2 D' u2 
 u d2 D u 
 u d2 D u' 
 u d2 D u2 
 u d2 D2 u 
 u d2 D2 u' 
 u d2 D2 u2 
 u d2 u 
 u d2 u' 
 u d2 u2 
 u' D' u 
 u' D' u' 
 u' D' u2 
 u' D' d' u 
 u' D' d' u' 
 u' D' d' u2 
 u' D' d u 
 u' D' d u' 
 u' D' d u2 
 u' D' d2 u 
 u' D' d2 u' 
 u' D' d2 u2 
 u' D u 
 u' D u' 
 u' D u2 
 u' D d' u 
 u' D d' u' 
 u' D d' u2 
 u' D d u 
 u' D d u' 
 u' D d u2 
 u' D d2 u 
 u' D d2 u' 
 u' D d2 u2 
 u' D2 u 
 u' D2 u' 
 u' D2 u2 
 u' D2 d' u 
 u' D2 d' u' 
 u' D2 d' u2 
 u' D2 d u 
 u' D2 d u' 
 u' D2 d u2 
 u' D2 d2 u 
 u' D2 d2 u' 
 u' D2 d2 u2 
 u' d' D' u 
 u' d' D' u' 
 u' d' D' u2 
 u' d' D u 
 u' d' D u' 
 u' d' D u2 
 u' d' D2 u 
 u' d' D2 u' 
 u' d' D2 u2 
 u' d' u 
 u' d' u' 
 u' d' u2 
 u' d D' u 
 u' d D' u' 
 u' d D' u2 
 u' d D u 
 u' d D u' 
 u' d D u2 
 u' d D2 u 
 u' d D2 u' 
 u' d D2 u2 
 u' d u 
 u' d u' 
 u' d u2 
 u' d2 D' u 
 u' d2 D' u' 
 u' d2 D' u2 
 u' d2 D u 
 u' d2 D u' 
 u' d2 D u2 
 u' d2 D2 u 
 u' d2 D2 u' 
 u' d2 D2 u2 
 u' d2 u 
 u' d2 u' 
 u' d2 u2 
 u2 D' u 
 u2 D' u' 
 u2 D' u2 
 u2 D' d' u 
 u2 D' d' u' 
 u2 D' d' u2 
 u2 D' d u 
 u2 D' d u' 
 u2 D' d u2 
 u2 D' d2 u 
 u2 D' d2 u' 
 u2 D' d2 u2 
 u2 D u 
 u2 D u' 
 u2 D u2 
 u2 D d' u 
 u2 D d' u' 
 u2 D d' u2 
 u2 D d u 
 u2 D d u' 
 u2 D d u2 
 u2 D d2 u 
 u2 D d2 u' 
 u2 D d2 u2 
 u2 D2 u 
 u2 D2 u' 
 u2 D2 u2 
 u2 D2 d' u 
 u2 D2 d' u' 
 u2 D2 d' u2 
 u2 D2 d u 
 u2 D2 d u' 
 u2 D2 d u2 
 u2 D2 d2 u 
 u2 D2 d2 u' 
 u2 D2 d2 u2 
 u2 d' D' u 
 u2 d' D' u' 
 u2 d' D' u2 
 u2 d' D u 
 u2 d' D u' 
 u2 d' D u2 
 u2 d' D2 u 
 u2 d' D2 u' 
 u2 d' D2 u2 
 u2 d' u 
 u2 d' u' 
 u2 d' u2 
 u2 d D' u 
 u2 d D' u' 
 u2 d D' u2 
 u2 d D u 
 u2 d D u' 
 u2 d D u2 
 u2 d D2 u 
 u2 d D2 u' 
 u2 d D2 u2 
 u2 d u 
 u2 d u' 
 u2 d u2 
 u2 d2 D' u 
 u2 d2 D' u' 
 u2 d2 D' u2 
 u2 d2 D u 
 u2 d2 D u' 
 u2 d2 D u2 
 u2 d2 D2 u 
 u2 d2 D2 u' 
 u2 d2 D2 u2 
 u2 d2 u 
 u2 d2 u' 
 u2 d2 u2 
 f B' f 
 f B' f' 
 f B' f2 
 f B' b' f 
 f B' b' f' 
 f B' b' f2 
 f B' b f 
 f B' b f' 
 f B' b f2 
 f B' b2 f 
 f B' b2 f' 
 f B' b2 f2 
 f B f 
 f B f' 
 f B f2 
 f B b' f 
 f B b' f' 
 f B b' f2 
 f B b f 
 f B b f' 
 f B b f2 
 f B b2 f 
 f B b2 f' 
 f B b2 f2 
 f B2 f 
 f B2 f' 
 f B2 f2 
 f B2 b' f 
 f B2 b' f' 
 f B2 b' f2 
 f B2 b f 
 f B2 b f' 
 f B2 b f2 
 f B2 b2 f 
 f B2 b2 f' 
 f B2 b2 f2 
 f b' B' f 
 f b' B' f' 
 f b' B' f2 
 f b' B f 
 f b' B f' 
 f b' B f2 
 f b' B2 f 
 f b' B2 f' 
 f b' B2 f2 
 f b' f 
 f b' f' 
 f b' f2 
 f b B' f 
 f b B' f' 
 f b B' f2 
 f b B f 
 f b B f' 
 f b B f2 
 f b B2 f 
 f b B2 f' 
 f b B2 f2 
 f b f 
 f b f' 
 f b f2 
 f b2 B' f 
 f b2 B' f' 
 f b2 B' f2 
 f b2 B f 
 f b2 B f' 
 f b2 B f2 
 f b2 B2 f 
 f b2 B2 f' 
 f b2 B2 f2 
 f b2 f 
 f b2 f' 
 f b2 f2 
 f' B' f 
 f' B' f' 
 f' B' f2 
 f' B' b' f 
 f' B' b' f' 
 f' B' b' f2 
 f' B' b f 
 f' B' b f' 
 f' B' b f2 
 f' B' b2 f 
 f' B' b2 f' 
 f' B' b2 f2 
 f' B f 
 f' B f' 
 f' B f2 
 f' B b' f 
 f' B b' f' 
 f' B b' f2 
 f' B b f 
 f' B b f' 
 f' B b f2 
 f' B b2 f 
 f' B b2 f' 
 f' B b2 f2 
 f' B2 f 
 f' B2 f' 
 f' B2 f2 
 f' B2 b' f 
 f' B2 b' f' 
 f' B2 b' f2 
 f' B2 b f 
 f' B2 b f' 
 f' B2 b f2 
 f' B2 b2 f 
 f' B2 b2 f' 
 f' B2 b2 f2 
 f' b' B' f 
 f' b' B' f' 
 f' b' B' f2 
 f' b' B f 
 f' b' B f' 
 f' b' B f2 
 f' b' B2 f 
 f' b' B2 f' 
 f' b' B2 f2 
 f' b' f 
 f' b' f' 
 f' b' f2 
 f' b B' f 
 f' b B' f' 
 f' b B' f2 
 f' b B f 
 f' b B f' 
 f' b B f2 
 f' b B2 f 
 f' b B2 f' 
 f' b B2 f2 
 f' b f 
 f' b f' 
 f' b f2 
 f' b2 B' f 
 f' b2 B' f' 
 f' b2 B' f2 
 f' b2 B f 
 f' b2 B f' 
 f' b2 B f2 
 f' b2 B2 f 
 f' b2 B2 f' 
 f' b2 B2 f2 
 f' b2 f 
 f' b2 f' 
 f' b2 f2 
 f2 B' f 
 f2 B' f' 
 f2 B' f2 
 f2 B' b' f 
 f2 B' b' f' 
 f2 B' b' f2 
 f2 B' b f 
 f2 B' b f' 
 f2 B' b f2 
 f2 B' b2 f 
 f2 B' b2 f' 
 f2 B' b2 f2 
 f2 B f 
 f2 B f' 
 f2 B f2 
 f2 B b' f 
 f2 B b' f' 
 f2 B b' f2 
 f2 B b f 
 f2 B b f' 
 f2 B b f2 
 f2 B b2 f 
 f2 B b2 f' 
 f2 B b2 f2 
 f2 B2 f 
 f2 B2 f' 
 f2 B2 f2 
 f2 B2 b' f 
 f2 B2 b' f' 
 f2 B2 b' f2 
 f2 B2 b f 
 f2 B2 b f' 
 f2 B2 b f2 
 f2 B2 b2 f 
 f2 B2 b2 f' 
 f2 B2 b2 f2 
 f2 b' B' f 
 f2 b' B' f' 
 f2 b' B' f2 
 f2 b' B f 
 f2 b' B f' 
 f2 b' B f2 
 f2 b' B2 f 
 f2 b' B2 f' 
 f2 b' B2 f2 
 f2 b' f 
 f2 b' f' 
 f2 b' f2 
 f2 b B' f 
 f2 b B' f' 
 f2 b B' f2 
 f2 b B f 
 f2 b B f' 
 f2 b B f2 
 f2 b B2 f 
 f2 b B2 f' 
 f2 b B2 f2 
 f2 b f 
 f2 b f' 
 f2 b f2 
 f2 b2 B' f 
 f2 b2 B' f' 
 f2 b2 B' f2 
 f2 b2 B f 
 f2 b2 B f' 
 f2 b2 B f2 
 f2 b2 B2 f 
 f2 b2 B2 f' 
 f2 b2 B2 f2 
 f2 b2 f 
 f2 b2 f' 
 f2 b2 f2 
 r L' r 
 r L' r' 
 r L' r2 
 r L' l' r 
 r L' l' r' 
 r L' l' r2 
 r L' l r 
 r L' l r' 
 r L' l r2 
 r L' l2 r 
 r L' l2 r' 
 r L' l2 r2 
 r L r 
 r L r' 
 r L r2 
 r L l' r 
 r L l' r' 
 r L l' r2 
 r L l r 
 r L l r' 
 r L l r2 
 r L l2 r 
 r L l2 r' 
 r L l2 r2 
 r L2 r 
 r L2 r' 
 r L2 r2 
 r L2 l' r 
 r L2 l' r' 
 r L2 l' r2 
 r L2 l r 
 r L2 l r' 
 r L2 l r2 
 r L2 l2 r 
 r L2 l2 r' 
 r L2 l2 r2 
 r l' L' r 
 r l' L' r' 
 r l' L' r2 
 r l' L r 
 r l' L r' 
 r l' L r2 
 r l' L2 r 
 r l' L2 r' 
 r l' L2 r2 
 r l' r 
 r l' r' 
 r l' r2 
 r l L' r 
 r l L' r' 
 r l L' r2 
 r l L r 
 r l L r' 
 r l L r2 
 r l L2 r 
 r l L2 r' 
 r l L2 r2 
 r l r 
 r l r' 
 r l r2 
 r l2 L' r 
 r l2 L' r' 
 r l2 L' r2 
 r l2 L r 
 r l2 L r' 
 r l2 L r2 
 r l2 L2 r 
 r l2 L2 r' 
 r l2 L2 r2 
 r l2 r 
 r l2 r' 
 r l2 r2 
 r' L' r 
 r' L' r' 
 r' L' r2 
 r' L' l' r 
 r' L' l' r' 
 r' L' l' r2 
 r' L' l r 
 r' L' l r' 
 r' L' l r2 
 r' L' l2 r 
 r' L' l2 r' 
 r' L' l2 r2 
 r' L r 
 r' L r' 
 r' L r2 
 r' L l' r 
 r' L l' r' 
 r' L l' r2 
 r' L l r 
 r' L l r' 
 r' L l r2 
 r' L l2 r 
 r' L l2 r' 
 r' L l2 r2 
 r' L2 r 
 r' L2 r' 
 r' L2 r2 
 r' L2 l' r 
 r' L2 l' r' 
 r' L2 l' r2 
 r' L2 l r 
 r' L2 l r' 
 r' L2 l r2 
 r' L2 l2 r 
 r' L2 l2 r' 
 r' L2 l2 r2 
 r' l' L' r 
 r' l' L' r' 
 r' l' L' r2 
 r' l' L r 
 r' l' L r' 
 r' l' L r2 
 r' l' L2 r 
 r' l' L2 r' 
 r' l' L2 r2 
 r' l' r 
 r' l' r' 
 r' l' r2 
 r' l L' r 
 r' l L' r' 
 r' l L' r2 
 r' l L r 
 r' l L r' 
 r' l L r2 
 r' l L2 r 
 r' l L2 r' 
 r' l L2 r2 
 r' l r 
 r' l r' 
 r' l r2 
 r' l2 L' r 
 r' l2 L' r' 
 r' l2 L' r2 
 r' l2 L r 
 r' l2 L r' 
 r' l2 L r2 
 r' l2 L2 r 
 r' l2 L2 r' 
 r' l2 L2 r2 
 r' l2 r 
 r' l2 r' 
 r' l2 r2 
 r2 L' r 
 r2 L' r' 
 r2 L' r2 
 r2 L' l' r 
 r2 L' l' r' 
 r2 L' l' r2 
 r2 L' l r 
 r2 L' l r' 
 r2 L' l r2 
 r2 L' l2 r 
 r2 L' l2 r' 
 r2 L' l2 r2 
 r2 L r 
 r2 L r' 
 r2 L r2 
 r2 L l' r 
 r2 L l' r' 
 r2 L l' r2 
 r2 L l r 
 r2 L l r' 
 r2 L l r2 
 r2 L l2 r 
 r2 L l2 r' 
 r2 L l2 r2 
 r2 L2 r 
 r2 L2 r' 
 r2 L2 r2 
 r2 L2 l' r 
 r2 L2 l' r' 
 r2 L2 l' r2 
 r2 L2 l r 
 r2 L2 l r' 
 r2 L2 l r2 
 r2 L2 l2 r 
 r2 L2 l2 r' 
 r2 L2 l2 r2 
 r2 l' L' r 
 r2 l' L' r' 
 r2 l' L' r2 
 r2 l' L r 
 r2 l' L r' 
 r2 l' L r2 
 r2 l' L2 r 
 r2 l' L2 r' 
 r2 l' L2 r2 
 r2 l' r 
 r2 l' r' 
 r2 l' r2 
 r2 l L' r 
 r2 l L' r' 
 r2 l L' r2 
 r2 l L r 
 r2 l L r' 
 r2 l L r2 
 r2 l L2 r 
 r2 l L2 r' 
 r2 l L2 r2 
 r2 l r 
 r2 l r' 
 r2 l r2 
 r2 l2 L' r 
 r2 l2 L' r' 
 r2 l2 L' r2 
 r2 l2 L r 
 r2 l2 L r' 
 r2 l2 L r2 
 r2 l2 L2 r 
 r2 l2 L2 r' 
 r2 l2 L2 r2 
 r2 l2 r 
 r2 l2 r' 
 r2 l2 r2 
 d' U u d' 
 d' U u d 
 d' U u d2 
 d' U u' d' 
 d' U u' d 
 d' U u' d2 
 d' U u2 d' 
 d' U u2 d 
 d' U u2 d2 
 d' U d' 
 d' U d 
 d' U d2 
 d' U- u d' 
 d' U- u d 
 d' U- u d2 
 d' U- u' d' 
 d' U- u' d 
 d' U- u' d2 
 d' U- u2 d' 
 d' U- u2 d 
 d' U- u2 d2 
 d' U- d' 
 d' U- d 
 d' U- d2 
 d' U2 u d' 
 d' U2 u d 
 d' U2 u d2 
 d' U2 u' d' 
 d' U2 u' d 
 d' U2 u' d2 
 d' U2 u2 d' 
 d' U2 u2 d 
 d' U2 u2 d2 
 d' U2 d' 
 d' U2 d 
 d' U2 d2 
 d' u U d' 
 d' u U d 
 d' u U d2 
 d' u U- d' 
 d' u U- d 
 d' u U- d2 
 d' u U2 d' 
 d' u U2 d 
 d' u U2 d2 
 d' u d' 
 d' u d 
 d' u d2 
 d' u' U d' 
 d' u' U d 
 d' u' U d2 
 d' u' U- d' 
 d' u' U- d 
 d' u' U- d2 
 d' u' U2 d' 
 d' u' U2 d 
 d' u' U2 d2 
 d' u' d' 
 d' u' d 
 d' u' d2 
 d' u2 U d' 
 d' u2 U d 
 d' u2 U d2 
 d' u2 U- d' 
 d' u2 U- d 
 d' u2 U- d2 
 d' u2 U2 d' 
 d' u2 U2 d 
 d' u2 U2 d2 
 d' u2 d' 
 d' u2 d 
 d' u2 d2 
 d U u d' 
 d U u d 
 d U u d2 
 d U u' d' 
 d U u' d 
 d U u' d2 
 d U u2 d' 
 d U u2 d 
 d U u2 d2 
 d U d' 
 d U d 
 d U d2 
 d U- u d' 
 d U- u d 
 d U- u d2 
 d U- u' d' 
 d U- u' d 
 d U- u' d2 
 d U- u2 d' 
 d U- u2 d 
 d U- u2 d2 
 d U- d' 
 d U- d 
 d U- d2 
 d U2 u d' 
 d U2 u d 
 d U2 u d2 
 d U2 u' d' 
 d U2 u' d 
 d U2 u' d2 
 d U2 u2 d' 
 d U2 u2 d 
 d U2 u2 d2 
 d U2 d' 
 d U2 d 
 d U2 d2 
 d u U d' 
 d u U d 
 d u U d2 
 d u U- d' 
 d u U- d 
 d u U- d2 
 d u U2 d' 
 d u U2 d 
 d u U2 d2 
 d u d' 
 d u d 
 d u d2 
 d u' U d' 
 d u' U d 
 d u' U d2 
 d u' U- d' 
 d u' U- d 
 d u' U- d2 
 d u' U2 d' 
 d u' U2 d 
 d u' U2 d2 
 d u' d' 
 d u' d 
 d u' d2 
 d u2 U d' 
 d u2 U d 
 d u2 U d2 
 d u2 U- d' 
 d u2 U- d 
 d u2 U- d2 
 d u2 U2 d' 
 d u2 U2 d 
 d u2 U2 d2 
 d u2 d' 
 d u2 d 
 d u2 d2 
 d2 U u d' 
 d2 U u d 
 d2 U u d2 
 d2 U u' d' 
 d2 U u' d 
 d2 U u' d2 
 d2 U u2 d' 
 d2 U u2 d 
 d2 U u2 d2 
 d2 U d' 
 d2 U d 
 d2 U d2 
 d2 U- u d' 
 d2 U- u d 
 d2 U- u d2 
 d2 U- u' d' 
 d2 U- u' d 
 d2 U- u' d2 
 d2 U- u2 d' 
 d2 U- u2 d 
 d2 U- u2 d2 
 d2 U- d' 
 d2 U- d 
 d2 U- d2 
 d2 U2 u d' 
 d2 U2 u d 
 d2 U2 u d2 
 d2 U2 u' d' 
 d2 U2 u' d 
 d2 U2 u' d2 
 d2 U2 u2 d' 
 d2 U2 u2 d 
 d2 U2 u2 d2 
 d2 U2 d' 
 d2 U2 d 
 d2 U2 d2 
 d2 u U d' 
 d2 u U d 
 d2 u U d2 
 d2 u U- d' 
 d2 u U- d 
 d2 u U- d2 
 d2 u U2 d' 
 d2 u U2 d 
 d2 u U2 d2 
 d2 u d' 
 d2 u d 
 d2 u d2 
 d2 u' U d' 
 d2 u' U d 
 d2 u' U d2 
 d2 u' U- d' 
 d2 u' U- d 
 d2 u' U- d2 
 d2 u' U2 d' 
 d2 u' U2 d 
 d2 u' U2 d2 
 d2 u' d' 
 d2 u' d 
 d2 u' d2 
 d2 u2 U d' 
 d2 u2 U d 
 d2 u2 U d2 
 d2 u2 U- d' 
 d2 u2 U- d 
 d2 u2 U- d2 
 d2 u2 U2 d' 
 d2 u2 U2 d 
 d2 u2 U2 d2 
 d2 u2 d' 
 d2 u2 d 
 d2 u2 d2 
 b' F f b' 
 b' F f b 
 b' F f b2 
 b' F f' b' 
 b' F f' b 
 b' F f' b2 
 b' F f2 b' 
 b' F f2 b 
 b' F f2 b2 
 b' F b' 
 b' F b 
 b' F b2 
 b' F' f b' 
 b' F' f b 
 b' F' f b2 
 b' F' f' b' 
 b' F' f' b 
 b' F' f' b2 
 b' F' f2 b' 
 b' F' f2 b 
 b' F' f2 b2 
 b' F' b' 
 b' F' b 
 b' F' b2 
 b' F2 f b' 
 b' F2 f b 
 b' F2 f b2 
 b' F2 f' b' 
 b' F2 f' b 
 b' F2 f' b2 
 b' F2 f2 b' 
 b' F2 f2 b 
 b' F2 f2 b2 
 b' F2 b' 
 b' F2 b 
 b' F2 b2 
 b' f F b' 
 b' f F b 
 b' f F b2 
 b' f F' b' 
 b' f F' b 
 b' f F' b2 
 b' f F2 b' 
 b' f F2 b 
 b' f F2 b2 
 b' f b' 
 b' f b 
 b' f b2 
 b' f' F b' 
 b' f' F b 
 b' f' F b2 
 b' f' F' b' 
 b' f' F' b 
 b' f' F' b2 
 b' f' F2 b' 
 b' f' F2 b 
 b' f' F2 b2 
 b' f' b' 
 b' f' b 
 b' f' b2 
 b' f2 F b' 
 b' f2 F b 
 b' f2 F b2 
 b' f2 F' b' 
 b' f2 F' b 
 b' f2 F' b2 
 b' f2 F2 b' 
 b' f2 F2 b 
 b' f2 F2 b2 
 b' f2 b' 
 b' f2 b 
 b' f2 b2 
 b F f b' 
 b F f b 
 b F f b2 
 b F f' b' 
 b F f' b 
 b F f' b2 
 b F f2 b' 
 b F f2 b 
 b F f2 b2 
 b F b' 
 b F b 
 b F b2 
 b F' f b' 
 b F' f b 
 b F' f b2 
 b F' f' b' 
 b F' f' b 
 b F' f' b2 
 b F' f2 b' 
 b F' f2 b 
 b F' f2 b2 
 b F' b' 
 b F' b 
 b F' b2 
 b F2 f b' 
 b F2 f b 
 b F2 f b2 
 b F2 f' b' 
 b F2 f' b 
 b F2 f' b2 
 b F2 f2 b' 
 b F2 f2 b 
 b F2 f2 b2 
 b F2 b' 
 b F2 b 
 b F2 b2 
 b f F b' 
 b f F b 
 b f F b2 
 b f F' b' 
 b f F' b 
 b f F' b2 
 b f F2 b' 
 b f F2 b 
 b f F2 b2 
 b f b' 
 b f b 
 b f b2 
 b f' F b' 
 b f' F b 
 b f' F b2 
 b f' F' b' 
 b f' F' b 
 b f' F' b2 
 b f' F2 b' 
 b f' F2 b 
 b f' F2 b2 
 b f' b' 
 b f' b 
 b f' b2 
 b f2 F b' 
 b f2 F b 
 b f2 F b2 
 b f2 F' b' 
 b f2 F' b 
 b f2 F' b2 
 b f2 F2 b' 
 b f2 F2 b 
 b f2 F2 b2 
 b f2 b' 
 b f2 b 
 b f2 b2 
 b2 F f b' 
 b2 F f b 
 b2 F f b2 
 b2 F f' b' 
 b2 F f' b 
 b2 F f' b2 
 b2 F f2 b' 
 b2 F f2 b 
 b2 F f2 b2 
 b2 F b' 
 b2 F b 
 b2 F b2 
 b2 F' f b' 
 b2 F' f b 
 b2 F' f b2 
 b2 F' f' b' 
 b2 F' f' b 
 b2 F' f' b2 
 b2 F' f2 b' 
 b2 F' f2 b 
 b2 F' f2 b2 
 b2 F' b' 
 b2 F' b 
 b2 F' b2 
 b2 F2 f b' 
 b2 F2 f b 
 b2 F2 f b2 
 b2 F2 f' b' 
 b2 F2 f' b 
 b2 F2 f' b2 
 b2 F2 f2 b' 
 b2 F2 f2 b 
 b2 F2 f2 b2 
 b2 F2 b' 
 b2 F2 b 
 b2 F2 b2 
 b2 f F b' 
 b2 f F b 
 b2 f F b2 
 b2 f F' b' 
 b2 f F' b 
 b2 f F' b2 
 b2 f F2 b' 
 b2 f F2 b 
 b2 f F2 b2 
 b2 f b' 
 b2 f b 
 b2 f b2 
 b2 f' F b' 
 b2 f' F b 
 b2 f' F b2 
 b2 f' F' b' 
 b2 f' F' b 
 b2 f' F' b2 
 b2 f' F2 b' 
 b2 f' F2 b 
 b2 f' F2 b2 
 b2 f' b' 
 b2 f' b 
 b2 f' b2 
 b2 f2 F b' 
 b2 f2 F b 
 b2 f2 F b2 
 b2 f2 F' b' 
 b2 f2 F' b 
 b2 f2 F' b2 
 b2 f2 F2 b' 
 b2 f2 F2 b 
 b2 f2 F2 b2 
 b2 f2 b' 
 b2 f2 b 
 b2 f2 b2 
 l' R r l' 
 l' R r l 
 l' R r l2 
 l' R r' l' 
 l' R r' l 
 l' R r' l2 
 l' R r2 l' 
 l' R r2 l 
 l' R r2 l2 
 l' R l' 
 l' R l 
 l' R l2 
 l' R' r l' 
 l' R' r l 
 l' R' r l2 
 l' R' r' l' 
 l' R' r' l 
 l' R' r' l2 
 l' R' r2 l' 
 l' R' r2 l 
 l' R' r2 l2 
 l' R' l' 
 l' R' l 
 l' R' l2 
 l' R2 r l' 
 l' R2 r l 
 l' R2 r l2 
 l' R2 r' l' 
 l' R2 r' l 
 l' R2 r' l2 
 l' R2 r2 l' 
 l' R2 r2 l 
 l' R2 r2 l2 
 l' R2 l' 
 l' R2 l 
 l' R2 l2 
 l' r R l' 
 l' r R l 
 l' r R l2 
 l' r R' l' 
 l' r R' l 
 l' r R' l2 
 l' r R2 l' 
 l' r R2 l 
 l' r R2 l2 
 l' r l' 
 l' r l 
 l' r l2 
 l' r' R l' 
 l' r' R l 
 l' r' R l2 
 l' r' R' l' 
 l' r' R' l 
 l' r' R' l2 
 l' r' R2 l' 
 l' r' R2 l 
 l' r' R2 l2 
 l' r' l' 
 l' r' l 
 l' r' l2 
 l' r2 R l' 
 l' r2 R l 
 l' r2 R l2 
 l' r2 R' l' 
 l' r2 R' l 
 l' r2 R' l2 
 l' r2 R2 l' 
 l' r2 R2 l 
 l' r2 R2 l2 
 l' r2 l' 
 l' r2 l 
 l' r2 l2 
 l R r l' 
 l R r l 
 l R r l2 
 l R r' l' 
 l R r' l 
 l R r' l2 
 l R r2 l' 
 l R r2 l 
 l R r2 l2 
 l R l' 
 l R l 
 l R l2 
 l R' r l' 
 l R' r l 
 l R' r l2 
 l R' r' l' 
 l R' r' l 
 l R' r' l2 
 l R' r2 l' 
 l R' r2 l 
 l R' r2 l2 
 l R' l' 
 l R' l 
 l R' l2 
 l R2 r l' 
 l R2 r l 
 l R2 r l2 
 l R2 r' l' 
 l R2 r' l 
 l R2 r' l2 
 l R2 r2 l' 
 l R2 r2 l 
 l R2 r2 l2 
 l R2 l' 
 l R2 l 
 l R2 l2 
 l r R l' 
 l r R l 
 l r R l2 
 l r R' l' 
 l r R' l 
 l r R' l2 
 l r R2 l' 
 l r R2 l 
 l r R2 l2 
 l r l' 
 l r l 
 l r l2 
 l r' R l' 
 l r' R l 
 l r' R l2 
 l r' R' l' 
 l r' R' l 
 l r' R' l2 
 l r' R2 l' 
 l r' R2 l 
 l r' R2 l2 
 l r' l' 
 l r' l 
 l r' l2 
 l r2 R l' 
 l r2 R l 
 l r2 R l2 
 l r2 R' l' 
 l r2 R' l 
 l r2 R' l2 
 l r2 R2 l' 
 l r2 R2 l 
 l r2 R2 l2 
 l r2 l' 
 l r2 l 
 l r2 l2 
 l2 R r l' 
 l2 R r l 
 l2 R r l2 
 l2 R r' l' 
 l2 R r' l 
 l2 R r' l2 
 l2 R r2 l' 
 l2 R r2 l 
 l2 R r2 l2 
 l2 R l' 
 l2 R l 
 l2 R l2 
 l2 R' r l' 
 l2 R' r l 
 l2 R' r l2 
 l2 R' r' l' 
 l2 R' r' l 
 l2 R' r' l2 
 l2 R' r2 l' 
 l2 R' r2 l 
 l2 R' r2 l2 
 l2 R' l' 
 l2 R' l 
 l2 R' l2 
 l2 R2 r l' 
 l2 R2 r l 
 l2 R2 r l2 
 l2 R2 r' l' 
 l2 R2 r' l 
 l2 R2 r' l2 
 l2 R2 r2 l' 
 l2 R2 r2 l 
 l2 R2 r2 l2 
 l2 R2 l' 
 l2 R2 l 
 l2 R2 l2 
 l2 r R l' 
 l2 r R l 
 l2 r R l2 
 l2 r R' l' 
 l2 r R' l 
 l2 r R' l2 
 l2 r R2 l' 
 l2 r R2 l 
 l2 r R2 l2 
 l2 r l' 
 l2 r l 
 l2 r l2 
 l2 r' R l' 
 l2 r' R l 
 l2 r' R l2 
 l2 r' R' l' 
 l2 r' R' l 
 l2 r' R' l2 
 l2 r' R2 l' 
 l2 r' R2 l 
 l2 r' R2 l2 
 l2 r' l' 
 l2 r' l 
 l2 r' l2 
 l2 r2 R l' 
 l2 r2 R l 
 l2 r2 R l2 
 l2 r2 R' l' 
 l2 r2 R' l 
 l2 r2 R' l2 
 l2 r2 R2 l' 
 l2 r2 R2 l 
 l2 r2 R2 l2 
 l2 r2 l' 
 l2 r2 l 
 l2 r2 l2
```

It looks like each person had a different agenda and the software compliments one another nicely. The solver of CW Tasai is very fast on my machine. I entered some random scrambles and 62-68 move solutions were appearing almost as soon as I hit the enter key. Not a move-length-optimized solution, but one that appeared with stunning speed!

It looks like I am not treading on anyone's toes as I don't believe the previous authors were crazy enough to implement a "brute force only" 4x4x4 solver. My interest is exhaustive search for the purpose of find any/all shortest algos for a given "endgame" if you want to call it that. And I have an ASCII board, unlike the others 



Right now I added a feature to draw the starting problem cube to a text file, the solution, and the number of nodes explored to find the brute force results. As a test of the code, I am having it solve every possible arrangement where only 2 center pieces need to be exchanged on an otherwise solved cube. I want to know if every arrangement can be solved by a unique 8-ply solution. For example, the top-left center of the top and the bottom-right center on the front (I call this Centers T1:F4) seems to be the one requiring at least 2 turns to "orient" the centers before applying a center swapping algo. Can this "align and then apply the algo" approach be bypassed by a unique, shorter algo?

It is a simple test for starters, but one that will tell me if the pruning code I added today was done correctly. Once I know the result, I can move on to more complex tasks.


----------



## rokicki (Apr 1, 2014)

Consider adding a small corners-only pruning table. This will give you pretty deep
pruning pretty quickly (should fit in cache; can be done with 78K entries or so); check
this before you check your bigger hash table. You can even take it a step further;
each entry can contain information on what twists take you closer to solved so you
don't even need to do many of the counterproductive moves. And you can factor
the coordinate into two subcoordinates, with tiny move tables, so the instruction
count is very minimal.

Average depth from solved on the 2x2x2 is somewhere around 10. This should
help keep you out of the weeds.

Edit:
After the corners-only table, you might consider adding a pruning table for two adjacent
corners, the two edges between them, and four same-color centers. I think this could
be done with a pruning table of perhaps 100MB, and you'll probably get a pretty good
distance on this. Further, this pruning table can be applied in 24 different ways to the
revenge; you can keep an pseudo-LRU table of which ones to check first.

If you have enough RAM you might choose to do one corner, four same-color centers,
and four of the edges near that corner around those centers. This will take a table
with 2.7B entries, which you can compact in a number of ways (using four, or two, or
1.6 bits per entry).

What you want to find is a pruning table that gives you the greatest average depth, and
I believe focusing on a small number of adjacent cubies will probably do this. Further,
you can exploit the adjacencies in various ways. Also, lookups are cheaper if you don't
need to examine as much cube state. Finally, you probably want to include cubies of
each "type" so you don't get lost in big non-solution areas that your pruning table has
a weak spot for.

For instance, my 3x3 optimal solver from about 2002/2003 focused on the top face cubies
only, and was able to get excellent performance.

-tom


----------



## unsolved (Apr 1, 2014)

rokicki said:


> Consider adding a small corners-only pruning table.
> -tom



I'm afraid I don't know what you mean. I am not building a scramble-solver via algorithms. I am building, basically, a bruce force algorithm finder/verifier.

The sun would run out of Hydrogen by the time I got to a depth of 18 moves, for example, nowhere near enough to solve a sufficiently scrambled cube.


----------



## rokicki (Apr 1, 2014)

The simplest way to visualize it is probably this.

Build a table storing the depth for each position of the revenge---but *only* consider the
corners. Ignore the edges and the centers *completely*. (You need to start with 24
entries at 0 because there are 24 different solution orientations, and you can populate it
by breadth-first search.)

Now, in your search recursion, at each step, look up your current position using *only* the
corners. If the table says you are too far away using only the corners, the position of
the other cubies don't matter---you're simply too far away.

That table, using a naive implementation, would have 8! * 3^7 or about 88M entries. You
can reduce this to about 78K entries by using the 1152-order symmetries of the 2x2x2.

The average depth of this table is, I think, about 9. Thus, you get very easy, fast,
and relatively deep pruning.

There are a lot of ways to make this faster once you have it working, but the basic idea
is simple: ignore everything but the corners. If corners "pass", then apply your other
search tree pruning techniques.


----------



## unsolved (Apr 1, 2014)

rokicki said:


> The simplest way to visualize it is probably this.
> 
> Build a table storing the depth for each position of the revenge---but *only* consider the
> corners.



I understand now. Speed cubers solve the corners last. In my lame way of solving, I do them much, much earlier. I solve the centers and dedges last.


----------



## Stefan (Apr 2, 2014)

unsolved said:


> I understand now. Speed cubers solve the corners last.



I don't think it has anything to do with solving corners last.


----------



## unsolved (Apr 2, 2014)

Stefan said:


> I don't think it has anything to do with solving corners last.



I mean, consider the 16 positions I solved here:

http://www.speedsolving.com/forum/showthread.php?47000-4X4X4-Fastest-Center-Solves-For-All-16-UF-cases

The corners are all solved, as are all of the edges.

Any algorithm to probe the configuration of the corners would be of no help. Or are you doing something other than I am imagining?


----------



## Stefan (Apr 2, 2014)

Ah, ok, sorry. Indeed, those cases are probably inner-slice heavy and corners are (almost) solved most of the time, so I don't see it being any good for that, either.


----------



## rokicki (Apr 2, 2014)

Corners will help prune the *search* a lot. You spend most of the time
in any standard IDA* search right at the outer limits of your pruning table.
Your search tree includes many move sequences that disturb the corners.
Let's say you are eight moves into a search, with a target depth of 15,
and the table says you are eight moves away from a corner solution. You
know then that you can prune your search immediately and backtrack.
No need to consider any further subnodes.


----------



## unsolved (Apr 2, 2014)

rokicki said:


> Corners will help prune the *search* a lot. You spend most of the time
> in any standard IDA* search right at the outer limits of your pruning table.
> Your search tree includes many move sequences that disturb the corners.
> Let's say you are eight moves into a search, with a target depth of 15,
> ...



OK the concept of probing a database of presolved distances I understand, and I have that option.

I stored all 5-turn configurations of ALL 4x4x4 cube positions into a 6.5 GB buffer. I didn't bother probing it for the center solves because I was essentially benchmarking the solver speed.

There are countless 4x4x4 inner configurations possible for every set of corner-only data. I don't think this 3x3x3 shortcut can help with the 4x4x4, but I would love it if it did.
I just need to gain a better understanding of it.

I have a COMMUTATOR FILTER now, which speeds up things tremendously for solves where you know it is a commutator solution.


----------



## cuBerBruce (Apr 2, 2014)

unsolved said:


> I stored all 5-turn configurations of ALL 4x4x4 cube positions into a 6.5 GB buffer. I didn't bother probing it for the center solves because I was essentially benchmarking the solver speed.
> 
> There are countless 4x4x4 inner configurations possible for every set of corner-only data. I don't think this 3x3x3 shortcut can help with the 4x4x4, but I would love it if it did.
> I just need to gain a better understanding of it.



I am not sure exactly what your goals are with the solver you're writing. It seemed at first you were intending to generate optimal solutions for a specified position. But I'm not clear that some of what you are doing to increase its speed may be at the expense of guaranteeing optimal solutions for some metric.

An optimal solver is a type of solver that *guarantees* that a solution of the shortest possible length will be found (assuming the program runs for a long enough time) for some move metric. Such solvers typically use an iterative-deepening depth-first search. I suggest reading http://www.jaapsch.net/puzzles/compcube.htm to learn about some of the basic techniques that are used in quality solver programs. The documentation for Cube Explorer can also be good to read.

Your table of positions up to depth 5 uses a lot of memory, and can tell you if a given position is at least 6 moves from solved or not. The corner pruning table suggested by Tom needs a lot less memory and can often detect if a position is at least 9 moves from solved. In a depth-first search, being able to abort a search path 3 moves earlier can save a lot of "useless" searching. If your average branching factor is 28 moves, each time you prune 3 moves earlier would save about 28 + 28^2 + 28^3 = 22764 positions from being generated.


----------



## unsolved (Apr 2, 2014)

cuBerBruce said:


> I am not sure exactly what your goals are with the solver you're writing.



I want to find the optimal solution for any position within the horizon of the search.



cuBerBruce said:


> It seemed at first you were intending to generate optimal solutions for a specified position.



When I was testing the move generator and benchmarking its speed, yes. When it got faster, I fed it a whole family of center positions to solve, and someone remarked that one of the solutions was a new commutator.



cuBerBruce said:


> But I'm not clear that some of what you are doing to increase its speed may be at the expense of guaranteeing optimal solutions for some metric.



I do iterative deepening, one-ply at a time. At each leaf node, I test to see if the cube is solved. If not, I can probe a 1-turn-from-solved, 2-tfs, 3-tfs, 4-tfs, and 5-tfs database. I probe from smallest (1) to largest (5). If I get a hit, I know that I can solve it in at least that many turns. 

At this point, I can take one of two paths:

1) Announce a win in however many moves and quit.
2) Continue searching

Option 2) is for determining if you can win more quickly than the tfs database. After all, I have not explored every leaf node at the current level. If I hit the 1-tfs database, there is no need to continue. I can't be less than 1 move away from solving the cube. But if I hit the 5-tfs database, that doesn't mean there isn't a 3-tfs position that is in there that I did not encounter yet from the current level of search.



cuBerBruce said:


> I suggest reading http://www.jaapsch.net/puzzles/compcube.htm to learn about some of the basic techniques that are used in quality solver programs. The documentation for Cube Explorer can also be good to read.



I thank you for the references, I will take a look.



cuBerBruce said:


> Your table of positions up to depth 5 uses a lot of memory, and can tell you if a given position is at least 6 moves from solved or not. The corner pruning table suggested by Tom needs a lot less memory and can often detect if a position is at least 9 moves from solved. In a depth-first search, being able to abort a search path 3 moves earlier can save a lot of "useless" searching. If your average branching factor is 28 moves, each time you prune 3 moves earlier would save about 28 + 28^2 + 28^3 = 22764 positions from being generated.



The branching factor varies based on two types of pruning:

1. Parallel face pruning
2. Non-Commutator pruning

If a solution is suspected to be of a commutator format, I can prune the heck out of the tree by setting a user-defined variable and hacking out any sequence where all the moves aren't zeroed in the end. I can even skip odd-plies in the search.

Parallel face pruning is less of a chainsaw, but still decent. I have not compiled explicit numbers for each as of yet.

I finally decided on a name for this program: *Omnia Obtorquebantur 4x4x4*

It means "All [sides/cubes] will be turned." I guess you can just call it OO 4x4x4. And, if it is successful, I will code a 5x5x5 version.


----------



## Stefan (Apr 2, 2014)

unsolved said:


> I fed it a whole family of center positions to solve, and someone remarked that one of the solutions was a new commutator.



New *to him*, I believe.


----------



## cmhardw (Apr 2, 2014)

Stefan said:


> New *to him*, I believe.



Yes, new to me. It is similar to a known corner commutator, but applied on the 4x4x4 in a way that I would not have thought to try.


----------



## unsolved (Apr 2, 2014)

cmhardw said:


> Yes, new to me. It is similar to a known corner commutator, but applied on the 4x4x4 in a way that I would not have thought to try.



Send me a move scramble to get a cube to that 3-cycle center you want me to test. The new code is running so much faster. I don't understand the other notation you posted yesterday.


----------



## irontwig (Apr 2, 2014)

unsolved said:


> Send me a move scramble to get a cube to that 3-cycle center you want me to test. The new code is running so much faster. I don't understand the other notation you posted yesterday.



It's this guy (clicky)


----------



## unsolved (Apr 2, 2014)

irontwig said:


> It's this guy (clicky)



OK, the search has started! I have the 1-turn-from-solve database re-coded as a rapid lookup function that uses 0-bytes of disk space  Should be interesting to see how this performs. I want to see if the "auto-skip next ply" code is working. After 6 plies, if none of the 1-tfs database positions are hit, then there is no need to iterate over ply 7, and the search can proceed directly to ply 8. At ply 8 it will also find a 9-ply result if there is one.


----------



## cmhardw (Apr 2, 2014)

irontwig said:


> It's this guy (clicky)





unsolved said:


> OK, the search has started! I have the 1-turn-from-solve database re-coded as a rapid lookup function that uses 0-bytes of disk space  Should be interesting to see how this performs. I want to see if the "auto-skip next ply" code is working. After 6 plies, if none of the 1-tfs database positions are hit, then there is no need to iterate over ply 7, and the search can proceed directly to ply 8. At ply 8 it will also find a 9-ply result if there is one.
> 
> View attachment 3829



Yes that is the case I am curious about! Thank you both. I was inspired by the, as far as I know relatively recent, discovery of "pseudo-slice" commutators of the form [D b D', l'] and [(Uu) r (Uu)', l'] and wondered if the case you are currently searching could be done a different way than people have tried before. I'm particularly curious if it can be done in fewer than 10 turns in block turn metric.


----------



## irontwig (Apr 2, 2014)

Just one thing, if you plan to use this to generate algs, you might want to check for symmetries and ignore moves that only affects solved pieces at the start.


----------



## cmhardw (Apr 2, 2014)

irontwig said:


> Just one thing, if you plan to use this to generate algs, you might want to check for symmetries and *ignore moves that only affects solved pieces at the start.*



Doesn't cmowla's proposed (proven?) optimal length parity algorithm for wing edges turn only solved pieces on the first turn (or last turn you do the inverse alg)?


----------



## irontwig (Apr 2, 2014)

Well, those cases are exceptions and you can always do a cyclic shift if you find that kind of solution.


----------



## unsolved (Apr 2, 2014)

cmowla said:


> I too am interested to see if this solver can find a 9 mover.



So far, on the 8th ply with the 1-turn-from-solve (1-tfs) database being accessed at every leaf node. That means if a move sequence fails to return "solved," it checks the cube to see if it is 1-move away from being completed. So, it is kind of like a 8 and 9-ply search carried out in tandem. If it probes all leaf nodes at depth 8, and no solution is found, that means ply-9 can be skipped and it can go directly to ply-10. But it is already known that there is a 10-ply answer.

If you guys have 64-bit hardware, I can give you this specifically-compiled version of it to test on your own machines. It will only solve this hard-coded case though.


----------



## cuBerBruce (Apr 3, 2014)

I tried my own optimal solver on cmhardw's position. I did not find any distance 9 solutions (single slice turn metric). Below is the output a third way through distance 10.


```
scramble: [10]  F  d  R2 d3 r3 d  R2 d3 r  F3
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        414   solved state checks        126
distance  5   node count      13014   solved state checks       3309
distance  6   node count     273291   solved state checks      60429
distance  7   node count    5007999   solved state checks    1049622
distance  8   node count   90199848   solved state checks   18065829
distance  9   node count 1607782779   solved state checks  311450757
Found solution: [10]  U  f3 l  F2 l3 f  l  F2 l3 U3
Found solution: [10]  U3 b3 R2 b  r  b3 R2 b  r3 U
Found solution: [10]  u  r3 F2 r  f  r3 F2 r  f3 u3
Found solution: [10]  u3 r3 f  R2 f3 r  f  R2 f3 u
```


----------



## unsolved (Apr 3, 2014)

cuBerBruce said:


> I tried my own optimal solver on cmhardw's position. I did not find any distance 9 solutions (single slice turn metric). Below is the output a third way through distance 10.
> 
> 
> ```
> ...



Can you explain your output up there Bruce? Like where the numbers come from and what the notation is? I don't recognize the f3 U3 stuff. Noob here


----------



## cuBerBruce (Apr 3, 2014)

unsolved said:


> Can you explain your output up there Bruce? Like where the numbers come from and what the notation is? I don't recognize the f3 U3 stuff. Noob here



The "distance" numbers indicates the actual goal value (desired solution length) for each step of the iterative deepening.

"Node count" simply indicates how many positions are generated in the depth first search. There is a pruning table based on 8 centers for two opposite faces that indicates the initial position requires at least 4 moves to solve. So when the search goal is less than 4, it doesn't have to search at all. In the future, I will just start the iterative deepening with a goal of 4 moves (or whatever lower bound I get from the pruning tables).

"Solved state checks" indicates how many branches of the depth-first search tree actually reach the goal number of moves. When this happens I need to check if the cube is actually in a solved state.

"f3" should really be f'. Similarly for the other 3's in the move sequences. Rotating a layer 3 quarter turns clockwise is equivalent to rotating a layer one quarter turn counterclockwise. Upper case is for the face layer and lower case is for the next layer in.

The numbers in square brackets just indicate the length of the scramble or the solution.


----------



## unsolved (Apr 3, 2014)

cuBerBruce said:


> The "distance" numbers indicates the actual goal value (desired solution length) for each step of the iterative deepening.
> 
> "Node count" simply indicates how many positions are generated in the depth first search. There is a pruning table based on 8 centers for two opposite faces that indicates the initial position requires at least 4 moves to solve. So when the search goal is less than 4, it doesn't have to search at all. In the future, I will just start the iterative deepening with a goal of 4 moves (or whatever lower bound I get from the pruning tables).
> 
> ...



OK, thanks.

Are you using a bit-move generator, or matrices and arrays?

I'd like to compare code at one point.

I can send you my Commutator Prune Code and my 1-turn-from-solved code (a "0-position" database, all done with IF statements. Actually finds stuff 1 ply sooner, and even when it fails, you can increment 2 plies in iterative deepening rather than 1.)

My game tree is still prohibitively large, even with the parallel face pruning code:


```
unsigned short prune_parallel_rotations(unsigned short i, unsigned short j, unsigned short k)
{
	/****************************************************************/
	/* 3-ply prunes of moves such as :                              */
	/*                                  T+ B+ T+  (same as T2 B+)   */
	/*                                  T+ B+ T-  (same as B+)      */
	/*                                  T+ B+ T2  (same as T- B+)   */
	/****************************************************************/
	if((i >= T___PLUS____) && (i <= T___TWICE___))
	if(((j >= B___PLUS____) && (j <= B___TWICE___)) || ((j >= b___PLUS____) && (j <= b___TWICE___)))
	if((k >= T___PLUS____) && (k <= T___TWICE___)) return 1;

	if((i >= t___PLUS____) && (i <= t___TWICE___))
	if(((j >= B___PLUS____) && (j <= B___TWICE___)) || ((j >= b___PLUS____) && (j <= b___TWICE___)))
	if((k >= t___PLUS____) && (k <= t___TWICE___)) return 1;

	if((i >= B___PLUS____) && (i <= B___TWICE___))
	if(((j >= T___PLUS____) && (j <= T___TWICE___)) || ((j >= t___PLUS____) && (j <= t___TWICE___)))
	if((k >= B___PLUS____) && (k <= B___TWICE___)) return 1;

	if((i >= b___PLUS____) && (i <= b___TWICE___))
	if(((j >= T___PLUS____) && (j <= T___TWICE___)) || ((j >= t___PLUS____) && (j <= t___TWICE___)))
	if((k >= b___PLUS____) && (k <= b___TWICE___)) return 1;

	/****************************************************************/
	/* 3-ply prunes of moves such as :                              */
	/*                                  F+ K+ F+  (same as F2 K+)   */
	/*                                  F+ K+ F-  (same as K+)      */
	/*                                  F+ K+ F2  (same as F- K+)   */
	/****************************************************************/

	if((i >= F___PLUS____) && (i <= F___TWICE___))
	if(((j >= K___PLUS____) && (j <= K___TWICE___)) || ((j >= k___PLUS____) && (j <= k___TWICE___)))
	if((k >= F___PLUS____) && (k <= F___TWICE___)) return 1;

	if((i >= f___PLUS____) && (i <= f___TWICE___))
	if(((j >= K___PLUS____) && (j <= K___TWICE___)) || ((j >= k___PLUS____) && (j <= k___TWICE___)))
	if((k >= f___PLUS____) && (k <= f___TWICE___)) return 1;

	if((i >= K___PLUS____) && (i <= K___TWICE___))
	if(((j >= F___PLUS____) && (j <= F___TWICE___)) || ((j >= f___PLUS____) && (j <= f___TWICE___)))
	if((k >= K___PLUS____) && (k <= K___TWICE___)) return 1;

	if((i >= k___PLUS____) && (i <= k___TWICE___))
	if(((j >= F___PLUS____) && (j <= F___TWICE___)) || ((j >= f___PLUS____) && (j <= f___TWICE___)))
	if((k >= k___PLUS____) && (k <= k___TWICE___)) return 1;

	/****************************************************************/
	/* 3-ply prunes of moves such as :                              */
	/*                                  R+ L+ R+  (same as R2 L+)   */
	/*                                  R+ L+ R-  (same as L+)      */
	/*                                  R+ L+ R2  (same as R- L+)   */
	/****************************************************************/

	if((i >= R___PLUS____) && (i <= R___TWICE___))
	if(((j >= L___PLUS____) && (j <= L___TWICE___)) || ((j >= l___PLUS____) && (j <= l___TWICE___)))
	if((k >= R___PLUS____) && (k <= R___TWICE___)) return 1;

	if((i >= r___PLUS____) && (i <= r___TWICE___))
	if(((j >= L___PLUS____) && (j <= L___TWICE___)) || ((j >= l___PLUS____) && (j <= l___TWICE___)))
	if((k >= r___PLUS____) && (k <= r___TWICE___)) return 1;

	if((i >= L___PLUS____) && (i <= L___TWICE___))
	if(((j >= R___PLUS____) && (j <= R___TWICE___)) || ((j >= r___PLUS____) && (j <= r___TWICE___)))
	if((k >= L___PLUS____) && (k <= L___TWICE___)) return 1;

	if((i >= l___PLUS____) && (i <= l___TWICE___))
	if(((j >= R___PLUS____) && (j <= R___TWICE___)) || ((j >= r___PLUS____) && (j <= r___TWICE___)))
	if((k >= l___PLUS____) && (k <= l___TWICE___)) return 1;
	
	return 0;
}

unsigned short prune_parallel_rotations(unsigned short a, unsigned short b, unsigned short c, unsigned short d)
{
	if(((a >= T___PLUS____) && (a <= T___TWICE___)) || ((a >= B___PLUS____) && (a <= B___TWICE___)) || ((a >= t___PLUS____) && (a <= t___TWICE___)) || ((a >= b___PLUS____) && (a <= b___TWICE___)))
	if(((b >= T___PLUS____) && (b <= T___TWICE___)) || ((b >= B___PLUS____) && (b <= B___TWICE___)) || ((b >= t___PLUS____) && (b <= t___TWICE___)) || ((b >= b___PLUS____) && (b <= b___TWICE___)))
	if(((c >= T___PLUS____) && (c <= T___TWICE___)) || ((c >= B___PLUS____) && (c <= B___TWICE___)) || ((c >= t___PLUS____) && (c <= t___TWICE___)) || ((c >= b___PLUS____) && (c <= b___TWICE___)))
	if(((d >= T___PLUS____) && (d <= T___TWICE___)) || ((d >= B___PLUS____) && (d <= B___TWICE___)) || ((d >= t___PLUS____) && (d <= t___TWICE___)) || ((d >= b___PLUS____) && (d <= b___TWICE___)))
	return 1;

	if(((a >= F___PLUS____) && (a <= F___TWICE___)) || ((a >= K___PLUS____) && (a <= K___TWICE___)) || ((a >= f___PLUS____) && (a <= f___TWICE___)) || ((a >= k___PLUS____) && (a <= k___TWICE___)))
	if(((b >= F___PLUS____) && (b <= F___TWICE___)) || ((b >= K___PLUS____) && (b <= K___TWICE___)) || ((b >= f___PLUS____) && (b <= f___TWICE___)) || ((b >= k___PLUS____) && (b <= k___TWICE___)))
	if(((c >= F___PLUS____) && (c <= F___TWICE___)) || ((c >= K___PLUS____) && (c <= K___TWICE___)) || ((c >= f___PLUS____) && (c <= f___TWICE___)) || ((c >= k___PLUS____) && (c <= k___TWICE___)))
	if(((d >= F___PLUS____) && (d <= F___TWICE___)) || ((d >= K___PLUS____) && (d <= K___TWICE___)) || ((d >= f___PLUS____) && (d <= f___TWICE___)) || ((d >= k___PLUS____) && (d <= k___TWICE___)))
	return 1;

	if(((a >= R___PLUS____) && (a <= R___TWICE___)) || ((a >= L___PLUS____) && (a <= L___TWICE___)) || ((a >= r___PLUS____) && (a <= r___TWICE___)) || ((a >= l___PLUS____) && (a <= l___TWICE___)))
	if(((b >= R___PLUS____) && (b <= R___TWICE___)) || ((b >= L___PLUS____) && (b <= L___TWICE___)) || ((b >= r___PLUS____) && (b <= r___TWICE___)) || ((b >= l___PLUS____) && (b <= l___TWICE___)))
	if(((c >= R___PLUS____) && (c <= R___TWICE___)) || ((c >= L___PLUS____) && (c <= L___TWICE___)) || ((c >= r___PLUS____) && (c <= r___TWICE___)) || ((c >= l___PLUS____) && (c <= l___TWICE___)))
	if(((d >= R___PLUS____) && (d <= R___TWICE___)) || ((d >= L___PLUS____) && (d <= L___TWICE___)) || ((d >= r___PLUS____) && (d <= r___TWICE___)) || ((d >= l___PLUS____) && (d <= l___TWICE___)))
	return 1;
	
	return 0;
}

unsigned short prune_parallel_rotations(unsigned short a, unsigned short b, unsigned short c, unsigned short d, unsigned short e)
{
	if(((a >= T___PLUS____) && (a <= T___TWICE___)) || ((a >= B___PLUS____) && (a <= B___TWICE___)) || ((a >= t___PLUS____) && (a <= t___TWICE___)) || ((a >= b___PLUS____) && (a <= b___TWICE___)))
	if(((b >= T___PLUS____) && (b <= T___TWICE___)) || ((b >= B___PLUS____) && (b <= B___TWICE___)) || ((b >= t___PLUS____) && (b <= t___TWICE___)) || ((b >= b___PLUS____) && (b <= b___TWICE___)))
	if(((c >= T___PLUS____) && (c <= T___TWICE___)) || ((c >= B___PLUS____) && (c <= B___TWICE___)) || ((c >= t___PLUS____) && (c <= t___TWICE___)) || ((c >= b___PLUS____) && (c <= b___TWICE___)))
	if(((d >= T___PLUS____) && (d <= T___TWICE___)) || ((d >= B___PLUS____) && (d <= B___TWICE___)) || ((d >= t___PLUS____) && (d <= t___TWICE___)) || ((d >= b___PLUS____) && (d <= b___TWICE___)))
	if(((e >= T___PLUS____) && (e <= T___TWICE___)) || ((e >= B___PLUS____) && (e <= B___TWICE___)) || ((e >= t___PLUS____) && (e <= t___TWICE___)) || ((e >= b___PLUS____) && (e <= b___TWICE___)))
	return 1;

	if(((a >= F___PLUS____) && (a <= F___TWICE___)) || ((a >= K___PLUS____) && (a <= K___TWICE___)) || ((a >= f___PLUS____) && (a <= f___TWICE___)) || ((a >= k___PLUS____) && (a <= k___TWICE___)))
	if(((b >= F___PLUS____) && (b <= F___TWICE___)) || ((b >= K___PLUS____) && (b <= K___TWICE___)) || ((b >= f___PLUS____) && (b <= f___TWICE___)) || ((b >= k___PLUS____) && (b <= k___TWICE___)))
	if(((c >= F___PLUS____) && (c <= F___TWICE___)) || ((c >= K___PLUS____) && (c <= K___TWICE___)) || ((c >= f___PLUS____) && (c <= f___TWICE___)) || ((c >= k___PLUS____) && (c <= k___TWICE___)))
	if(((d >= F___PLUS____) && (d <= F___TWICE___)) || ((d >= K___PLUS____) && (d <= K___TWICE___)) || ((d >= f___PLUS____) && (d <= f___TWICE___)) || ((d >= k___PLUS____) && (d <= k___TWICE___)))
	if(((e >= F___PLUS____) && (e <= F___TWICE___)) || ((e >= K___PLUS____) && (e <= K___TWICE___)) || ((e >= f___PLUS____) && (e <= f___TWICE___)) || ((e >= k___PLUS____) && (e <= k___TWICE___)))
	return 1;

	if(((a >= R___PLUS____) && (a <= R___TWICE___)) || ((a >= L___PLUS____) && (a <= L___TWICE___)) || ((a >= r___PLUS____) && (a <= r___TWICE___)) || ((a >= l___PLUS____) && (a <= l___TWICE___)))
	if(((b >= R___PLUS____) && (b <= R___TWICE___)) || ((b >= L___PLUS____) && (b <= L___TWICE___)) || ((b >= r___PLUS____) && (b <= r___TWICE___)) || ((b >= l___PLUS____) && (b <= l___TWICE___)))
	if(((c >= R___PLUS____) && (c <= R___TWICE___)) || ((c >= L___PLUS____) && (c <= L___TWICE___)) || ((c >= r___PLUS____) && (c <= r___TWICE___)) || ((c >= l___PLUS____) && (c <= l___TWICE___)))
	if(((d >= R___PLUS____) && (d <= R___TWICE___)) || ((d >= L___PLUS____) && (d <= L___TWICE___)) || ((d >= r___PLUS____) && (d <= r___TWICE___)) || ((d >= l___PLUS____) && (d <= l___TWICE___)))
	if(((e >= R___PLUS____) && (e <= R___TWICE___)) || ((e >= L___PLUS____) && (e <= L___TWICE___)) || ((e >= r___PLUS____) && (e <= r___TWICE___)) || ((e >= l___PLUS____) && (e <= l___TWICE___)))
	return 1;
	
	return 0;
}
```

Etc., for each new level in the tree, I just add one line of code to the bottom, and one more variable to be based in for overloading.


----------



## cuBerBruce (Apr 3, 2014)

unsolved said:


> Are you using a bit-move generator, or matrices and arrays?
> 
> I'd like to compare code at one point.



My program was hacked from my 5-phase solver program. Its got a lot of extra stuff from the other program that isn't used. I'll probably want to clean it up a lot before sharing it. Maybe I'll share pieces of it like you are doing.

My program uses arrays for each piece type, one element per piece. The elements in the corner array contain both permutation and orientation information. With depth-first searching, only the positions along the current search branch need to be stored, so storage required for the search tree isn't very much. The search uses a recursive procedure, one level for each move in the solution sequence.


----------



## unsolved (Apr 3, 2014)

cuBerBruce said:


> My program was hacked from my 5-phase solver program. Its got a lot of extra stuff from the other program that isn't used. I'll probably want to clean it up a lot before sharing it. Maybe I'll share pieces of it like you are doing.
> 
> My program uses arrays for each piece type, one element per piece. The elements in the corner array contain both permutation and orientation information. With depth-first searching, only the positions along the current search branch need to be stored, so storage required for the search tree isn't very much. The search uses a recursive procedure, one level for each move in the solution sequence.



The guts of my matrix version of the move generator showing the functions for R+ and R-.


```
typedef struct cube_4x4x4__arrangement
{
	unsigned char cube_top[16];
	unsigned char cube_bottom[16];
	unsigned char cube_front[16];
	unsigned char cube_back[16];
	unsigned char cube_right[16];
	unsigned char cube_left[16];
}
CUBE_4x4_ARRANGEMENT, *CUBE_4x4_ARRANGEMENT_PTR;

CUBE_4x4_ARRANGEMENT plus_right_face_move(CUBE_4x4_ARRANGEMENT original_4x4x4_cube)
{
	CUBE_4x4_ARRANGEMENT new_cube;

	new_cube = original_4x4x4_cube;

	new_cube.cube_top[4-1] = original_4x4x4_cube.cube_front[4-1];
	new_cube.cube_top[8-1] = original_4x4x4_cube.cube_front[8-1];
	new_cube.cube_top[12-1] = original_4x4x4_cube.cube_front[12-1];
	new_cube.cube_top[16-1] = original_4x4x4_cube.cube_front[16-1];

	new_cube.cube_front[4-1] = original_4x4x4_cube.cube_bottom[4-1];
	new_cube.cube_front[8-1] = original_4x4x4_cube.cube_bottom[8-1];
	new_cube.cube_front[12-1] = original_4x4x4_cube.cube_bottom[12-1];
	new_cube.cube_front[16-1] = original_4x4x4_cube.cube_bottom[16-1];

	new_cube.cube_bottom[4-1] = original_4x4x4_cube.cube_back[13-1];
	new_cube.cube_bottom[8-1] = original_4x4x4_cube.cube_back[9-1];
	new_cube.cube_bottom[12-1] = original_4x4x4_cube.cube_back[5-1];
	new_cube.cube_bottom[16-1] = original_4x4x4_cube.cube_back[1-1];

	new_cube.cube_back[1-1] = original_4x4x4_cube.cube_top[16-1];
	new_cube.cube_back[5-1] = original_4x4x4_cube.cube_top[12-1];
	new_cube.cube_back[9-1] = original_4x4x4_cube.cube_top[8-1];
	new_cube.cube_back[13-1] = original_4x4x4_cube.cube_top[4-1];

	/*********************************/
	/*       *       *       *       */
	/*  01   *  02   *  03   *   04  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  05   *  06   *  07   *   08  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  09   *  10   *  11   *   12  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  13   *  14   *  15   *   16  */
	/*       *       *       *       */
	/*********************************/


	/*********************************/
	/*       *       *       *       */
	/*  13   *  09   *  05   *   01  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  14   *  10   *  06   *   02  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  15   *  11   *  07   *   03  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  16   *  12   *  08   *   04  */
	/*       *       *       *       */
	/*********************************/

	new_cube.cube_right[1-1] = original_4x4x4_cube.cube_right[13-1];
	new_cube.cube_right[2-1] = original_4x4x4_cube.cube_right[9-1];
	new_cube.cube_right[3-1] = original_4x4x4_cube.cube_right[5-1];
	new_cube.cube_right[4-1] = original_4x4x4_cube.cube_right[1-1];

	new_cube.cube_right[5-1] = original_4x4x4_cube.cube_right[14-1];
	new_cube.cube_right[6-1] = original_4x4x4_cube.cube_right[10-1];
	new_cube.cube_right[7-1] = original_4x4x4_cube.cube_right[6-1];
	new_cube.cube_right[8-1] = original_4x4x4_cube.cube_right[2-1];

	new_cube.cube_right[9-1] = original_4x4x4_cube.cube_right[15-1];
	new_cube.cube_right[10-1] = original_4x4x4_cube.cube_right[11-1];
	new_cube.cube_right[11-1] = original_4x4x4_cube.cube_right[7-1];
	new_cube.cube_right[12-1] = original_4x4x4_cube.cube_right[3-1];

	new_cube.cube_right[13-1] = original_4x4x4_cube.cube_right[16-1];
	new_cube.cube_right[14-1] = original_4x4x4_cube.cube_right[12-1];
	new_cube.cube_right[15-1] = original_4x4x4_cube.cube_right[8-1];
	new_cube.cube_right[16-1] = original_4x4x4_cube.cube_right[4-1];

	return new_cube;
}



CUBE_4x4_ARRANGEMENT minus_right_face_move(CUBE_4x4_ARRANGEMENT original_4x4x4_cube)
{
	CUBE_4x4_ARRANGEMENT new_cube;

	new_cube = original_4x4x4_cube;

	new_cube.cube_top[4-1] = original_4x4x4_cube.cube_back[13-1];
	new_cube.cube_top[8-1] = original_4x4x4_cube.cube_back[9-1];
	new_cube.cube_top[12-1] = original_4x4x4_cube.cube_back[5-1];
	new_cube.cube_top[16-1] = original_4x4x4_cube.cube_back[1-1];

	new_cube.cube_back[13-1] = original_4x4x4_cube.cube_bottom[4-1];
	new_cube.cube_back[9-1] = original_4x4x4_cube.cube_bottom[8-1];
	new_cube.cube_back[5-1] = original_4x4x4_cube.cube_bottom[12-1];
	new_cube.cube_back[1-1] = original_4x4x4_cube.cube_bottom[16-1];

	new_cube.cube_bottom[4-1] = original_4x4x4_cube.cube_front[4-1];
	new_cube.cube_bottom[8-1] = original_4x4x4_cube.cube_front[8-1];
	new_cube.cube_bottom[12-1] = original_4x4x4_cube.cube_front[12-1];
	new_cube.cube_bottom[16-1] = original_4x4x4_cube.cube_front[16-1];

	new_cube.cube_front[4-1] = original_4x4x4_cube.cube_top[4-1];
	new_cube.cube_front[8-1] = original_4x4x4_cube.cube_top[8-1];
	new_cube.cube_front[12-1] = original_4x4x4_cube.cube_top[12-1];
	new_cube.cube_front[16-1] = original_4x4x4_cube.cube_top[16-1];

	/*********************************/
	/*       *       *       *       */
	/*  01   *  02   *  03   *   04  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  05   *  06   *  07   *   08  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  09   *  10   *  11   *   12  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  13   *  14   *  15   *   16  */
	/*       *       *       *       */
	/*********************************/


	/*********************************/
	/*       *       *       *       */
	/*  04   *  08   *  12   *   16  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  03   *  07   *  11   *   15  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  02   *  06   *  10   *   14  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  01   *  05   *  09   *   13  */
	/*       *       *       *       */
	/*********************************/

	new_cube.cube_right[1-1] = original_4x4x4_cube.cube_right[4-1];
	new_cube.cube_right[2-1] = original_4x4x4_cube.cube_right[8-1];
	new_cube.cube_right[3-1] = original_4x4x4_cube.cube_right[12-1];
	new_cube.cube_right[4-1] = original_4x4x4_cube.cube_right[16-1];

	new_cube.cube_right[5-1] = original_4x4x4_cube.cube_right[3-1];
	new_cube.cube_right[6-1] = original_4x4x4_cube.cube_right[7-1];
	new_cube.cube_right[7-1] = original_4x4x4_cube.cube_right[11-1];
	new_cube.cube_right[8-1] = original_4x4x4_cube.cube_right[15-1];

	new_cube.cube_right[9-1] = original_4x4x4_cube.cube_right[2-1];
	new_cube.cube_right[10-1] = original_4x4x4_cube.cube_right[6-1];
	new_cube.cube_right[11-1] = original_4x4x4_cube.cube_right[10-1];
	new_cube.cube_right[12-1] = original_4x4x4_cube.cube_right[14-1];

	new_cube.cube_right[13-1] = original_4x4x4_cube.cube_right[1-1];
	new_cube.cube_right[14-1] = original_4x4x4_cube.cube_right[5-1];
	new_cube.cube_right[15-1] = original_4x4x4_cube.cube_right[9-1];
	new_cube.cube_right[16-1] = original_4x4x4_cube.cube_right[13-1];

	return new_cube;
}
```

To call the function, I just pass in an index to an array of function pointers.


```
#define T___PLUS____ 0
#define T___MINUS___ 1
#define T___TWICE___ 2

#define F___PLUS____ 3
#define F___MINUS___ 4
#define F___TWICE___ 5

#define R___PLUS____ 6
#define R___MINUS___ 7
#define R___TWICE___ 8

....

#define l___PLUS____ 33
#define l___MINUS___ 34
#define l___TWICE___ 35


typedef CUBE_4x4_ARRANGEMENT (*cube_move_ptr)(CUBE_4x4_ARRANGEMENT);
cube_move_ptr cube_move_array[GLOBAL_TOTAL_LEGAL_MOVES_PER_POSITION];

void init_function_pointers(void)
{

	cube_move_array[R___PLUS____] = plus_right_face_move;
	cube_move_array[R___MINUS___] = minus_right_face_move;
	cube_move_array[R___TWICE___] = double_right_face_move;
}
```

The move generator is just lame for loop execution, nothing fancy:


```
for(i = FIRST_MOVE; i <= LAST_MOVE; i++)
for(j = FIRST_MOVE; j<= LAST_MOVE; j++)
{
	if((i/3) == (j/3)) continue;// never do the same triplet move twice in a row

	modified_cube = cube_move_array[i](original_cube);
	modified_cube = cube_move_array[j](modified_cube);
	g_total_nodes++;
	
	solved_info = solved_distance(modified_cube);
}
```


----------



## Stefan (Apr 3, 2014)

irontwig said:


> It's this guy (clicky)



This guy looks rather scrambling to me. Are you guys all seeing just a center-3-cycle when you play it?



cmhardw said:


> as far as I know relatively recent, discovery of "pseudo-slice" commutators of the form [D b D', l'] and [(Uu) r (Uu)', l']



Well, at least [post=241223]from 2009[/post] (just clarifying cause _"relatively recent"_ is rather vague and confused at least me). I btw don't really see "pseudo" in it, I've read [post=483950]this[/post] but I just see it as normal _"[affect one l-piece, turn l]"_ commutator, with the l-piece Dlb stepping out of the way with D so it's not affected when Rub steps into the l-slice with b. Similar to how a beginner can solve the 3x3 first layer corner UFR with b R b' (where the corner steps into the first layer with R, and the b temporarily gets two pieces out of the way that would otherwise be affected by the R).


----------



## unsolved (Apr 3, 2014)

Stefan said:


> This guy looks rather scrambling to me. Are you guys all seeing just a center-3-cycle when you play it?




I see this:


----------



## cmhardw (Apr 3, 2014)

Stefan said:


> Well, at least [post=241223]from 2009[/post] (just clarifying cause _"relatively recent"_ is rather vague and confused at least me).



That was longer ago than I remembered it being, but that is the post I was thinking of when referring to that type of commutator.



Stefan said:


> I btw don't really see "pseudo" in it, I've read [post=483950]this[/post] but I just see it as normal _"[affect one l-piece, turn l]"_ commutator, with the l-piece Dlb stepping out of the way with D so it's not affected when Rub steps into the l-slice with b. Similar to how a beginner can solve the 3x3 first layer corner UFR with b R b' (where the corner steps into the first layer with R, and the b temporarily gets two pieces out of the way that would otherwise be affected by the R).



Yeah it does make more sense to view the *l* slice as being temporarily broken up to do the *b* move to affect only Ubl. I prefer to have a name for each commutator type, so what would you suggest calling this case-that-should-probably-not-be-named "pseudo-slicing" ? I will think on this too.


----------



## Stefan (Apr 3, 2014)

cmhardw said:


> what would you suggest calling this case-that-should-probably-not-be-named "pseudo-slicing"?



Hmm, it's hard, what have I gotten myself into now . Maybe something with "isolation" or "left alone", as Ulb gets isolated (from all other l-pieces) so that it can move alone (with the b-turn).



unsolved said:


> I see this:
> 
> View attachment 3831



Ooooooohh... I had the _"twisty.js beta"_ checked. If I uncheck that, it looks good to me as well. Thanks.


----------



## unsolved (Apr 4, 2014)

cmhardw said:


> That was longer ago than I remembered it being, but that is the post I was thinking of when referring to that type of commutator.



I just compiled a much faster version of my program, thanks to the excellent advice I received from Jakube. 

I changed the 1-tfs database (1 turn-from-solution) into 12 pieces of logic that are accessed much more quickly than probing my bloated database 

As a result, here is an 8-ply solution (U and F centers switched) that was found in just 7 plies (since a 1-tfs position was identified 1 ply early).

lightningcloudcomputing.com/4x4x4_depth_7.zip

And, because of the search extension code, it jumps from ply 5 to 7 with "authority," since every possible 1-tfs position from ply 5 did was not encountered, it means there cannot possibly be a 6-ply solution.
Watch how fast this one is solved!


----------



## cuBerBruce (Apr 4, 2014)

unsolved said:


> And, because of the search extension code, it jumps from ply 5 to 7 with "authority," since every possible 1-tfs position from ply 5 did was not encountered, it means there cannot possibly be a 6-ply solution.


Yes, it seems to me (from what I understand about your solver), it is valid to skip "depth 6" (which in my mind is really a depth 7 search) in the iterative deepening. In fact, it seems to me you could skip "depth 2," "depth 4", and any other "even depth" searches.

However, suppose the scramble had a 7-move solution instead of 8. You would likely find the solution quicker with a "depth 6" (in my view, really a depth (6+1) search), than with a depth (7+1) search. Further, the depth (7+1) search might find many suboptimal 8-move solutions before finding an optimal 7-move solution. By having skipped the depth (6+1) search (which should be much quicker than a depth (7+1) search), when you find an 8-move solution, you won't immediately know if it's optimal or not, and you must continue the search until all 7-move possiblilities have been checked if you want a proven optimal solution.

I note that I've run your solver and my own solver on the same computer. For that scramble your solver took close to 2 minutes. My solver took about 6 seconds to find the first solution, and about 40 seconds to completely search for all 8-move solutions. And I don't consider my program to be very well optimized yet.

If you haven't read Jaap's Computer Puzzling page yet, I strongly suggest reading that before doing any more work on your solver.


----------



## unsolved (Apr 4, 2014)

cuBerBruce said:


> Yes, it seems to me (from what I understand about your solver), it is valid to skip "depth 6" (which in my mind is really a depth 7 search) in the iterative deepening. In fact, it seems to me you could skip "depth 2," "depth 4", and any other "even depth" searches.



Yes, but for the sake of completeness, and the fact it takes no time, I just leave it in there.



cuBerBruce said:


> However, suppose the scramble had a 7-move solution instead of 8. You would likely find the solution quicker with a "depth 6" (in my view, really a depth (6+1) search), than with a depth (7+1) search. Further, the depth (7+1) search might find many suboptimal 8-move solutions before finding an optimal 7-move solution. By having skipped the depth (6+1) search (which should be much quicker than a depth (7+1) search), when you find an 8-move solution, you won't immediately know if it's optimal or not, and you must continue the search until all 7-move possiblilities have been checked if you want a proven optimal solution.



Yes, indeed, a situation I have seen myself. With the pre-knowledge of the supposed optimal solution, I have a user setting to address that (Skip odd/even searches, with/without a probe of the tfs databases.)

I have even seen an "over-scramble" solution appear: Where the cube was solved, then made an additional turn, and the 1-tfs database said "Hey, look, this is one move away from being solved" without realizing the program already solved it, then made an additional move!



cuBerBruce said:


> I note that I've run your solver and my own solver on the same computer. For that scramble your solver took close to 2 minutes. My solver took about 6 seconds to find the first solution, and about 40 seconds to completely search for all 8-move solutions. And I don't consider my program to be very well optimized yet.



This project is doing fine for being a week old  I have no delusions about where it happens to be, performance-wise. You should have seen it before, it was only averaging 8- or 9-million nodes/second on my hardware initially, now it is 120 million nodes/second per core. That is also "part of my problem" -- I have access to really fast hardware. The solve that you mentioned taking 2 minutes takes 12 seconds on my computer.

The real enemy seems to be the branching factor. Think about this: *even if you and I made our programs 1,000 times as fast, it would only add 2-ply to the search depth* with the branching factor so high! As far as I can tell, you are doing something to prune the heck out of the tree, whereas I only have the filtering mechanism suggested by Jakube implemented (plus the tfs databases).

I did implement a Non-Commutator Prune which works awesome if you know a solution is of that form, however, the real gold nugget would be to design a Non-Commutator Move Generator, which is next on my list of things to do.

Believe it or not, I have written some high performance chess and checkers programs, have more than one paper that was published by the Internal Computer Games Association Journal, and one of my papers appears in a book by Springer-Verlag. But I am new to cubing, so to speak, and I fully acknowledge that I must crawl before I can walk, and I have all of you really awesome folks offering great tips and advice, so how can I possibly go wrong?


----------



## rokicki (Apr 4, 2014)

Sounds like you have a lot of useful experience, some that may not be that common in the computer
cubing world! There are a lot of incredible tricks that originated in the gaming (especially chess)
world, and I'm sure we'll all benefit from your ideas.

Would you be willing to take a look at the code we used to prove "20"? It's on

http://cube20.org/src/

Maybe you can come up with some good ideas on how to speed it up even further? I'm always
looking for new magic.

Also, you keep mentioning this "fast hardware" you have access to. Can you elaborate? What
processor, what motherboard, etc.? I'm always interested in getting the fastest hardware I can
for this sort of thing.


----------



## unsolved (Apr 4, 2014)

rokicki said:


> Sounds like you have a lot of useful experience, some that may not be that common in the computer
> cubing world! There are a lot of incredible tricks that originated in the gaming (especially chess)
> world, and I'm sure we'll all benefit from your ideas.
> 
> ...



I think it would help if I showcase how "simple" my program is right now (and by that, I mean, lacking any kind of sophistication).

Here is the code that generates my U' move, for example (in the code I say "top" to talk about "U").


```
CUBE_4x4_ARRANGEMENT minus_top_face_move(CUBE_4x4_ARRANGEMENT original_4x4x4_cube)
{
	CUBE_4x4_ARRANGEMENT new_cube;

	new_cube = original_4x4x4_cube;

	new_cube.cube_front[0] = original_4x4x4_cube.cube_left[0];
	new_cube.cube_front[1] = original_4x4x4_cube.cube_left[1];
	new_cube.cube_front[2] = original_4x4x4_cube.cube_left[2];
	new_cube.cube_front[3] = original_4x4x4_cube.cube_left[3];

	new_cube.cube_right[0] = original_4x4x4_cube.cube_front[0];
	new_cube.cube_right[1] = original_4x4x4_cube.cube_front[1];
	new_cube.cube_right[2] = original_4x4x4_cube.cube_front[2];
	new_cube.cube_right[3] = original_4x4x4_cube.cube_front[3];

	new_cube.cube_back[0] = original_4x4x4_cube.cube_right[0];
	new_cube.cube_back[1] = original_4x4x4_cube.cube_right[1];
	new_cube.cube_back[2] = original_4x4x4_cube.cube_right[2];
	new_cube.cube_back[3] = original_4x4x4_cube.cube_right[3];

	new_cube.cube_left[0] = original_4x4x4_cube.cube_back[0];
	new_cube.cube_left[1] = original_4x4x4_cube.cube_back[1];
	new_cube.cube_left[2] = original_4x4x4_cube.cube_back[2];
	new_cube.cube_left[3] = original_4x4x4_cube.cube_back[3];

	/*********************************/
	/*       *       *       *       */
	/*  01   *  02   *  03   *   04  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  05   *  06   *  07   *   08  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  09   *  10   *  11   *   12  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  13   *  14   *  15   *   16  */
	/*       *       *       *       */
	/*********************************/


	/*********************************/
	/*       *       *       *       */
	/*  04   *  08   *  12   *   16  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  03   *  07   *  11   *   15  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  02   *  06   *  10   *   14  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  01   *  05   *  09   *   13  */
	/*       *       *       *       */
	/*********************************/

	new_cube.cube_top[1-1] = original_4x4x4_cube.cube_top[4-1];
	new_cube.cube_top[2-1] = original_4x4x4_cube.cube_top[8-1];
	new_cube.cube_top[3-1] = original_4x4x4_cube.cube_top[12-1];
	new_cube.cube_top[4-1] = original_4x4x4_cube.cube_top[16-1];

	new_cube.cube_top[5-1] = original_4x4x4_cube.cube_top[3-1];
	new_cube.cube_top[6-1] = original_4x4x4_cube.cube_top[7-1];
	new_cube.cube_top[7-1] = original_4x4x4_cube.cube_top[11-1];
	new_cube.cube_top[8-1] = original_4x4x4_cube.cube_top[15-1];

	new_cube.cube_top[9-1] = original_4x4x4_cube.cube_top[2-1];
	new_cube.cube_top[10-1] = original_4x4x4_cube.cube_top[6-1];
	new_cube.cube_top[11-1] = original_4x4x4_cube.cube_top[10-1];
	new_cube.cube_top[12-1] = original_4x4x4_cube.cube_top[14-1];

	new_cube.cube_top[13-1] = original_4x4x4_cube.cube_top[1-1];
	new_cube.cube_top[14-1] = original_4x4x4_cube.cube_top[5-1];
	new_cube.cube_top[15-1] = original_4x4x4_cube.cube_top[9-1];
	new_cube.cube_top[16-1] = original_4x4x4_cube.cube_top[13-1];

	return new_cube;
}
```

As you can see, the cube is treated as 16 "cells" on each face, which is NOT the way to write high performance code!

This is my Bitboard Move Generator (experiment, not verified as working nor fully tested) which I am currently writing to speed things up:


```
CUBE_4x4_BITBOARD_ARRANGEMENT minus_top_face_bitboard_move(CUBE_4x4_BITBOARD_ARRANGEMENT original_4x4x4_bitboard_cube)
{
		CUBE_4x4_BITBOARD_ARRANGEMENT new_bitboard_cube;
		unsigned long new_bits, top_row[4];

		/**************************************************/
		/* Part I: Shift the bitboard 4 bits to the right */
		/**************************************************/
		
		new_bitboard_cube = original_4x4x4_bitboard_cube;
		new_bits = original_4x4x4_bitboard_cube.cube_left[0] >> 4;

		/******************************************************/
		/* Part II: Copy the lower-16 bits to the top-16 bits */
		/*          of the 32-bit structure. Then bit-OR the  */
		/*          lower-16 bits to the whole 32-bits, which */
		/*          basically makes a perfect copy. This is   */
		/*          so the bits never "fall off" the bitboard */
		/******************************************************/

		new_bitboard_cube.cube_left[0] = (((new_bits & 0x0000FFFF) << 16) & 0xFFFF0000)   |   (new_bits & 0x0000FFFF);

		/*****************************************************/
		/* Part III: Rotate the top.                         */
		/*****************************************************/

		top_row[0] = original_4x4x4_bitboard_cube.cube_top[0] & 0x00F000F0;
		top_row[1] = original_4x4x4_bitboard_cube.cube_top[1] & 0x00F000F0;
		top_row[2] = original_4x4x4_bitboard_cube.cube_top[2] & 0x00F000F0;
		top_row[3] = original_4x4x4_bitboard_cube.cube_top[3] & 0x00F000F0;

		/*********************************************************/
		/*                                                       */
		/* TOP BITBOARD LAYOUT = 0x00F000F0 for each row         */
		/*                                                       */
		/*********************************************************/
		/*   B  *   L  *   T  *   R  *   B  *   L  *  T   *  R   */
		/*********************************************************/
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/*********************************************************/

/******************************/     /******************************/     /******************************/     /******************************/
/*  cube 04 moved to cube 01  */     /*  cube 08 moved to cube 02  */     /*  cube 12 moved to cube 03  */     /*  cube 16 moved to cube 04  */
/******************************/     /******************************/     /******************************/     /******************************/
		new_bitboard_cube.cube_top[0] = ((top_row[0] & 0x00100010) << 3)  |  ((top_row[1] & 0x00100010) << 2)  |  ((top_row[2] & 0x00100010) << 1)  |  (top_row[3] & 0x00100010);

/******************************/     /******************************/     /******************************/     /******************************/
/*  cube 03 moved to cube 05  */     /*  cube 07 moved to cube 06  */     /*  cube 11 moved to cube 07  */     /*  cube 15 moved to cube 08  */
/******************************/     /******************************/     /******************************/     /******************************/
		new_bitboard_cube.cube_top[1] = ((top_row[0] & 0x00200020) << 2)  |  ((top_row[1] & 0x00200020) << 1)  |  (top_row[2] & 0x00200020)         |  ((top_row[3] & 0x00200020) >> 1);


/******************************/     /******************************/     /******************************/     /******************************/
/*  cube 02 moved to cube 09  */     /*  cube 06 moved to cube 10  */     /*  cube 10 moved to cube 11  */     /*  cube 14 moved to cube 12  */
/******************************/     /******************************/     /******************************/     /******************************/
		new_bitboard_cube.cube_top[2] = ((top_row[0] & 0x00400040) << 1)  |  (top_row[1] & 0x00400040)         |  ((top_row[2] & 0x00400040) >> 1)  |  ((top_row[3] & 0x00400040) >> 2);



/******************************/     /******************************/     /******************************/     /******************************/
/*  cube 01 moved to cube 13  */     /*  cube 05 moved to cube 14  */     /*  cube 09 moved to cube 15  */     /*  cube 13 moved to cube 16  */
/******************************/     /******************************/     /******************************/     /******************************/
		new_bitboard_cube.cube_top[3] = (top_row[0] & 0x00800080)         |  ((top_row[1] & 0x00800080) >> 1)  |  ((top_row[2] & 0x00800080) >> 2)  |  ((top_row[3] & 0x00800080) >> 3);


		/*********************************/             /*********************************/
		/*  01   *  02   *  03   *   04  */             /*  04   *  08   *  12   *   16  */
		/*********************************/             /*********************************/
		/*  05   *  06   *  07   *   08  */             /*  03   *  07   *  11   *   15  */
		/*********************************/             /*********************************/
		/*  09   *  10   *  11   *   12  */             /*  02   *  06   *  10   *   14  */
		/*********************************/             /*********************************/
		/*  13   *  14   *  15   *   16  */             /*  01   *  05   *  09   *   13  */
		/*********************************/             /*********************************/


		/*****************************************************************/
		/* Part IV: Do the same for each wrap-around 4-face linked list  */
		/*          that involves the TOP bits.                          */
		/*****************************************************************/	

		top_row[0] = original_4x4x4_bitboard_cube.cube_bottom[0] & 0xF000F000;
		top_row[1] = original_4x4x4_bitboard_cube.cube_bottom[1] & 0xF000F000;
		top_row[2] = original_4x4x4_bitboard_cube.cube_bottom[2] & 0xF000F000;
		top_row[3] = original_4x4x4_bitboard_cube.cube_bottom[3] & 0xF000F000;
	
		/*********************************************************/
		/*                                                       */
		/* BOTTOM BITBOARD LAYOUT = 0xF000F000 for each row      */
		/*                                                       */
		/*********************************************************/
		/*   T  *   L  *   B  *   R  *   T  *   L  *  B   *  R   */
		/*********************************************************/
		/* 1111 * 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 */
		/* 1111 * 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 */
		/* 1111 * 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 */
		/* 1111 * 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 */
		/*********************************************************/	

		new_bitboard_cube.cube_top[0] = ((top_row[0] & 0x10001000) << 3)  |  ((top_row[1] & 0x10001000) << 2)  |  ((top_row[2] & 0x10001000) << 1)  |  (top_row[3] & 0x10001000);
		new_bitboard_cube.cube_top[1] = ((top_row[0] & 0x20002000) << 2)  |  ((top_row[1] & 0x20002000) << 1)  |  (top_row[2] & 0x20002000)         |  ((top_row[3] & 0x20002000) >> 1);
		new_bitboard_cube.cube_top[2] = ((top_row[0] & 0x30003000) << 1)  |  (top_row[1] & 0x30003000)         |  ((top_row[2] & 0x30003000) >> 1)  |  ((top_row[3] & 0x30003000) >> 2);
		new_bitboard_cube.cube_top[3] = (top_row[0] & 0x40004000)         |  ((top_row[1] & 0x40004000) >> 1)  |  ((top_row[2] & 0x40004000) >> 2)  |  ((top_row[3] & 0x40004000) >> 3);

		return new_bitboard_cube;
}
```

A very big difference in thinking. For example, this part alone:


```
new_bits = original_4x4x4_bitboard_cube.cube_left[0] >> 4;
		new_bitboard_cube.cube_left[0] = (((new_bits & 0x0000FFFF) << 16) & 0xFFFF0000)   |   (new_bits & 0x0000FFFF);
```

...does all of this from the other code...


```
new_cube.cube_front[0] = original_4x4x4_cube.cube_left[0];
	new_cube.cube_front[1] = original_4x4x4_cube.cube_left[1];
	new_cube.cube_front[2] = original_4x4x4_cube.cube_left[2];
	new_cube.cube_front[3] = original_4x4x4_cube.cube_left[3];

	new_cube.cube_right[0] = original_4x4x4_cube.cube_front[0];
	new_cube.cube_right[1] = original_4x4x4_cube.cube_front[1];
	new_cube.cube_right[2] = original_4x4x4_cube.cube_front[2];
	new_cube.cube_right[3] = original_4x4x4_cube.cube_front[3];

	new_cube.cube_back[0] = original_4x4x4_cube.cube_right[0];
	new_cube.cube_back[1] = original_4x4x4_cube.cube_right[1];
	new_cube.cube_back[2] = original_4x4x4_cube.cube_right[2];
	new_cube.cube_back[3] = original_4x4x4_cube.cube_right[3];

	new_cube.cube_left[0] = original_4x4x4_cube.cube_back[0];
	new_cube.cube_left[1] = original_4x4x4_cube.cube_back[1];
	new_cube.cube_left[2] = original_4x4x4_cube.cube_back[2];
	new_cube.cube_left[3] = original_4x4x4_cube.cube_back[3];
```

I came up with the idea to place all 4 rotated faces together, side-by-side, then copy them again, side by side, like this:


```
/*********************************************************/
		/*                                                       */
		/* TOP BITBOARD LAYOUT = 0x00F000F0 for each row         */
		/*                                                       */
		/*********************************************************/
		/*   B  *   L  *   T  *   R  *   B  *   L  *  T   *  R   */
		/*********************************************************/
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
		/*********************************************************/
```

Bottom, Left, Top, Right, Bottom, Left, Top, Right

A "0" indicates there is no "top" piece present. A "1" indicates there is a top piece present.

There will be one of these bitboards for EVERY face, so 6 all in total.

The beauty of this approach is, a bit never "falls off" the board, no matter how many times you rotate the cube, IF... you do one little trick.


```
/*********************************************************/
	/*                                                       */
	/* LEFT BITBOARD LAYOUT, WRAP-AROUND 4-FACE LINKED LIST  */
	/*                                                       */
	/* 32 bits for each horizontal row of the 4x4x4 cube. No */
	/* way to shift bits off of the bitboard, even after more*/
	/* than one doube-turn of the same face, IF the bits are */
	/* copied from one half to the other half after each one */
	/* of the shifting operations (turn of the cube) is done.*/
	/*********************************************************/
	/*   R  *   K  *   L  *   F  *   R  *   K  *   L  *  F   */
	/*********************************************************/
	/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
	/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
	/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
	/* 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 * 0000 */
	/*********************************************************/
```
Consider that U' rotates L to F to R to K (what I call "back") to L.

All I have to do is shift all of these bits 4 to the right after such a move:


```
/*********************************************************/
	/*   R  *   K  *   L  *   F  *   R  *   K  *   L  *  F   */
	/*********************************************************/
	/* 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 */
	/* 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 */
	/* 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 */
	/* 0000 * 0000 * 0000 * 1111 * 0000 * 0000 * 0000 * 1111 */
	/*********************************************************/
```

And, with the exception of the rotated face, I am done! What could be quicker?

Now, the "trick" is to copy the RIGHT-MOST cluster of R K L F and "stamp" those bits to the LEFT-MOST cluster, 
and then all "off the board" bit shifts to the right are taken care of, forever.

Once I get all of these details worked out, you can see how this will be so-called "magic."



rokicki said:


> Also, you keep mentioning this "fast hardware" you have access to. Can you elaborate? What
> processor, what motherboard, etc.? I'm always interested in getting the fastest hardware I can
> for this sort of thing.



Oh, I am talking about a $145,000 cluster of 40 CPU cores running at 5.40 GHz each. Probably not the kind of thing you have at home. I haven't tapped all of the cores yet, but I will once I write the Linux version of this thing


----------



## rokicki (Apr 4, 2014)

Be sure to let us know how much that speeds things up!

If you switch to a cubie representation, your piece count goes down from 6*16=96 to 8+24+24=56.
This may provide substantial speedup as well.

The server looks sweet! You're right, I don't have anything like that at home.

Thanks for keeping us all up to date on your progress.


----------



## unsolved (Apr 5, 2014)

rokicki said:


> Be sure to let us know how much that speeds things up!


It's a ways off yet. Once I do get it cranking, and fully parallel, it will be interesting!

But, as I mentioned in a prior post, even if it were 1,000 times faster, it would only search 2 moves more deeply than it does now. Why? The branching factor of the 4x4x4 cube is roughly 30x per depth, which means 30 times as many positions for each 1 move additionally searched. So 30x30 = 900 times as long to search 2 more moves ahead, etc.

That is why I need to focus on ways to reduce the size of the tree more than speeding up the search speed. Even a speedup of 1,000,000 times is only worth 4 more moves of search!



rokicki said:


> If you switch to a cubie representation, your piece count goes down from 6*16=96 to 8+24+24=56.
> This may provide substantial speedup as well.



I am guessing by cubie you mean the 3x3x3? There are so many solvers out there for that now, I am letting them enjoy their peace 

I want to concentrate on 4x4x4 for now, and when/if I get a fast bitboard engine up and running with large enough pruning databases, I'll switch to 5x5x5.



rokicki said:


> The server looks sweet! You're right, I don't have anything like that at home.



Here is my home rig, running at -50 degrees Celsius = -58 degrees Fahrenheit @ 5.35 GHz on the Intel i7-3770K:


http://lightningcloudcomputing.com/lightning__box.jpg


----------



## Stefan (Apr 5, 2014)

unsolved said:


> I am guessing by cubie you mean the 3x3x3?



No. Check out _"The Cubie Level"_ in the Cube Explorer documentation suggested earlier:
http://kociemba.org/cube.htm


----------



## unsolved (Apr 5, 2014)

rokicki said:


> Corners will help prune the *search* a lot. You spend most of the time
> in any standard IDA* search right at the outer limits of your pruning table.
> Your search tree includes many move sequences that disturb the corners.
> Let's say you are eight moves into a search, with a target depth of 15,
> ...



Originally I thought you meant to scan a database of corners-only to aid in the search for solutions where corners were unsolved in the original cube. I think I understand what you really meant now. So, what you do is, generate face moves only from the cube from a solved position, store the corner orientations along with how far they are from the solved position, and these are like "roadmaps" to your distance from being solved. Is that correct?

I would think at some point, you would duplicate a configuration, even though you are a different distance from the solution.

Or did someone already map every corner config possible to a "turns-from-solved" number?


----------



## cuBerBruce (Apr 5, 2014)

unsolved said:


> Originally I thought you meant to scan a database of corners-only to aid in the search for solutions where corners were unsolved in the original cube. I think I understand what you really meant now. So, what you do is, generate face moves only from the cube from a solved position, store the corner orientations along with how far they are from the solved position, and these are like "roadmaps" to your distance from being solved. Is that correct?



I would say "roadmap" is not the right analogy. The corner "distance-from-solved" database will give you a LOWER BOUND on the number of moves needed to solve the entire 4x4x4 position. This often allows aborting a search path before reaching the leaf nodes for your current search depth.

Such a database is usually created using a breadth-first search. This is a different type of search from a depth-first search. This is all talked about in Jaap's Computer Puzzling page I referenced earlier.



unsolved said:


> I would think at some point, you would duplicate a configuration, even though you are a different distance from the solution.



That's not important. What is important is that you get a true LOWER BOUND from how far you are from the solved state.



unsolved said:


> Or did someone already map every corner config possible to a "turns-from-solved" number?



Yes, it's been done a long time ago. I note that my optimal 4x4x4 solver, which I wrote in 2006, uses such a corner database. But such a breadth-first search had been done long before that.


----------



## Stefan (Apr 5, 2014)

unsolved said:


> Or did someone already map every corner config possible to a "turns-from-solved" number?



Korf, 1997 is the earliest I know (and quite a nice paper, I think).


----------



## cuBerBruce (Apr 5, 2014)

unsolved said:


> Or did someone already map every corner config possible to a "turns-from-solved" number?





Stefan said:


> Korf, 1997 is the earliest I know (and quite a nice paper, I think).



If you just care about solving corners with relative to each other instead of with respect to centers (i.e. 2x2x2 cube), it's been done as early as Sept. 9, 1981 (according to Mark Longridge's page).


----------



## Stefan (Apr 5, 2014)

Ah yes, I should have thought of 2x2, but only thought of pruning tables for something larger.


----------



## qqwref (Apr 6, 2014)

I know you have a bunch of experience already, in programming and computation-intensive code, but please listen! Some of the people posting (e.g. rokicki and cuBerBruce) have an amazing amount of experience in programming cube solvers, and the advice they are giving is definitely helpful. When you don't understand something, make sure not to just assume it's unhelpful - do some research, or ask questions, and try to see what the advice means. It may save you a lot of work later on.



unsolved said:


> I understand now. Speed cubers solve the corners last. In my lame way of solving, I do them much, much earlier. I solve the centers and dedges last.





unsolved said:


> As far as I can tell, you are doing something to prune the heck out of the tree, whereas I only have the filtering mechanism suggested by Jakube implemented (plus the tfs databases).





unsolved said:


> I am guessing by cubie you mean the 3x3x3? There are so many solvers out there for that now, I am letting them enjoy their peace
> 
> I want to concentrate on 4x4x4 for now




Anyway, you ARE making some good progress. I just wish you'd give your variables shorter names, so the code wouldn't be bloated with the same thing written several times (like original_4x4x4_cube.cube_right[0])


----------



## unsolved (Apr 6, 2014)

qqwref said:


> I know you have a bunch of experience already, in programming and computation-intensive code, but please listen! Some of the people posting (e.g. rokicki and cuBerBruce) have an amazing amount of experience in programming cube solvers, and the advice they are giving is definitely helpful. When you don't understand something, make sure not to just assume it's unhelpful - do some research, or ask questions, and try to see what the advice means. It may save you a lot of work later on.



Yes, I bow to their expertise and I readily acknowledge I am the noob of all noobs, I have no problem admitting that, at all. Please don't mistake my exuberance for anything but the extreme joy I found in programming a 4x4x4 solver. I had no idea how in the dark I was until I saw Bruce's program prune the heck out of the search tree like a hot knife through butter 

It is possible to have a fair amount of programming experience and be a total dork when it comes to cubing. Dork #1, right here <------. I do read the posts/links/web pages and PDFs, but that does not necessarily translate into a complete understanding. That is not to say I don't make some underlining and often times _incorrect _conjectures about what I am reading. Please understand I am weak on the nomenclature, and some of what I am reading is not crystal clear to me. Not by a longshot.

When I do grasp something, I do have the innate ability to fully delve into it, and, at times, even raise the bar. I am not yet at the fully-grasping phase yet. I do understand the concept of indexing and pruning and searching, just not as it applies to cubing. To illustrate this, here is a fairly complex indexing function for the game of checkers where one side has 3 kings and 1 checker and the other side has 2 kings and 2 checkers. This function will magically enumerate from 0 to n-1, where n is the total number of possible arrangements, without duplicating an index, nor skipping any ranges.


```
/*********************************************************************/
/*                                                                   */
/* General Indexing Function Combinatoric Macros                     */
/* ---------------------------------------------                     */
/*                                                                   */
/* Given there are N identical pieces of the same color, how many    */
/* ways can they be arranged uniquely on a game board, independent   */
/* of the size of the board?                                         */
/*                                                                   */
/* The answer involves producing a polynomial expansion of the form  */
/*                                                                   */
/* a + (b-1)(b-2)/2! + (c-1)(c-2)(c-3)/3! + .. (z-1)(z-2)..(z-N)/N!  */
/*                                                                   */
/*********************************************************************/

#define _2_same_pieces_subindex(a,b) 		 ((a) + ((((b)-1)*((b)-2))/2))
#define _3_same_pieces_subindex(a,b,c)		 ((a) + ((((b)-1)*((b)-2))/2) + ((((c)-1)*((c)-2)*((c)-3))/6))
#define _4_same_pieces_subindex(a,b,c,d)	 ((a) + ((((b)-1)*((b)-2))/2) + ((((c)-1)*((c)-2)*((c)-3))/6) + ((((d)-1)*((d)-2)*((d)-3)*((d)-4))/24))	
#define _5_same_pieces_subindex(a,b,c,d,e)	 ((a) + ((((b)-1)*((b)-2))/2) + ((((c)-1)*((c)-2)*((c)-3))/6) + ((((d)-1)*((d)-2)*((d)-3)*((d)-4))/24) + ((((e)-1)*((e)-2)*((e)-3)*((e)-4)*((e)-5))/120))


unsigned long long get_08_piece_index_3K1C_AGAINST_2k2c(unsigned char wk1, unsigned char wk2, unsigned char wk3, unsigned char wc1, unsigned char rk1, unsigned char rk2, unsigned char rc1, unsigned char rc2)
{
	unsigned long long index_function_value;
	unsigned long long index_part_1, index_part_2;
	unsigned long combined_checker_contribution_to_index, index_part_3;
	unsigned char 	   adjust_rk1_index,
					   adjust_rk2_index,
					   adjust_wk1_index,
					   adjust_wk2_index,
					   adjust_wk3_index;

	index_function_value = 0;
	
	/*********************************************/
	/* order of placement on the board: wrrWWWRR */
	/*********************************************/

	adjust_wk1_index = wk1;
	adjust_wk2_index = wk2;
	adjust_wk3_index = wk3;

	adjust_rk1_index = rk1;
	adjust_rk2_index = rk2;
	

	if(wk1 > wc1)
		adjust_wk1_index--;
	if(wk1 > rc1)
		adjust_wk1_index--;
	if(wk1 > rc2)
		adjust_wk1_index--;
		
	/**********************/
			
	if(wk2 > wc1)
		adjust_wk2_index--;
	if(wk2 > rc1)
		adjust_wk2_index--;
	if(wk2 > rc2)
		adjust_wk2_index--;
		
	/**********************/
			
	if(wk3 > wc1)
		adjust_wk3_index--;
	if(wk3 > rc1)
		adjust_wk3_index--;
	if(wk3 > rc2)
		adjust_wk3_index--;
		
	/**********************/
	/**********************/

	if(rk1 > wc1)
		adjust_rk1_index--;
	if(rk1 > rc1)
		adjust_rk1_index--;
	if(rk1 > rc2)
		adjust_rk1_index--;

	if(rk1 > wk1)
		adjust_rk1_index--;
	if(rk1 > wk2)
		adjust_rk1_index--;				
	if(rk1 > wk3)
		adjust_rk1_index--;

	/**********************/

	if(rk2 > wc1)
		adjust_rk2_index--;
	if(rk2 > rc1)
		adjust_rk2_index--;
	if(rk2 > rc2)
		adjust_rk2_index--;

	if(rk2 > wk1)
		adjust_rk2_index--;
	if(rk2 > wk2)
		adjust_rk2_index--;				
	if(rk2 > wk3)
		adjust_rk2_index--;

	/**********************/


	/*************************************************************************************************/
	/*                                                                                               */
	/*  February 12, 2009                                                                     */
	/*                                                                                               */
	/* Completely changed this indexing function. First, the order in which data is passed in now    */
	/* matches the CONSTANT identifying the slice: k_WWWwRRrr -- this is now standard for all of the */
	/* indexing functions. Second, the all checkers indexing function for 3 pieces is used. Why not  */
	/* use what is already available? Third, the colors were reversed to match the spec.             */
	/*                                                                                               */
	/* July 11, 2001                                                                            */
	/*                                                                                               */
	/* With one black checker in the king row, count from 1-378 for each of the 4 squares.           */
	/* The white checkers can reside on 28*27/2  = 378 squares, so the equations is of the form:     */
	/*                                                                                               */
	/* (rc1-1)* 378 + _2_same_pieces_subindex(wc1, wc2)                                               */
	/*                                                                                               */
	/* When the black checker has moved to square 5 or greater, then you add 378*4 (1512) to the     */
	/* count and determine which of the 27*26/2 remaining combination of squares the white checkers  */
	/* are on. With 27*26/2 = 351, the equation looks like...                                        */
	/*                                                                                               */
	/* (rc1-5)* 351 + _2_same_pieces_subindex(wc1, wc2) + 1512                                        */
	/*                                                                                               */
	/* This technique treats the black and white checkers as one "sub-index", rather than separate   */
	/* components. We count from 1 to (4*378 + 24*351) = 9936, then pass this as the "Q" to          */
	/* the  precompiled macro. This "Q" is a substitue for "rc1" and "wc1" and "wc2".                 */
	/*                                                                                               */
	/*  September 4, 2010                                                                         */
	/*                                                                                               */
	/* Changed the indexing function again, hopefully for the last time. Dealing with that wonderful */
	/* Microsoft Compiler bug where intermediate calculations exceeding 2^31 are always treated as a */
	/* signed 32-bit result, which invariably resulted in a negative number, which invariably would  */
	/* decrease the index when an increase was expected, and, consequently, duplicate indices would  */
	/* always be produced. It's a good thing I decided to re-test the indexing functions!!           */
	/*                                                                                               */
	/*************************************************************************************************/
	
	combined_checker_contribution_to_index = 1 + get_03_piece_index_0K2C_AGAINST_0k1c(33-rc2, 33-rc1, 33-wc1);

	/*************************************************************************************************************/
	/*                                                                                                           */
	/* September 4, 2010                                                                                */
	/*                                                                                                           */
	/* Gradually converting more GOOD, WORKING indexing functions over to this new format. See my comments from  */
	/* August 26, 2010 for a full explanation. Thanks to Billy Gates for more wasted time.                       */
	/*                                                                                                           */
	/*************************************************************************************************************/

	index_part_1 = (unsigned long long)(1187550) * (unsigned long)(combined_checker_contribution_to_index - 1);
	index_part_2 = (unsigned long long)(325) * (unsigned long)(_3_same_pieces_subindex(adjust_wk1_index, adjust_wk2_index, adjust_wk3_index) -1);
	index_part_3 = (unsigned long)(_2_same_pieces_subindex(adjust_rk1_index, adjust_rk2_index));

	index_function_value = (unsigned long long)(index_part_1 + index_part_2 + index_part_3);

	return (index_function_value - 1);
}
```

So, I am thinking about how to index just the corners, and just the centers. I'd like to pre-solve turns-from-solution (tfs) for the corners, and all of the centers that are reasonable (1 missing per side, 2 per side, maybe no more).

If I could create such an indexing function, there is no need to store positions at all, just transform a position to an index, and write to that index during the solve, and read that many bytes into the file when probing.

The problem is: Creating the indexing function!

Checkers and chess, I had no problem with. Flat board, easy to enumerate the state space. Corners, ugh! 3D. Orientation variations. I am not sure how to map a turned vs. unturned cube. Also, there are some turns that are illegal positions, such as just one corner being flipped, etc., so I am not sure about how to go about it.

What I am doing: Sharing all of the portions of my code that would be of interest, in hopes that some of the guys who did write some easy-to-read code might be interested in doing the same. If I could get a lean/mean version of a program running, some of the hardware I have access to might crank out some very interesting finds!

The pillars of civilization were built upon ideas shared and improved upon over vast spans of time. Who knows, we might brainstorm some killer code through cooperation.



Stefan said:


> Korf, 1997 is the earliest I know (and quite a nice paper, I think).



Yes, very nice. Some code would have been even better. 

Interestingly, the paper mentions the work of Dr. Jonathan Schaeffer. He cited one of the papers I wrote in two of his own papers (on checkers) and he was nice enough to thank me (and some others, of course) on his website after he solved the game of checkers.



cuBerBruce said:


> I would say "roadmap" is not the right analogy. The corner "distance-from-solved" database will give you a LOWER BOUND on the number of moves needed to solve the entire 4x4x4 position. This often allows aborting a search path before reaching the leaf nodes for your current search depth.
> 
> Such a database is usually created using a breadth-first search. This is a different type of search from a depth-first search. This is all talked about in Jaap's Computer Puzzling page I referenced earlier.



If you want to see some really cool endgame databases used in run-time during a search, check out my 80-square chess program,
which can announce a mate in 268 moves in the endgame of King + Queen + 1 Pawn vs. King + Queen. I added 2 pieces to the board,
one that can move like a Knight + Rook, which I called the Chancellor. The other moves like a Knigh + Bishop = Archbishop.







The King + Archbishop vs. King has a longest win of 21 moves I think, and it is really hard to administer for the side
with the archbishop.

Anyway, if you like chess, this program will surprise you with some really strong moves on this 80-square board.

It's about 64 MB compressed with all of the 3-piece and some of the 4-piece endings already included.
A menu item will load the position for some of the longest win configurations.

lightningcloudcomputing.com/vortex.zip



cuBerBruce said:


> I The corner "distance-from-solved" database will give you a LOWER BOUND on the number of moves...



Ah ha! Lighbulb moment! So if you are at a depth of 3 plies executing a 10 ply search, you are 7 plies from your terminal node, you can use the INEXACT information in the corner-tfs to basically check your own corner arrangement, and discard all of those that definitely can't be solved with a lower bound of 7 turns. Nice! You see, I am "too used to" the EXACT distance-to-win data in the databases I have experience with, so this experience was working against me!

So is there an indexing function that generates only one instance of each of the 8! * 3^7 corner configurations? Or would that just be the IDA* move generator with only face turns?


----------



## Herbert Kociemba (Apr 6, 2014)

unsolved said:


> So is there an indexing function that generates only one instance of each of the 8! * 3^7 corner configurations? Or would that just be the IDA* move generator with only face turns?



Since all combinations of orientations and permutations happen, you can use for example permIndex(corners)*2048+oriIndex(corners) for this index.
Examples for permIndex and oriIndex are here: http://kociemba.org/math/coordlevel.htm


----------



## unsolved (Apr 6, 2014)

Herbert Kociemba said:


> Since all combinations of orientations and permutations happen, you can use for example permIndex(corners)*2048+oriIndex(corners) for this index.
> Examples for permIndex and oriIndex are here: http://kociemba.org/math/coordlevel.htm



Thank you 

And where can one see the definitions of things like *Pred(BR)* and *PEdge^[ed].o*?


----------



## Herbert Kociemba (Apr 6, 2014)

unsolved said:


> Thank you
> 
> And where can one see the definitions of things like *Pred(BR)* and *PEdge^[ed].o*?



Sorry, I thought more about the verbal explanations given (ternary number system, variable base number system etc.) and less about the code snippets when I gave the link. But no problem, PEdge^[ed].o ist just the orientation of the edge ed, and Pred(BR) is the predecessor of the - in my program - "last" of the 12 edges BR. So in the loop the last edge BR is ignored, because its orientation is forced by the other 11 edges.


----------



## unsolved (Apr 6, 2014)

Herbert Kociemba said:


> Sorry, I thought more about the verbal explanations given (ternary number system, variable base number system etc.) and less about the code snippets when I gave the link. But no problem, PEdge^[ed].o ist just the orientation of the edge ed, and Pred(BR) is the predecessor of the - in my program - "last" of the 12 edges BR. So in the loop the last edge BR is ignored, because its orientation is forced by the other 11 edges.



Just a question: Why not post code people can actually compile to check it out? I would never have figured out what you meant there, in like a million years.


----------



## cuBerBruce (Apr 9, 2014)

Earlier in this thread, rokicki suggested a pruning table for two adjacent corners, the two edges in between, and the four center pieces of one of the faces sharing those edges. I have implemented such a pruning table in my solver. The distance distribution is given below for both single slice turn metric and block turn metric. One of the two corners is regarded as a fixed reference cubie with respect to which the other cubies must be solved.

```
Single slice turn metric:
dist  0: count =          1 total          1
dist  1: count =         21 total         22
dist  2: count =        361 total        383
dist  3: count =       6256 total       6639
dist  4: count =      97107 total     103746
dist  5: count =    1225834 total    1329580
dist  6: count =   10781087 total   12110667
dist  7: count =   48898689 total   61009356
dist  8: count =   58361514 total  119370870
dist  9: count =    3805702 total  123176572
dist 10: count =         20 total  123176592

Block turn metric:
dist  0: count =          1 total          1
dist  1: count =         27 total         28
dist  2: count =        556 total        584
dist  3: count =      12320 total      12904
dist  4: count =     234483 total     247387
dist  5: count =    3329496 total    3576883
dist  6: count =   27983342 total   31560225
dist  7: count =   75468139 total  107028364
dist  8: count =   16143357 total  123171721
dist  9: count =       4871 total  123176592
```


----------



## unsolved (Apr 10, 2014)

cuBerBruce said:


> Earlier in this thread, rokicki suggested a pruning table for two adjacent corners, the two edges in between, and the four center pieces of one of the faces sharing those edges.



I have decided to focus on what I am at good at for now. I don't understand how to create an indexing function for the 2x2x2 subset of corners in order to build such a pruning table. I did, however, come up with a "magic bitboard" move generator which is over 20 times faster than my older code, and then I parallelized this code to run on the multicore servers here at the office. Running on a Dual E5-2697 (24 cores total, 48 with hyperthreading) it averages 12 billion 200 million nodes/second.

My move generator for U' is reduced to this:


```
// 3 lines of code to handle the 64 bits that wrap around 4 faces of the cube at once

preserve_left_side = x_axis[0] & 0x000F000F000F000F;
x_axis[0] >>= 4;
x_axis[0] |= (preserve_left_side << 12);

t_ rotation[0] = top_rotation_bits & 0x1111;
t_ rotation[1] = top_rotation_bits & 0x2222;
t_ rotation[2] = top_rotation_bits & 0x4444;
t_ rotation[3] = top_rotation_bits & 0x8888;

//a precomputed 16-bit rotation lookup table: pass in a 16-bit pattern as an index, get a counterclockwise rotated bit pattern back

new_rotated_top_bits = GLOBAL_COUNTER_CLOCKWISE_BIT_ROTATIONS[t_ rotation[0] | t_ rotation[1] | t_ rotation[2] | t_ rotation[3]];

x_axis[0] |= (new_rotated_top_bits >> TOP_BITBOARD_SHIFT_OFFSET) & SLAP_NEW_TOP_BITBOARD_BITS_IN_PLACE_BITMASK;

//shortened the variable names by request :)
```

My code for handling t slice moves is ridiculously small, 3 lines of code, since I don't have to worry about rotating 16 cubes of a face:


```
preserve_left_side = x_axis[1] & 0x000F000F000F000F;
x_axis[1] >>= 4;
x_axis[1] |= (preserve_left_side << 12);
```

Using bit patterns not only speeds up the move generator, the evaluation routine to determine if the cube is solved, or ANY cube configuration, is just 8 short comparisons.


```
solved = (x_axis[0] == TOP_RING_SOLVED) && (x_axis[1] == TOP_SLICE_SOLVED) && (x_axis[2] == BOTTOM_SLICE_SOLVED) && (x_axis[3] == BOTTOM_RING_SOLVED) &&\
         (y_axis[0] == BACK_RING_SOLVED) && (y_axis[1] == BACK_SLICE_SOLVED) && (y_axis[2] == FRONT_SLICE_SOLVED) && (y_axis[3] == FRONT_RING_SOLVED);
```

In this case, the "TOP" variables are everything but the top and bottom. The front, right, back, and left faces wrap about the cube in the x-direction. 4 bits per face x 4 faces x 4 rows around.
The "BACK" variables are 90 degrees separated, looping from the left to the top to the right to the bottom. There are 8 faces instead of 6, since I stratify horizontal and vertical moves. All of the turns and moves along the z-axis are precomputed in terms of x- and y-, then transformed to reflect the correct bitboards for updating. It was easier this way.

The beauty of this approach is that I can add ANY position with a known optimal solve distance to the evaluation routine with literally no impact on the search speed. And, if the position is hit during a probe, it returns optimal distance-to-solve back down to the game tree. If the distance is "N" from a leaf node, I now know there is a win from that leaf node. If a shorter distance-to-solve is not found, then striving for that position is the best way to go.

http://www.lightningcloudcomputing.com/depth%209.jpg

I also solved the 7-turn-from-solution database with its 18,032,462,352 positions and came up with a new scheme how to index those positions in a RAM buffer. So, from depth-1, I actually complete an 8-ply search, depth-2 = 9 plies, etc.

I imagine if I ever figure out how to implement a pruning table like you have, I could probably do optimal solutions for 18-20 plies.

I'm afraid that's all the code I am going to share until other people reciprocate. I've given quite a few examples of ways to speed up your own code if you want to.


----------



## rokicki (Apr 10, 2014)

Wow, very quick work, Bruce! Thank you very much. If I can get a couple of 
smaller things I'm working on done I hope to verify these numbers.

So the distance isn't as high as I was hoping. The tables are pretty small, and
the pruning table can be applied many times to a given position, but the distance
just isn't very high. Indeed, in the block turn metric it's almost depressing how
low it is. I guess that's just the high-ply factor at work.

If your code is general enough it might be illuminating to try it with some scattered
cubies (I expect the average distance to fall somewhat), and/or perhaps with
edges-only or centers-only up to some reasonable count of cubies. My earliest
explorations of computer cubing were just such explorations on the 3x3x3.


----------



## cuBerBruce (Apr 11, 2014)

unsolved said:


> I have decided to focus on what I am at good at for now. I don't understand how to create an indexing function for the 2x2x2 subset of corners in order to build such a pruning table.


Well, your use of a facelet-level representation does make it a little more involved to calculate an index for these types of cubie-based pruning tables. The cost of calculating pruning table indices could be large compared to the time required to apply a move.



unsolved said:


> Using bit patterns not only speeds up the move generator, the evaluation routine to determine if the cube is solved, or ANY cube configuration, is just 8 short comparisons.


Your solved state check seems to assume the orientation of the puzzle matters. (And by the way, it looks like you have some "=" operations that should be "==".) This would seem to require locating a particular corner cubie, then applying the particular whole cube rotation that results in putting that corner cubie in its standard position. And then applying your check to see if the resulting cube state is equal to the standard solved state. Or else you could define 24 solved states, one for each possible orientation of the cube, and check if the candidate position matches one of these 24 solved states.



unsolved said:


> I also solved the 7-turn-from-solution database with its 18,032,462,352 positions and came up with a new scheme how to index those positions in a RAM buffer. So, from depth-1, I actually complete an 8-ply search, depth-2 = 9 plies, etc.


Your depth-5 or depth-7 database can be thought of as a "perfect" pruning table. It's perfect in the sense that instead a lower bound for the distance from solved, it gives the exact distance. The drawbacks of such a pruning table is poor pruning depth and high memory consumption. Storing 18 billion positions in RAM? That would seem to require the better part of a terabyte at 48 bytes/position without using symmetry reduction, and still a lot with symmetry reduction.

In a 3x3x3 solver, I've experimented with using a hash table to store all positions for up to 8 moves from solved. I used symmetry to significantly the number of table entries. Still, I needed other pruning functions for higher pruning depth to make the solver compete with existing optimal solvers. And for homing in on the solved state once your close, a small pruning table can probably do almost as good as a perfect pruning table. It seems like "perfect pruning" does not provide the best tradeoff between performance and memory usage.

Another way the moves-from-solved hash table could be used on the 3x3x3 is checking if your sequence of moves already made in your current search branch is an optimal move sequence or not. If you detect that it is non-optimal, there is no way that some extension of the sequence will be optimal, so no point in pursuing the branch any farther. For the 4x4x4, however, you would need to use a supercube moves-from-solved table, which is not the same as a regular 4x4x4 moves-from-solved table. There is also the issue of whether this will add more time than it will save.


----------



## rokicki (Apr 11, 2014)

cuBerBruce said:


> Another way the moves-from-solved hash table could be used on the 3x3x3 is checking if your sequence of moves already made in your current search branch is an optimal move sequence or not.



From our comparison of the count of canonical sequences of length d with positions at distance d, and the
close correspondence seen there, we know such a check on the 3x3x3 is not beneficial.

I believe this is still an open question on the 4x4x4.


----------



## unsolved (Apr 11, 2014)

cuBerBruce said:


> Your solved state check seems to assume the orientation of the puzzle matters.



I initiate the solver with a Top = top, Front = front, Right = right orientation, but the multi-threaded code tackles one rotated/revolved orientation per thread. So rather than run into the solution first encountered by a single move generator, there are several instances of the same move generator working on cubes laying on the side, rotated so that front = top, etc. Pure laziness on my part, but the best way to make use of so many cores.



cuBerBruce said:


> (And by the way, it looks like you have some "=" operations that should be "==".)



Yes. I knew some of the readers here hate my long variables name, which I retyped, and I retyped the entire line of code there as well, leaving out the == where I had the single =.



cuBerBruce said:


> Or else you could define 24 solved states



That fits in nicely with my laziness philosophy.




cuBerBruce said:


> Your depth-5 or depth-7 database can be thought of as a "perfect" pruning table. It's perfect in the sense that instead a lower bound for the distance from solved, it gives the exact distance. The drawbacks of such a pruning table is poor pruning depth and high memory consumption. Storing 18 billion positions in RAM? That would seem to require the better part of a terabyte at 48 bytes/position without using symmetry reduction, and still a lot with symmetry reduction.



Yes, but as I alluded to, I found a much better way to handle it that requires only 1 byte per position!



cuBerBruce said:


> It seems like "perfect pruning" does not provide the best tradeoff between performance and memory usage.



I refer to your corner-cube pruning as Leaf Node Pruning, but Perfect Pruning is more like Trunk Pruning. Perfect Pruning primarily lets you complete your overall search at least one iteration sooner, but it is useless at the leaf nodes. For example, if at depth == 5 I find a 7-turn solution for a 12-ply total solution, you might think I would have to keep searching until depth == 11 is completed. However, as I continue to search, I am guaranteed to find at least one "tfs-1" solution at the next iterative depth. When I search two consecutive depths, and the optimal distance has not improved, then I can stop searching altogether. 

Suppose it finds a tfs (turns from solution) == 7 @ ply 5, then the best tfs == 6 @ ply 6. If I complete ply 6 and only hit tfs == 6, then I know the 12-ply solution is optimal. I'm done a 12-ply search after only 6-ply of nominal depth. So, this pruned the trunk of the tree, and did literally nothing to the leaf nodes.

When I probe the leaf nodes, at present I have no other comparison to make to halt the interim search. The only improvement would be if the *depth + tfs best < the corner prune distance*, then I could shave the tree much more.


----------



## ShadenSmith (Apr 11, 2014)

unsolved said:


> Yes, indeed. But it is a start and it can only improve from here. You have to understand, I am programming on a computer that has a total of 16 CPU cores (Dual Intel E5-2687W with 8 CPU cores per chip) and I am running this in single-core mode. Once I get it to run as a parallel search, the speedup in nodes/second is guaranteed to be linear (16x faster or 1.6 billion turns/second)



Speedup is never guaranteed to be linear. I would be very surprised if you get linear scaling up to 16 cores on a dual socket machine.


----------



## rokicki (Apr 11, 2014)

For this particular problem, which tends to be CPU-heavy, no shared read/write data, random memory
access (to hash tables and pruning tables, read-only), you actually get pretty good scalability. Almost
all of my twisty puzzle search programs over the years have scaled very well.

Dual sockets is a big deal, though. You normally get a pretty good speedup per-core by locking your
threads and memory to a single core, and using the machine essentially as two UP machines. (For
a four-socket machine, this is even more dramatic.) This does mean replicating your pruning tables
to memory attached to each socket rather than using one big pool.

It does depend on the program. Lowering the instructions-per-lookup is critical; indexing is often the
main bottleneck, followed by memory access itself.


----------



## rokicki (Apr 11, 2014)

unsolved said:


> Yes, but as I alluded to, I found a much better way to handle it that requires only 1 byte per position!



Information theory demands that, in order to accomplish this you had to make some sort of tradeoff.
Either that or you've found a significant pattern in positions-at-a-distance that has eluded us so far.
Would you care to share your trick?

Is your hash table exact (that is, given a position, I can get a definitive answer in constant time that
tells me the distance of the position if the distance is <= n, or tells me definitively that the distance is
> n), and works for all positions? For this problem, indexing generally does not work well (the table is
too sparse) so you usually end up having to explicitly store each position (which takes more than a byte
simply because of the count of possible positions).

Tricks such as bloom filters can give you approximate answers in somewhat less memory---but they
are approximate, not exact.


----------



## unsolved (Apr 12, 2014)

ShadenSmith said:


> Speedup is never guaranteed to be linear. I would be very surprised if you get linear scaling up to 16 cores on a dual socket machine.



This is true for most searching programs, such as chess, as there is a diminishing return on each additional core thrown at the problem.

However, the cube has 6 faces, each of which may be rotated 0 degrees, 90 degrees, 180, or 270. This gives a total of 24 possible orientations to start from as the cube is attempted to be solved. I can replicate all of my data structures in RAM with simply a different cube orientation, and I am essentially attacking the problem with a potential 24 times increase in speed. I can spawn up to this many threads in my move generation code.

I did test my move generator out on a Dual E5-2697v2 at the office (24 physical cores) and I got in some trouble  I also shot up from 500 million nodes/second (old matrix code on a slower system) to 14,200,000,000 nodes/second (new bitboard move generator with optimized code, *one line of code to generate slice moves*!) That was a little more than a factor of 28.

But this incredible speed is worthless unless I figure out how to use a corner-pruning table (and other tricks) to reduce the size of the game tree. When I do finally get it, though, this thing will be awesome!



rokicki said:


> Information theory demands that, in order to accomplish this you had to make some sort of tradeoff.
> Either that or you've found a significant pattern in positions-at-a-distance that has eluded us so far.
> Would you care to share your trick?



I think you already know the answer. I created separate indexing functions for each "turn" of the cube.
One indexing function returns the numbers 1 to 36 when fed in any position that is 1 turn away from being solved.
So, all I have to write to disk (and read into memory) is the distance to the solution. One byte.

Next, I wrote an indexing function to convert every cube position that is 2 turns away from a solution into numbers from 1 to 1026.
Again, I write the distance to the solution that many bytes into the file, and read that far into the RAM buffer.

3 turns = 28,836 positions, 4 turns = 810,891 ... 7 turns = 18,032,462,352.

It is tricky and can return ambiguous data if not called in the proper hierarchy, otherwise I would not need a program to solve the cube, the indexing function would know the answer.
The current techniques also breakdown for > 7 turns. I just don't understand enough about the cube yet. This will come with time and experience.



rokicki said:


> Is your hash table exact (that is, given a position, I can get a definitive answer in constant time that
> tells me the distance of the position if the distance is <= n, or tells me definitively that the distance is
> > n), and works for all positions?



Every position that is hit in the database has been solved optimally through brute force using my huge, bloated game tree. I posted all 16 solutions for the 1-unsolved-center vs. 1-unsolved-center for U and F in an earlier post, and the consensus was that these were all optimal 8-ply solutions. So, when I encounter a leaf node that has a known distance-from-solved, I know from that point forward there is a solution in "depth + database solve length" or better. The "or better" depends on whether a faster solution exists outside of the pre-solved database, or if a quicker solution can be encountered in the database with additional searching.

Once there is 2 consecutive iterative depths of saturation, meaning all pre-computed solutions have been encountered and there has not been a decrease in the solution length, the position has been solved and no additional nominal depth will change that.



rokicki said:


> Would you care to share your trick?



Nobody really has seemed too interested to post examples of that which will help me, though I have offered just about everything I have. Remember my project is only a couple of weeks old, and clearly in the basement as far as solvers go. I have made progress though.



rokicki said:


> Would you be willing to take a look at the code we used to prove "20"? It's on
> 
> http://cube20.org/src/
> 
> ...



I finally had time to look around and I saw the search for the 3x3x3 positions of distance 20. Now *that *I find interesting  

By the way, one of our 16-core servers is finishing up a calculation either on the 14th or the 15th. As far as I can tell, it's coming back into our office with "nothing to do."

If this is the case, I can set you up with a logon id if you want to run any calculations. I think it is 16 cores x 3.1 GHz with a turboboost @ 3.4 GHz. Let me know if you are interested.


----------



## cuBerBruce (Apr 12, 2014)

rokicki said:


> Wow, very quick work, Bruce! Thank you very much. If I can get a couple of
> smaller things I'm working on done I hope to verify these numbers.
> 
> So the distance isn't as high as I was hoping. The tables are pretty small, and
> ...



Yes, the distance distribution was rather disappointing. It's a little bit better than 2 opposite composite centers (8 pieces). I've also redone the opposite centers table so it's with respect to a corner piece. That distance distribution is still not quite as good as for the case of two corners and two edge pieces in between with one adjacent composite center.

Well, my code isn't quite general to do any case, but it shouldn't be too much work to adapt it to different cases. I am thinking of trying the 3x3x1 block case, but first I'll probably try a tripod of one corner (reference piece) and six edge pieces. Changing the specific choices among each piece type keeping the count of each piece type the same should be easier to do. But I probably won't be experimenting with scattered arrangements of pieces within the next week.

I am not totally confident in my results so an independent confirmation would be good. 

EDIT (appending):
I've now completed the analysis for the tripod with 1 corner and 6 edge pieces. It's slightly better (for pruning) than the configuration of two corners, two edges, and four center pieces I analyzed earlier.

```
Single slice turn metric:
dist  0: count =          1 total          1
dist  1: count =         27 total         28
dist  2: count =        456 total        484
dist  3: count =       6186 total       6670   0.006 %
dist  4: count =      71460 total      78130   0.07 %
dist  5: count =     690093 total     768223   0.71 %
dist  6: count =    5215743 total    5983966   5.38 %
dist  7: count =   26355000 total   32338966  27.20 %
dist  8: count =   54426898 total   86765864  56.16 %
dist  9: count =   10142500 total   96908364  10.47 %
dist 10: count =        756 total   96909120

Block turn metric:
dist  0: count =          1 total          1
dist  1: count =         27 total         28
dist  2: count =        576 total        604
dist  3: count =       9462 total      10066   0.01 %
dist  4: count =     128744 total     138810   0.13 %
dist  5: count =    1426072 total    1564882   1.47 %
dist  6: count =   11002582 total   12567464  11.35 %
dist  7: count =   44731304 total   57298768  46.16 %
dist  8: count =   39121319 total   96420087  40.37 %
dist  9: count =     489031 total   96909118   0.50 %
dist 10: count =          2 total   96909120
```

For two opposite composite centers with respect to a corner that I did earlier, the distance distribution is:


```
Single slice turn metric:
dist  0: count =          1 total          1
dist  1: count =         17 total         18
dist  2: count =        236 total        254
dist  3: count =       4586 total       4840   0.009 %
dist  4: count =      71802 total      76642   0.14 %
dist  5: count =     860860 total     937502   1.67 %
dist  6: count =    7255348 total    8192850  14.09 %
dist  7: count =   27562586 total   35755436  53.54 %
dist  8: count =   15669580 total   51425016  30.44 %
dist  9: count =      57954 total   51482970   0.11 %

Block turn metric:
Performing misc. initializations...
dist  0: count =          1 total          1
dist  1: count =         17 total         18
dist  2: count =        332 total        350
dist  3: count =       7818 total       8168   0.02 %
dist  4: count =     152698 total     160866   0.30 %
dist  5: count =    2321546 total    2482412   4.51 %
dist  6: count =   19341255 total   21823667  37.57 %
dist  7: count =   29031796 total   50855463  56.39 %
dist  8: count =     627507 total   51482970   1.22 %
dist  9: count =          0 total   51482970
```


----------



## unsolved (Apr 13, 2014)

cuBerBruce said:


> I am not totally confident in my results so an independent confirmation would be good.



Speaking of *independent confirmation*... I am giving the *corner pruning* test a try.

The first step was to modify the move generator and turn it in to a 3x3x3 move generator avoiding slice turns. Easy enough.
The second step was to see if I am capturing all of the 8! corner permutations properly, which is where I am at now.







I am not sure if I am doing this correctly, so if anyone could advise, I would appreciate it.

It looks like 6 turns is all that are needed to place the 8 corners at every possible position, if you *disregard the orientations*.

Does this data match what you corner-pruner-dudes have done already?

If so, I am going to try and implement the corner orientation indexer, then combine the two and hopefully come up with 88,179,840 corner positions with turns-from-solved info for each.


```
Node 0 has corner permutation # 0 @ depth 0 after --- 1 found, 40319 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 1 has corner permutation # 79 @ depth 1 after  U. 2 found, 40318 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 2 has corner permutation # 58 @ depth 1 after  U'. 3 found, 40317 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 3 has corner permutation # 107 @ depth 1 after  U2. 4 found, 40316 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------

...

  Node 5,344,095 has corner permutation # 17569 @ depth 6 after  F R D2 F' R' B2. 40317 found, 3 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|XXXX|XXXX|&&&&|   |XXXX|~~~~|~~~~|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|####|XXXX|XXXX|^^^^|   |OOOO|OOOO|OOOO|^^^^|   |~~~~|~~~~|~~~~|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |~~~~|OOOO|OOOO|XXXX|   |&&&&|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|&&&&|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|&&&&|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |&&&&|&&&&|&&&&|XXXX|   |~~~~|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------



  Node 5,357,010 has corner permutation # 22427 @ depth 6 after  F R F2 U' B' L2. 40318 found, 2 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|OOOO|^^^^|^^^^|^^^^|   |####|^^^^|^^^^|XXXX|   |~~~~|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|####|####|XXXX|   |&&&&|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|####|####|XXXX|   |&&&&|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|XXXX|####|####|&&&&|   |&&&&|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |####|&&&&|&&&&|XXXX|   |####|^^^^|^^^^|&&&&|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|~~~~|   |XXXX|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|~~~~|   |XXXX|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|####|XXXX|XXXX|OOOO|   |~~~~|####|####|^^^^|   |&&&&|&&&&|&&&&|~~~~|
---------------------   ---------------------   ---------------------



  Node 5,403,664 has corner permutation # 17999 @ depth 6 after  F R2 U B2 R' D'. 40319 found, 1 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|^^^^|~~~~|~~~~|~~~~|   |XXXX|XXXX|XXXX|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|^^^^|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |OOOO|XXXX|XXXX|XXXX|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|&&&&|&&&&|&&&&|   |^^^^|&&&&|&&&&|OOOO|   |####|OOOO|OOOO|&&&&|
---------------------   ---------------------   ---------------------
|XXXX|~~~~|~~~~|####|   |####|&&&&|&&&&|OOOO|   |####|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|XXXX|~~~~|~~~~|####|   |####|&&&&|&&&&|OOOO|   |####|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|XXXX|~~~~|~~~~|####|   |&&&&|^^^^|^^^^|~~~~|   |OOOO|OOOO|OOOO|XXXX|
---------------------   ---------------------   ---------------------



  Node 5,506,295 has corner permutation # 17892 @ depth 6 after  F L2 D B2 L' D. 40320 found, 0 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |^^^^|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|^^^^|^^^^|^^^^|   |OOOO|XXXX|XXXX|XXXX|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|&&&&|&&&&|&&&&|   |XXXX|XXXX|XXXX|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|&&&&|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|&&&&|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|####|   |&&&&|OOOO|OOOO|~~~~|   |OOOO|&&&&|&&&&|XXXX|
---------------------   ---------------------   ---------------------
```


----------



## rokicki (Apr 13, 2014)

I don't have the actual numbers handy at the moment but they look correct. Once you get the
orientations in, those numbers are all over so it will be easier to verify them. Looks like good
progress!


----------



## cuBerBruce (Apr 13, 2014)

unsolved said:


> I am not sure if I am doing this correctly, so if anyone could advise, I would appreciate it.
> 
> It looks like 6 turns is all that are needed to place the 8 corners at every possible position, if you *disregard the orientations*.
> 
> Does this data match what you corner-pruner-dudes have done already?



Using GAP, I get 7 moves needed.



Spoiler





```
[noparse]
gap> BFS := function (G, Lgoal, Lmovs)
>   local Lrem, Lcur, Lprev, d, g, Gx, Lout;
>   Lout := [Size (Lgoal)];
>   #Lg := AsSet (Lgoal);
>   Gx := Group (Lmovs);
>   if not (Gx = G) then
>     return [];
>   fi;
>   for g in Lgoal do
>     if not g in G then
>       return [];
>     fi;
>   od;
>   Lrem := ShallowCopy (AsList (G));
>   Lprev := ShallowCopy (Lgoal);
>   Lcur := [];
>   SubtractSet (Lrem, Lgoal);
>   d := 1;
>   while Size (Lrem) > 0 do
>     Lcur := BFSgen (d, Lprev, Lrem, Lmovs);
>     Add (Lout, Size (Lcur));
>     d := d + 1;
>     SubtractSet (Lrem, Lcur);
>     Lprev := Lcur;
>     Lcur := [];
>   od;
>   return Lout;
> end;
function( G, Lgoal, Lmovs ) ... end
gap> 
gap> U := (1,4,3,2);
(1,4,3,2)
gap> D := (5,6,7,8);
(5,6,7,8)
gap> L := (1,5,8,4);
(1,5,8,4)
gap> R := (2,3,7,6);
(2,3,7,6)
gap> F := (1,2,6,5);
(1,2,6,5)
gap> B := (3,4,8,7);
(3,4,8,7)
gap> Gcp := Group (U, D, L, R, F, B);
Group([ (1,4,3,2), (5,6,7,8), (1,5,8,4), (2,3,7,6), (1,2,6,5), (3,4,8,7) ])
gap> Size (Gcp); 
40320
gap> U2 := U^2;
(1,3)(2,4)
gap> U3 := U^3;
(1,2,3,4)
gap> D2 := D^2;
(5,7)(6,8)
gap> D3 := D^3;
(5,8,7,6)
gap> L2 := L^2;
(1,8)(4,5)
gap> L3 := L^3;
(1,4,8,5)
gap> R2 := R^2;
(2,7)(3,6)
gap> R3 := R^3;
(2,6,7,3)
gap> F2 := F^2;
(1,6)(2,5)
gap> F3 := F^3;
(1,5,6,2)
gap> B2 := B^2;
(3,8)(4,7)
gap> B3 := B^3;
(3,7,8,4)
gap> Lm := [ U,U2,U3,D,D2,D3,L,L2,L3,R,R2,R3,F,F2,F3,B,B2,B3 ];
[ (1,4,3,2), (1,3)(2,4), (1,2,3,4), (5,6,7,8), (5,7)(6,8), (5,8,7,6), 
  (1,5,8,4), (1,8)(4,5), (1,4,8,5), (2,3,7,6), (2,7)(3,6), (2,6,7,3), 
  (1,2,6,5), (1,6)(2,5), (1,5,6,2), (3,4,8,7), (3,8)(4,7), (3,7,8,4) ]
gap> BFS (Gcp, [ () ], Lm );
[ 1, 18, 243, 2646, 12516, 17624, 7080, 192 ]
[/noparse]
```


----------



## unsolved (Apr 13, 2014)

cuBerBruce said:


> Using GAP, I get 7 moves needed.



Hmmm. One of us must be incorrect.

I modified the verbose output to toss out only the indexing function value returned.


```
0
79
58
107
10344
7224
21744
25349
1603
8079
3680
6248
12512
284
507
647
8046
15294
27630

....


22941
17396
17462
34452
22638
17826
17695
17920
22750
22723
22446
22624
17378
29396
17569
22427
17999
17892
```

Next, I imported it into Excel and sorted the data. All of the indices are accounted for, 0...40319, and there are no duplicates according to the "Remove Duplicates" item on the Data Ribbon of Excel.

I can double check my code again. But I somehow think 6 is the answer.

Here are the 1st three and last three indices in my program.


```
Node 1 has corner permutation # 0 @ depth 0 after  --- 1 found, 40319 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


************************************************************************************************
************************************************************************************************


Node 16,169 has corner permutation # 1 @ depth 4 after  R F B L. 11195 found, 29125 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|&&&&|XXXX|XXXX|XXXX|   |XXXX|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|&&&&|####|####|OOOO|   |####|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|&&&&|####|####|OOOO|   |####|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|####|^^^^|^^^^|^^^^|   |^^^^|~~~~|~~~~|~~~~|   |OOOO|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|OOOO|XXXX|XXXX|XXXX|   |####|####|####|^^^^|   |####|####|####|OOOO|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|&&&&|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|&&&&|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|XXXX|   |&&&&|~~~~|~~~~|~~~~|
---------------------   ---------------------   ---------------------


************************************************************************************************
************************************************************************************************


Node 467,027 has corner permutation # 2 @ depth 5 after  F2 D F' R' F'. 38200 found, 2120 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|^^^^|   |####|####|####|OOOO|   |XXXX|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|~~~~|~~~~|~~~~|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|&&&&|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|^^^^|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|^^^^|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|^^^^|   |&&&&|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|^^^^|
---------------------   ---------------------   ---------------------


************************************************************************************************
************************************************************************************************


Node 1,335,579 has corner permutation # 40317 @ depth 6 after  U2 B' U2 B2 D' L2. 40079 found, 241 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|XXXX|XXXX|XXXX|   |^^^^|&&&&|&&&&|&&&&|   |~~~~|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|^^^^|^^^^|^^^^|   |OOOO|XXXX|XXXX|^^^^|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|^^^^|~~~~|~~~~|####|   |&&&&|&&&&|&&&&|XXXX|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|XXXX|~~~~|~~~~|####|   |XXXX|^^^^|^^^^|OOOO|   |####|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------


************************************************************************************************
************************************************************************************************


Node 90,284 has corner permutation # 40318 @ depth 5 after  U2 L2 D B2 R'. 30341 found, 9979 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |&&&&|&&&&|&&&&|~~~~|   |&&&&|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|####|####|OOOO|   |&&&&|OOOO|OOOO|####|   |^^^^|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|####|####|OOOO|   |&&&&|OOOO|OOOO|####|   |^^^^|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|####|####|XXXX|   |XXXX|XXXX|XXXX|####|   |^^^^|XXXX|XXXX|OOOO|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |~~~~|XXXX|XXXX|XXXX|   |OOOO|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|XXXX|   |####|OOOO|OOOO|OOOO|   |^^^^|&&&&|&&&&|&&&&|


************************************************************************************************
************************************************************************************************


Node 78,234 has corner permutation # 40319 @ depth 5 after  U2 R L' U2 F2. 29412 found, 10908 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|OOOO|####|####|OOOO|   |~~~~|OOOO|OOOO|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|####|####|OOOO|   |~~~~|OOOO|OOOO|~~~~|   |^^^^|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|####|####|OOOO|   |~~~~|OOOO|OOOO|~~~~|   |^^^^|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|&&&&|   |####|OOOO|OOOO|####|   |^^^^|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|&&&&|####|####|&&&&|   |~~~~|&&&&|&&&&|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|####|   |XXXX|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|####|   |XXXX|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|OOOO|   |####|&&&&|&&&&|####|   |XXXX|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
```

A link to all of the indices in a text file. Kinda big. About 60 MB.
lightningcloudcomputing.com/40320_corners.txt


----------



## rokicki (Apr 13, 2014)

Ahh, don't question Bruce. I don't think he's ever been wrong.

This is what I get. Bruce is correct.

0 1
1 18
2 243
3 2646
4 12516
5 17624
6 7080
7 192


----------



## rokicki (Apr 13, 2014)

It's normally not too hard to debug this sort of thing. Just do random moves, and
ensure that the distance doesn't change by more than one on each move. If that
doesn't find the problem, write a quick IDA* for corners using your table and try
it for random positions, and then separately, go random sequence -> position ->
solution and the solution had better be the same length or shorter.

See my phase1prune.pdf or phase2prune.pdf for sample code that I used to
generate and test my Kociemba-solver pruning tables if this isn't clear enough.


----------



## unsolved (Apr 13, 2014)

rokicki said:


> Ahh, don't question Bruce. I don't think he's ever been wrong.



I just said *one of us must be incorrect*. And I was right 

Don't know how I messed up and got all of the 8! permutations in fewer moves, but it's good that we compared data. Switched over to my array move generator from the bitboard move generator, and I got identical results (to my bitboard code, still different than the both of you, ugh!)


```
#define CONSTANT_TOP 1
#define CONSTANT_FRONT 3
#define CONSTANT_RIGHT 5
#define CONSTANT_BOTTOM 7
#define CONSTANT_BACK 11
#define CONSTANT_LEFT 13

#define TFR_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_FRONT) * (CONSTANT_RIGHT))    // 15
#define TFL_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_FRONT) * (CONSTANT_LEFT))     // 39
#define TKR_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_BACK)  * (CONSTANT_RIGHT))    // 55
#define TKL_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_BACK)  * (CONSTANT_LEFT))     // 143

#define BFR_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_FRONT) * (CONSTANT_RIGHT)) // 105
#define BFL_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_FRONT) * (CONSTANT_LEFT))  // 273
#define BKR_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_BACK)  * (CONSTANT_RIGHT)) // 385
#define BKL_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_BACK)  * (CONSTANT_LEFT))  // 1001

unsigned short GLOBAL_FACTORIAL[8] = {1, 1, 2, 6, 24, 120, 720, 5040};

unsigned long get_corner_permutation(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short tfr[3], tfl[3], tkr[3], tkl[3], bfr[3], bfl[3], bkr[3], bkl[3];
	unsigned short corner_place_value[8], i, j, count;
	unsigned long corner_permutation_index;

	tkl[0] = your_cube.cube_top[1-1];
	tkr[0] = your_cube.cube_top[4-1];
	tfl[0] = your_cube.cube_top[13-1];
	tfr[0] = your_cube.cube_top[16-1];

	tkl[1] = your_cube.cube_back[4-1];
	tkr[1] = your_cube.cube_back[1-1];
	tfl[1] = your_cube.cube_front[1-1];
	tfr[1] = your_cube.cube_front[4-1];

	tkl[2] = your_cube.cube_left[1-1];
	tkr[2] = your_cube.cube_right[4-1];
	tfl[2] = your_cube.cube_left[4-1];
	tfr[2] = your_cube.cube_right[1-1];

	bkl[0] = your_cube.cube_bottom[13-1];
	bkr[0] = your_cube.cube_bottom[16-1];
	bfl[0] = your_cube.cube_bottom[1-1];
	bfr[0] = your_cube.cube_bottom[4-1];

	bkl[1] = your_cube.cube_back[13-1];
	bkr[1] = your_cube.cube_back[16-1];
	bfl[1] = your_cube.cube_front[13-1];
	bfr[1] = your_cube.cube_front[16-1];

	bkl[2] = your_cube.cube_left[13-1];
	bkr[2] = your_cube.cube_right[16-1];
	bfl[2] = your_cube.cube_left[16-1];
	bfr[2] = your_cube.cube_right[13-1];

	corner_place_value[7] = tfr[0] * tfr[1] * tfr[2];
	corner_place_value[6] = tfl[0] * tfl[1] * tfl[2];
	corner_place_value[5] = tkr[0] * tkr[1] * tkr[2];
	corner_place_value[4] = bfr[0] * bfr[1] * bfr[2];
	corner_place_value[3] = tkl[0] * tkl[1] * tkl[2];
	corner_place_value[2] = bfl[0] * bfl[1] * bfl[2];
	corner_place_value[1] = bkr[0] * bkr[1] * bkr[2];
	corner_place_value[0] = bkl[0] * bkl[1] * bkl[2];

	/*************************************************/
	/*                                               */
	/* TFR   TFL   TKR   BFR   TKL   BFL   BKR   BKL */
	/*                                               */
	/*   0    1!    2!    3!    4!    5!    6!    7! */
	/*                                               */
	/*************************************************/

	corner_permutation_index = 0;
	for(i = 0; i <= 6; i++)
	{	
		count = 0;
		for(j = i+1; j <= 7; j++)
		{
			if(corner_place_value[j] > corner_place_value[i]) count++;
		}
		corner_permutation_index += (GLOBAL_FACTORIAL[7 - i] * count);
	}

	if(corner_permutation_index >= 40320)
	{
		printf("  ** Indexing Error. corner_permutation_index == %u and should be < 40320. **\n", corner_permutation_index);
		return 0;
	}
	return corner_permutation_index;
}
```



****** UPDATE ******

Bug found! And look how simple it was!


```
bkl[1] = your_cube.cube_back[13-1];
	bkr[1] = your_cube.cube_back[16-1];
```

The above code references what you guys call DBL and DBR, bottom-back-left and bottom-back-right in my code, where I use k for back and b for bottom.

Well, I encoded those two entries improperly! The correct code is...


```
bkl[1] = your_cube.cube_back[16-1];
	bkr[1] = your_cube.cube_back[13-1];
```

This has my cumulative numbers match your numbers.






By the way, my "19 indices found" after depth 1 shows the cumulative number, since I suppress the output at depth == 0. Only 18 nodes are generated at depth == 1, so it might look odd to have found 19 indices.

Very important lesson == share data and compare!

And now, on to the orientations. I thought this was going to be simple, but somehow, I suspect these numbers are not right:






How could there only be 15 total orientations found after depth == 1?

I would think every move would produce an "orientation" so something must be amiss, again!

*[edit] Unless U, U' and U2 all have the same orientation. Hmmm. I may have answered my own question.*


----------



## cuBerBruce (Apr 13, 2014)

unsolved said:


> *[edit] Unless U, U' and U2 all have the same orientation. Hmmm. I may have answered my own question.*


A problem with orientation is that if a cubie is in a different location from its "home" position, its orientation is unclear without having some convention by which you clarify what you mean by orientation. Almost always, we use the convention of treating the U or D sticker of a corner cubie as a reference sticker. We consider the cubie oriented correctly if that sticker is on the U or D face of the puzzle. I hope that is the convention you are using.

With this convention, you should only find 4 new orientation configurations at one move away from solved. One comes from F or F'. Another from R or R'. Another from B or B'. And the last one from L or L'. Any U-layer or D-layer turn of the solved cube should not affect orientation (all cubies remain oriented), and the same is true for any half-turns of the other faces.


----------



## unsolved (Apr 13, 2014)

cuBerBruce said:


> A problem with orientation is that if a cubie is in a different location from its "home" position, its orientation is unclear without having some convention by which you clarify what you mean by orientation. Almost always, we use the convention of treating the U or D sticker of a corner cubie as a reference sticker. We consider the cubie oriented correctly if that sticker is on the U or D face of the puzzle. I hope that is the convention you are using.



I puzzled over this very same thing. I tried to invent a convention that would be fast at runtime and easy to code.

I came up with something simple, but possibly incorrect:


```
corner_place_value[6] += ((ufr[0] > ufr[1]) || (ufr[0] > ufr[2]));
	corner_place_value[6] += ((ufr[0] > ufr[1]) && (ufr[0] > ufr[2]));
```

I look at UFR for the "sticker" value, as you say. Dimension [0] is the first axis, dimension [1] is the second axis, and dimension [2] is the third axis.
ufr[0] would be the u sticker value. ufr[1] is the f sticker value. ufr[2] is the r sticker value.

I initialize the corner_place_value[n] values all to 0 for n = 0...6.

Ultimately, corner_place_value[n] will equal 0, 1, or 2 based on the "orientation."

My assignment of the value is based on "king of the hill" to see which dimension is the largest of the 3 stickers.

if U > F > R, the value will be 2.
if U > F but U < R, or U > R but U < F, the value will be 1.
if U < F and U < R, the value will be 0.

Then you apply a power of 3 series to each of the place value numbers.


```
corner_place_value[6] += ((tfr[0] > tfr[1]) || (tfr[0] > tfr[2]));
	corner_place_value[6] += ((tfr[0] > tfr[1]) && (tfr[0] > tfr[2]));
	
	corner_place_value[5] += ((tfl[0] > tfl[1]) || (tfl[0] > tfl[2]));
	corner_place_value[5] += ((tfl[0] > tfl[1]) && (tfl[0] > tfl[2]));

	corner_place_value[4] += ((tkr[0] > tkr[1]) || (tkr[0] > tfr[2]));
	corner_place_value[4] += ((tkr[0] > tkr[1]) && (tkr[0] > tfr[2]));

	corner_place_value[3] += ((bfr[0] > bfr[1]) || (bfr[0] > bfr[2]));
	corner_place_value[3] += ((bfr[0] > bfr[1]) && (bfr[0] > bfr[2]));

	corner_place_value[2] += ((tkl[0] > tkl[1]) || (tkl[0] > tkl[2]));
	corner_place_value[2] += ((tkl[0] > tkl[1]) && (tkl[0] > tkl[2]));

	corner_place_value[1] += ((bfl[0] > bfl[1]) || (bfl[0] > bfl[2]));
	corner_place_value[1] += ((bfl[0] > bfl[1]) && (bfl[0] > bfl[2]));

	corner_place_value[0] += ((bkr[0] > bkr[1]) || (bkr[0] > bkr[2]));
	corner_place_value[0] += ((bkr[0] > bkr[1]) && (bkr[0] > bkr[2]));

	corner_orientation_index = 0;

	corner_orientation_index += (GLOBAL_POWER_OF_3[0] * corner_place_value[0]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[1] * corner_place_value[1]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[2] * corner_place_value[2]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[3] * corner_place_value[3]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[4] * corner_place_value[4]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[5] * corner_place_value[5]);
	corner_orientation_index += (GLOBAL_POWER_OF_3[6] * corner_place_value[6]);
```

It's pretty straightforward, again, if my orientation assumption is correct. It does generate 2187 unique orientations, but based on what I saw with my last code also generating the correct permutation numbers but being an incorrect implementation, I am not sure if this is a correct way to proceed.

Here is my data for the unturned cube and the first depth. It does list D, D' and D2, only because in my "sticker" assignments, L == 6 so L will always be > D.


```
Node 1 has corner orientation # 58 @ depth 0 after --- 1 found, 2186 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 4 has corner orientation # 33 @ depth 1 after  D'. 2 found, 2185 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------



  Node 5 has corner orientation # 29 @ depth 1 after  D. 3 found, 2184 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------



  Node 6 has corner orientation # 4 @ depth 1 after  D2. 4 found, 2183 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------



  Node 7 has corner orientation # 139 @ depth 1 after  R. 5 found, 2182 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 8 has corner orientation # 1650 @ depth 1 after  R'. 6 found, 2181 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 9 has corner orientation # 894 @ depth 1 after  R2. 7 found, 2180 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|~~~~|   |OOOO|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|~~~~|   |OOOO|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|~~~~|   |OOOO|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|~~~~|   |OOOO|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 10 has corner orientation # 68 @ depth 1 after  L'. 8 found, 2179 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 11 has corner orientation # 310 @ depth 1 after  L. 9 found, 2178 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 12 has corner orientation # 65 @ depth 1 after  L2. 10 found, 2177 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |&&&&|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |&&&&|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |&&&&|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|####|   |&&&&|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 13 has corner orientation # 2002 @ depth 1 after  F. 11 found, 2176 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------



  Node 14 has corner orientation # 1276 @ depth 1 after  F'. 12 found, 2175 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------



  Node 15 has corner orientation # 1216 @ depth 1 after  F2. 13 found, 2174 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |^^^^|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |^^^^|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |^^^^|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |^^^^|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------



  Node 16 has corner orientation # 238 @ depth 1 after  B'. 14 found, 2173 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 18 has corner orientation # 147 @ depth 1 after  B2. 15 found, 2172 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |XXXX|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
```


----------



## cuBerBruce (Apr 14, 2014)

If you are going to build a table based upon orientation only, you absolutely need to use an orientation convention that is "consistent" for all 8 corner cubies. For instance, let's say you have a cubie that is correctly oriented at UFR. The move R will move it to BUR. That is the sticker that was on the U face goes to the B (back) face, the sticker on the F face moves to the U face, and the sticker on the R face remains on the R face. Using the convention I mentioned previously, the correctly oriented cubie at UFR becomes twisted clockwise when the move R moves it to BUR. No matter which cubie is at UFR, the move R should have the same effect on the orientation of that piece as it moves to BUR. If it doesn't, the results are basically going to be useless.

So just define orientation in the manner I described in my previous post, or your table will probably be useless.


----------



## unsolved (Apr 14, 2014)

cuBerBruce said:


> If you are going to build a table based upon orientation only, you absolutely need to use an orientation convention that is "consistent" for all 8 corner cubies.



I have gone back to make the recommended changes. I came up with an even simpler formula which takes one line of code per corner arrangement


```
corner_place_value[6] += ((ufl[0] > ufl[2]) + (ufl[0] > ufl[1]));
	corner_place_value[5] += ((ubr[2] > ubr[1]) + (ubr[0] > ubr[1]));
	corner_place_value[4] += ((dfr[1] > dfr[0]) + (dfr[1] > dfr[2]));
	corner_place_value[3] += ((ubl[0] > ubl[2]) + (ubl[0] > ubl[1]));
	corner_place_value[2] += ((dfl[0] > dfl[2]) + (dfl[1] > dfl[2]));
	corner_place_value[1] += ((dbr[2] > dbr[0]) + (dbr[2] > dbr[1]));
	corner_place_value[0] += ((dbl[0] > dbl[2]) + (dbl[0] > dbl[1]));
```

This works with the prime values I have for U = 1, F = 3, R = 5, D = 7, B = 11, L = 13.

Whenever both conditions are false, I have a "+= 0" which means the cubie is in its native orientation.
When I get a "+= 1" that means the cubie is rotated 90 degrees clockwise from its normal orientation.
The "+= 2" means it is rotated 90 degrees counterclockwise.

I'm taking the dangerous step of merging this with the permutation code now to generate the index over the entire range of 8! * 3^7 without testing the 3^7 part stand alone. I am too anxious to see what happens 

Thanks for all of your good advice Bruce. I appreciate it!


----------



## cuBerBruce (Apr 14, 2014)

unsolved said:


> I have gone back to make the recommended changes. I came up with an even simpler formula which takes one line of code per corner arrangement
> 
> 
> ```
> ...



If I'm interpreting your code properly, I don't think this implements what I suggested.

Basically there are 8 positions on the puzzle where the corner piecescan be located. I call these positions "cubicles." (We can also talk about edge cubicles and center cubicles, but those aren't relevant to this discussion.) There are 8 corner pieces which can be identified through the colors of their stickers. I call these "cubies." We can refer to the sticker colors as the "U-color," "D=color", "R-color," etc. insteaad of actual colors if we want to label the colors in a general way without regard to the actual color scheme of the puzzle.

Now if we want to determine the orientation of a cubie at a given cubicle, we first look at the sticker that is on the reference facelet of that cubicle, which is the facelet which is either on the U face or the D face. If that sticker color is either the U-color or the D-color we say that cubicle is oriented or has an orientation value of 0. If it is a different color, *we don't care what color it is!* Instead we look at the next facelet of that cubicle in clockwise order. If that facelet's sticker is the U-color or D-color, we say that the cubicle has clockwise orientation, or an orientation value of 1. If neither of those two facelets had a sticker color of the U- or D-color, then the final facelet must be one of those two colors. (we technically shouldn't have to check it.) In this case we say the cubicle has an orientation value of 2 (rotated counterclockwise).

*Again, we only care about U-color and D-color stickers when trying to determine orientation.*


----------



## unsolved (Apr 14, 2014)

cuBerBruce said:


> *Again, we only care about U-color and D-color stickers when trying to determine orientation.*



So after R+, the previous UFR cubie moves to BFR and has an orientation of +1 since the U sticker is 90 clockwise from the F sticker?


----------



## cuBerBruce (Apr 14, 2014)

unsolved said:


> So after R+, the previous UFR cubie moves to BUR and has an orientation of +1 since the U sticker is 90 clockwise from the F sticker?


We *don't care* where the F-color sticker is. We don't even care whether or not the *cubie* at the URB *cubicle* has an F-color sticker. What we care about is where the U-color or D-color sticker is with respect to the U facelet of the URB *cubicle*. (The U facelet of the URB *cubicle* always refers to the sticker position on the U (top) face of the cube. Note *cubicles* never move, only *cubies* move.) We may care about the other sticker colors for determining permutation, but not for orientation.


----------



## unsolved (Apr 14, 2014)

cuBerBruce said:


> We *don't care* where the F-color sticker is. We don't even care whether or not the *cubie* at the URB *cubicle* has an F-color sticker. What we care about is where the U-color or D-color sticker is with respect to the U facelet of the URB *cubicle*. (The U facelet of the URB *cubicle* always refers to the sticker position on the U (top) face of the cube. Note *cubicles* never move, only *cubies* move.) We may care about the other sticker colors for determining permutation, but not for orientation.



Wow, did I really type BFR? I must have been exhausted  I swear, that cubicle designation made _perfect sense_ at the time!

I am starting to get the feeling for what it must be like for an astronaut in outerspace. There are only relative motions, no absolutes, and I am having a hard time getting my brain in gear!

OK, so my current level of understand (or misunderstanding) is this:


If there is a U sticker face up on U, we have a 0-orientation for that cubie at that cubicle
If there is a U sticker face up on D (when viewed from D face up as if on top but still a D-cubicle), we have a 0-orientation for that cubie at that cubicle
If there is a D sticker face up on U, we have a 0-orientation for that cubie at that cubicle
If there is a U sticker face up on D (when viewed from D face up as if on top but still a D-cubicle), we have a 0-orientation for that cubie at that cubicle
For any non-0 case, +1 indicates the U or D sticker is 90 degrees clockwise from the 0-orientation
Any other case results in a +2 orientation

As I have no relative info attached to my cubies, I will need to do some recoding to make this work.

UPDATE: Trying this code now:


```
#define CONSTANT_TOP 1
#define CONSTANT_FRONT 3
#define CONSTANT_RIGHT 5
#define CONSTANT_BOTTOM 7
#define CONSTANT_BACK 11
#define CONSTANT_LEFT 13

#define UFR_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_FRONT) * (CONSTANT_RIGHT))    // 15
#define UFL_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_FRONT) * (CONSTANT_LEFT))     // 39
#define UBR_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_BACK)  * (CONSTANT_RIGHT))    // 55
#define UBL_NATIVE_CORNER ((CONSTANT_TOP) * (CONSTANT_BACK)  * (CONSTANT_LEFT))     // 143

#define DFR_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_FRONT) * (CONSTANT_RIGHT)) // 105
#define DFL_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_FRONT) * (CONSTANT_LEFT))  // 273
#define DBR_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_BACK)  * (CONSTANT_RIGHT)) // 385
#define DBL_NATIVE_CORNER ((CONSTANT_BOTTOM) * (CONSTANT_BACK)  * (CONSTANT_LEFT))  // 1001

#define GLOBAL_CORNER_ORIENTATION_TOTAL 2187

unsigned short GLOBAL_POWER_OF_3[7] = {1, 3, 9, 27, 81, 243, 729};

unsigned short get_corner_orientation(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short ufr[3], ufl[3], ubr[3], ubl[3], dfr[3], dfl[3], dbr[3], dbl[3];
	unsigned short where_cubie_came_from[7] = {0,0,0,0,0,0,0};
	unsigned short corner_orientation_index = 0;
	unsigned short which_corner, which_U_or_D_cubie, which_orientation, i;

	/*****************************************/
	/* CUBICLE accessing code. Get the cubie */
 	/* at these hard-coded addresses.        */
	/*****************************************/
	ubl[0] = your_cube.cube_top[1-1];
	ubr[0] = your_cube.cube_top[4-1];
	ufl[0] = your_cube.cube_top[13-1];
	ufr[0] = your_cube.cube_top[16-1];

	ubl[1] = your_cube.cube_back[4-1];
	ubr[1] = your_cube.cube_back[1-1];
	ufl[1] = your_cube.cube_front[1-1];
	ufr[1] = your_cube.cube_front[4-1];

	ubl[2] = your_cube.cube_left[1-1];
	ubr[2] = your_cube.cube_right[4-1];
	ufl[2] = your_cube.cube_left[4-1];
	ufr[2] = your_cube.cube_right[1-1];

	dbl[0] = your_cube.cube_bottom[13-1];
	dbr[0] = your_cube.cube_bottom[16-1];
	dfl[0] = your_cube.cube_bottom[1-1];
	dfr[0] = your_cube.cube_bottom[4-1];

	dbl[1] = your_cube.cube_back[16-1];
	dbr[1] = your_cube.cube_back[13-1];
	dfl[1] = your_cube.cube_front[13-1];
	dfr[1] = your_cube.cube_front[16-1];

	dbl[2] = your_cube.cube_left[13-1];
	dbr[2] = your_cube.cube_right[16-1];
	dfl[2] = your_cube.cube_left[16-1];
	dfr[2] = your_cube.cube_right[13-1];

	/***************************************************/
        /* The 6 faces of the cube were given prime number */
	/* constants. Each triple product will be a number */
        /* that is unique, and therefore reveals where it  */
        /* was on the cube originally.                     */
	/***************************************************/
	where_cubie_came_from[7] = ufr[0] * ufr[1] * ufr[2];
	where_cubie_came_from[6] = ufl[0] * ufl[1] * ufl[2];
	where_cubie_came_from[5] = ubr[0] * ubr[1] * ubr[2];
	where_cubie_came_from[4] = dfr[0] * dfr[1] * dfr[2];
	where_cubie_came_from[3] = ubl[0] * ubl[1] * ubl[2];
	where_cubie_came_from[2] = dfl[0] * dfl[1] * dfl[2];
	where_cubie_came_from[1] = dbr[0] * dbr[1] * dbr[2];
	where_cubie_came_from[0] = dbl[0] * dbl[1] * dbl[2];

	corner_orientation_index = 0;

	for(i = 0; i<= 6; i++)
	{
		which_corner = where_cubie_came_from[i];
		which_orientation = 0;

			/*******************************************/
			/*                                         */
			/* Each CUBICLE array is of dimension [3]. */
			/*                                         */
			/* [0] is always from the 1st face of the  */
                        /*     3-letter variable designation.      */
			/*                                         */
			/*     dbr[0] = the cubie sticker on D     */
			/*                                         */
			/* [1] is always from the 2nd face of the  */
                        /*     3-letter variable designation.      */
			/*                                         */
			/*     dbr[1] = the cubie sticker on B     */
			/*                                         */
			/* [2] is always from the 3rd face of the  */
                        /*     3-letter variable designation.      */
			/*                                         */
			/*     dbr[2] = the cubie sticker on R     */
			/*                                         */
			/*******************************************/

			switch(i)
			{
				case 0: which_U_or_D_cubie = dbl[0]; break;
				case 1: which_U_or_D_cubie = dbr[0]; break;
				case 2: which_U_or_D_cubie = dfl[0]; break;
				case 3: which_U_or_D_cubie = ubl[0]; break;
				case 4: which_U_or_D_cubie = dfr[0]; break;
				case 5: which_U_or_D_cubie = ubr[0]; break;
				case 6: which_U_or_D_cubie = ufl[0]; break;
			}

			/*******************************************/
			/*                                         */
			/* If sticker is U or D, orientation = 0   */
                        /*                                         */
			/* If the dimension[1] sticker is face up, */
                        /*                       orientation = 1   */
                        /*                                         */
			/* If the dimension[2] sticker is face up, */
                        /*                       orientation = 2   */
			/*                                         */
			/*******************************************/

			switch(which_corner)
			{
				case UFR_NATIVE_CORNER: break;
				case UFL_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_FRONT) + (2*(which_U_or_D_cubie == CONSTANT_LEFT))); break;
				case UBR_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_BACK)  + (2*(which_U_or_D_cubie == CONSTANT_RIGHT))); break;
				case UBL_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_BACK)  + (2*(which_U_or_D_cubie == CONSTANT_LEFT))); break;
				case DFR_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_FRONT) + (2*(which_U_or_D_cubie == CONSTANT_RIGHT))); break;
				case DFL_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_FRONT) + (2*(which_U_or_D_cubie == CONSTANT_LEFT))); break;
				case DBR_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_BACK)  + (2*(which_U_or_D_cubie == CONSTANT_RIGHT))); break;
				case DBL_NATIVE_CORNER: which_orientation += ((which_U_or_D_cubie == CONSTANT_BACK)  + (2*(which_U_or_D_cubie == CONSTANT_LEFT))); break;
				default: printf("  ** WTF Error. which_corner == %d and doesn't FRIGGIN exist! **\n", which_corner);break;
			}

		corner_orientation_index += (GLOBAL_POWER_OF_3[i] * which_orientation);
	}
	
	if(corner_orientation_index > GLOBAL_CORNER_ORIENTATION_TOTAL)
	{
		printf("  ** Indexing Error. corner_orientation_index == %d and should be %d < . **\n", corner_orientation_index, GLOBAL_CORNER_ORIENTATION_TOTAL);
		return 0;
	}

	return corner_orientation_index;
}
```

I just started running this a few minutes ago, and here is what I get after about 18.5 trillion nodes have been explored, total (depth 9 + current depth 10 node count)






Doesn't look good for the full indexing code. Are most of the permutations * orientations happening that late in the search?


----------



## cuBerBruce (Apr 14, 2014)

unsolved said:


> Doesn't look good for the full indexing code. Are most of the permutations * orientations happening that late in the search?



So far, so good! Just depth 10 and depth 11 left.

I note that usually these analyses are done using a breadth first search. That is, at each depth, you just go out one more move from the positions found at the preceding depth. It seems to me that you are generating a full brute force tree of depth N for each new depth.


----------



## rokicki (Apr 14, 2014)

cuBerBruce said:


> I note that usually these analyses are done using a breadth first search. That is, at each depth, you just go out one more move from the positions found at the preceding depth. It seems to me that you are generating a full brute force tree of depth N for each new depth.



Right, and that's nice if you're storing all the results (and have index and unindex routines) because
for each level you just scan your results so far for depth d, and use them to generate depth d+1.

There are ways to speed this up (do the early levels using depth-first search, as you are doing, and
do the late levels using backwards search) but for a table this small (88M entries) it won't matter much.

Most of the fun of pruning tables is generating fast but dense indexing and unindexing functions. For
corners, it's pretty easy because the permutation and orientation are fully separable.

-tom


----------



## unsolved (Apr 14, 2014)

cuBerBruce said:


> So far, so good! Just depth 10 and depth 11 left.
> 
> I note that usually these analyses are done using a breadth first search. That is, at each depth, you just go out one more move from the positions found at the preceding depth. It seems to me that you are generating a full brute force tree of depth N for each new depth.



Something is awry though.


```
Node 3 has corner orientation # 243 @ depth 1 after  U2. 2 found, 2185 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Node 4 has corner orientation # 22 @ depth 1 after  D'. 3 found, 2184 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------



Node 5 has corner orientation # 172 @ depth 1 after  D. 4 found, 2183 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------



Node 6 has corner orientation # 107 @ depth 1 after  D2. 5 found, 2182 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
```

I should not be seeing any U or D moves at depth == 1. In this file I am only capturing the first instance of a new *orientation*, and not *(permutation - 1)*(orientation) + (orientation - 1)* written here as the 0-based master index with 1-based sub-indices for permutation and orientation.

My code for the orientation (prior post) looks correct though, doesn't it?

I don't increment the orientation index (0..2) when U or D are on the top or bottom face up, and it's +1 for +90 and +2 for -90 rotations of the cubie.

Grrrr.... more debugging with fprintf()....

*UPDATE:

Ok, I think I solved the orientation bug...*

http://lightningcloudcomputing.com/orientation_only.txt

If someone could check that out and let me know.

Looks like ply-1 is working...


```
Node 1 has corner orientation # 0 @ depth 0 after --- 1 found, 2186 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 7 has corner orientation # 84 @ depth 1 after  R. 2 found, 2185 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 8 has corner orientation # 246 @ depth 1 after  R'. 3 found, 2184 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 10 has corner orientation # 766 @ depth 1 after  L'. 4 found, 2183 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 13 has corner orientation # 1476 @ depth 1 after  F. 5 found, 2182 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------



  Node 14 has corner orientation # 180 @ depth 1 after  F'. 6 found, 2181 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |~~~~|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------



  Node 16 has corner orientation # 548 @ depth 1 after  B'. 7 found, 2180 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 4 has corner orientation # 573 @ depth 2 after  U R. 8 found, 2179 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|XXXX|   |XXXX|XXXX|XXXX|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|^^^^|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 5 has corner orientation # 408 @ depth 2 after  U R'. 9 found, 2178 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |XXXX|XXXX|XXXX|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|^^^^|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|XXXX|   |~~~~|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 7 has corner orientation # 740 @ depth 2 after  U L'. 10 found, 2177 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|XXXX|####|####|####|   |~~~~|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |^^^^|^^^^|^^^^|####|   |OOOO|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |OOOO|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |OOOO|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|^^^^|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |OOOO|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 8 has corner orientation # 1486 @ depth 2 after  U L. 11 found, 2176 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|####|####|####|   |####|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|XXXX|~~~~|~~~~|~~~~|   |^^^^|^^^^|^^^^|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|~~~~|   |^^^^|^^^^|^^^^|OOOO|
---------------------   ---------------------   ---------------------
```

*UPDATE #2*

The array move generator was taking too long to complete ply 11 last night (over 2 hours), so, of course, I decided tor recode the permutations + orientation table as a bitboard and switch to the massively-parallel bitboard implementation and log in and run it on one of the blinding fast server racks at the office. And this is what I find today:






Nooooooooooooooooooooooo!


----------



## cuBerBruce (Apr 15, 2014)

unsolved said:


> If someone could check that out and let me know.
> 
> Looks like ply-1 is working...



It looks wrong to me. You should only have 4 new configurations at depth 1.

From solved, R and R' produce the same orientation configuration. Cubicles URB and DRF will each contain a cubie that is twisted clockwise, and cubicles UFR and DBR will contain counter-clockwise twisted cubies.

If you're using (DLB),UFR,ULF,URB,DRF,ULB,DFL,DBR cublicle ordering, the base 3 number should look like (0)2011002. This should give 1568 decimal. Your value of 84 (for R) would correspond to a base 3 number of (?)0010001, and it doesn't have any 2's (well, one if the "(?)" is a 2, but it actually needs to be 1 for the digits to add to 0 modulo 3) for the counterclockwise-twisted cubicles, so it doesn't make sense to me.

EDIT (appending):
I've now finished analyzing the distance distribution for the 3x3x1 block pruning table in single slice turn metric and block turn metric.


```
3x3x1 block:
Single slice turn metric:
dist  0: count =          1 total          1
dist  1: count =         18 total         19
dist  2: count =        348 total        367
dist  3: count =       6969 total       7336
dist  4: count =     127662 total     134998
dist  5: count =    2183800 total    2318798
dist  6: count =   31940635 total   34259433
dist  7: count =  328348722 total  362608155
dist  8: count = 1463547678 total 1826155833
dist  9: count =  879470589 total 2705626422
dist 10: count =    4258602 total 2709885024

Block turn metric:
dist  0: count =          1 total          1
dist  1: count =         18 total         19
dist  2: count =        455 total        474
dist  3: count =      11271 total      11745
dist  4: count =     266161 total     277906
dist  5: count =    5722833 total    6000739
dist  6: count =   96340321 total  102341060
dist  7: count =  882894514 total  985235574
dist  8: count = 1638637904 total 2623873478
dist  9: count =   86011474 total 2709884952
dist 10: count =         72 total 2709885024
```


----------



## unsolved (Apr 15, 2014)

cuBerBruce said:


> I've now finished analyzing the distance distribution for the 3x3x1 block pruning table in single slice turn metric and block turn metric.
> 
> 
> ```
> ...



So there are no depth == 11 entries?


----------



## rokicki (Apr 15, 2014)

Wow. So on average corners-only distance returns a higher value than this metric, which uses
9 cubies and 2.7B entries.

Of course this metric can be applied in 24 different ways, which bumps it up a move or two.
And then there's the addition of one you can perform in many cases because a given move only
changes a subset of the solved blocks. This is easy to figure out, I think; there are only a few
moves that disturb a solved block, and you can make a bitmask for each, and "and" together all
the ones at the greatest distance, and if you end up with zero, you get a free addition of 1
move to the distance.

Next is to consider other subspaces than just defined by cubies, and see if there's a good
pruning table that works well. Probably edge pairing is something to consider.


----------



## unsolved (Apr 15, 2014)

rokicki said:


> Next is to consider other subspaces than just defined by cubies, and see if there's a good
> pruning table that works well. Probably edge pairing is something to consider.



I have given this idea some thought, when I have not been pulling what's left of my hair out of my head from the orientation perplexity.

How about this for an idea...

Of course, pruning based on the location of ALL CENTERS is never going to happen, but... we can get the functional "distance-usable" equivalent with a trick.

A chain is only as strong as its weakest link, and so, the distance-from-solved for any of the center arrangements cannot be any faster than the slowest solution for two adjacent faces.

Why not index every possible U vs. F center face configuration, obtain strong solutions for distance-from-solved for each, and use them as a center pruning table?

There should be all kinds of symmetry reductions, and the state space is small enough that it can be handled via distributed computing in a reasonable amount of time.
The table will be small, RAM resident, and should provide for some very deep pruning. Using the corner-pruning table during the database generation will be of tremendous help.


----------



## cuBerBruce (Apr 15, 2014)

unsolved said:


> So there are no depth == 11 entries?


Correct. Although this table is different from the one you're working on, which does have distance 11 positions. By the way the numbers I get for corners considering only orientation are { 1, 4, 34, 186, 816, 1018, 128 } for distances 0 through 6, with 6 being the maximum depth.



rokicki said:


> Wow. So on average corners-only distance returns a higher value than this metric, which uses
> 9 cubies and 2.7B entries.
> 
> Of course this metric can be applied in 24 different ways, which bumps it up a move or two.
> ...



Yes, the corners pruning table has the branching factor limited due to several 4x4x4 moves having no effect on them. Another thing about corners pruning, is that if the pruning table distance is exactly the distance-to-goal depth, you can skip applying any moves that don't involve outer layers.

One could try 8 corners and 2 edges. (Of course, that's a superset of just the 8 corners, so it doesn't complement that pruning table.)


----------



## rokicki (Apr 15, 2014)

unsolved said:


> Why not index every possible U vs. F center face configuration, obtain strong solutions for distance-from-solved for each, and use them as a center pruning table?
> 
> There should be all kinds of symmetry reductions, and the state space is small enough that it can be handled via distributed computing in a reasonable amount of time.
> The table will be small, RAM resident, and should provide for some very deep pruning. Using the corner-pruning table during the database generation will be of tremendous help.



This isn't that big a space; (24 choose 4) * (20 choose 4) for which I get 51M entries. No need
for distributed computing. Probably worth investigating.

Indeed, for any pruning table that fits in memory, it's pretty fast and easy to just do breadth-first
by scanning; you can even multithread this pretty easily if you're careful. If you have a big-memory
machine, consider doing relatively large scans. You can use some of the tricks on Jaap's site to
push things a bit further (for instance, four values in a byte by storing values mod 3 is a very classic
trick).


----------



## cuBerBruce (Apr 15, 2014)

rokicki said:


> This isn't that big a space; (24 choose 4) * (20 choose 4) for which I get 51M entries. No need
> for distributed computing. Probably worth investigating.



I've done this for the center pieces of 2 opposite faces (with respect to a corner piece) instead of 2 adjacent faces (post 83). It should be rather easy to change it to adjacent faces. I'll probably try it in the next day or so, but I would guess the results will be similar.


----------



## unsolved (Apr 15, 2014)

cuBerBruce said:


> It looks wrong to me. You should only have 4 new configurations at depth 1.
> 
> From solved, R and R' produce the same orientation configuration. Cubicles URB and DRF will each contain a cubie that is twisted clockwise, and cubicles UFR and DBR will contain counter-clockwise twisted cubies.
> 
> If you're using (DLB),UFR,ULF,URB,DRF,ULB,DFL,DBR cublicle ordering, the base 3 number should look like (0)2011002. This should give 1568 decimal. Your value of 84 (for R) would correspond to a base 3 number of (?)0010001, and it doesn't have any 2's (well, one if the "(?)" is a 2, but it actually needs to be 1 for the digits to add to 0 modulo 3) for the counterclockwise-twisted cubicles, so it doesn't make sense to me.



I changed the order of the cubicles for the place-value assignments in the power-of-3 section of the code that generates the orientation sub-index.

Here is ply 1 with the 1st two entries @ ply-2.

I still get R and R' tossing out different orientation indices from the solved state.


```
Node 1 == orientation # 0  [(base-3 number = 0000000) order UFR UFL UBL UBR DFR DFL DBL] @ depth 0 after --- 1 found, 2186 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 7 == orientation # 756  [(base-3 number = 1001000) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  R. 2 found, 2185 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 8 == orientation # 738  [(base-3 number = 1000100) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  R'. 3 found, 2184 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 10 == orientation # 328  [(base-3 number = 0110011) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  L'. 4 found, 2183 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|OOOO|####|####|####|   |~~~~|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|&&&&|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|####|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 13 == orientation # 1968  [(base-3 number = 2200220) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  F. 5 found, 2182 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |####|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------



  Node 16 == orientation # 216  [(base-3 number = 0022000) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  B'. 6 found, 2181 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|####|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 17 == orientation # 164  [(base-3 number = 0020002) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  B. 7 found, 2180 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|XXXX|XXXX|XXXX|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|~~~~|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|^^^^|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|&&&&|   |####|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 4 == orientation # 783  [(base-3 number = 1002000) order UFR UFL UBL UBR DFR DFL DBL] @ depth 2 after  U R. 8 found, 2179 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|XXXX|   |XXXX|XXXX|XXXX|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|####|####|OOOO|   |OOOO|OOOO|OOOO|~~~~|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|&&&&|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|^^^^|   |####|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



  Node 5 == orientation # 1476  [(base-3 number = 2000200) order UFR UFL UBL UBR DFR DFL DBL] @ depth 2 after  U R'. 9 found, 2178 remain.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |XXXX|XXXX|XXXX|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|&&&&|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|^^^^|   |OOOO|OOOO|OOOO|####|   |&&&&|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|XXXX|   |~~~~|^^^^|^^^^|^^^^|   |OOOO|OOOO|OOOO|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|OOOO|   |~~~~|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
```



rokicki said:


> This isn't that big a space; (24 choose 4) * (20 choose 4) for which I get 51M entries. No need
> for distributed computing. Probably worth investigating.



Well you'd have to solve 51M entries via searching from scratch, and not via just move generation + hoping to run into a permutation * orientation as in the case of the corners table. With a distance-from-solved == 8 plies just for 1 center unsolved vs. 1 center unsolved, I imagine the longest to swap say 3 splattered on 1 face and 3 splattered on another could take 24 plies or longer. Might be a tough solve! And, you'd need data for every entry to make the table fully useful.



rokicki said:


> You can use some of the tricks on Jaap's site to
> push things a bit further (for instance, four values in a byte by storing values mod 3 is a very classic
> trick).



Oh, you can do waaaay better than 2 per byte if you use run-length encoding. When I solved the 440 billion positions in the 8-piece checkers endgame database, we averaged over 30 positions per byte by examining the runs of the same data and compressing it with data bytes that indicate how many were in a row.

Example in our case. Say you have indices where the results are (in turns from solved) 1,1,1,1,1,1,2,2,2,2,3,2,2,2,1,2,3,2,2,2,2,2,2,2,4,4,4,4,4,4,4,4,4,4,4,4

You represent the bytes as 1x6, 2x4, (3 + 2 as 4-bits each stuffed into a byte since they break up a run), (2 + 2 as 4-bits each since we don't run-length encode runs of 2 values in a row), (1 + 2, same reason), (3 + 2, same reason), 2x6, 4x12.

There is no reason to adhere to a standard where 1 represents the number 1, 2 represents the number 2, etc. I can encode "2" to mean "when I have 12 values in a row, each == 4."

In such a scheme, you have 1 byte per run of entries, and 1 byte per pair (as you suggested @ 4 bits each).

You create a lookup table as you compress the data, storing them in blocks with the last global index stored per block of data.


```
-----------------------------------------------------------------------------------------------------
| 205 | 206 |  50 |  34 |  18 |  50 |  207 |  208 |XXXX| store that index 36 is last entry in block |
-----------------------------------------------------------------------------------------------------

You can store up to 12 + 12 in one byte and only use 204 of the 255 values in a byte.
So you can make 205 to 255 mean anything you want!

1x6 = 205
2x4 = 206

(3 + 2 = 0011 0010) = 50 
(2 + 2 = 0010 0010) = 34
(1 + 2 = 0001 0010) = 18
(3 + 2 = 0011 0010) = 50 

2x6  = 207 
4x12 = 208

This way, you have 36 entries encoded using only 8 bytes + a "last index in block" value that can store the largest index in your set, in this case, 4 bytes.

This means 36 entries in 12 bytes = 3 positions per byte.
```

So what you have is a cluster of fixed-size blocks in RAM, each of which you know the largest index contained therein. So to find the value of your position, here is what you do:

1. Generate the index.
2. Binary search among the blocks to find the block that contains the index.
3. Go to the start of that block, read the bytes sequentially, decoding the "skip" value for the entry, and keeping track until you encounter or surpass your index.
4. Once you are at such a location, the value of the byte tells you the value of your distance.

There is a "penalty" for decompression, so you want to only use this for very large databases that would not otherwise fit into RAM.


----------



## cuBerBruce (Apr 16, 2014)

unsolved said:


> ```
> Node 7 == orientation # 756  [(base-3 number = 1001000) order UFR UFL UBL UBR DFR DFL DBL] @ depth 1 after  R. 2 found, 2185 remain.
> ```


First, I want to say that you should list the facelets/stickers consistently in either clockwise order or counterclockwise order. For this post, I will use clockwise order. Then UFL is OK, but UFR is not - it should be URF (or RFU or FUR). Then after the move F' (starting from solved), we can say that the cubie at UFL is RFU. The U facelet of the UFL cubicle has an R-color sticker, the F facelet is the F-color, and the L-facelet is the U-color. Similarly, after U, we could say the UFL cubicle contains cubie URF. In this manner we not only specify what what cubie is at a particular cublcle, but also how its oriented.

We then list our cubicles, as (DRB) URF UFL ULB UBR DFR DLF DBL. The state after the move R (starting from solved) can be specified by listing the cubicles and the cubie at each of them.


```
cubicles: (DRB) URF UFL ULB UBR DFR DLF DBL
cubies:   (BRU) FRD UFL ULB FUR BDR DLF DBL
base 3 #: (  2)   2 0   0    1   1  0   0
```
So for R, we should get the base-3 number 2001100 (ignoring the DRB cubicle) or 1494 decimal.

For F, we should get:

```
cubicles: (DRB) URF UFL ULB UBR DFR DLF DBL
cubies:   (DRB) LUF LFD ULB UBR RFU RDF DBL
base 3 #  (0  )  1    2 0   0     2  1  0
```
Base-3 1200210 is decimal 1236.

Note I label the cubicles starting with a U or D, and then the position of the U or D for the cubies determines the base-3 digit.


----------



## qqwref (Apr 16, 2014)

Just a little pruning table idea: suppose we have a table for corners, so we know our position needs at least (say) 8 moves to solve. But none of those 8 moves are slice moves, since slice moves don't affect corners. Perhaps we could add on a second pruning table for centers or edges, and then by looking at that, determine that our position also requires at least (say) 4 slice moves. Because the second pruning table counts slice moves only, we can add the results! Then our position requires at least 12 moves to solve.


----------



## cuBerBruce (Apr 16, 2014)

qqwref said:


> Just a little pruning table idea: suppose we have a table for corners, so we know our position needs at least (say) 8 moves to solve. But none of those 8 moves are slice moves, since slice moves don't affect corners. Perhaps we could add on a second pruning table for centers or edges, and then by looking at that, determine that our position also requires at least (say) 4 slice moves. Because the second pruning table counts slice moves only, we can add the results! Then our position requires at least 12 moves to solve.



Good suggestion! This should be very useful at least for single slice turn metric. It's probably not going to be helpful for block turn metric or outer block turn metric.

Inner layer turns are needed to pair up edges, and if you have 3 or fewer dedges formed, we know it takes at least 3 inner layer turns to form the rest. Similarly, inner layer moves are needed to move center pieces to a different face. If you know at least 17 center pieces must move to a different face, at least 3 inner layer turns are required. Determining the number of centers needing to move to a different face may not be so simple, though. A table based on a subset might be more useful.


----------



## unsolved (Apr 17, 2014)

I have not had much success with the orientation bug, so I took a "time out" from that and worked on something else as a distraction. I probed my 2-turns-from-solved database of 1,026 positions and saw that there were only 73 different "patterns" for the first row on the top face. I decided to see if it was possible to do a *Karnaugh Map Reduction* of the entire database into a series of instructions. As it turns out, it is possible, and I recoded the positions (remember there are 98,496 data elements total that describe every possible arrangement 2 turns away from a solved cube, if you count each cube's location as 1 item) with one set of case statements, one matrix, and one for-loop that determines what range of the matrix to parse over.

*UPDATE: Added a feature to automatically turn off any turns-from-solved (tfs) database that could not possibly improve upon the fastest solution found so far.*







It is a relatively small chunk of code when you consider what it does and how it can be used.

Recall, my previous 2-tfs database was not in any kind of "order," so I had a lazy implementation where I had to scan every element in the database to see if there was a match. My "justification" of this lazy approach was that it was a small database and the performance hit was not that great when you consider it chops off 2 entire plies of search from the tree.

But now, it is much quicker, though clearly not as elegant as a hashing function with a bitboard. (My bitboard code is too buggy for now, I am back to the old matrix code).

I am not sure if this code is of interest to the group or not. The bigger question is, to what extent can this be applied to larger tfs databases.


```
Solution to 4x4x4 Cube scrambled with ----> d'  u2  l2  F'  b'  f2  L2  

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|^^^^|~~~~|####|####|   |&&&&|&&&&|XXXX|OOOO|   |~~~~|^^^^|####|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|XXXX|^^^^|   |^^^^|&&&&|XXXX|OOOO|   |~~~~|OOOO|~~~~|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|~~~~|####|~~~~|   |OOOO|^^^^|OOOO|&&&&|   |####|XXXX|####|&&&&|
---------------------   ---------------------   ---------------------
|~~~~|^^^^|&&&&|XXXX|   |&&&&|&&&&|XXXX|OOOO|   |~~~~|^^^^|####|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|XXXX|OOOO|^^^^|   |&&&&|&&&&|OOOO|OOOO|   |####|XXXX|~~~~|^^^^|
---------------------   ---------------------   ---------------------
|^^^^|####|~~~~|####|   |OOOO|OOOO|XXXX|&&&&|   |~~~~|^^^^|~~~~|OOOO|
---------------------   ---------------------   ---------------------
|~~~~|&&&&|^^^^|XXXX|   |^^^^|^^^^|&&&&|OOOO|   |####|&&&&|####|XXXX|
---------------------   ---------------------   ---------------------
|XXXX|####|~~~~|~~~~|   |&&&&|&&&&|OOOO|OOOO|   |####|XXXX|~~~~|^^^^|
---------------------   ---------------------   ---------------------



Solution [1] =  L2 F f2 b l2  [INSIDE 2-turn database]
Solution [2] =  L2 F f2 b l2 u  [INSIDE 2-turn database]
Solution [3] =  L2 F f2 b l2 u'  [INSIDE 2-turn database]
Solution [4] =  L2 F f2 b l2 u2  [INSIDE 1-turn database]
Solution [5] =  L2 F f2 b l2 d'  [INSIDE 2-turn database]
Solution [6] =  L2 F f2 b l2 d  [INSIDE 1-turn database]
Solution [7] =  L2 F f2 b l2 d2  [INSIDE 2-turn database]
Solution [8] =  L2 F b l2 f2 u2  [INSIDE 1-turn database]
Solution [9] =  L2 F b l2 f2 d  [INSIDE 1-turn database]
```

*Update: Karnaugh Map Reduction for 3-TFS Database*

Believe it or not, there are only 216 unique patterns possible for the topmost row of the Top face of the 4x4x4 after every possible 3-turn path is taken. I was able to perform a Karnaugh Map Reduction on the entire database, mapping every position possible from 3 moves away from a solution using just a case statement, a matrix, and a for loop. Well, the matrix is much bigger, but only a small section of it ever needs to be queried to find a position.

If you turn the top row of the top face into a 4-digit number, where 1 = top color, 2 = front color, 3 = right color, 4 = bottom color, 5 = back color, 6 = left color, these are the only combinations that are present 3 moves from a solution. The cube's orientation is UFR facing you for the assignment of row numerals.


```
TFS_03_ARRAY_INDEX = 0;
	current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

	switch(current_cube_row_data)
	{
		case 1111: index_start = 0; index_stop = 184656; break;
		case 1121: index_start = 184680; index_stop = 211824; break;
		case 1131: index_start = 211848; index_stop = 218160; break;
		case 1141: index_start = 218184; index_stop = 246384; break;
		case 1151: index_start = 246408; index_stop = 273384; break;
		case 1161: index_start = 273408; index_stop = 279720; break;
		case 1211: index_start = 279744; index_stop = 306888; break;
		case 1221: index_start = 306912; index_stop = 308808; break;
		case 1231: index_start = 308832; index_stop = 308904; break;
		case 1241: index_start = 308928; index_stop = 310680; break;
		case 1251: index_start = 310704; index_stop = 312456; break;
		case 1261: index_start = 312480; index_stop = 312552; break;
		case 1311: index_start = 312576; index_stop = 318888; break;
		case 1321: index_start = 318912; index_stop = 318984; break;
		case 1331: index_start = 319008; index_stop = 319392; break;
		case 1341: index_start = 319416; index_stop = 319608; break;
		case 1351: index_start = 319632; index_stop = 319752; break;
		case 1361: index_start = 319776; index_stop = 319848; break;
		case 1411: index_start = 319872; index_stop = 348072; break;
		case 1421: index_start = 348096; index_stop = 349848; break;
		case 1431: index_start = 349872; index_stop = 350064; break;
		case 1441: index_start = 350088; index_stop = 353496; break;
		case 1451: index_start = 353520; index_stop = 355296; break;
		case 1461: index_start = 355320; index_stop = 355512; break;
		case 1511: index_start = 355536; index_stop = 382512; break;
		case 1521: index_start = 382536; index_stop = 384288; break;
		case 1531: index_start = 384312; index_stop = 384432; break;
		case 1541: index_start = 384456; index_stop = 386232; break;
		case 1551: index_start = 386256; index_stop = 388080; break;
		case 1561: index_start = 388104; index_stop = 388224; break;
		case 1611: index_start = 388248; index_stop = 394560; break;
		case 1621: index_start = 394584; index_stop = 394656; break;
		case 1631: index_start = 394680; index_stop = 394752; break;
		case 1641: index_start = 394776; index_stop = 394968; break;
		case 1651: index_start = 394992; index_stop = 395112; break;
		case 1661: index_start = 395136; index_stop = 395544; break;
		case 2112: index_start = 395568; index_stop = 422568; break;
		case 2122: index_start = 422592; index_stop = 424488; break;
		case 2132: index_start = 424512; index_stop = 424584; break;
		case 2142: index_start = 424608; index_stop = 426384; break;
		case 2152: index_start = 426408; index_stop = 428160; break;
		case 2162: index_start = 428184; index_stop = 428256; break;
		case 2212: index_start = 428280; index_stop = 430176; break;
		case 2222: index_start = 430200; index_stop = 432648; break;
		case 2232: index_start = 432672; index_stop = 432840; break;
		case 2242: index_start = 432864; index_stop = 433056; break;
		case 2252: index_start = 433080; index_stop = 433176; break;
		case 2262: index_start = 433200; index_stop = 433392; break;
		case 2312: index_start = 433416; index_stop = 433488; break;
		case 2322: index_start = 433512; index_stop = 433680; break;
		case 2332: index_start = 433704; index_stop = 436368; break;
		case 2342: index_start = 436392; index_stop = 436416; break;
		case 2352: index_start = 436440; index_stop = 436512; break;
		case 2362: index_start = 436536; index_stop = 436632; break;
		case 2412: index_start = 436656; index_stop = 438432; break;
		case 2422: index_start = 438456; index_stop = 438648; break;
		case 2432: index_start = 438672; index_stop = 438696; break;
		case 2442: index_start = 438720; index_stop = 441528; break;
		case 2452: index_start = 441552; index_stop = 441648; break;
		case 2462: index_start = 441672; index_stop = 441696; break;
		case 2512: index_start = 441720; index_stop = 443472; break;
		case 2522: index_start = 443496; index_stop = 443592; break;
		case 2532: index_start = 443616; index_stop = 443688; break;
		case 2542: index_start = 443712; index_stop = 443808; break;
		case 2552: index_start = 443832; index_stop = 443904; break;
		case 2562: index_start = 443928; index_stop = 444000; break;
		case 2612: index_start = 444024; index_stop = 444096; break;
		case 2622: index_start = 444120; index_stop = 444312; break;
		case 2632: index_start = 444336; index_stop = 444432; break;
		case 2642: index_start = 444456; index_stop = 444480; break;
		case 2652: index_start = 444504; index_stop = 444576; break;
		case 2662: index_start = 444600; index_stop = 447264; break;
		case 3113: index_start = 447288; index_stop = 453672; break;
		case 3123: index_start = 453696; index_stop = 453768; break;
		case 3133: index_start = 453792; index_stop = 454176; break;
		case 3143: index_start = 454200; index_stop = 454368; break;
		case 3153: index_start = 454392; index_stop = 454512; break;
		case 3163: index_start = 454536; index_stop = 454632; break;
		case 3213: index_start = 454656; index_stop = 454728; break;
		case 3223: index_start = 454752; index_stop = 454944; break;
		case 3233: index_start = 454968; index_stop = 457704; break;
		case 3243: index_start = 457728; index_stop = 457752; break;
		case 3253: index_start = 457776; index_stop = 457848; break;
		case 3263: index_start = 457872; index_stop = 457944; break;
		case 3313: index_start = 457968; index_stop = 458352; break;
		case 3323: index_start = 458376; index_stop = 461112; break;
		case 3333: index_start = 461136; index_stop = 484896; break;
		case 3343: index_start = 484920; index_stop = 486288; break;
		case 3353: index_start = 486312; index_stop = 488904; break;
		case 3363: index_start = 488928; index_stop = 490368; break;
		case 3413: index_start = 490392; index_stop = 490560; break;
		case 3423: index_start = 490584; index_stop = 490608; break;
		case 3433: index_start = 490632; index_stop = 492000; break;
		case 3443: index_start = 492024; index_stop = 492360; break;
		case 3453: index_start = 492384; index_stop = 492408; break;
		case 3463: index_start = 492432; index_stop = 492456; break;
		case 3513: index_start = 492480; index_stop = 492600; break;
		case 3523: index_start = 492624; index_stop = 492696; break;
		case 3533: index_start = 492720; index_stop = 495312; break;
		case 3543: index_start = 495336; index_stop = 495360; break;
		case 3553: index_start = 495384; index_stop = 495576; break;
		case 3563: index_start = 495600; index_stop = 495672; break;
		case 3613: index_start = 495696; index_stop = 495792; break;
		case 3623: index_start = 495816; index_stop = 495888; break;
		case 3633: index_start = 495912; index_stop = 497352; break;
		case 3643: index_start = 497376; index_stop = 497400; break;
		case 3653: index_start = 497424; index_stop = 497496; break;
		case 3663: index_start = 497520; index_stop = 498984; break;
		case 4114: index_start = 499008; index_stop = 527256; break;
		case 4124: index_start = 527280; index_stop = 529032; break;
		case 4134: index_start = 529056; index_stop = 529248; break;
		case 4144: index_start = 529272; index_stop = 532560; break;
		case 4154: index_start = 532584; index_stop = 534408; break;
		case 4164: index_start = 534432; index_stop = 534624; break;
		case 4214: index_start = 534648; index_stop = 536400; break;
		case 4224: index_start = 536424; index_stop = 536592; break;
		case 4234: index_start = 536616; index_stop = 536640; break;
		case 4244: index_start = 536664; index_stop = 539472; break;
		case 4254: index_start = 539496; index_stop = 539568; break;
		case 4264: index_start = 539592; index_stop = 539616; break;
		case 4314: index_start = 539640; index_stop = 539832; break;
		case 4324: index_start = 539856; index_stop = 539880; break;
		case 4334: index_start = 539904; index_stop = 541272; break;
		case 4344: index_start = 541296; index_stop = 541656; break;
		case 4354: index_start = 541680; index_stop = 541704; break;
		case 4364: index_start = 541728; index_stop = 541752; break;
		case 4414: index_start = 541776; index_stop = 545064; break;
		case 4424: index_start = 545088; index_stop = 547896; break;
		case 4434: index_start = 547920; index_stop = 548280; break;
		case 4444: index_start = 548304; index_stop = 578280; break;
		case 4454: index_start = 578304; index_stop = 581040; break;
		case 4464: index_start = 581064; index_stop = 581424; break;
		case 4514: index_start = 581448; index_stop = 583272; break;
		case 4524: index_start = 583296; index_stop = 583368; break;
		case 4534: index_start = 583392; index_stop = 583416; break;
		case 4544: index_start = 583440; index_stop = 586176; break;
		case 4554: index_start = 586200; index_stop = 586440; break;
		case 4564: index_start = 586464; index_stop = 586488; break;
		case 4614: index_start = 586512; index_stop = 586704; break;
		case 4624: index_start = 586728; index_stop = 586752; break;
		case 4634: index_start = 586776; index_stop = 586800; break;
		case 4644: index_start = 586824; index_stop = 587184; break;
		case 4654: index_start = 587208; index_stop = 587232; break;
		case 4664: index_start = 587256; index_stop = 588600; break;
		case 5115: index_start = 588624; index_stop = 615768; break;
		case 5125: index_start = 615792; index_stop = 617520; break;
		case 5135: index_start = 617544; index_stop = 617664; break;
		case 5145: index_start = 617688; index_stop = 619440; break;
		case 5155: index_start = 619464; index_stop = 621288; break;
		case 5165: index_start = 621312; index_stop = 621432; break;
		case 5215: index_start = 621456; index_stop = 623184; break;
		case 5225: index_start = 623208; index_stop = 623304; break;
		case 5235: index_start = 623328; index_stop = 623376; break;
		case 5245: index_start = 623400; index_stop = 623496; break;
		case 5255: index_start = 623520; index_stop = 623568; break;
		case 5265: index_start = 623592; index_stop = 623664; break;
		case 5315: index_start = 623688; index_stop = 623808; break;
		case 5325: index_start = 623832; index_stop = 623880; break;
		case 5335: index_start = 623904; index_stop = 626568; break;
		case 5345: index_start = 626592; index_stop = 626616; break;
		case 5355: index_start = 626640; index_stop = 626832; break;
		case 5365: index_start = 626856; index_stop = 626928; break;
		case 5415: index_start = 626952; index_stop = 628704; break;
		case 5425: index_start = 628728; index_stop = 628824; break;
		case 5435: index_start = 628848; index_stop = 628872; break;
		case 5445: index_start = 628896; index_stop = 631656; break;
		case 5455: index_start = 631680; index_stop = 631872; break;
		case 5465: index_start = 631896; index_stop = 631920; break;
		case 5515: index_start = 631944; index_stop = 633768; break;
		case 5525: index_start = 633792; index_stop = 633840; break;
		case 5535: index_start = 633864; index_stop = 634056; break;
		case 5545: index_start = 634080; index_stop = 634272; break;
		case 5555: index_start = 634296; index_stop = 636864; break;
		case 5565: index_start = 636888; index_stop = 637080; break;
		case 5615: index_start = 637104; index_stop = 637224; break;
		case 5625: index_start = 637248; index_stop = 637320; break;
		case 5635: index_start = 637344; index_stop = 637416; break;
		case 5645: index_start = 637440; index_stop = 637464; break;
		case 5655: index_start = 637488; index_stop = 637680; break;
		case 5665: index_start = 637704; index_stop = 640320; break;
		case 6116: index_start = 640344; index_stop = 646632; break;
		case 6126: index_start = 646656; index_stop = 646728; break;
		case 6136: index_start = 646752; index_stop = 646848; break;
		case 6146: index_start = 646872; index_stop = 647040; break;
		case 6156: index_start = 647064; index_stop = 647184; break;
		case 6166: index_start = 647208; index_stop = 647592; break;
		case 6216: index_start = 647616; index_stop = 647688; break;
		case 6226: index_start = 647712; index_stop = 647904; break;
		case 6236: index_start = 647928; index_stop = 647976; break;
		case 6246: index_start = 648000; index_stop = 648024; break;
		case 6256: index_start = 648048; index_stop = 648120; break;
		case 6266: index_start = 648144; index_stop = 650808; break;
		case 6316: index_start = 650832; index_stop = 650928; break;
		case 6326: index_start = 650952; index_stop = 651000; break;
		case 6336: index_start = 651024; index_stop = 652512; break;
		case 6346: index_start = 652536; index_stop = 652560; break;
		case 6356: index_start = 652584; index_stop = 652680; break;
		case 6366: index_start = 652704; index_stop = 654168; break;
		case 6416: index_start = 654192; index_stop = 654360; break;
		case 6426: index_start = 654384; index_stop = 654408; break;
		case 6436: index_start = 654432; index_stop = 654456; break;
		case 6446: index_start = 654480; index_stop = 654864; break;
		case 6456: index_start = 654888; index_stop = 654912; break;
		case 6466: index_start = 654936; index_stop = 656304; break;
		case 6516: index_start = 656328; index_stop = 656448; break;
		case 6526: index_start = 656472; index_stop = 656544; break;
		case 6536: index_start = 656568; index_stop = 656664; break;
		case 6546: index_start = 656688; index_stop = 656712; break;
		case 6556: index_start = 656736; index_stop = 656928; break;
		case 6566: index_start = 656952; index_stop = 659568; break;
		case 6616: index_start = 659592; index_stop = 659976; break;
		case 6626: index_start = 660000; index_stop = 662664; break;
		case 6636: index_start = 662688; index_stop = 664152; break;
		case 6646: index_start = 664176; index_stop = 665544; break;
		case 6656: index_start = 665568; index_stop = 668184; break;
		case 6666: index_start = 668208; index_stop = 692040; break;
		default: goto test_tfs_02; break;
	}
```

The start and stop indices are the only ranges within the matrix that need to be scanned in order to identify a position that matches the rest of the cube.

So now all you have to do is...


```
for(TFS_03_ARRAY_INDEX = index_start; TFS_03_ARRAY_INDEX <= index_stop; TFS_03_ARRAY_INDEX+= 24)
	{
		GLOBAL_TFS_3_DATABASE_PROBES++;

		index_offset = 0;

		/*********************************/
		/* TOP face match existing cube? */
		/*********************************/
		current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
		if(current_database_row_data != current_cube_row_data) continue;

		index_offset++;
		current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
		if(current_database_row_data != current_cube_row_data) continue;

		index_offset++;
		current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
		if(current_database_row_data != current_cube_row_data) continue;

		index_offset++;
		current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
		if(current_database_row_data != current_cube_row_data) continue;

		/***********************************/
		/* FRONT face match existing cube? */
		/***********************************/
		index_offset++;
		current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[0], your_cube.cube_front[1], your_cube.cube_front[2], your_cube.cube_front[3]);
		if(current_database_row_data != current_cube_row_data) continue;

ETC. ETC. ETC.
```

...and the GLOBAL_TFS_03_DATABASE matrix finds the matching positions.

Nice way to shave off 3-ply from any search.


----------



## rokicki (Apr 17, 2014)

qqwref said:


> Just a little pruning table idea: suppose we have a table for corners, so we know our position needs at least (say) 8 moves to solve. But none of those 8 moves are slice moves, since slice moves don't affect corners. Perhaps we could add on a second pruning table for centers or edges, and then by looking at that, determine that our position also requires at least (say) 4 slice moves. Because the second pruning table counts slice moves only, we can add the results! Then our position requires at least 12 moves to solve.



I don't think you can add here, unfortunately, since
the face turns alone change the edges and corners
sufficiently that you have a different position.

If you could generalize things, so you build a table
that somehow says "for this particular edge
pairing, and this particular corner quads" (neither
of which are affected by face turns) you might be
able to do something, but even if it is only slice
turns I'm still a little leery.

Additive pruning tables are excellent; if there's a
way to apply them to the 4x4x4, that's almost
certainly the best direction to go---but I'm not
yet convinced it is possible.


----------



## cuBerBruce (Apr 17, 2014)

rokicki said:


> I don't think you can add here, unfortunately, since
> the face turns alone change the edges and corners
> sufficiently that you have a different position.



In the breadth-first search for inner layer turns, after each inner-layer turn, you need to find all positions reachable using only face turns (not including wide turns, we need to assume single-slice turn metric) and mark those positions as being of the same depth. Likewise the "solved" states have to include all positions reachable from only face turns from the actual solved state. Then we'll have a count of the minimum number of inner layer turns needed indpendent of how many outer layer turns are needed. Then for a given position, we can have a minimum number of inner turns independent of how many outer layer turns are used, and (from the corner table) a minimum number of outer layer turns independent of how many inner layer turns are used. Then the minimum number of moves from solved has to be at least the sum of these two bounds.

A simple bound for edge pairing bound can be obtained using the following table:

```
dedges already    inner layer
   formed         turns needed
     0                3
     1                3
     2                3
     3                3
     4                2
     5                2
     6                2
     7                2
     8                1
     9                2
    10                2
    11            (impossible)
    12                0
```


----------



## unsolved (Apr 17, 2014)

cuBerBruce said:


> In the breadth-first search for inner layer turns, after each inner-layer turn,



Hi Bruce,

Sorry that this post is unrelated  I just ran a solve for the case of 2 centers missing from 2 adjacent faces. It hit my new 3-TFS database and found a solution, but I don't have a cube with me here at work to test it out. Can you supply the last 3 turns for me if your solver is not otherwise engaged right now? Thanks if you can. And, is there an algo for doing 2 simultaneous center swaps?







```
Solution to 4x4x4 cube center scenario U1,2:F1,2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [1] =  U  F' D2 B2 l' B2 D2 F2  [INSIDE 3-turn database] @ 11076427485 nodes                                                           
Solution [2] =  U  F' l' F2 D2 B2 r' B2  [INSIDE 3-turn database] @ 11205157254 nodes
```


----------



## cuBerBruce (Apr 17, 2014)

unsolved said:


> Hi Bruce,
> 
> Sorry that this post is unrelated  I just ran a solve for the case of 2 centers missing from 2 adjacent faces. It hit my new 3-TFS database and found a solution, but I don't have a cube with me here at work to test it out. Can you supply the last 3 turns for me if your solver is not otherwise engaged right now?



Enter: F b' u' d b U2 b' u d' b U2 F' U F' D2 B2 l' B2 D2 F2
scramble: [20] F b' u' d b U2 b' u d' b U2 F' U F' D2 B2 l' B2 D2 F2
Found solution: [ 3] r' F' U'
distance 3 node count 177 solved state checks 54
Enter: F b' u' d b U2 b' u d' b U2 F' U F' l' F2 D2 B2 r' B2
scramble: [20] F b' u' d b U2 b' u d' b U2 F' U F' l' F2 D2 B2 r' B2
Found solution: [ 3] D2 F' U'
distance 3 node count 99 solved state checks 54


----------



## unsolved (Apr 17, 2014)

cuBerBruce said:


> Found solution: [ 3] r' F' U'
> Found solution: [ 3] D2 F' U'



Thanks! I will check it out when I get home.

So now we have an 11-move algo for swapping two adjacent centers.


----------



## rokicki (Apr 18, 2014)

Ahh, if your metric is such that turning a two-depth block counts as two moves,
yes, then this works. Is "slice turn metric" such a metric? I guess I was confused
by what was meant by "slice turn metric".


----------



## cuBerBruce (Apr 18, 2014)

rokicki said:


> Ahh, if your metric is such that turning a two-depth block counts as two moves,
> yes, then this works. Is "slice turn metric" such a metric? I guess I was confused
> by what was meant by "slice turn metric".



That's why I don't call it "slice turn metric," but rather "*single* slice turn metric" - to emphasize that you're only allowed to turn a *single* slice (layer) at a time as a move.


----------



## qqwref (Apr 18, 2014)

The first alg is a setup to F2 D2 B2 l' B2 D2 F2 r'. I didn't know about that one but it's interesting.


----------



## cuBerBruce (Apr 18, 2014)

unsolved said:


> I just ran a solve for the case of 2 centers missing from 2 adjacent faces.


Technically, each of the sequences you found are two 3-cycles rather than two swaps, as is clear when I execute these sequence in GAP:

```
gap> U*F3*D2*B2*l3*B2*D2*F2*r3*F3*U3;
(6,38,11)(7,39,10)
gap> U*F3*l3*F2*D2*B2*r3*B2*D2*F3*U3;
(6,38,11)(7,39,10)
```
The fact that some pieces are indistinguishable give the appearance of simple swaps.



unsolved said:


> And, is there an algo for doing 2 simultaneous center swaps?


I am not totally clear what you want. In terms of swapping all 4 center pieces on one face with those of another face, there is r2 f2 b2 r2 f2 b2. This swaps among opposite faces, and is actually 4 swaps as one might expect (with no hidden swaps or other hidden cycles). For 2 adjacent faces my solver gives:

```
Enter: 5uffuuff5u/8l8l/5f2u2f2u5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count          0   solved state checks          0
distance  5   node count        546   solved state checks          0
distance  6   node count      12792   solved state checks        240
distance  7   node count     220407   solved state checks      12336
distance  8   node count    5646369   solved state checks    1237992
distance  9   node count   57603123   solved state checks    7497474
Found solution: [10]  l  U2 B2 D2 l  r  D2 B2 U2 r
Found solution: [10]  l  D2 B2 U2 l  r  U2 B2 D2 r
Found solution: [10]  l' F2 D2 B2 l' r' B2 D2 F2 r'
Found solution: [10]  l' B2 D2 F2 l' r' F2 D2 B2 r'
Found solution: [10]  r  F2 D2 B2 l  r  B2 D2 F2 l
Found solution: [10]  r  B2 D2 F2 l  r  F2 D2 B2 l
Found solution: [10]  r' U2 B2 D2 l' r' D2 B2 U2 l'
Found solution: [10]  r' D2 B2 U2 l' r' U2 B2 D2 l'
distance 10   node count  881587164   solved state checks  138793824
```
These are also 4 swaps and no other hidden cycles.

I also tried "swapping" individual center pieces among 4 faces, thinking I might get 2 swaps, but still ended up with double 3-cycles. (A couple solutions also changed the orientation of the cube.)

```
Enter: 5uf2u8u/8l2ld5l/5fu2f8f/8r8r/8b8b/8d2dl5d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count          0   solved state checks          0
distance  5   node count        177   solved state checks          0
distance  6   node count       8400   solved state checks       1782
distance  7   node count      62994   solved state checks       2403
distance  8   node count    2210466   solved state checks     493524
distance  9   node count   23569581   solved state checks    2312484
distance 10   node count  500716785   solved state checks   72125880
Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u
Found solution: [11]  U  d' F' l  b2 l  b2 l2 F  U' d
Found solution: [11]  U  d' F' l  b2 l  b2 l2 F  u  D'
Found solution: [11]  u' D  R' f  l2 f  l2 f2 R  U' d
Found solution: [11]  u' D  R' f  l2 f  l2 f2 R  u  D'
Found solution: [11]  u' L' U  f  r2 f  r2 f2 U' L  u
Found solution: [11]  u' R' D  f  l2 f  l2 f2 D' R  u
Found solution: [11]  D  d' B' l2 f2 l' f2 l' B  D' d
Found solution: [11]  d' l' D  l' f2 l' f2 l2 D' l  d
Found solution: [11]  d' r' B  l' d2 l' d2 l2 B' r  d
Found solution: [11]  d' F' U  l  b2 l  b2 l2 U' F  d
Found solution: [11]  d' B' D  l2 f2 l' f2 l' D' B  d
distance 11   node count 3033266855   solved state checks  594172323
```


----------



## unsolved (Apr 18, 2014)

cuBerBruce said:


> Technically, each of the sequences you found are two 3-cycles rather than two swaps, as is clear when I execute these sequence in GAP



And what is GAP?



cuBerBruce said:


> The fact that some pieces are indistinguishable give the appearance of simple swaps.



Ooooooh, I see. I thought the optimal algo for one center swap across adjacent faces was 8-plies, so I was surprised to see 2 being swapped in only 11 total.




cuBerBruce said:


> I am not totally clear what you want.



Mostly I am just testing my code under the one of the lesser-known Hippocratic Oath sayings: "Don't make the patient worse."  Just making sure the TFS databases I am recoding as *matrix-case statement-for loop* implementations have no errors in them, nor are there any "missing entries," and so on. I am just creating every position/orientation where the U face needs 2 centers to be solved, ditto for the F face. 



cuBerBruce said:


> In terms of swapping all 4 center pieces on one face with those of another face, there is r2 f2 b2 r2 f2 b2.



I can remember doing that back in 1984 


```
Found solution: [10]  l  U2 B2 D2 l  r  D2 B2 U2 r
```

I just did this on my cube here, but I thought your first "l" was just an ASCII pipe, so I applied U2 B2 D2 l r D2 B2 U2 r without the without the first "l", and was pleasantly surprised when I could (fortunately) just apply it at the end.
But that misapplied version of the algo swaps just 2 centers in that case.


```
Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u
```

Now that is cool! I'll have to set that up on a test run a little later.

And here's my "scare moment" of the day:







Solution [1] finds a 3-TFS solution @ depth 6.
Solution [2] finds a 2-TFS solution @ depth 7, which you expect. By definition, there must be one solution of "distance - 1" when you find a turns-from-solved database solution from the previous iteration.

But now look at Solution [3].

It's back in the 3-TFS database just one node away from the 2-FTS solution just encountered. And the next node is also a 3-TFS solution.

Naturally, I thought this meant I had a bug in my code....

But if you do the listed scramble at the top, you can see that all of the enumerated solutions are correct in the announcement of their turn-lengths.



And here is some code that can be compiled to use the 2-TFS database. It should recognize every possible solution that is either 1 or 2 moves from being solved. Not very useful stand alone, but it can reduce the number of nodes you have to probe by a factor of 1026 since it finds solutions 2 plies sooner than a nominal search could.


```
// sample_4x4x4_program_for_4x4x4_paper.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


#define MAX_DEPTH 24

#define UNSOLVED (-1)
#define ALREADY_SOLVED (0)
#define SOLVED_IN_1_MORE_MOVE (1)
#define SOLVED_IN_2_MORE_MOVES (2)

#define TOP_INDEX 1
#define FRONT_INDEX 2
#define RIGHT_INDEX 3
#define BOTTOM_INDEX 4
#define BACK_INDEX 5
#define LEFT_INDEX 6

#define CONSTANT_TOP 1
#define CONSTANT_FRONT 3
#define CONSTANT_RIGHT 5
#define CONSTANT_BOTTOM 7
#define CONSTANT_BACK 11
#define CONSTANT_LEFT 13

#define TOP_IS_SOLVED 16
#define FRONT_IS_SOLVED 48
#define RIGHT_IS_SOLVED 80
#define BOTTOM_IS_SOLVED 112
#define BACK_IS_SOLVED 176
#define LEFT_IS_SOLVED 208

typedef struct cube_4x4x4_arrangement
{
	unsigned char cube_top[16];
	unsigned char cube_bottom[16];
	unsigned char cube_front[16];
	unsigned char cube_back[16];
	unsigned char cube_right[16];
	unsigned char cube_left[16];
}
CUBE_4x4_ARRANGEMENT, *CUBE_4x4_ARRANGEMENT_PTR;

CUBE_4x4_ARRANGEMENT global_4x4x4_array_cube;

unsigned short GLOBAL_SEARCH_EXTENSIONS_ON = 1;
unsigned short GLOBAL_PROBE_TFS_1_DATABASE = 1;
unsigned short GLOBAL_PROBE_TFS_2_DATABASE = 1;

unsigned long long GLOBAL_TFS_1_DATABASE_PROBES;
unsigned long long GLOBAL_TFS_2_DATABASE_PROBES;

unsigned short GLOBAL_CUBE_SOLUTION[MAX_DEPTH] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

unsigned long TFS_01_ARRAY_INDEX = 0;
unsigned short GLOBAL_TFS_01_DATABASE[864] = {1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664};


unsigned long TFS_02_ARRAY_INDEX = 0;
unsigned short GLOBAL_TFS_02_DATABASE[24624] = {1111, 1111, 1111, 1111, 2222, 1551, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 2222, 1551, 1551, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 1551, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 2222, 1551, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 1551, 3333, 3333, 3333, 6666, 5445, 5445, 5445, 5445, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 2552, 3333, 3333, 3333, 6666, 1441, 1441, 1441, 1441, 2552, 2552, 2552, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 1551, 5555, 4444, 4444, 4444, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 2552, 1111, 4444, 4444, 4444, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4664, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4554, 2222, 4444, 4444, 4444, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 5335, 5335, 5335, 5335, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1661, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3553, 2552, 2552, 2662, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 4554, 3333, 3333, 3333, 6666, 2442, 2442, 2442, 2442, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4224, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1221, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 5555, 2552, 2552, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6556, 2552, 2552, 2332, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 2332, 2332, 2332, 2332, 4444, 4444, 4444, 4444, 1551, 1551, 1551, 1331, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 1111, 2552, 2552, 2552, 3333, 6666, 6666, 6666, 2552, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 2222, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 4554, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 5555, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 1551, 
1111, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 4554, 4334, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 2552, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 2222, 2552, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 1551, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 6666, 1551, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 2552, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 6666, 2552, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 4554, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 6666, 4554, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 3553, 2662, 2552, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3353, 3353, 3353, 3353, 4444, 4444, 4444, 4444, 4554, 4554, 4664, 4554, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3533, 3533, 3533, 3533, 4444, 4444, 4444, 4444, 1551, 1551, 1661, 1551, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 5555, 3333, 3333, 5555, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 2222, 6666, 6666, 2222, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 3333, 6666, 3333, 3333, 5555, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 6666, 3333, 6666, 6666, 2222, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 4554, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 2222, 4554, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 5555, 2222, 2552, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4444, 4444, 4554, 4554, 4224, 4554, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 4444, 4444, 1551, 1551, 1221, 1551, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 5555, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3233, 3233, 3233, 3233, 4444, 4444, 4444, 4444, 1551, 1551, 1331, 1551, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3323, 3323, 3323, 3323, 4444, 4444, 4444, 4444, 4554, 4554, 4334, 4554, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 6556, 2332, 2552, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 1551, 1551, 3333, 1551, 6666, 6666, 1551, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2552, 2552, 3333, 2552, 6666, 6666, 2552, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 4554, 4554, 3333, 4554, 6666, 6666, 4554, 6666, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 2222, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 5555, 3333, 3333, 2222, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 2222, 6666, 6666, 5555, 3333, 
1111, 1111, 1111, 1111, 2222, 2222, 6666, 6666, 3333, 3333, 2222, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 3333, 3333, 6666, 6666, 5555, 5555, 
1111, 1111, 1111, 1111, 2222, 2552, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 2222, 2552, 2552, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 1551, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 6666, 1551, 1551, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 2552, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 6666, 2552, 2552, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 2552, 2662, 3553, 2552, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 4554, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 6666, 4554, 4554, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3353, 3353, 3353, 3353, 4444, 4444, 4444, 4444, 1551, 1661, 1551, 1551, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3533, 3533, 3533, 3533, 4444, 4444, 4444, 4444, 4554, 4664, 4554, 4554, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 5555, 3333, 5555, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 2222, 6666, 2222, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 3333, 2222, 6666, 3333, 5555, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 6666, 5555, 3333, 6666, 2222, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 3333, 3333, 2222, 3333, 5555, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 6666, 5555, 6666, 2222, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 5555, 2222, 3333, 5555, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 2222, 5555, 6666, 2222, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 3333, 6666, 2222, 3333, 5555, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 6666, 3333, 5555, 6666, 2222, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 4554, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 2222, 4554, 4554, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2552, 2222, 5555, 2552, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4444, 4444, 1551, 1221, 1551, 1551, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 4444, 4444, 4554, 4224, 4554, 4554, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 5555, 3333, 2222, 3333, 6666, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 6666, 5555, 6666, 3333, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 5555, 6666, 2222, 3333, 6666, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 2222, 3333, 5555, 6666, 3333, 5555, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3233, 3233, 3233, 3233, 4444, 4444, 4444, 4444, 4554, 4334, 4554, 4554, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3323, 3323, 3323, 3323, 4444, 4444, 4444, 4444, 1551, 1331, 1551, 1551, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 1551, 3333, 1551, 1551, 6666, 1551, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2552, 3333, 2552, 2552, 6666, 2552, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 4554, 3333, 4554, 4554, 6666, 4554, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2552, 2332, 6556, 2552, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 2222, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 5555, 3333, 2222, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 2222, 6666, 5555, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 6666, 2222, 6666, 3333, 2222, 3333, 2222, 4444, 4444, 4444, 4444, 5555, 3333, 5555, 3333, 6666, 5555, 6666, 5555, 
1111, 1111, 1111, 1111, 2222, 6666, 3333, 2222, 3333, 2222, 5555, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 6666, 5555, 6666, 5555, 2222, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 5555, 2222, 3333, 2222, 6666, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 2222, 5555, 6666, 5555, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 6666, 6666, 2222, 3333, 2222, 2222, 3333, 4444, 4444, 4444, 4444, 5555, 3333, 3333, 5555, 6666, 5555, 5555, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1661, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 2662, 2552, 2552, 3553, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5335, 5335, 5335, 5335, 4444, 4444, 4444, 4444, 4664, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 3663, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 4664, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 1661, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 3333, 2222, 2222, 6666, 5555, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 6666, 5555, 5555, 3333, 2222, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 3333, 2222, 3333, 2222, 5555, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 6666, 5555, 2222, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 3333, 2222, 6666, 2222, 5555, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 6666, 5555, 3333, 5555, 2222, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 3333, 3333, 2222, 2222, 5555, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 6666, 5555, 5555, 2222, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 3333, 6666, 2222, 2222, 5555, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 3333, 5555, 5555, 2222, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 1221, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1221, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 2222, 2552, 2552, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 4444, 4224, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 5555, 6666, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 2222, 3333, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 5555, 2222, 3333, 2222, 6666, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 6666, 5555, 3333, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 5555, 2222, 6666, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 2222, 5555, 3333, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 5555, 2222, 6666, 2222, 6666, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 2222, 5555, 3333, 5555, 3333, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 5555, 3333, 2222, 2222, 6666, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 6666, 5555, 5555, 3333, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 4224, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 5225, 5225, 5225, 6666, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 5225, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 5555, 2222, 2222, 6666, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 2222, 5555, 5555, 3333, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 5555, 6666, 2222, 2222, 6666, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 3333, 5555, 5555, 3333, 5555, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 1331, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 4334, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 6336, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2332, 2332, 2332, 2332, 4444, 4444, 4444, 4444, 4334, 4554, 4554, 4554, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 2332, 2552, 2552, 6556, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 1331, 1551, 1551, 1551, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 
1111, 1111, 1111, 1111, 6666, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 4444, 4444, 4444, 4444, 3333, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 
1111, 1111, 1111, 1111, 6666, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 
1111, 1111, 1111, 1111, 6666, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 4444, 4444, 4444, 4444, 3333, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 
1111, 1111, 1111, 1111, 6666, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 
1111, 1111, 1111, 1111, 6666, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 
1111, 1111, 1111, 1441, 5225, 5225, 5225, 5225, 6336, 6336, 6336, 6336, 4114, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 2222, 3333, 2222, 2222, 2222, 1551, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 1551, 1551, 1551, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 2222, 6666, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 2332, 6226, 6226, 6226, 6226, 4224, 4334, 4334, 4334, 5665, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 2442, 1221, 1221, 1221, 1221, 6336, 6336, 6336, 6336, 5115, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 2662, 3223, 3223, 3223, 3223, 1331, 1331, 1331, 1551, 5335, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3233, 2622, 2622, 2622, 2622, 4334, 4224, 4334, 4334, 6566, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 3323, 2262, 2262, 2262, 2262, 4334, 4334, 4224, 4334, 6656, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 3333, 1111, 2222, 2222, 2222, 2332, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 6666, 4444, 4444, 4444, 4554, 4554, 4554, 6556, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4224, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4554, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4664, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4444, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 3553, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 5555, 6446, 6446, 6446, 6446, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 4334, 
1111, 1111, 1111, 3333, 2222, 2222, 2222, 6666, 4334, 4334, 4334, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4334, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 3333, 2222, 2222, 4334, 2222, 4334, 4334, 5555, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 5555, 2222, 4334, 4334, 6666, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 4334, 6666, 
1111, 1111, 1111, 3333, 2222, 2222, 6666, 2222, 4334, 4334, 2222, 4334, 6666, 4444, 4444, 4444, 5555, 5555, 4334, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 3333, 2222, 4334, 2222, 2222, 4334, 5555, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 5555, 2222, 2222, 4334, 6666, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 4334, 6666, 6666, 
1111, 1111, 1111, 3333, 2222, 6666, 2222, 2222, 4334, 2222, 4334, 4334, 6666, 4444, 4444, 4444, 5555, 4334, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 3333, 4444, 2222, 2222, 2222, 5335, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 5555, 2222, 2222, 2222, 1331, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 3333, 5555, 2222, 2222, 2222, 1661, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 5555, 3333, 1661, 1661, 1661, 
1111, 1111, 1111, 3353, 2232, 2232, 2232, 2232, 4334, 4334, 4554, 4334, 6626, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 3363, 2252, 2252, 2252, 2252, 4334, 4334, 4664, 4334, 6636, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 3533, 2322, 2322, 2322, 2322, 4334, 4554, 4334, 4334, 6266, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 3633, 2522, 2522, 2522, 2522, 4334, 4664, 4334, 4334, 6366, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 3663, 5225, 5225, 5225, 5225, 1331, 1331, 1331, 1661, 6336, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 1111, 4444, 4444, 4444, 4554, 4554, 4554, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 4554, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 3333, 6556, 6336, 6336, 2332, 1111, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 6666, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 6336, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 5555, 6666, 6336, 6336, 3333, 1111, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 5555, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6666, 6226, 6336, 6336, 5335, 1111, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 2222, 6666, 6336, 6336, 6336, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 6336, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 4444, 2222, 2222, 3333, 2222, 6336, 6556, 2332, 6336, 1111, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 5555, 2222, 6336, 6336, 6666, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 6336, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 5555, 2222, 6336, 6666, 3333, 6336, 1111, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6336, 2222, 6336, 6336, 5555, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6666, 2222, 6336, 6226, 5335, 6336, 1111, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 2222, 6666, 2222, 6336, 6336, 2222, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6336, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 4444, 2222, 3333, 2222, 2222, 6336, 2332, 6556, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 4444, 2222, 5555, 2222, 2222, 6336, 3333, 6666, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 4444, 2222, 5555, 2222, 2222, 6336, 6666, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 6336, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6336, 2222, 2222, 6336, 5555, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6666, 2222, 2222, 6336, 2222, 6336, 6336, 1111, 4444, 4444, 4444, 5555, 6336, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 4444, 2222, 6666, 2222, 2222, 6336, 5335, 6226, 6336, 1111, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 4444, 3333, 2222, 2222, 2222, 2332, 6336, 6336, 6556, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 4444, 3333, 2222, 2222, 2222, 2552, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 4444, 5555, 2222, 2222, 2222, 3333, 6336, 6336, 6666, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 3333, 
1111, 1111, 1111, 4444, 5555, 2222, 2222, 2222, 3663, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 2222, 5555, 5555, 5555, 3333, 3663, 3663, 3663, 
1111, 1111, 1111, 4444, 6666, 2222, 2222, 2222, 5335, 6336, 6336, 6226, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 4444, 6666, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 5335, 3223, 3223, 3223, 3223, 4554, 4334, 4334, 4334, 2662, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 5445, 4224, 4224, 4224, 4224, 6336, 6336, 6336, 6336, 2112, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 5555, 3333, 2222, 2222, 2222, 4554, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 4554, 4554, 4554, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 5555, 6666, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 5665, 6226, 6226, 6226, 6226, 1331, 1331, 1331, 1221, 2332, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 6266, 2322, 2322, 2322, 2322, 1331, 1331, 1551, 1331, 3533, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 6336, 5225, 5225, 5225, 5225, 4664, 4334, 4334, 4334, 3663, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 6366, 2522, 2522, 2522, 2522, 1331, 1331, 1661, 1331, 3633, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 3333, 6666, 
1111, 1111, 1111, 6566, 2622, 2622, 2622, 2622, 1331, 1331, 1221, 1331, 3233, 4444, 4444, 4444, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 6626, 2232, 2232, 2232, 2232, 1331, 1551, 1331, 1331, 3353, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 6636, 2252, 2252, 2252, 2252, 1331, 1661, 1331, 1331, 3363, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 3333, 6666, 6666, 
1111, 1111, 1111, 6656, 2262, 2262, 2262, 2262, 1331, 1221, 1331, 1331, 3323, 4444, 4444, 4444, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 1331, 2222, 2222, 1331, 5555, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 6666, 5555, 5555, 6666, 2222, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 1331, 2222, 1331, 1331, 5555, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 6666, 5555, 6666, 6666, 2222, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 1111, 1331, 1331, 1331, 5335, 3333, 4444, 4444, 4444, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 5555, 3443, 3443, 3443, 3443, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 2222, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1111, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6556, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1221, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1551, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1661, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 1111, 3333, 4444, 4444, 4444, 4554, 4554, 4554, 3553, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 4444, 1331, 1331, 1331, 2332, 3333, 4444, 4444, 4444, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 4334, 3333, 4444, 4444, 4444, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 6666, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 1331, 
1111, 1111, 1111, 6666, 2222, 2222, 2222, 6666, 1331, 1331, 1331, 2222, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1331, 6666, 6666, 6666, 5555, 
1111, 1111, 1111, 6666, 2222, 2222, 5555, 2222, 1331, 1331, 6666, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 2222, 5555, 6666, 6666, 1331, 6666, 
1111, 1111, 1111, 6666, 2222, 2222, 6666, 2222, 1331, 1331, 2222, 1331, 3333, 4444, 4444, 4444, 5555, 5555, 1331, 5555, 6666, 6666, 5555, 6666, 
1111, 1111, 1111, 6666, 2222, 5555, 2222, 2222, 1331, 6666, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 2222, 5555, 5555, 6666, 1331, 6666, 6666, 
1111, 1111, 1111, 6666, 2222, 6666, 2222, 2222, 1331, 2222, 1331, 1331, 3333, 4444, 4444, 4444, 5555, 1331, 5555, 5555, 6666, 5555, 6666, 6666, 
1111, 1111, 1111, 6666, 5555, 2222, 2222, 2222, 4664, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 2222, 5555, 5555, 5555, 3333, 4664, 4664, 4664, 
1111, 1111, 1441, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4114, 4444, 4444, 2552, 2552, 2552, 2552, 6636, 6636, 6636, 6636, 
1111, 1111, 2222, 1111, 3333, 2242, 2242, 2242, 5155, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 6666, 5155, 5155, 5155, 2242, 6666, 6666, 6666, 
1111, 1111, 2222, 1111, 6666, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 3333, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 
1111, 1111, 2332, 1111, 6666, 2222, 2222, 2222, 2422, 3433, 3433, 3433, 4444, 5665, 4444, 4444, 3333, 5555, 5555, 5555, 5515, 6616, 6616, 6616, 
1111, 1111, 2442, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 5115, 4444, 4444, 4554, 4554, 4554, 4554, 6636, 6636, 6636, 6636, 
1111, 1111, 2662, 1111, 2222, 2222, 2222, 3333, 3133, 3133, 3133, 5155, 4444, 5335, 4444, 4444, 5555, 5555, 5555, 6666, 6646, 6646, 6646, 2242, 
1111, 1111, 3233, 1111, 2222, 6666, 2222, 2222, 3433, 2422, 3433, 3433, 4444, 6566, 4444, 4444, 5555, 3333, 5555, 5555, 6616, 5515, 6616, 6616, 
1111, 1111, 3323, 1111, 2222, 2222, 6666, 2222, 3433, 3433, 2422, 3433, 4444, 6656, 4444, 4444, 5555, 5555, 3333, 5555, 6616, 6616, 5515, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3133, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3233, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 4554, 4554, 4554, 4554, 6656, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 3333, 4444, 6666, 4444, 4444, 4554, 4554, 6556, 4554, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3333, 4444, 3333, 3333, 4444, 6666, 4444, 4444, 1551, 3553, 1551, 1551, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 6666, 4444, 4444, 2552, 2552, 2552, 2552, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3533, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 1551, 1551, 1551, 1551, 6626, 6616, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 3333, 3433, 3433, 3433, 5455, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 6666, 6616, 6616, 6616, 2212, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 5555, 4644, 4644, 4644, 4644, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 2222, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 6466, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 3313, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 6616, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 3433, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 6616, 3433, 3433, 3433, 2222, 4464, 4464, 4464, 4464, 5555, 5555, 5555, 3433, 6616, 6616, 6616, 5555, 
1111, 1111, 3333, 1111, 2222, 2222, 2222, 6666, 3433, 3433, 3433, 2422, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 3333, 6616, 6616, 6616, 5515, 
1111, 1111, 3333, 1111, 2222, 2222, 3433, 2222, 3433, 3433, 5555, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 6616, 5555, 6616, 6616, 2222, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 5555, 2222, 3433, 3433, 6616, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 2222, 5555, 6616, 6616, 3433, 6616, 
1111, 1111, 3333, 1111, 2222, 2222, 6616, 2222, 3433, 3433, 2222, 3433, 4444, 6666, 4444, 4444, 5555, 5555, 3433, 5555, 6616, 6616, 5555, 6616, 
1111, 1111, 3333, 1111, 2222, 3433, 2222, 2222, 3433, 5555, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 6616, 5555, 5555, 6616, 2222, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 5555, 2222, 2222, 3433, 6616, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 2222, 5555, 5555, 6616, 3433, 6616, 6616, 
1111, 1111, 3333, 1111, 2222, 6616, 2222, 2222, 3433, 2222, 3433, 3433, 4444, 6666, 4444, 4444, 5555, 3433, 5555, 5555, 6616, 5555, 6616, 6616, 
1111, 1111, 3333, 1111, 5555, 2222, 2222, 2222, 6166, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 2222, 5555, 5555, 5555, 3343, 6166, 6166, 6166, 
1111, 1111, 3333, 3333, 2222, 2222, 2222, 2222, 4434, 4434, 4434, 4434, 6666, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 4444, 2222, 2222, 2222, 2222, 6436, 6436, 6436, 6436, 1111, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3333, 6666, 2222, 2222, 2222, 2222, 1431, 1431, 1431, 1431, 3333, 6666, 4444, 4444, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
1111, 1111, 3353, 1111, 2222, 2222, 3333, 2222, 3433, 3433, 5455, 3433, 4444, 6626, 4444, 4444, 5555, 5555, 6666, 5555, 6616, 6616, 2212, 6616, 
1111, 1111, 3363, 1111, 2222, 2222, 5555, 2222, 3433, 3433, 6466, 3433, 4444, 6636, 4444, 4444, 5555, 5555, 2222, 5555, 6616, 6616, 3313, 6616, 
1111, 1111, 3533, 1111, 2222, 3333, 2222, 2222, 3433, 5455, 3433, 3433, 4444, 6266, 4444, 4444, 5555, 6666, 5555, 5555, 6616, 2212, 6616, 6616, 
1111, 1111, 3633, 1111, 2222, 5555, 2222, 2222, 3433, 6466, 3433, 3433, 4444, 6366, 4444, 4444, 5555, 2222, 5555, 5555, 6616, 3313, 6616, 6616, 
1111, 1111, 3663, 1111, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 6166, 4444, 6336, 4444, 4444, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 3343, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 1111, 4444, 4444, 4554, 4554, 1551, 4554, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 1111, 4444, 4444, 1551, 4554, 1551, 1551, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 1111, 4444, 4444, 2552, 2552, 2552, 2552, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 3333, 3233, 3633, 3633, 5655, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 6666, 6656, 6636, 6636, 2232, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 5555, 4144, 4144, 4144, 4144, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 2222, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 5555, 3333, 3633, 3633, 6666, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 2222, 6666, 6636, 6636, 3333, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 5555, 3633, 3633, 3633, 6636, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 2222, 6636, 6636, 6636, 3633, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 6636, 3633, 3633, 3633, 2222, 4414, 4414, 4414, 4414, 5555, 5555, 5555, 3633, 6636, 6636, 6636, 5555, 
1111, 1111, 4444, 1111, 2222, 2222, 2222, 6666, 3533, 3633, 3633, 2622, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 3333, 6626, 6636, 6636, 5535, 
1111, 1111, 4444, 1111, 2222, 2222, 3333, 2222, 3633, 3233, 5655, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 6666, 5555, 6636, 6656, 2232, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 3633, 2222, 3633, 3633, 5555, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 6636, 5555, 6636, 6636, 2222, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 5555, 2222, 3633, 3333, 6666, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 2222, 5555, 6636, 6666, 3333, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 5555, 2222, 3633, 3633, 6636, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 2222, 5555, 6636, 6636, 3633, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 6636, 2222, 3633, 3633, 2222, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 3633, 5555, 6636, 6636, 5555, 6636, 
1111, 1111, 4444, 1111, 2222, 2222, 6666, 2222, 3633, 3533, 2622, 3633, 4444, 1111, 4444, 4444, 5555, 5555, 3333, 5555, 6636, 6626, 5535, 6636, 
1111, 1111, 4444, 1111, 2222, 3333, 2222, 2222, 3633, 5655, 3233, 3633, 4444, 1111, 4444, 4444, 5555, 6666, 5555, 5555, 6636, 2232, 6656, 6636, 
1111, 1111, 4444, 1111, 2222, 3633, 2222, 2222, 3633, 5555, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 6636, 5555, 5555, 6636, 2222, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 5555, 2222, 2222, 3633, 6636, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 2222, 5555, 5555, 6636, 3633, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 5555, 2222, 2222, 3633, 6666, 3333, 3633, 4444, 1111, 4444, 4444, 5555, 2222, 5555, 5555, 6636, 3333, 6666, 6636, 
1111, 1111, 4444, 1111, 2222, 6636, 2222, 2222, 3633, 2222, 3633, 3633, 4444, 1111, 4444, 4444, 5555, 3633, 5555, 5555, 6636, 5555, 6636, 6636, 
1111, 1111, 4444, 1111, 2222, 6666, 2222, 2222, 3633, 2622, 3533, 3633, 4444, 1111, 4444, 4444, 5555, 3333, 5555, 5555, 6636, 5535, 6626, 6636, 
1111, 1111, 4444, 1111, 3333, 2222, 2222, 2222, 5655, 3633, 3633, 3233, 4444, 1111, 4444, 4444, 6666, 5555, 5555, 5555, 2232, 6636, 6636, 6656, 
1111, 1111, 4444, 1111, 3333, 2252, 2252, 2252, 5255, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 6666, 5255, 5255, 5255, 2252, 6666, 6666, 6666, 
1111, 1111, 4444, 1111, 5555, 2222, 2222, 2222, 6366, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 2222, 5555, 5555, 5555, 3363, 6366, 6366, 6366, 
1111, 1111, 4444, 1111, 5555, 2222, 2222, 2222, 6666, 3633, 3633, 3333, 4444, 1111, 4444, 4444, 2222, 5555, 5555, 5555, 3333, 6636, 6636, 6666, 
1111, 1111, 4444, 1111, 6666, 2222, 2222, 2222, 2622, 3633, 3633, 3533, 4444, 1111, 4444, 4444, 3333, 5555, 5555, 5555, 5535, 6636, 6636, 6626, 
1111, 1111, 4444, 1111, 6666, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 3333, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 
1111, 1111, 4444, 3333, 2222, 2222, 2222, 2222, 4634, 4634, 4634, 4634, 6666, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 4444, 2222, 2222, 2222, 2222, 6636, 6636, 6636, 6636, 1111, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 4444, 6666, 2222, 2222, 2222, 2222, 1631, 1631, 1631, 1631, 3333, 1111, 4444, 4444, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
1111, 1111, 5335, 1111, 3333, 2222, 2222, 2222, 5455, 3433, 3433, 3433, 4444, 2662, 4444, 4444, 6666, 5555, 5555, 5555, 2212, 6616, 6616, 6616, 
1111, 1111, 5445, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 2112, 4444, 4444, 1551, 1551, 1551, 1551, 6636, 6636, 6636, 6636, 
1111, 1111, 5555, 1111, 3333, 2212, 2212, 2212, 5455, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 6666, 5455, 5455, 5455, 2212, 6666, 6666, 6666, 
1111, 1111, 5555, 1111, 6666, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 3333, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 
1111, 1111, 5665, 1111, 2222, 2222, 2222, 6666, 3133, 3133, 3133, 2122, 4444, 2332, 4444, 4444, 5555, 5555, 5555, 3333, 6646, 6646, 6646, 5545, 
1111, 1111, 6266, 1111, 2222, 2222, 3333, 2222, 3133, 3133, 5155, 3133, 4444, 3533, 4444, 4444, 5555, 5555, 6666, 5555, 6646, 6646, 2242, 6646, 
1111, 1111, 6336, 1111, 5555, 2222, 2222, 2222, 6466, 3433, 3433, 3433, 4444, 3663, 4444, 4444, 2222, 5555, 5555, 5555, 3313, 6616, 6616, 6616, 
1111, 1111, 6366, 1111, 2222, 2222, 5555, 2222, 3133, 3133, 6166, 3133, 4444, 3633, 4444, 4444, 5555, 5555, 2222, 5555, 6646, 6646, 3343, 6646, 
1111, 1111, 6566, 1111, 2222, 2222, 6666, 2222, 3133, 3133, 2122, 3133, 4444, 3233, 4444, 4444, 5555, 5555, 3333, 5555, 6646, 6646, 5545, 6646, 
1111, 1111, 6626, 1111, 2222, 3333, 2222, 2222, 3133, 5155, 3133, 3133, 4444, 3353, 4444, 4444, 5555, 6666, 5555, 5555, 6646, 2242, 6646, 6646, 
1111, 1111, 6636, 1111, 2222, 5555, 2222, 2222, 3133, 6166, 3133, 3133, 4444, 3363, 4444, 4444, 5555, 2222, 5555, 5555, 6646, 3343, 6646, 6646, 
1111, 1111, 6656, 1111, 2222, 6666, 2222, 2222, 3133, 2122, 3133, 3133, 4444, 3323, 4444, 4444, 5555, 3333, 5555, 5555, 6646, 5545, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3233, 4444, 3333, 4444, 4444, 1551, 1551, 1551, 1551, 6646, 6646, 6646, 6656, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3433, 4444, 3333, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6646, 6646, 6616, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3533, 4444, 3333, 4444, 4444, 4554, 4554, 4554, 4554, 6646, 6646, 6646, 6626, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 3333, 4444, 4444, 2552, 2552, 2552, 2552, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3333, 1111, 3333, 3333, 4444, 3333, 4444, 4444, 1551, 6556, 1551, 1551, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 1111, 3333, 4444, 3333, 4444, 4444, 4554, 4554, 3553, 4554, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 5555, 4344, 4344, 4344, 4344, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 2222, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 6646, 4444, 4444, 3333, 4444, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 3133, 
1111, 1111, 6666, 1111, 2222, 2222, 2222, 6646, 3133, 3133, 3133, 2222, 4434, 4434, 4434, 4434, 5555, 5555, 5555, 3133, 6646, 6646, 6646, 5555, 
1111, 1111, 6666, 1111, 2222, 2222, 3133, 2222, 3133, 3133, 5555, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 6646, 5555, 6646, 6646, 2222, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 5555, 2222, 3133, 3133, 6646, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 2222, 5555, 6646, 6646, 3133, 6646, 
1111, 1111, 6666, 1111, 2222, 2222, 6646, 2222, 3133, 3133, 2222, 3133, 4444, 3333, 4444, 4444, 5555, 5555, 3133, 5555, 6646, 6646, 5555, 6646, 
1111, 1111, 6666, 1111, 2222, 3133, 2222, 2222, 3133, 5555, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 6646, 5555, 5555, 6646, 2222, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 5555, 2222, 2222, 3133, 6646, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 2222, 5555, 5555, 6646, 3133, 6646, 6646, 
1111, 1111, 6666, 1111, 2222, 6646, 2222, 2222, 3133, 2222, 3133, 3133, 4444, 3333, 4444, 4444, 5555, 3133, 5555, 5555, 6646, 5555, 6646, 6646, 
1111, 1111, 6666, 1111, 3333, 2222, 2222, 2222, 5155, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 6666, 5555, 5555, 5555, 2242, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 5555, 2222, 2222, 2222, 6166, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 2222, 5555, 5555, 5555, 3343, 6646, 6646, 6646, 
1111, 1111, 6666, 1111, 5555, 2222, 2222, 2222, 6466, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 2222, 5555, 5555, 5555, 3313, 6466, 6466, 6466, 
1111, 1111, 6666, 1111, 6666, 2222, 2222, 2222, 2122, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 3333, 5555, 5555, 5555, 5545, 6646, 6646, 6646, 
1111, 1111, 6666, 3333, 2222, 2222, 2222, 2222, 4134, 4134, 4134, 4134, 6666, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 4444, 2222, 2222, 2222, 2222, 6136, 6136, 6136, 6136, 1111, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1111, 6666, 6666, 2222, 2222, 2222, 2222, 1131, 1131, 1131, 1131, 3333, 3333, 4444, 4444, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
1111, 1141, 1141, 4444, 2252, 2252, 2252, 2252, 6336, 6336, 6336, 6336, 1111, 4414, 4414, 4444, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1111, 1411, 1411, 4444, 2522, 2522, 2522, 2522, 6336, 6336, 6336, 6336, 1111, 4144, 4144, 4444, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1111, 1441, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 4114, 4444, 2552, 2552, 2552, 2552, 6366, 6366, 6366, 6366, 
1111, 2222, 1111, 1111, 3333, 2422, 2422, 2422, 5515, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 6666, 5515, 5515, 5515, 2422, 6666, 6666, 6666, 
1111, 2222, 1111, 1111, 6666, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 3333, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 
1111, 2332, 1111, 1111, 6666, 2222, 2222, 2222, 2242, 3343, 3343, 3343, 4444, 4444, 5665, 4444, 3333, 5555, 5555, 5555, 5155, 6166, 6166, 6166, 
1111, 2442, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 5115, 4444, 4554, 4554, 4554, 4554, 6366, 6366, 6366, 6366, 
1111, 2662, 1111, 1111, 2222, 2222, 2222, 3333, 3313, 3313, 3313, 5515, 4444, 4444, 5335, 4444, 5555, 5555, 5555, 6666, 6466, 6466, 6466, 2422, 
1111, 3233, 1111, 1111, 2222, 6666, 2222, 2222, 3343, 2242, 3343, 3343, 4444, 4444, 6566, 4444, 5555, 3333, 5555, 5555, 6166, 5155, 6166, 6166, 
1111, 3323, 1111, 1111, 2222, 2222, 6666, 2222, 3343, 3343, 2242, 3343, 4444, 4444, 6656, 4444, 5555, 5555, 3333, 5555, 6166, 6166, 5155, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 2552, 2552, 2552, 2552, 6466, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3323, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 4554, 4554, 4554, 4554, 6566, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 4444, 3333, 4444, 4444, 6666, 4444, 1551, 1551, 3553, 1551, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 4444, 3333, 3333, 4444, 4444, 6666, 4444, 4554, 6556, 4554, 4554, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3353, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 1551, 1551, 1551, 1551, 6266, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 4444, 6666, 4444, 2552, 2552, 2552, 2552, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 3333, 3343, 3343, 3343, 5545, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 6666, 6166, 6166, 6166, 2122, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 5555, 4464, 4464, 4464, 4464, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 2222, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 6166, 4444, 6666, 4444, 4444, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 3343, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 6646, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 3133, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 6166, 3343, 3343, 3343, 2222, 4644, 4644, 4644, 4644, 5555, 5555, 5555, 3343, 6166, 6166, 6166, 5555, 
1111, 3333, 1111, 1111, 2222, 2222, 2222, 6666, 3343, 3343, 3343, 2242, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 3333, 6166, 6166, 6166, 5155, 
1111, 3333, 1111, 1111, 2222, 2222, 3343, 2222, 3343, 3343, 5555, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 6166, 5555, 6166, 6166, 2222, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 5555, 2222, 3343, 3343, 6166, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 2222, 5555, 6166, 6166, 3343, 6166, 
1111, 3333, 1111, 1111, 2222, 2222, 6166, 2222, 3343, 3343, 2222, 3343, 4444, 4444, 6666, 4444, 5555, 5555, 3343, 5555, 6166, 6166, 5555, 6166, 
1111, 3333, 1111, 1111, 2222, 3343, 2222, 2222, 3343, 5555, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 6166, 5555, 5555, 6166, 2222, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 5555, 2222, 2222, 3343, 6166, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 2222, 5555, 5555, 6166, 3343, 6166, 6166, 
1111, 3333, 1111, 1111, 2222, 6166, 2222, 2222, 3343, 2222, 3343, 3343, 4444, 4444, 6666, 4444, 5555, 3343, 5555, 5555, 6166, 5555, 6166, 6166, 
1111, 3333, 1111, 1111, 5555, 2222, 2222, 2222, 6616, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 2222, 5555, 5555, 5555, 3433, 6616, 6616, 6616, 
1111, 3333, 1111, 3333, 2222, 2222, 2222, 2222, 4344, 4344, 4344, 4344, 6666, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 4444, 2222, 2222, 2222, 2222, 6346, 6346, 6346, 6346, 1111, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 1111, 6666, 2222, 2222, 2222, 2222, 1341, 1341, 1341, 1341, 3333, 4444, 6666, 4444, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
1111, 3333, 3333, 1111, 2222, 2222, 2222, 2222, 3443, 3443, 3443, 3443, 4444, 6666, 6666, 4444, 5555, 5555, 5555, 5555, 6116, 6116, 6116, 6116, 
1111, 3333, 4444, 1111, 2222, 2222, 2222, 2222, 3643, 3643, 3643, 3643, 4444, 1111, 6666, 4444, 5555, 5555, 5555, 5555, 6136, 6136, 6136, 6136, 
1111, 3333, 6666, 1111, 2222, 2222, 2222, 2222, 3143, 3143, 3143, 3143, 4444, 3333, 6666, 4444, 5555, 5555, 5555, 5555, 6146, 6146, 6146, 6146, 
1111, 3353, 1111, 1111, 2222, 2222, 3333, 2222, 3343, 3343, 5545, 3343, 4444, 4444, 6626, 4444, 5555, 5555, 6666, 5555, 6166, 6166, 2122, 6166, 
1111, 3363, 1111, 1111, 2222, 2222, 5555, 2222, 3343, 3343, 6646, 3343, 4444, 4444, 6636, 4444, 5555, 5555, 2222, 5555, 6166, 6166, 3133, 6166, 
1111, 3533, 1111, 1111, 2222, 3333, 2222, 2222, 3343, 5545, 3343, 3343, 4444, 4444, 6266, 4444, 5555, 6666, 5555, 5555, 6166, 2122, 6166, 6166, 
1111, 3633, 1111, 1111, 2222, 5555, 2222, 2222, 3343, 6646, 3343, 3343, 4444, 4444, 6366, 4444, 5555, 2222, 5555, 5555, 6166, 3133, 6166, 6166, 
1111, 3663, 1111, 1111, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 6616, 4444, 4444, 6336, 4444, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 3433, 
1111, 4114, 4114, 4444, 5225, 5225, 5225, 5225, 6336, 6336, 6336, 6336, 1111, 1441, 1441, 4444, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 1111, 4444, 1551, 1551, 4554, 1551, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 1111, 4444, 4554, 1551, 4554, 4554, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 4444, 1111, 4444, 2552, 2552, 2552, 2552, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 3333, 3323, 3363, 3363, 5565, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 6666, 6566, 6366, 6366, 2322, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 5555, 4414, 4414, 4414, 4414, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 2222, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3363, 3363, 6666, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 2222, 6666, 6366, 6366, 3333, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 5555, 3363, 3363, 3363, 6366, 4444, 1111, 4444, 4444, 5555, 5555, 5555, 2222, 6366, 6366, 6366, 3363, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 6366, 3363, 3363, 3363, 2222, 4144, 4144, 4144, 4144, 5555, 5555, 5555, 3363, 6366, 6366, 6366, 5555, 
1111, 4444, 1111, 1111, 2222, 2222, 2222, 6666, 3353, 3363, 3363, 2262, 4444, 4444, 1111, 4444, 5555, 5555, 5555, 3333, 6266, 6366, 6366, 5355, 
1111, 4444, 1111, 1111, 2222, 2222, 3333, 2222, 3363, 3323, 5565, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 6666, 5555, 6366, 6566, 2322, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 3363, 2222, 3363, 3363, 5555, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 6366, 5555, 6366, 6366, 2222, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3333, 6666, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 2222, 5555, 6366, 6666, 3333, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 5555, 2222, 3363, 3363, 6366, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 2222, 5555, 6366, 6366, 3363, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 6366, 2222, 3363, 3363, 2222, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 3363, 5555, 6366, 6366, 5555, 6366, 
1111, 4444, 1111, 1111, 2222, 2222, 6666, 2222, 3363, 3353, 2262, 3363, 4444, 4444, 1111, 4444, 5555, 5555, 3333, 5555, 6366, 6266, 5355, 6366, 
1111, 4444, 1111, 1111, 2222, 3333, 2222, 2222, 3363, 5565, 3323, 3363, 4444, 4444, 1111, 4444, 5555, 6666, 5555, 5555, 6366, 2322, 6566, 6366, 
1111, 4444, 1111, 1111, 2222, 3363, 2222, 2222, 3363, 5555, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 6366, 5555, 5555, 6366, 2222, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 6366, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 2222, 5555, 5555, 6366, 3363, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 5555, 2222, 2222, 3363, 6666, 3333, 3363, 4444, 4444, 1111, 4444, 5555, 2222, 5555, 5555, 6366, 3333, 6666, 6366, 
1111, 4444, 1111, 1111, 2222, 6366, 2222, 2222, 3363, 2222, 3363, 3363, 4444, 4444, 1111, 4444, 5555, 3363, 5555, 5555, 6366, 5555, 6366, 6366, 
1111, 4444, 1111, 1111, 2222, 6666, 2222, 2222, 3363, 2262, 3353, 3363, 4444, 4444, 1111, 4444, 5555, 3333, 5555, 5555, 6366, 5355, 6266, 6366, 
1111, 4444, 1111, 1111, 3333, 2222, 2222, 2222, 5565, 3363, 3363, 3323, 4444, 4444, 1111, 4444, 6666, 5555, 5555, 5555, 2322, 6366, 6366, 6566, 
1111, 4444, 1111, 1111, 3333, 2522, 2522, 2522, 5525, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 6666, 5525, 5525, 5525, 2522, 6666, 6666, 6666, 
1111, 4444, 1111, 1111, 5555, 2222, 2222, 2222, 6636, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 2222, 5555, 5555, 5555, 3633, 6636, 6636, 6636, 
1111, 4444, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3363, 3363, 3333, 4444, 4444, 1111, 4444, 2222, 5555, 5555, 5555, 3333, 6366, 6366, 6666, 
1111, 4444, 1111, 1111, 6666, 2222, 2222, 2222, 2262, 3363, 3363, 3353, 4444, 4444, 1111, 4444, 3333, 5555, 5555, 5555, 5355, 6366, 6366, 6266, 
1111, 4444, 1111, 1111, 6666, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 3333, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 
1111, 4444, 1111, 3333, 2222, 2222, 2222, 2222, 4364, 4364, 4364, 4364, 6666, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 4444, 2222, 2222, 2222, 2222, 6366, 6366, 6366, 6366, 1111, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 1111, 6666, 2222, 2222, 2222, 2222, 1361, 1361, 1361, 1361, 3333, 4444, 1111, 4444, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
1111, 4444, 3333, 1111, 2222, 2222, 2222, 2222, 3463, 3463, 3463, 3463, 4444, 6666, 1111, 4444, 5555, 5555, 5555, 5555, 6316, 6316, 6316, 6316, 
1111, 4444, 4444, 1111, 2222, 2222, 2222, 2222, 3663, 3663, 3663, 3663, 4444, 1111, 1111, 4444, 5555, 5555, 5555, 5555, 6336, 6336, 6336, 6336, 
1111, 4444, 6666, 1111, 2222, 2222, 2222, 2222, 3163, 3163, 3163, 3163, 4444, 3333, 1111, 4444, 5555, 5555, 5555, 5555, 6346, 6346, 6346, 6346, 
1111, 5335, 1111, 1111, 3333, 2222, 2222, 2222, 5545, 3343, 3343, 3343, 4444, 4444, 2662, 4444, 6666, 5555, 5555, 5555, 2122, 6166, 6166, 6166, 
1111, 5445, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 2112, 4444, 1551, 1551, 1551, 1551, 6366, 6366, 6366, 6366, 
1111, 5555, 1111, 1111, 3333, 2122, 2122, 2122, 5545, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 6666, 5545, 5545, 5545, 2122, 6666, 6666, 6666, 
1111, 5555, 1111, 1111, 6666, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 3333, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 
1111, 5665, 1111, 1111, 2222, 2222, 2222, 6666, 3313, 3313, 3313, 2212, 4444, 4444, 2332, 4444, 5555, 5555, 5555, 3333, 6466, 6466, 6466, 5455, 
1111, 6266, 1111, 1111, 2222, 2222, 3333, 2222, 3313, 3313, 5515, 3313, 4444, 4444, 3533, 4444, 5555, 5555, 6666, 5555, 6466, 6466, 2422, 6466, 
1111, 6336, 1111, 1111, 5555, 2222, 2222, 2222, 6646, 3343, 3343, 3343, 4444, 4444, 3663, 4444, 2222, 5555, 5555, 5555, 3133, 6166, 6166, 6166, 
1111, 6366, 1111, 1111, 2222, 2222, 5555, 2222, 3313, 3313, 6616, 3313, 4444, 4444, 3633, 4444, 5555, 5555, 2222, 5555, 6466, 6466, 3433, 6466, 
1111, 6566, 1111, 1111, 2222, 2222, 6666, 2222, 3313, 3313, 2212, 3313, 4444, 4444, 3233, 4444, 5555, 5555, 3333, 5555, 6466, 6466, 5455, 6466, 
1111, 6626, 1111, 1111, 2222, 3333, 2222, 2222, 3313, 5515, 3313, 3313, 4444, 4444, 3353, 4444, 5555, 6666, 5555, 5555, 6466, 2422, 6466, 6466, 
1111, 6636, 1111, 1111, 2222, 5555, 2222, 2222, 3313, 6616, 3313, 3313, 4444, 4444, 3363, 4444, 5555, 2222, 5555, 5555, 6466, 3433, 6466, 6466, 
1111, 6656, 1111, 1111, 2222, 6666, 2222, 2222, 3313, 2212, 3313, 3313, 4444, 4444, 3323, 4444, 5555, 3333, 5555, 5555, 6466, 5455, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 4444, 3333, 4444, 2552, 2552, 2552, 2552, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3323, 4444, 4444, 3333, 4444, 1551, 1551, 1551, 1551, 6466, 6466, 6466, 6566, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3343, 4444, 4444, 3333, 4444, 2552, 2552, 2552, 2552, 6466, 6466, 6466, 6166, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3353, 4444, 4444, 3333, 4444, 4554, 4554, 4554, 4554, 6466, 6466, 6466, 6266, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 1111, 3333, 3333, 4444, 4444, 3333, 4444, 4554, 3553, 4554, 4554, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 1111, 3333, 4444, 4444, 3333, 4444, 1551, 1551, 6556, 1551, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 5555, 4434, 4434, 4434, 4434, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 2222, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 6466, 4444, 3333, 4444, 4444, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 3313, 
1111, 6666, 1111, 1111, 2222, 2222, 2222, 6466, 3313, 3313, 3313, 2222, 4344, 4344, 4344, 4344, 5555, 5555, 5555, 3313, 6466, 6466, 6466, 5555, 
1111, 6666, 1111, 1111, 2222, 2222, 3313, 2222, 3313, 3313, 5555, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 6466, 5555, 6466, 6466, 2222, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 5555, 2222, 3313, 3313, 6466, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 2222, 5555, 6466, 6466, 3313, 6466, 
1111, 6666, 1111, 1111, 2222, 2222, 6466, 2222, 3313, 3313, 2222, 3313, 4444, 4444, 3333, 4444, 5555, 5555, 3313, 5555, 6466, 6466, 5555, 6466, 
1111, 6666, 1111, 1111, 2222, 3313, 2222, 2222, 3313, 5555, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 6466, 5555, 5555, 6466, 2222, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 5555, 2222, 2222, 3313, 6466, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 2222, 5555, 5555, 6466, 3313, 6466, 6466, 
1111, 6666, 1111, 1111, 2222, 6466, 2222, 2222, 3313, 2222, 3313, 3313, 4444, 4444, 3333, 4444, 5555, 3313, 5555, 5555, 6466, 5555, 6466, 6466, 
1111, 6666, 1111, 1111, 3333, 2222, 2222, 2222, 5515, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 6666, 5555, 5555, 5555, 2422, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 5555, 2222, 2222, 2222, 6616, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 2222, 5555, 5555, 5555, 3433, 6466, 6466, 6466, 
1111, 6666, 1111, 1111, 5555, 2222, 2222, 2222, 6646, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 2222, 5555, 5555, 5555, 3133, 6646, 6646, 6646, 
1111, 6666, 1111, 1111, 6666, 2222, 2222, 2222, 2212, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 3333, 5555, 5555, 5555, 5455, 6466, 6466, 6466, 
1111, 6666, 1111, 3333, 2222, 2222, 2222, 2222, 4314, 4314, 4314, 4314, 6666, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 4444, 2222, 2222, 2222, 2222, 6316, 6316, 6316, 6316, 1111, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 1111, 6666, 2222, 2222, 2222, 2222, 1311, 1311, 1311, 1311, 3333, 4444, 3333, 4444, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
1111, 6666, 3333, 1111, 2222, 2222, 2222, 2222, 3413, 3413, 3413, 3413, 4444, 6666, 3333, 4444, 5555, 5555, 5555, 5555, 6416, 6416, 6416, 6416, 
1111, 6666, 4444, 1111, 2222, 2222, 2222, 2222, 3613, 3613, 3613, 3613, 4444, 1111, 3333, 4444, 5555, 5555, 5555, 5555, 6436, 6436, 6436, 6436, 
1111, 6666, 6666, 1111, 2222, 2222, 2222, 2222, 3113, 3113, 3113, 3113, 4444, 3333, 3333, 4444, 5555, 5555, 5555, 5555, 6446, 6446, 6446, 6446, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 1151, 1151, 1151, 1151, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 2152, 2152, 2152, 2152, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 4154, 4154, 4154, 4154, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 5155, 4444, 5555, 4444, 4444, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 2242, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 5155, 3333, 3333, 3333, 6666, 4544, 4544, 4544, 4544, 5155, 5155, 5155, 2242, 6666, 6666, 6666, 3333, 
1121, 1121, 1121, 1121, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 2242, 4444, 4444, 5555, 4444, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 5155, 
1121, 1121, 1121, 1121, 2242, 2242, 3333, 2242, 3333, 3333, 5155, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 6666, 5155, 6666, 6666, 2242, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 5155, 2242, 3333, 3333, 6666, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 2242, 5155, 6666, 6666, 3333, 6666, 
1121, 1121, 1121, 1121, 2242, 2242, 6666, 2242, 3333, 3333, 2242, 3333, 4454, 4454, 4454, 4454, 5155, 5155, 3333, 5155, 6666, 6666, 5155, 6666, 
1121, 1121, 1121, 1121, 2242, 3333, 2242, 2242, 3333, 5155, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 6666, 5155, 5155, 6666, 2242, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 5155, 2242, 2242, 3333, 6666, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 2242, 5155, 5155, 6666, 3333, 6666, 6666, 
1121, 1121, 1121, 1121, 2242, 6666, 2242, 2242, 3333, 2242, 3333, 3333, 4454, 4454, 4454, 4454, 5155, 3333, 5155, 5155, 6666, 5155, 6666, 6666, 
1121, 1121, 1121, 1121, 5515, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 2422, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 
1121, 1121, 1121, 1131, 2242, 2242, 2242, 3343, 3333, 3333, 3333, 5555, 4464, 4454, 4454, 4454, 5155, 5155, 5155, 6166, 6666, 6666, 6666, 2222, 
1121, 1121, 1121, 1151, 2242, 2242, 2242, 5545, 3333, 3333, 3333, 6666, 4424, 4454, 4454, 4454, 5155, 5155, 5155, 2122, 6666, 6666, 6666, 3333, 
1121, 1121, 1121, 1161, 2242, 2242, 2242, 6646, 3333, 3333, 3333, 2222, 4434, 4454, 4454, 4454, 5155, 5155, 5155, 3133, 6666, 6666, 6666, 5555, 
1121, 1121, 1121, 3323, 2262, 2242, 2242, 2242, 4334, 4334, 4334, 4334, 6656, 4454, 4454, 4454, 5355, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 3333, 2222, 4444, 2222, 2222, 4334, 5335, 4334, 4334, 6666, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 4424, 2212, 2242, 2242, 2242, 6336, 6336, 6336, 6336, 1151, 4454, 4454, 4454, 5455, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 4544, 2422, 2422, 2422, 2422, 6336, 6336, 6336, 6336, 1211, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 6626, 2232, 2242, 2242, 2242, 1331, 1331, 1331, 1331, 3353, 4454, 4454, 4454, 5655, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1121, 6666, 2222, 2222, 4444, 2222, 1331, 1331, 2332, 1331, 3333, 4454, 4454, 4454, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
1121, 1121, 1131, 1121, 2242, 2242, 3343, 2242, 3333, 3333, 5555, 3333, 4454, 4464, 4454, 4454, 5155, 5155, 6166, 5155, 6666, 6666, 2222, 6666, 
1121, 1121, 1151, 1121, 2242, 2242, 5545, 2242, 3333, 3333, 6666, 3333, 4454, 4424, 4454, 4454, 5155, 5155, 2122, 5155, 6666, 6666, 3333, 6666, 
1121, 1121, 1161, 1121, 2242, 2242, 6646, 2242, 3333, 3333, 2222, 3333, 4454, 4434, 4454, 4454, 5155, 5155, 3133, 5155, 6666, 6666, 5555, 6666, 
1121, 1121, 3323, 1121, 2242, 2262, 2242, 2242, 3433, 3433, 3433, 3433, 4454, 6656, 4454, 4454, 5155, 5355, 5155, 5155, 6616, 6616, 6616, 6616, 
1121, 1121, 3333, 1121, 2242, 2242, 2242, 2242, 3433, 3533, 3433, 3433, 4454, 6666, 4454, 4454, 5155, 5155, 5155, 5155, 6616, 6626, 6616, 6616, 
1121, 1121, 4424, 1121, 2242, 2212, 2242, 2242, 3633, 3633, 3633, 3633, 4454, 1151, 4454, 4454, 5155, 5455, 5155, 5155, 6636, 6636, 6636, 6636, 
1121, 1121, 4544, 1121, 2242, 2242, 2242, 2242, 3633, 3633, 3633, 3633, 4454, 1211, 4454, 4454, 5155, 5155, 5155, 5155, 6636, 6636, 6636, 6636, 
1121, 1121, 6626, 1121, 2242, 2232, 2242, 2242, 3133, 3133, 3133, 3133, 4454, 3353, 4454, 4454, 5155, 5655, 5155, 5155, 6646, 6646, 6646, 6646, 
1121, 1121, 6666, 1121, 2242, 2242, 2242, 2242, 3133, 3133, 3233, 3133, 4454, 3333, 4454, 4454, 5155, 5155, 5155, 5155, 6646, 6646, 6656, 6646, 
1121, 1131, 1121, 1121, 2242, 3343, 2242, 2242, 3333, 5555, 3333, 3333, 4454, 4454, 4464, 4454, 5155, 6166, 5155, 5155, 6666, 2222, 6666, 6666, 
1121, 1151, 1121, 1121, 2242, 5545, 2242, 2242, 3333, 6666, 3333, 3333, 4454, 4454, 4424, 4454, 5155, 2122, 5155, 5155, 6666, 3333, 6666, 6666, 
1121, 1151, 1151, 1151, 2212, 2212, 2212, 5515, 3333, 3333, 3333, 6666, 4424, 4424, 4424, 4454, 5455, 5455, 5455, 2422, 6666, 6666, 6666, 3333, 
1121, 1161, 1121, 1121, 2242, 6646, 2242, 2242, 3333, 2222, 3333, 3333, 4454, 4454, 4434, 4454, 5155, 3133, 5155, 5155, 6666, 5555, 6666, 6666, 
1121, 3323, 1121, 1121, 2242, 2242, 2262, 2242, 3343, 3343, 3343, 3343, 4454, 4454, 6656, 4454, 5155, 5155, 5355, 5155, 6166, 6166, 6166, 6166, 
1121, 3333, 1121, 1121, 2242, 2242, 2242, 2242, 3343, 3353, 3343, 3343, 4454, 4454, 6666, 4454, 5155, 5155, 5155, 5155, 6166, 6266, 6166, 6166, 
1121, 4424, 1121, 1121, 2242, 2242, 2212, 2242, 3363, 3363, 3363, 3363, 4454, 4454, 1151, 4454, 5155, 5155, 5455, 5155, 6366, 6366, 6366, 6366, 
1121, 4544, 1121, 1121, 2242, 2242, 2242, 2242, 3363, 3363, 3363, 3363, 4454, 4454, 1211, 4454, 5155, 5155, 5155, 5155, 6366, 6366, 6366, 6366, 
1121, 6626, 1121, 1121, 2242, 2242, 2232, 2242, 3313, 3313, 3313, 3313, 4454, 4454, 3353, 4454, 5155, 5155, 5655, 5155, 6466, 6466, 6466, 6466, 
1121, 6666, 1121, 1121, 2242, 2242, 2242, 2242, 3313, 3313, 3323, 3313, 4454, 4454, 3333, 4454, 5155, 5155, 5155, 5155, 6466, 6466, 6566, 6466, 
1131, 1121, 1121, 1121, 3343, 2242, 2242, 2242, 5555, 3333, 3333, 3333, 4454, 4454, 4454, 4464, 6166, 5155, 5155, 5155, 2222, 6666, 6666, 6666, 
1131, 1131, 1131, 1131, 3343, 2222, 2222, 2222, 5555, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 6166, 5555, 5555, 5555, 2222, 6166, 6166, 6166, 
1131, 1131, 1131, 1131, 6616, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 3433, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 
1131, 1141, 1141, 6646, 2252, 2252, 2252, 2252, 1331, 1331, 1331, 1331, 3313, 4414, 4414, 4464, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1131, 1151, 1151, 1151, 2212, 2212, 2212, 6616, 3333, 3333, 3333, 2222, 4424, 4424, 4424, 4464, 5455, 5455, 5455, 3433, 6666, 6666, 6666, 5555, 
1141, 1111, 4444, 1141, 2252, 2252, 2252, 2252, 3633, 3633, 3633, 3633, 4414, 1111, 4444, 4414, 5255, 5255, 5255, 5255, 6636, 6636, 6636, 6636, 
1141, 1131, 6646, 1141, 2252, 2252, 2252, 2252, 3133, 3133, 3133, 3133, 4414, 3313, 4464, 4414, 5255, 5255, 5255, 5255, 6646, 6646, 6646, 6646, 
1141, 1141, 1141, 1141, 2222, 2252, 2252, 5555, 3333, 3333, 3333, 6666, 4414, 4414, 4414, 4414, 5555, 5255, 5255, 2222, 6666, 6666, 6666, 3333, 
1141, 1141, 1141, 1141, 2232, 2252, 2252, 6656, 3333, 3333, 3333, 2222, 4414, 4414, 4414, 4414, 5655, 5255, 5255, 3233, 6666, 6666, 6666, 5555, 
1141, 1141, 1141, 1141, 2252, 2222, 5555, 2252, 3333, 3333, 6666, 3333, 4414, 4414, 4414, 4414, 5255, 5555, 2222, 5255, 6666, 6666, 3333, 6666, 
1141, 1141, 1141, 1141, 2252, 2232, 6656, 2252, 3333, 3333, 2222, 3333, 4414, 4414, 4414, 4414, 5255, 5655, 3233, 5255, 6666, 6666, 5555, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 1251, 1251, 1251, 1251, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2252, 2252, 2252, 2252, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 4254, 4254, 4254, 4254, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 5255, 4444, 1111, 4444, 4444, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 2252, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 5255, 3333, 3333, 3333, 6666, 4144, 4144, 4144, 4144, 5255, 5255, 5255, 2252, 6666, 6666, 6666, 3333, 
1141, 1141, 1141, 1141, 2252, 2252, 2252, 6666, 3333, 3333, 3333, 2252, 4444, 4444, 1111, 4444, 5255, 5255, 5255, 3333, 6666, 6666, 6666, 5255, 
1141, 1141, 1141, 1141, 2252, 2252, 3333, 2252, 3333, 3333, 5255, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 6666, 5255, 6666, 6666, 2252, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 5255, 2252, 3333, 3333, 6666, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 2252, 5255, 6666, 6666, 3333, 6666, 
1141, 1141, 1141, 1141, 2252, 2252, 6666, 2252, 3333, 3333, 2252, 3333, 4414, 4414, 4414, 4414, 5255, 5255, 3333, 5255, 6666, 6666, 5255, 6666, 
1141, 1141, 1141, 1141, 2252, 2262, 3353, 2252, 3333, 3333, 5555, 3333, 4414, 4414, 4414, 4414, 5255, 5355, 6266, 5255, 6666, 6666, 2222, 6666, 
1141, 1141, 1141, 1141, 2252, 3333, 2252, 2252, 3333, 5255, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 6666, 5255, 5255, 6666, 2252, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 3353, 2262, 2252, 3333, 5555, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 6266, 5355, 5255, 6666, 2222, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 5255, 2252, 2252, 3333, 6666, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 2252, 5255, 5255, 6666, 3333, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 5555, 2222, 2252, 3333, 6666, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 2222, 5555, 5255, 6666, 3333, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 6656, 2232, 2252, 3333, 2222, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 3233, 5655, 5255, 6666, 5555, 6666, 6666, 
1141, 1141, 1141, 1141, 2252, 6666, 2252, 2252, 3333, 2252, 3333, 3333, 4414, 4414, 4414, 4414, 5255, 3333, 5255, 5255, 6666, 5255, 6666, 6666, 
1141, 1141, 1141, 1141, 2262, 2252, 2252, 3353, 3333, 3333, 3333, 5555, 4414, 4414, 4414, 4414, 5355, 5255, 5255, 6266, 6666, 6666, 6666, 2222, 
1141, 1141, 1141, 1141, 3353, 2252, 2252, 2262, 5555, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 6266, 5255, 5255, 5355, 2222, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 3363, 2222, 2222, 2222, 5555, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 6366, 5555, 5555, 5555, 2222, 6366, 6366, 6366, 
1141, 1141, 1141, 1141, 5525, 2522, 2522, 2522, 6666, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2522, 5525, 5525, 5525, 3333, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 5555, 2252, 2252, 2222, 6666, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2222, 5255, 5255, 5555, 3333, 6666, 6666, 6666, 
1141, 1141, 1141, 1141, 6636, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 3633, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 
1141, 1141, 1141, 1141, 6656, 2252, 2252, 2232, 2222, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 3233, 5255, 5255, 5655, 5555, 6666, 6666, 6666, 
1141, 1141, 1141, 3333, 2222, 5555, 2222, 2222, 4334, 1331, 4334, 4334, 6666, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 4144, 2522, 2522, 2522, 2522, 6336, 6336, 6336, 6336, 1411, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 1141, 6666, 2222, 2222, 5555, 2222, 1331, 1331, 4334, 1331, 3333, 4414, 4414, 4414, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1141, 1141, 3333, 1141, 2252, 2252, 2252, 2252, 3433, 3133, 3433, 3433, 4414, 6666, 4414, 4414, 5255, 5255, 5255, 5255, 6616, 6646, 6616, 6616, 
1141, 1141, 4144, 1141, 2252, 2252, 2252, 2252, 3633, 3633, 3633, 3633, 4414, 1411, 4414, 4414, 5255, 5255, 5255, 5255, 6636, 6636, 6636, 6636, 
1141, 1141, 6666, 1141, 2252, 2252, 2252, 2252, 3133, 3133, 3433, 3133, 4414, 3333, 4414, 4414, 5255, 5255, 5255, 5255, 6646, 6646, 6616, 6646, 
1141, 1161, 3343, 1141, 2252, 2252, 2252, 2252, 3433, 3433, 3433, 3433, 4414, 6616, 4434, 4414, 5255, 5255, 5255, 5255, 6616, 6616, 6616, 6616, 
1141, 3333, 1141, 1141, 2252, 2252, 2252, 2252, 3343, 3313, 3343, 3343, 4414, 4414, 6666, 4414, 5255, 5255, 5255, 5255, 6166, 6466, 6166, 6166, 
1141, 3343, 1161, 1141, 2252, 2252, 2252, 2252, 3343, 3343, 3343, 3343, 4414, 4434, 6616, 4414, 5255, 5255, 5255, 5255, 6166, 6166, 6166, 6166, 
1141, 4144, 1141, 1141, 2252, 2252, 2252, 2252, 3363, 3363, 3363, 3363, 4414, 4414, 1411, 4414, 5255, 5255, 5255, 5255, 6366, 6366, 6366, 6366, 
1141, 4444, 1111, 1141, 2252, 2252, 2252, 2252, 3363, 3363, 3363, 3363, 4414, 4444, 1111, 4414, 5255, 5255, 5255, 5255, 6366, 6366, 6366, 6366, 
1141, 6646, 1131, 1141, 2252, 2252, 2252, 2252, 3313, 3313, 3313, 3313, 4414, 4464, 3313, 4414, 5255, 5255, 5255, 5255, 6466, 6466, 6466, 6466, 
1141, 6666, 1141, 1141, 2252, 2252, 2252, 2252, 3313, 3313, 3343, 3313, 4414, 4414, 3333, 4414, 5255, 5255, 5255, 5255, 6466, 6466, 6166, 6466, 
1151, 1121, 1121, 1121, 5545, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 4454, 4454, 4454, 4424, 2122, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 
1151, 1121, 1151, 1151, 2212, 2212, 5515, 2212, 3333, 3333, 6666, 3333, 4424, 4424, 4454, 4424, 5455, 5455, 2422, 5455, 6666, 6666, 3333, 6666, 
1151, 1131, 1151, 1151, 2212, 2212, 6616, 2212, 3333, 3333, 2222, 3333, 4424, 4424, 4464, 4424, 5455, 5455, 3433, 5455, 6666, 6666, 5555, 6666, 
1151, 1151, 1121, 1151, 2212, 5515, 2212, 2212, 3333, 6666, 3333, 3333, 4424, 4454, 4424, 4424, 5455, 2422, 5455, 5455, 6666, 3333, 6666, 6666, 
1151, 1151, 1131, 1151, 2212, 6616, 2212, 2212, 3333, 2222, 3333, 3333, 4424, 4464, 4424, 4424, 5455, 3433, 5455, 5455, 6666, 5555, 6666, 6666, 
1151, 1151, 1151, 1121, 5515, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 4454, 4424, 4424, 4424, 2422, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 
1151, 1151, 1151, 1131, 6616, 2212, 2212, 2212, 2222, 3333, 3333, 3333, 4464, 4424, 4424, 4424, 3433, 5455, 5455, 5455, 5555, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 1451, 1451, 1451, 1451, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 2452, 2452, 2452, 2452, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 4454, 4454, 4454, 4454, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 5455, 4444, 2222, 4444, 4444, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 2212, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 5455, 3333, 3333, 3333, 6666, 4244, 4244, 4244, 4244, 5455, 5455, 5455, 2212, 6666, 6666, 6666, 3333, 
1151, 1151, 1151, 1151, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 2212, 4444, 4444, 2222, 4444, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 5455, 
1151, 1151, 1151, 1151, 2212, 2212, 3333, 2212, 3333, 3333, 5455, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 6666, 5455, 6666, 6666, 2212, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 5455, 2212, 3333, 3333, 6666, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 2212, 5455, 6666, 6666, 3333, 6666, 
1151, 1151, 1151, 1151, 2212, 2212, 6666, 2212, 3333, 3333, 2212, 3333, 4424, 4424, 4424, 4424, 5455, 5455, 3333, 5455, 6666, 6666, 5455, 6666, 
1151, 1151, 1151, 1151, 2212, 3333, 2212, 2212, 3333, 5455, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 6666, 5455, 5455, 6666, 2212, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 5455, 2212, 2212, 3333, 6666, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 2212, 5455, 5455, 6666, 3333, 6666, 6666, 
1151, 1151, 1151, 1151, 2212, 6666, 2212, 2212, 3333, 2212, 3333, 3333, 4424, 4424, 4424, 4424, 5455, 3333, 5455, 5455, 6666, 5455, 6666, 6666, 
1151, 1151, 1151, 1151, 5545, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 2122, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 
1151, 1151, 1151, 1161, 3313, 2212, 2212, 2212, 5555, 3333, 3333, 3333, 4434, 4424, 4424, 4424, 6466, 5455, 5455, 5455, 2222, 6666, 6666, 6666, 
1151, 1151, 1151, 3333, 2222, 1111, 2222, 2222, 4334, 2332, 4334, 4334, 6666, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 3353, 2212, 2212, 2212, 2232, 4334, 4334, 4334, 4334, 6626, 4424, 4424, 4424, 5455, 5455, 5455, 5655, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 4244, 2122, 2122, 2122, 2122, 6336, 6336, 6336, 6336, 1511, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 4454, 2212, 2212, 2212, 2242, 6336, 6336, 6336, 6336, 1121, 4424, 4424, 4424, 5455, 5455, 5455, 5155, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 6656, 2212, 2212, 2212, 2262, 1331, 1331, 1331, 1331, 3323, 4424, 4424, 4424, 5455, 5455, 5455, 5355, 6666, 6666, 6666, 6666, 
1151, 1151, 1151, 6666, 2222, 2222, 1111, 2222, 1331, 1331, 5335, 1331, 3333, 4424, 4424, 4424, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
1151, 1151, 1161, 1151, 2212, 3313, 2212, 2212, 3333, 5555, 3333, 3333, 4424, 4434, 4424, 4424, 5455, 6466, 5455, 5455, 6666, 2222, 6666, 6666, 
1151, 1151, 3333, 1151, 2212, 2212, 2212, 2212, 3433, 3233, 3433, 3433, 4424, 6666, 4424, 4424, 5455, 5455, 5455, 5455, 6616, 6656, 6616, 6616, 
1151, 1151, 3353, 1151, 2212, 2212, 2232, 2212, 3433, 3433, 3433, 3433, 4424, 6626, 4424, 4424, 5455, 5455, 5655, 5455, 6616, 6616, 6616, 6616, 
1151, 1151, 4244, 1151, 2212, 2212, 2212, 2212, 3633, 3633, 3633, 3633, 4424, 1511, 4424, 4424, 5455, 5455, 5455, 5455, 6636, 6636, 6636, 6636, 
1151, 1151, 4454, 1151, 2212, 2212, 2242, 2212, 3633, 3633, 3633, 3633, 4424, 1121, 4424, 4424, 5455, 5455, 5155, 5455, 6636, 6636, 6636, 6636, 
1151, 1151, 6656, 1151, 2212, 2212, 2262, 2212, 3133, 3133, 3133, 3133, 4424, 3323, 4424, 4424, 5455, 5455, 5355, 5455, 6646, 6646, 6646, 6646, 
1151, 1151, 6666, 1151, 2212, 2212, 2212, 2212, 3133, 3133, 3533, 3133, 4424, 3333, 4424, 4424, 5455, 5455, 5455, 5455, 6646, 6646, 6626, 6646, 
1151, 1161, 1151, 1151, 2212, 2212, 3313, 2212, 3333, 3333, 5555, 3333, 4424, 4424, 4434, 4424, 5455, 5455, 6466, 5455, 6666, 6666, 2222, 6666, 
1151, 3333, 1151, 1151, 2212, 2212, 2212, 2212, 3343, 3323, 3343, 3343, 4424, 4424, 6666, 4424, 5455, 5455, 5455, 5455, 6166, 6566, 6166, 6166, 
1151, 3353, 1151, 1151, 2212, 2232, 2212, 2212, 3343, 3343, 3343, 3343, 4424, 4424, 6626, 4424, 5455, 5655, 5455, 5455, 6166, 6166, 6166, 6166, 
1151, 4244, 1151, 1151, 2212, 2212, 2212, 2212, 3363, 3363, 3363, 3363, 4424, 4424, 1511, 4424, 5455, 5455, 5455, 5455, 6366, 6366, 6366, 6366, 
1151, 4454, 1151, 1151, 2212, 2242, 2212, 2212, 3363, 3363, 3363, 3363, 4424, 4424, 1121, 4424, 5455, 5155, 5455, 5455, 6366, 6366, 6366, 6366, 
1151, 6656, 1151, 1151, 2212, 2262, 2212, 2212, 3313, 3313, 3313, 3313, 4424, 4424, 3323, 4424, 5455, 5355, 5455, 5455, 6466, 6466, 6466, 6466, 
1151, 6666, 1151, 1151, 2212, 2212, 2212, 2212, 3313, 3313, 3353, 3313, 4424, 4424, 3333, 4424, 5455, 5455, 5455, 5455, 6466, 6466, 6266, 6466, 
1161, 1121, 1121, 1121, 6646, 2242, 2242, 2242, 2222, 3333, 3333, 3333, 4454, 4454, 4454, 4434, 3133, 5155, 5155, 5155, 5555, 6666, 6666, 6666, 
1161, 1141, 1141, 3343, 2252, 2252, 2252, 2252, 4334, 4334, 4334, 4334, 6616, 4414, 4414, 4434, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
1161, 1151, 1151, 1151, 2212, 2212, 2212, 3313, 3333, 3333, 3333, 5555, 4424, 4424, 4424, 4434, 5455, 5455, 5455, 6466, 6666, 6666, 6666, 2222, 
1161, 1161, 1161, 1161, 3313, 2222, 2222, 2222, 5555, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 6466, 5555, 5555, 5555, 2222, 6466, 6466, 6466, 
1161, 1161, 1161, 1161, 6646, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 3133, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 1511, 1511, 1511, 1511, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 2512, 2512, 2512, 2512, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 4544, 4514, 4514, 4514, 4514, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 5515, 4444, 4444, 5555, 4444, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 2422, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 5515, 3333, 3333, 3333, 6666, 4454, 4454, 4454, 4454, 5515, 5515, 5515, 2422, 6666, 6666, 6666, 3333, 
1211, 1211, 1211, 1211, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 2422, 4444, 5555, 4444, 4444, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 5515, 
1211, 1211, 1211, 1211, 2422, 2422, 3333, 2422, 3333, 3333, 5515, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 6666, 5515, 6666, 6666, 2422, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 5515, 2422, 3333, 3333, 6666, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 2422, 5515, 6666, 6666, 3333, 6666, 
1211, 1211, 1211, 1211, 2422, 2422, 6666, 2422, 3333, 3333, 2422, 3333, 4544, 4544, 4544, 4544, 5515, 5515, 3333, 5515, 6666, 6666, 5515, 6666, 
1211, 1211, 1211, 1211, 2422, 3333, 2422, 2422, 3333, 5515, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 6666, 5515, 5515, 6666, 2422, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 5515, 2422, 2422, 3333, 6666, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 2422, 5515, 5515, 6666, 3333, 6666, 6666, 
1211, 1211, 1211, 1211, 2422, 6666, 2422, 2422, 3333, 2422, 3333, 3333, 4544, 4544, 4544, 4544, 5515, 3333, 5515, 5515, 6666, 5515, 6666, 6666, 
1211, 1211, 1211, 1211, 5155, 2242, 2242, 2242, 6666, 3333, 3333, 3333, 4454, 4454, 4454, 4454, 2242, 5155, 5155, 5155, 3333, 6666, 6666, 6666, 
1211, 1211, 1211, 1311, 2422, 2422, 2422, 3433, 3333, 3333, 3333, 5555, 4644, 4544, 4544, 4544, 5515, 5515, 5515, 6616, 6666, 6666, 6666, 2222, 
1211, 1211, 1211, 1511, 2422, 2422, 2422, 5455, 3333, 3333, 3333, 6666, 4244, 4544, 4544, 4544, 5515, 5515, 5515, 2212, 6666, 6666, 6666, 3333, 
1211, 1211, 1211, 1611, 2422, 2422, 2422, 6466, 3333, 3333, 3333, 2222, 4344, 4544, 4544, 4544, 5515, 5515, 5515, 3313, 6666, 6666, 6666, 5555, 
1211, 1211, 1211, 3233, 2622, 2422, 2422, 2422, 4334, 4334, 4334, 4334, 6566, 4544, 4544, 4544, 5535, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 3333, 2222, 2222, 4444, 2222, 4334, 4334, 5335, 4334, 6666, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 4244, 2122, 2422, 2422, 2422, 6336, 6336, 6336, 6336, 1511, 4544, 4544, 4544, 5545, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 4454, 2242, 2242, 2242, 2242, 6336, 6336, 6336, 6336, 1121, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 6266, 2322, 2422, 2422, 2422, 1331, 1331, 1331, 1331, 3533, 4544, 4544, 4544, 5565, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1211, 6666, 2222, 4444, 2222, 2222, 1331, 2332, 1331, 1331, 3333, 4544, 4544, 4544, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
1211, 1211, 1311, 1211, 2422, 2422, 3433, 2422, 3333, 3333, 5555, 3333, 4544, 4644, 4544, 4544, 5515, 5515, 6616, 5515, 6666, 6666, 2222, 6666, 
1211, 1211, 1511, 1211, 2422, 2422, 5455, 2422, 3333, 3333, 6666, 3333, 4544, 4244, 4544, 4544, 5515, 5515, 2212, 5515, 6666, 6666, 3333, 6666, 
1211, 1211, 1611, 1211, 2422, 2422, 6466, 2422, 3333, 3333, 2222, 3333, 4544, 4344, 4544, 4544, 5515, 5515, 3313, 5515, 6666, 6666, 5555, 6666, 
1211, 1211, 3233, 1211, 2422, 2622, 2422, 2422, 3433, 3433, 3433, 3433, 4544, 6566, 4544, 4544, 5515, 5535, 5515, 5515, 6616, 6616, 6616, 6616, 
1211, 1211, 3333, 1211, 2422, 2422, 2422, 2422, 3433, 3433, 3533, 3433, 4544, 6666, 4544, 4544, 5515, 5515, 5515, 5515, 6616, 6616, 6626, 6616, 
1211, 1211, 4244, 1211, 2422, 2122, 2422, 2422, 3633, 3633, 3633, 3633, 4544, 1511, 4544, 4544, 5515, 5545, 5515, 5515, 6636, 6636, 6636, 6636, 
1211, 1211, 4454, 1211, 2422, 2422, 2422, 2422, 3633, 3633, 3633, 3633, 4544, 1121, 4544, 4544, 5515, 5515, 5515, 5515, 6636, 6636, 6636, 6636, 
1211, 1211, 6266, 1211, 2422, 2322, 2422, 2422, 3133, 3133, 3133, 3133, 4544, 3533, 4544, 4544, 5515, 5565, 5515, 5515, 6646, 6646, 6646, 6646, 
1211, 1211, 6666, 1211, 2422, 2422, 2422, 2422, 3133, 3233, 3133, 3133, 4544, 3333, 4544, 4544, 5515, 5515, 5515, 5515, 6646, 6656, 6646, 6646, 
1211, 1311, 1211, 1211, 2422, 3433, 2422, 2422, 3333, 5555, 3333, 3333, 4544, 4544, 4644, 4544, 5515, 6616, 5515, 5515, 6666, 2222, 6666, 6666, 
1211, 1511, 1211, 1211, 2422, 5455, 2422, 2422, 3333, 6666, 3333, 3333, 4544, 4544, 4244, 4544, 5515, 2212, 5515, 5515, 6666, 3333, 6666, 6666, 
1211, 1511, 1511, 1511, 2122, 2122, 2122, 5155, 3333, 3333, 3333, 6666, 4244, 4244, 4244, 4544, 5545, 5545, 5545, 2242, 6666, 6666, 6666, 3333, 
1211, 1611, 1211, 1211, 2422, 6466, 2422, 2422, 3333, 2222, 3333, 3333, 4544, 4544, 4344, 4544, 5515, 3313, 5515, 5515, 6666, 5555, 6666, 6666, 
1211, 3233, 1211, 1211, 2422, 2422, 2622, 2422, 3343, 3343, 3343, 3343, 4544, 4544, 6566, 4544, 5515, 5515, 5535, 5515, 6166, 6166, 6166, 6166, 
1211, 3333, 1211, 1211, 2422, 2422, 2422, 2422, 3343, 3343, 3353, 3343, 4544, 4544, 6666, 4544, 5515, 5515, 5515, 5515, 6166, 6166, 6266, 6166, 
1211, 4244, 1211, 1211, 2422, 2422, 2122, 2422, 3363, 3363, 3363, 3363, 4544, 4544, 1511, 4544, 5515, 5515, 5545, 5515, 6366, 6366, 6366, 6366, 
1211, 4454, 1211, 1211, 2422, 2422, 2422, 2422, 3363, 3363, 3363, 3363, 4544, 4544, 1121, 4544, 5515, 5515, 5515, 5515, 6366, 6366, 6366, 6366, 
1211, 6266, 1211, 1211, 2422, 2422, 2322, 2422, 3313, 3313, 3313, 3313, 4544, 4544, 3533, 4544, 5515, 5515, 5565, 5515, 6466, 6466, 6466, 6466, 
1211, 6666, 1211, 1211, 2422, 2422, 2422, 2422, 3313, 3323, 3313, 3313, 4544, 4544, 3333, 4544, 5515, 5515, 5515, 5515, 6466, 6566, 6466, 6466, 
1221, 1221, 1221, 1221, 2442, 2442, 2442, 2442, 3333, 3333, 3333, 3333, 4554, 4554, 4554, 4554, 5115, 5115, 5115, 5115, 6666, 6666, 6666, 6666, 
1241, 1241, 1241, 1241, 2452, 2452, 2452, 2452, 3333, 3333, 3333, 3333, 4514, 4514, 4514, 4514, 5215, 5215, 5215, 5215, 6666, 6666, 6666, 6666, 
1251, 1251, 1251, 1251, 2412, 2412, 2412, 2412, 3333, 3333, 3333, 3333, 4524, 4524, 4524, 4524, 5415, 5415, 5415, 5415, 6666, 6666, 6666, 6666, 
1311, 1211, 1211, 1211, 3433, 2422, 2422, 2422, 5555, 3333, 3333, 3333, 4544, 4544, 4544, 4644, 6616, 5515, 5515, 5515, 2222, 6666, 6666, 6666, 
1311, 1311, 1311, 1311, 3433, 2222, 2222, 2222, 5555, 3433, 3433, 3433, 4444, 6666, 4444, 4444, 6616, 5555, 5555, 5555, 2222, 6616, 6616, 6616, 
1311, 1311, 1311, 1311, 6166, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 4444, 4444, 6666, 4444, 3343, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 
1311, 1411, 1411, 6466, 2522, 2522, 2522, 2522, 1331, 1331, 1331, 1331, 3133, 4144, 4144, 4644, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1311, 1511, 1511, 1511, 2122, 2122, 2122, 6166, 3333, 3333, 3333, 2222, 4244, 4244, 4244, 4644, 5545, 5545, 5545, 3343, 6666, 6666, 6666, 5555, 
1411, 1111, 4444, 1411, 2522, 2522, 2522, 2522, 3633, 3633, 3633, 3633, 4144, 1111, 4444, 4144, 5525, 5525, 5525, 5525, 6636, 6636, 6636, 6636, 
1411, 1311, 6466, 1411, 2522, 2522, 2522, 2522, 3133, 3133, 3133, 3133, 4144, 3133, 4644, 4144, 5525, 5525, 5525, 5525, 6646, 6646, 6646, 6646, 
1411, 1411, 1411, 1411, 2222, 2522, 2522, 5555, 3333, 3333, 3333, 6666, 4144, 4144, 4144, 4144, 5555, 5525, 5525, 2222, 6666, 6666, 6666, 3333, 
1411, 1411, 1411, 1411, 2322, 2522, 2522, 6566, 3333, 3333, 3333, 2222, 4144, 4144, 4144, 4144, 5565, 5525, 5525, 3323, 6666, 6666, 6666, 5555, 
1411, 1411, 1411, 1411, 2522, 2222, 5555, 2522, 3333, 3333, 6666, 3333, 4144, 4144, 4144, 4144, 5525, 5555, 2222, 5525, 6666, 6666, 3333, 6666, 
1411, 1411, 1411, 1411, 2522, 2322, 6566, 2522, 3333, 3333, 2222, 3333, 4144, 4144, 4144, 4144, 5525, 5565, 3323, 5525, 6666, 6666, 5555, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 1521, 1521, 1521, 1521, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2522, 2522, 2522, 2522, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 4524, 4524, 4524, 4524, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 5525, 4444, 4444, 1111, 4444, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 2522, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 5525, 3333, 3333, 3333, 6666, 4414, 4414, 4414, 4414, 5525, 5525, 5525, 2522, 6666, 6666, 6666, 3333, 
1411, 1411, 1411, 1411, 2522, 2522, 2522, 6666, 3333, 3333, 3333, 2522, 4444, 1111, 4444, 4444, 5525, 5525, 5525, 3333, 6666, 6666, 6666, 5525, 
1411, 1411, 1411, 1411, 2522, 2522, 3333, 2522, 3333, 3333, 5525, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 6666, 5525, 6666, 6666, 2522, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 5525, 2522, 3333, 3333, 6666, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 2522, 5525, 6666, 6666, 3333, 6666, 
1411, 1411, 1411, 1411, 2522, 2522, 6666, 2522, 3333, 3333, 2522, 3333, 4144, 4144, 4144, 4144, 5525, 5525, 3333, 5525, 6666, 6666, 5525, 6666, 
1411, 1411, 1411, 1411, 2522, 2622, 3533, 2522, 3333, 3333, 5555, 3333, 4144, 4144, 4144, 4144, 5525, 5535, 6626, 5525, 6666, 6666, 2222, 6666, 
1411, 1411, 1411, 1411, 2522, 3333, 2522, 2522, 3333, 5525, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 6666, 5525, 5525, 6666, 2522, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 3533, 2622, 2522, 3333, 5555, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 6626, 5535, 5525, 6666, 2222, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 5525, 2522, 2522, 3333, 6666, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 2522, 5525, 5525, 6666, 3333, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 5555, 2222, 2522, 3333, 6666, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 2222, 5555, 5525, 6666, 3333, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 6566, 2322, 2522, 3333, 2222, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 3323, 5565, 5525, 6666, 5555, 6666, 6666, 
1411, 1411, 1411, 1411, 2522, 6666, 2522, 2522, 3333, 2522, 3333, 3333, 4144, 4144, 4144, 4144, 5525, 3333, 5525, 5525, 6666, 5525, 6666, 6666, 
1411, 1411, 1411, 1411, 2622, 2522, 2522, 3533, 3333, 3333, 3333, 5555, 4144, 4144, 4144, 4144, 5535, 5525, 5525, 6626, 6666, 6666, 6666, 2222, 
1411, 1411, 1411, 1411, 3533, 2522, 2522, 2622, 5555, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 6626, 5525, 5525, 5535, 2222, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 3633, 2222, 2222, 2222, 5555, 3633, 3633, 3633, 4444, 1111, 4444, 4444, 6636, 5555, 5555, 5555, 2222, 6636, 6636, 6636, 
1411, 1411, 1411, 1411, 5255, 2252, 2252, 2252, 6666, 3333, 3333, 3333, 4414, 4414, 4414, 4414, 2252, 5255, 5255, 5255, 3333, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 5555, 2522, 2522, 2222, 6666, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 2222, 5525, 5525, 5555, 3333, 6666, 6666, 6666, 
1411, 1411, 1411, 1411, 6366, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 4444, 4444, 1111, 4444, 3363, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 
1411, 1411, 1411, 1411, 6566, 2522, 2522, 2322, 2222, 3333, 3333, 3333, 4144, 4144, 4144, 4144, 3323, 5525, 5525, 5565, 5555, 6666, 6666, 6666, 
1411, 1411, 1411, 3333, 2222, 2222, 5555, 2222, 4334, 4334, 1331, 4334, 6666, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 4414, 2252, 2252, 2252, 2252, 6336, 6336, 6336, 6336, 1141, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 1411, 6666, 2222, 5555, 2222, 2222, 1331, 4334, 1331, 1331, 3333, 4144, 4144, 4144, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1411, 1411, 3333, 1411, 2522, 2522, 2522, 2522, 3433, 3433, 3133, 3433, 4144, 6666, 4144, 4144, 5525, 5525, 5525, 5525, 6616, 6616, 6646, 6616, 
1411, 1411, 4414, 1411, 2522, 2522, 2522, 2522, 3633, 3633, 3633, 3633, 4144, 1141, 4144, 4144, 5525, 5525, 5525, 5525, 6636, 6636, 6636, 6636, 
1411, 1411, 6666, 1411, 2522, 2522, 2522, 2522, 3133, 3433, 3133, 3133, 4144, 3333, 4144, 4144, 5525, 5525, 5525, 5525, 6646, 6616, 6646, 6646, 
1411, 1611, 3433, 1411, 2522, 2522, 2522, 2522, 3433, 3433, 3433, 3433, 4144, 6166, 4344, 4144, 5525, 5525, 5525, 5525, 6616, 6616, 6616, 6616, 
1411, 3333, 1411, 1411, 2522, 2522, 2522, 2522, 3343, 3343, 3313, 3343, 4144, 4144, 6666, 4144, 5525, 5525, 5525, 5525, 6166, 6166, 6466, 6166, 
1411, 3433, 1611, 1411, 2522, 2522, 2522, 2522, 3343, 3343, 3343, 3343, 4144, 4344, 6166, 4144, 5525, 5525, 5525, 5525, 6166, 6166, 6166, 6166, 
1411, 4414, 1411, 1411, 2522, 2522, 2522, 2522, 3363, 3363, 3363, 3363, 4144, 4144, 1141, 4144, 5525, 5525, 5525, 5525, 6366, 6366, 6366, 6366, 
1411, 4444, 1111, 1411, 2522, 2522, 2522, 2522, 3363, 3363, 3363, 3363, 4144, 4444, 1111, 4144, 5525, 5525, 5525, 5525, 6366, 6366, 6366, 6366, 
1411, 6466, 1311, 1411, 2522, 2522, 2522, 2522, 3313, 3313, 3313, 3313, 4144, 4644, 3133, 4144, 5525, 5525, 5525, 5525, 6466, 6466, 6466, 6466, 
1411, 6666, 1411, 1411, 2522, 2522, 2522, 2522, 3313, 3343, 3313, 3313, 4144, 4144, 3333, 4144, 5525, 5525, 5525, 5525, 6466, 6166, 6466, 6466, 
1421, 1421, 1421, 1421, 2542, 2542, 2542, 2542, 3333, 3333, 3333, 3333, 4154, 4154, 4154, 4154, 5125, 5125, 5125, 5125, 6666, 6666, 6666, 6666, 
1441, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 4114, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
1441, 1441, 1441, 1441, 2552, 2552, 2552, 2552, 3333, 3333, 3333, 3333, 4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 6666, 6666, 6666, 6666, 
1451, 1451, 1451, 1451, 2512, 2512, 2512, 2512, 3333, 3333, 3333, 3333, 4124, 4124, 4124, 4124, 5425, 5425, 5425, 5425, 6666, 6666, 6666, 6666, 
1511, 1211, 1211, 1211, 5455, 2422, 2422, 2422, 6666, 3333, 3333, 3333, 4544, 4544, 4544, 4244, 2212, 5515, 5515, 5515, 3333, 6666, 6666, 6666, 
1511, 1211, 1511, 1511, 2122, 2122, 5155, 2122, 3333, 3333, 6666, 3333, 4244, 4244, 4544, 4244, 5545, 5545, 2242, 5545, 6666, 6666, 3333, 6666, 
1511, 1311, 1511, 1511, 2122, 2122, 6166, 2122, 3333, 3333, 2222, 3333, 4244, 4244, 4644, 4244, 5545, 5545, 3343, 5545, 6666, 6666, 5555, 6666, 
1511, 1511, 1211, 1511, 2122, 5155, 2122, 2122, 3333, 6666, 3333, 3333, 4244, 4544, 4244, 4244, 5545, 2242, 5545, 5545, 6666, 3333, 6666, 6666, 
1511, 1511, 1311, 1511, 2122, 6166, 2122, 2122, 3333, 2222, 3333, 3333, 4244, 4644, 4244, 4244, 5545, 3343, 5545, 5545, 6666, 5555, 6666, 6666, 
1511, 1511, 1511, 1211, 5155, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 4544, 4244, 4244, 4244, 2242, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 
1511, 1511, 1511, 1311, 6166, 2122, 2122, 2122, 2222, 3333, 3333, 3333, 4644, 4244, 4244, 4244, 3343, 5545, 5545, 5545, 5555, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 1541, 1541, 1541, 1541, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 2542, 2542, 2542, 2542, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 4244, 4544, 4544, 4544, 4544, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 5545, 4444, 4444, 2222, 4444, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 2122, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 5545, 3333, 3333, 3333, 6666, 4424, 4424, 4424, 4424, 5545, 5545, 5545, 2122, 6666, 6666, 6666, 3333, 
1511, 1511, 1511, 1511, 2122, 2122, 2122, 6666, 3333, 3333, 3333, 2122, 4444, 2222, 4444, 4444, 5545, 5545, 5545, 3333, 6666, 6666, 6666, 5545, 
1511, 1511, 1511, 1511, 2122, 2122, 3333, 2122, 3333, 3333, 5545, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 6666, 5545, 6666, 6666, 2122, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 5545, 2122, 3333, 3333, 6666, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 2122, 5545, 6666, 6666, 3333, 6666, 
1511, 1511, 1511, 1511, 2122, 2122, 6666, 2122, 3333, 3333, 2122, 3333, 4244, 4244, 4244, 4244, 5545, 5545, 3333, 5545, 6666, 6666, 5545, 6666, 
1511, 1511, 1511, 1511, 2122, 3333, 2122, 2122, 3333, 5545, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 6666, 5545, 5545, 6666, 2122, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 5545, 2122, 2122, 3333, 6666, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 2122, 5545, 5545, 6666, 3333, 6666, 6666, 
1511, 1511, 1511, 1511, 2122, 6666, 2122, 2122, 3333, 2122, 3333, 3333, 4244, 4244, 4244, 4244, 5545, 3333, 5545, 5545, 6666, 5545, 6666, 6666, 
1511, 1511, 1511, 1511, 5455, 2212, 2212, 2212, 6666, 3333, 3333, 3333, 4424, 4424, 4424, 4424, 2212, 5455, 5455, 5455, 3333, 6666, 6666, 6666, 
1511, 1511, 1511, 1611, 3133, 2122, 2122, 2122, 5555, 3333, 3333, 3333, 4344, 4244, 4244, 4244, 6646, 5545, 5545, 5545, 2222, 6666, 6666, 6666, 
1511, 1511, 1511, 3333, 2222, 2222, 1111, 2222, 4334, 4334, 2332, 4334, 6666, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 3533, 2122, 2122, 2122, 2322, 4334, 4334, 4334, 4334, 6266, 4244, 4244, 4244, 5545, 5545, 5545, 5565, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 4424, 2212, 2212, 2212, 2212, 6336, 6336, 6336, 6336, 1151, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 4544, 2122, 2122, 2122, 2422, 6336, 6336, 6336, 6336, 1211, 4244, 4244, 4244, 5545, 5545, 5545, 5515, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 6566, 2122, 2122, 2122, 2622, 1331, 1331, 1331, 1331, 3233, 4244, 4244, 4244, 5545, 5545, 5545, 5535, 6666, 6666, 6666, 6666, 
1511, 1511, 1511, 6666, 2222, 1111, 2222, 2222, 1331, 5335, 1331, 1331, 3333, 4244, 4244, 4244, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
1511, 1511, 1611, 1511, 2122, 3133, 2122, 2122, 3333, 5555, 3333, 3333, 4244, 4344, 4244, 4244, 5545, 6646, 5545, 5545, 6666, 2222, 6666, 6666, 
1511, 1511, 3333, 1511, 2122, 2122, 2122, 2122, 3433, 3433, 3233, 3433, 4244, 6666, 4244, 4244, 5545, 5545, 5545, 5545, 6616, 6616, 6656, 6616, 
1511, 1511, 3533, 1511, 2122, 2122, 2322, 2122, 3433, 3433, 3433, 3433, 4244, 6266, 4244, 4244, 5545, 5545, 5565, 5545, 6616, 6616, 6616, 6616, 
1511, 1511, 4424, 1511, 2122, 2122, 2122, 2122, 3633, 3633, 3633, 3633, 4244, 1151, 4244, 4244, 5545, 5545, 5545, 5545, 6636, 6636, 6636, 6636, 
1511, 1511, 4544, 1511, 2122, 2122, 2422, 2122, 3633, 3633, 3633, 3633, 4244, 1211, 4244, 4244, 5545, 5545, 5515, 5545, 6636, 6636, 6636, 6636, 
1511, 1511, 6566, 1511, 2122, 2122, 2622, 2122, 3133, 3133, 3133, 3133, 4244, 3233, 4244, 4244, 5545, 5545, 5535, 5545, 6646, 6646, 6646, 6646, 
1511, 1511, 6666, 1511, 2122, 2122, 2122, 2122, 3133, 3533, 3133, 3133, 4244, 3333, 4244, 4244, 5545, 5545, 5545, 5545, 6646, 6626, 6646, 6646, 
1511, 1611, 1511, 1511, 2122, 2122, 3133, 2122, 3333, 3333, 5555, 3333, 4244, 4244, 4344, 4244, 5545, 5545, 6646, 5545, 6666, 6666, 2222, 6666, 
1511, 3333, 1511, 1511, 2122, 2122, 2122, 2122, 3343, 3343, 3323, 3343, 4244, 4244, 6666, 4244, 5545, 5545, 5545, 5545, 6166, 6166, 6566, 6166, 
1511, 3533, 1511, 1511, 2122, 2322, 2122, 2122, 3343, 3343, 3343, 3343, 4244, 4244, 6266, 4244, 5545, 5565, 5545, 5545, 6166, 6166, 6166, 6166, 
1511, 4424, 1511, 1511, 2122, 2122, 2122, 2122, 3363, 3363, 3363, 3363, 4244, 4244, 1151, 4244, 5545, 5545, 5545, 5545, 6366, 6366, 6366, 6366, 
1511, 4544, 1511, 1511, 2122, 2422, 2122, 2122, 3363, 3363, 3363, 3363, 4244, 4244, 1211, 4244, 5545, 5515, 5545, 5545, 6366, 6366, 6366, 6366, 
1511, 6566, 1511, 1511, 2122, 2622, 2122, 2122, 3313, 3313, 3313, 3313, 4244, 4244, 3233, 4244, 5545, 5535, 5545, 5545, 6466, 6466, 6466, 6466, 
1511, 6666, 1511, 1511, 2122, 2122, 2122, 2122, 3313, 3353, 3313, 3313, 4244, 4244, 3333, 4244, 5545, 5545, 5545, 5545, 6466, 6266, 6466, 6466, 
1521, 1521, 1521, 1521, 2142, 2142, 2142, 2142, 3333, 3333, 3333, 3333, 4254, 4254, 4254, 4254, 5145, 5145, 5145, 5145, 6666, 6666, 6666, 6666, 
1541, 1541, 1541, 1541, 2152, 2152, 2152, 2152, 3333, 3333, 3333, 3333, 4214, 4214, 4214, 4214, 5245, 5245, 5245, 5245, 6666, 6666, 6666, 6666, 
1551, 1551, 1551, 1551, 2112, 2112, 2112, 2112, 3333, 3333, 3333, 3333, 4224, 4224, 4224, 4224, 5445, 5445, 5445, 5445, 6666, 6666, 6666, 6666, 
1611, 1211, 1211, 1211, 6466, 2422, 2422, 2422, 2222, 3333, 3333, 3333, 4544, 4544, 4544, 4344, 3313, 5515, 5515, 5515, 5555, 6666, 6666, 6666, 
1611, 1411, 1411, 3433, 2522, 2522, 2522, 2522, 4334, 4334, 4334, 4334, 6166, 4144, 4144, 4344, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
1611, 1511, 1511, 1511, 2122, 2122, 2122, 3133, 3333, 3333, 3333, 5555, 4244, 4244, 4244, 4344, 5545, 5545, 5545, 6646, 6666, 6666, 6666, 2222, 
1611, 1611, 1611, 1611, 3133, 2222, 2222, 2222, 5555, 3133, 3133, 3133, 4444, 3333, 4444, 4444, 6646, 5555, 5555, 5555, 2222, 6646, 6646, 6646, 
1611, 1611, 1611, 1611, 6466, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 4444, 4444, 3333, 4444, 3313, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 
2112, 2112, 2112, 2112, 1551, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 1551, 1551, 1551, 3333, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 3333, 4224, 4224, 3333, 5555, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 6666, 5555, 5555, 6666, 4224, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 3333, 4224, 3333, 3333, 5555, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 6666, 5555, 6666, 6666, 4224, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 4224, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4224, 6666, 6666, 6666, 3333, 
2112, 2112, 2112, 2112, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 4224, 5555, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
2112, 2112, 2112, 2112, 4224, 4224, 5555, 4224, 3333, 3333, 6666, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 4224, 5555, 6666, 6666, 3333, 6666, 
2112, 2112, 2112, 2112, 4224, 4224, 6666, 4224, 3333, 3333, 4224, 3333, 5445, 5445, 5445, 5445, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
2112, 2112, 2112, 2112, 4224, 5555, 4224, 4224, 3333, 6666, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 4224, 5555, 5555, 6666, 3333, 6666, 6666, 
2112, 2112, 2112, 2112, 4224, 6666, 4224, 4224, 3333, 4224, 3333, 3333, 5445, 5445, 5445, 5445, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
2112, 2112, 2112, 2332, 6226, 4224, 4224, 4224, 4334, 4334, 4334, 4334, 5665, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 1111, 6666, 6666, 6666, 
2112, 2112, 2112, 2442, 1221, 4224, 4224, 4224, 6336, 6336, 6336, 6336, 5115, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
2112, 2112, 2112, 2662, 3223, 4224, 4224, 4224, 1331, 1331, 1331, 1331, 5335, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 4444, 6666, 6666, 6666, 
2112, 2112, 2112, 3113, 4224, 4224, 4224, 4334, 3333, 3333, 3333, 5555, 6446, 5445, 5445, 5445, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 3333, 2222, 2222, 2222, 4444, 4334, 4334, 4334, 5335, 6666, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 5115, 4224, 4224, 4224, 4554, 3333, 3333, 3333, 6666, 2442, 5445, 5445, 5445, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 6116, 4224, 4224, 4224, 4664, 3333, 3333, 3333, 2222, 3443, 5445, 5445, 5445, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 6666, 
2112, 2112, 2112, 6666, 4444, 2222, 2222, 2222, 2332, 1331, 1331, 1331, 3333, 5445, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
2112, 2112, 2332, 2112, 4224, 6226, 4224, 4224, 3433, 3433, 3433, 3433, 5445, 5665, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 1111, 6666, 6666, 
2112, 2112, 2442, 2112, 4224, 1221, 4224, 4224, 3633, 3633, 3633, 3633, 5445, 5115, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 3333, 6666, 6666, 
2112, 2112, 2662, 2112, 4224, 3223, 4224, 4224, 3133, 3133, 3133, 3133, 5445, 5335, 5445, 5445, 5555, 5555, 5555, 5555, 6666, 4444, 6666, 6666, 
2112, 2112, 3113, 2112, 4224, 4224, 4334, 4224, 3333, 3333, 5555, 3333, 5445, 6446, 5445, 5445, 5555, 5555, 6666, 5555, 6626, 6626, 6626, 6626, 
2112, 2112, 3333, 2112, 4224, 4224, 4224, 4224, 3433, 3433, 3433, 3533, 5445, 6666, 5445, 5445, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6626, 
2112, 2112, 4444, 2112, 4224, 4224, 4224, 4224, 3633, 3633, 3633, 3633, 5445, 1111, 5445, 5445, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
2112, 2112, 5115, 2112, 4224, 4224, 4554, 4224, 3333, 3333, 6666, 3333, 5445, 2442, 5445, 5445, 5555, 5555, 2222, 5555, 6636, 6636, 6636, 6636, 
2112, 2112, 6116, 2112, 4224, 4224, 4664, 4224, 3333, 3333, 2222, 3333, 5445, 3443, 5445, 5445, 5555, 5555, 3333, 5555, 6656, 6656, 6656, 6656, 
2112, 2112, 6666, 2112, 4224, 4224, 4224, 4224, 3233, 3133, 3133, 3133, 5445, 3333, 5445, 5445, 5555, 5555, 5555, 5555, 6656, 6646, 6646, 6646, 
2112, 2332, 2112, 2112, 4224, 4224, 6226, 4224, 3343, 3343, 3343, 3343, 5445, 5445, 5665, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 1111, 6666, 
2112, 2442, 2112, 2112, 4224, 4224, 1221, 4224, 3363, 3363, 3363, 3363, 5445, 5445, 5115, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 3333, 6666, 
2112, 2662, 2112, 2112, 4224, 4224, 3223, 4224, 3313, 3313, 3313, 3313, 5445, 5445, 5335, 5445, 5555, 5555, 5555, 5555, 6666, 6666, 4444, 6666, 
2112, 3113, 2112, 2112, 4224, 4334, 4224, 4224, 3333, 5555, 3333, 3333, 5445, 5445, 6446, 5445, 5555, 6666, 5555, 5555, 6266, 6266, 6266, 6266, 
2112, 3333, 2112, 2112, 4224, 4224, 4224, 4224, 3343, 3343, 3343, 3353, 5445, 5445, 6666, 5445, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6266, 
2112, 4444, 2112, 2112, 4224, 4224, 4224, 4224, 3363, 3363, 3363, 3363, 5445, 5445, 1111, 5445, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
2112, 5115, 2112, 2112, 4224, 4554, 4224, 4224, 3333, 6666, 3333, 3333, 5445, 5445, 2442, 5445, 5555, 2222, 5555, 5555, 6366, 6366, 6366, 6366, 
2112, 5115, 5115, 5115, 1221, 1221, 1221, 1551, 3333, 3333, 3333, 6666, 2442, 2442, 2442, 5445, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 3663, 
2112, 6116, 2112, 2112, 4224, 4664, 4224, 4224, 3333, 2222, 3333, 3333, 5445, 5445, 3443, 5445, 5555, 3333, 5555, 5555, 6566, 6566, 6566, 6566, 
2112, 6666, 2112, 2112, 4224, 4224, 4224, 4224, 3323, 3313, 3313, 3313, 5445, 5445, 3333, 5445, 5555, 5555, 5555, 5555, 6566, 6466, 6466, 6466, 
2122, 2122, 2122, 2122, 4244, 4244, 4244, 4244, 3333, 3333, 3333, 3333, 5455, 5455, 5455, 5455, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
2142, 2142, 2142, 2142, 4254, 4254, 4254, 4254, 3333, 3333, 3333, 3333, 5415, 5415, 5415, 5415, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
2152, 2152, 2152, 2152, 4214, 4214, 4214, 4214, 3333, 3333, 3333, 3333, 5425, 5425, 5425, 5425, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
2212, 2212, 2212, 2212, 4424, 4424, 4424, 4424, 3333, 3333, 3333, 3333, 5545, 5545, 5545, 5545, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
2222, 1111, 1111, 1111, 3333, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 5445, 5445, 5445, 5445, 6666, 5555, 5555, 5555, 4224, 6666, 6666, 6666, 
2222, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 
2332, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 5665, 5555, 5555, 5555, 5555, 1551, 1661, 1661, 1661, 
2332, 2112, 2112, 2112, 4224, 4224, 4224, 6226, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5665, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 1111, 
2412, 2412, 2412, 2412, 4524, 4524, 4524, 4524, 3333, 3333, 3333, 3333, 5145, 5145, 5145, 5145, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
2442, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 5115, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
2442, 2112, 2112, 2112, 4224, 4224, 4224, 1221, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5115, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
2512, 2512, 2512, 2512, 4124, 4124, 4124, 4124, 3333, 3333, 3333, 3333, 5245, 5245, 5245, 5245, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
2662, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 5335, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4224, 
2662, 2112, 2112, 2112, 4224, 4224, 4224, 3223, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 5335, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 4444, 
3113, 2112, 2112, 2112, 4334, 4224, 4224, 4224, 5555, 3333, 3333, 3333, 5445, 5445, 5445, 6446, 6666, 5555, 5555, 5555, 2662, 2662, 2662, 2662, 
3113, 3113, 3113, 3113, 1661, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 3333, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 
3113, 3113, 3113, 3113, 4334, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
3113, 4114, 4114, 4664, 5225, 5225, 5225, 5225, 1331, 1331, 1331, 1331, 1331, 1441, 1441, 6446, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
3113, 5115, 5115, 5115, 1221, 1221, 1221, 1661, 3333, 3333, 3333, 2222, 2442, 2442, 2442, 6446, 5555, 5555, 5555, 3333, 5665, 5665, 5665, 5665, 
3233, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 6566, 5535, 5535, 5535, 5535, 1661, 1551, 1661, 1661, 
3233, 1211, 1211, 1211, 2422, 2422, 2422, 2622, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 6566, 5515, 5515, 5515, 5535, 1661, 1661, 1661, 1661, 
3323, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 6656, 5355, 5355, 5355, 5355, 1661, 1661, 1551, 1661, 
3323, 1121, 1121, 1121, 2242, 2242, 2242, 2262, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 6656, 5155, 5155, 5155, 5355, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 1661, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 3333, 5555, 5555, 1661, 5555, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 1661, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 3333, 5555, 1661, 1661, 5555, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 1661, 3333, 3333, 3333, 2222, 6446, 6446, 6446, 6446, 5555, 5555, 5555, 3333, 1661, 1661, 1661, 5555, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 1111, 5555, 5555, 5555, 2662, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 2222, 5555, 5555, 5555, 4664, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 4444, 5555, 5555, 5555, 5665, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 6666, 1551, 1551, 1551, 3553, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2552, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 4444, 3333, 3333, 3333, 4444, 4444, 4444, 6666, 6556, 4554, 4554, 4554, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 2222, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 6666, 6556, 6556, 6556, 6556, 1661, 1661, 1661, 1221, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 1661, 6666, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 3333, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 6666, 2552, 2552, 2552, 2552, 1661, 1661, 1661, 1331, 
3333, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 6666, 3553, 3553, 3553, 3553, 1661, 1661, 1661, 1551, 
3333, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 1661, 5555, 1661, 1661, 2222, 1661, 
3333, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 1661, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 2222, 5555, 1661, 1661, 3333, 1661, 
3333, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 1661, 5555, 5555, 1661, 2222, 1661, 1661, 
3333, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 1661, 3333, 3333, 4444, 4444, 4444, 6666, 5555, 2222, 5555, 5555, 1661, 3333, 1661, 1661, 
3333, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 4334, 4334, 4334, 6666, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 4334, 6666, 6666, 6666, 
3333, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 6666, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
3333, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 6666, 5555, 5555, 5555, 5555, 1611, 1611, 1611, 1611, 
3333, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 6666, 5555, 5555, 5555, 5555, 1631, 1631, 1631, 1631, 
3333, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 6666, 5555, 5555, 5555, 5555, 1641, 1641, 1641, 1641, 
3333, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 6666, 5555, 1111, 5555, 5555, 1661, 2662, 1661, 1661, 
3333, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 6666, 5555, 2222, 5555, 5555, 1661, 4664, 1661, 1661, 
3333, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 6666, 5555, 4444, 5555, 5555, 1661, 5665, 1661, 1661, 
3333, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 6666, 5555, 5555, 1111, 5555, 1661, 1661, 2662, 1661, 
3333, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 6666, 5555, 5555, 2222, 5555, 1661, 1661, 4664, 1661, 
3333, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 6666, 5555, 5555, 4444, 5555, 1661, 1661, 5665, 1661, 
3333, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 6666, 5555, 5555, 5555, 1111, 1661, 1661, 1661, 2662, 
3333, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 6666, 5555, 5555, 5555, 5555, 1161, 1161, 1161, 1161, 
3333, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 2222, 1661, 1661, 1661, 4664, 
3333, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 6666, 5555, 5555, 5555, 5555, 1361, 1361, 1361, 1361, 
3333, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 4444, 1661, 1661, 1661, 5665, 
3333, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 6666, 5555, 5555, 5555, 5555, 1461, 1461, 1461, 1461, 
3343, 1141, 1141, 1161, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4434, 4414, 4414, 6616, 5255, 5255, 5255, 5255, 1661, 1661, 1661, 1661, 
3353, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 6626, 5655, 5655, 5655, 5655, 1661, 1661, 1221, 1661, 
3353, 1151, 1151, 1151, 2232, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 6626, 5655, 5455, 5455, 5455, 1661, 1661, 1661, 1661, 
3363, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 6636, 5255, 5255, 5255, 5255, 1661, 1661, 1331, 1661, 
3433, 1411, 1411, 1611, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4344, 4144, 4144, 6166, 5525, 5525, 5525, 5525, 1661, 1661, 1661, 1661, 
3533, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 6266, 5565, 5565, 5565, 5565, 1661, 1221, 1661, 1661, 
3533, 1511, 1511, 1511, 2322, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 6266, 5565, 5545, 5545, 5545, 1661, 1661, 1661, 1661, 
3633, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 6366, 5525, 5525, 5525, 5525, 1661, 1331, 1661, 1661, 
3663, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 6336, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4334, 
4114, 1111, 4444, 4114, 5225, 5225, 5225, 5225, 3633, 3633, 3633, 3633, 1441, 1111, 4444, 1441, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
4114, 3113, 4664, 4114, 5225, 5225, 5225, 5225, 3133, 3133, 3133, 3133, 1441, 1331, 6446, 1441, 5555, 5555, 5555, 5555, 6466, 6466, 6466, 6466, 
4114, 3333, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3343, 3343, 3313, 1441, 1441, 6666, 1441, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6466, 
4114, 4114, 3333, 4114, 5225, 5225, 5225, 5225, 3433, 3433, 3433, 3133, 1441, 6666, 1441, 1441, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6646, 
4114, 4114, 4114, 3333, 2222, 2222, 2222, 5555, 4334, 4334, 4334, 1331, 6666, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 2222, 5225, 5225, 5555, 3333, 3333, 3333, 6666, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 2222, 3333, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 2552, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 2552, 2552, 2552, 3333, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 3223, 5225, 5225, 5665, 3333, 3333, 3333, 2222, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 3333, 5555, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 3663, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 
4114, 4114, 4114, 4114, 5225, 2222, 5555, 5225, 3333, 3333, 6666, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 2222, 5555, 6666, 3333, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 3223, 5665, 5225, 3333, 3333, 2222, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 3333, 5555, 6666, 5555, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 3333, 5225, 5225, 3333, 5555, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 6666, 5555, 5555, 6666, 5225, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 3333, 5225, 3333, 3333, 5555, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 6666, 5555, 6666, 6666, 5225, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 5225, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 5225, 6666, 6666, 6666, 3333, 
4114, 4114, 4114, 4114, 5225, 5225, 5225, 6666, 3333, 3333, 3333, 5225, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
4114, 4114, 4114, 4114, 5225, 5225, 5555, 5225, 3333, 3333, 6666, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 5225, 5555, 6666, 6666, 3333, 6666, 
4114, 4114, 4114, 4114, 5225, 5225, 6666, 5225, 3333, 3333, 5225, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
4114, 4114, 4114, 4114, 5225, 5335, 6226, 5225, 3333, 5555, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 6666, 5555, 5555, 6666, 6666, 2222, 6666, 
4114, 4114, 4114, 4114, 5225, 5555, 2222, 5225, 3333, 6666, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 2222, 5555, 5555, 6666, 6666, 3333, 6666, 
4114, 4114, 4114, 4114, 5225, 5555, 5225, 5225, 3333, 6666, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 5225, 5555, 5555, 6666, 3333, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 5665, 3223, 5225, 3333, 2222, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 3333, 5555, 5555, 6666, 6666, 5555, 6666, 
4114, 4114, 4114, 4114, 5225, 6226, 5335, 5225, 3333, 3333, 5555, 3333, 1441, 1441, 1441, 1441, 5555, 5555, 6666, 5555, 6666, 2222, 6666, 6666, 
4114, 4114, 4114, 4114, 5225, 6666, 5225, 5225, 3333, 5225, 3333, 3333, 1441, 1441, 1441, 1441, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
4114, 4114, 4114, 4114, 5335, 5225, 5225, 6226, 5555, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 6666, 6666, 6666, 2222, 
4114, 4114, 4114, 4114, 5555, 5225, 5225, 2222, 6666, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
4114, 4114, 4114, 4114, 5665, 5225, 5225, 3223, 2222, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 3333, 5555, 5555, 5555, 6666, 6666, 6666, 5555, 
4114, 4114, 4114, 4114, 6226, 5225, 5225, 5335, 3333, 3333, 3333, 5555, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 6666, 2222, 6666, 6666, 6666, 
4114, 4114, 4114, 4114, 6336, 2222, 2222, 2222, 5555, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
4114, 4114, 4114, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4114, 6666, 5555, 2222, 2222, 2222, 4334, 1331, 1331, 1331, 3333, 1441, 1441, 1441, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4114, 4114, 4444, 4114, 5225, 5225, 5225, 5225, 3633, 3633, 3633, 3633, 1441, 1111, 1441, 1441, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
4114, 4114, 6666, 4114, 5225, 5225, 5225, 5225, 3433, 3133, 3133, 3133, 1441, 3333, 1441, 1441, 5555, 5555, 5555, 5555, 6616, 6646, 6646, 6646, 
4114, 4334, 6116, 4114, 5225, 5225, 5225, 5225, 3343, 3343, 3343, 3343, 1441, 3443, 1661, 1441, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6616, 
4114, 4444, 1111, 4114, 5225, 5225, 5225, 5225, 3363, 3363, 3363, 3363, 1441, 4444, 1111, 1441, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
4114, 4444, 4114, 4114, 5225, 5225, 5225, 5225, 3363, 3363, 3363, 3363, 1441, 1441, 1111, 1441, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
4114, 4664, 3113, 4114, 5225, 5225, 5225, 5225, 3313, 3313, 3313, 3313, 1441, 6446, 1331, 1441, 5555, 5555, 5555, 5555, 6646, 6646, 6646, 6646, 
4114, 6116, 4334, 4114, 5225, 5225, 5225, 5225, 3433, 3433, 3433, 3433, 1441, 1661, 3443, 1441, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6166, 
4114, 6666, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3313, 3313, 3313, 1441, 1441, 3333, 1441, 5555, 5555, 5555, 5555, 6166, 6466, 6466, 6466, 
4124, 4124, 4124, 4124, 5245, 5245, 5245, 5245, 3333, 3333, 3333, 3333, 1451, 1451, 1451, 1451, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
4144, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 1411, 5525, 5525, 5525, 5525, 3663, 3663, 3663, 3663, 
4144, 4144, 4144, 4144, 5255, 5255, 5255, 5255, 3333, 3333, 3333, 3333, 1411, 1411, 1411, 1411, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
4154, 4154, 4154, 4154, 5215, 5215, 5215, 5215, 3333, 3333, 3333, 3333, 1421, 1421, 1421, 1421, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
4214, 4214, 4214, 4214, 5425, 5425, 5425, 5425, 3333, 3333, 3333, 3333, 1541, 1541, 1541, 1541, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
4244, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 1511, 5545, 5545, 5545, 5545, 3663, 3663, 3663, 3663, 
4244, 1211, 1211, 1211, 2422, 2422, 2422, 2122, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 1511, 5515, 5515, 5515, 5545, 3663, 3663, 3663, 3663, 
4334, 4114, 4114, 6116, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 3443, 1441, 1441, 1661, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4414, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 1141, 5255, 5255, 5255, 5255, 3663, 3663, 3663, 3663, 
4414, 4414, 4414, 4414, 5525, 5525, 5525, 5525, 3333, 3333, 3333, 3333, 1141, 1141, 1141, 1141, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
4424, 1121, 1121, 1121, 2242, 2242, 2242, 2212, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 1151, 5155, 5155, 5155, 5455, 3663, 3663, 3663, 3663, 
4424, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 1151, 5455, 5455, 5455, 5455, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 1111, 1551, 1551, 1551, 4554, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 4444, 4444, 4444, 1111, 2552, 2552, 2552, 2552, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 1551, 4554, 4554, 4554, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 1111, 6666, 5555, 5555, 5555, 5665, 3663, 3663, 3223, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 2222, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 3663, 3333, 3333, 3333, 2222, 1441, 1441, 1441, 1441, 5555, 5555, 5555, 3333, 3663, 3663, 3663, 5555, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 3663, 1111, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 3663, 3663, 3663, 3333, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 1111, 2222, 5555, 5555, 5555, 6666, 3663, 3663, 3333, 
4444, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 2662, 3663, 3663, 3553, 
4444, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3663, 5555, 3663, 3663, 2222, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 1111, 5555, 6666, 5555, 5555, 3663, 5665, 3223, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 3663, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3333, 5555, 3663, 3663, 5555, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 3663, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 2222, 5555, 3663, 3663, 3333, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 1111, 5555, 2222, 5555, 5555, 3663, 6666, 3333, 3663, 
4444, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 1111, 5555, 3333, 5555, 5555, 3663, 2662, 3553, 3663, 
4444, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 3663, 5555, 5555, 3663, 2222, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 6666, 5555, 3663, 3223, 5665, 3663, 
4444, 1111, 1111, 1111, 2222, 3663, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 3333, 5555, 5555, 3663, 5555, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 3663, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 2222, 5555, 5555, 3663, 3333, 3663, 3663, 
4444, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 2222, 5555, 3663, 3333, 6666, 3663, 
4444, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 3333, 5555, 3663, 3553, 2662, 3663, 
4444, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 6666, 3223, 3663, 3663, 5665, 
4444, 1111, 1111, 1111, 3333, 5225, 5225, 5225, 5555, 3333, 3333, 3333, 1441, 1441, 1441, 1441, 6666, 5555, 5555, 5555, 5225, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 2222, 3333, 3663, 3663, 6666, 
4444, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 6336, 6336, 6336, 1111, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 6336, 6666, 6666, 6666, 
4444, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 1111, 5555, 5555, 5555, 3333, 3553, 3663, 3663, 2662, 
4444, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 
4444, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 1111, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
4444, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 1111, 5555, 5555, 5555, 5555, 3613, 3613, 3613, 3613, 
4444, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 1111, 5555, 5555, 5555, 5555, 3633, 3633, 3633, 3633, 
4444, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 1111, 5555, 5555, 5555, 5555, 3643, 3643, 3643, 3643, 
4444, 1141, 1141, 1111, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4444, 4414, 4414, 1111, 5255, 5255, 5255, 5255, 3663, 3663, 3663, 3663, 
4444, 1411, 1411, 1111, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4444, 4144, 4144, 1111, 5525, 5525, 5525, 5525, 3663, 3663, 3663, 3663, 
4444, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 1111, 1551, 1551, 1551, 1551, 3663, 3663, 3663, 3663, 
4444, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 1111, 5555, 5555, 5555, 5555, 3163, 3163, 3163, 3163, 
4444, 4114, 4114, 1111, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 4444, 1441, 1441, 1111, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
4444, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 1111, 2552, 2552, 2552, 2552, 3663, 3663, 3663, 3663, 
4444, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 1111, 5555, 5555, 5555, 5555, 3363, 3363, 3363, 3363, 
4444, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 1111, 4554, 4554, 4554, 4554, 3663, 3663, 3663, 3663, 
4444, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 1111, 5555, 5555, 5555, 5555, 3463, 3463, 3463, 3463, 
4454, 1151, 1151, 1151, 2242, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 1121, 5155, 5455, 5455, 5455, 3663, 3663, 3663, 3663, 
4454, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 1121, 5155, 5155, 5155, 5155, 3663, 3663, 3663, 3663, 
4514, 4514, 4514, 4514, 5125, 5125, 5125, 5125, 3333, 3333, 3333, 3333, 1241, 1241, 1241, 1241, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
4544, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 1211, 5515, 5515, 5515, 5515, 3663, 3663, 3663, 3663, 
4544, 1511, 1511, 1511, 2422, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 1211, 5515, 5545, 5545, 5545, 3663, 3663, 3663, 3663, 
4664, 4114, 4114, 3113, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 6446, 1441, 1441, 1331, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 2112, 2112, 2112, 4554, 4224, 4224, 4224, 6666, 3333, 3333, 3333, 5445, 5445, 5445, 2442, 2222, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5115, 2112, 5115, 5115, 1221, 1221, 1551, 1221, 3333, 3333, 6666, 3333, 2442, 2442, 5445, 2442, 5555, 5555, 2222, 5555, 6366, 6366, 6366, 6366, 
5115, 3113, 5115, 5115, 1221, 1221, 1661, 1221, 3333, 3333, 2222, 3333, 2442, 2442, 6446, 2442, 5555, 5555, 3333, 5555, 6566, 6566, 6566, 6566, 
5115, 3333, 5115, 5115, 1221, 1221, 1221, 1221, 3343, 3343, 3343, 3323, 2442, 2442, 6666, 2442, 5555, 5555, 5555, 5555, 6166, 6166, 6166, 6566, 
5115, 4444, 5115, 5115, 1221, 1221, 1221, 1221, 3363, 3363, 3363, 3363, 2442, 2442, 1111, 2442, 5555, 5555, 5555, 5555, 6366, 6366, 6366, 6366, 
5115, 5115, 2112, 5115, 1221, 1551, 1221, 1221, 3333, 6666, 3333, 3333, 2442, 5445, 2442, 2442, 5555, 2222, 5555, 5555, 6636, 6636, 6636, 6636, 
5115, 5115, 3113, 5115, 1221, 1661, 1221, 1221, 3333, 2222, 3333, 3333, 2442, 6446, 2442, 2442, 5555, 3333, 5555, 5555, 6656, 6656, 6656, 6656, 
5115, 5115, 3333, 5115, 1221, 1221, 1221, 1221, 3433, 3433, 3433, 3233, 2442, 6666, 2442, 2442, 5555, 5555, 5555, 5555, 6616, 6616, 6616, 6656, 
5115, 5115, 4444, 5115, 1221, 1221, 1221, 1221, 3633, 3633, 3633, 3633, 2442, 1111, 2442, 2442, 5555, 5555, 5555, 5555, 6636, 6636, 6636, 6636, 
5115, 5115, 5115, 2112, 1551, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 5445, 2442, 2442, 2442, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 3113, 1661, 1221, 1221, 1221, 2222, 3333, 3333, 3333, 6446, 2442, 2442, 2442, 3333, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 3333, 2222, 2222, 2222, 1111, 4334, 4334, 4334, 2332, 6666, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 1551, 1551, 1551, 1551, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 2552, 2552, 2552, 2552, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 1221, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 6666, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 1221, 6666, 6666, 6666, 3333, 
5115, 5115, 5115, 5115, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 1221, 2222, 4444, 4444, 4444, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 5555, 
5115, 5115, 5115, 5115, 1221, 1221, 3333, 1221, 3333, 3333, 5555, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 6666, 5555, 6666, 6666, 1221, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 5555, 1221, 3333, 3333, 6666, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 1221, 5555, 6666, 6666, 3333, 6666, 
5115, 5115, 5115, 5115, 1221, 1221, 6666, 1221, 3333, 3333, 1221, 3333, 2442, 2442, 2442, 2442, 5555, 5555, 3333, 5555, 6666, 6666, 5555, 6666, 
5115, 5115, 5115, 5115, 1221, 3333, 1221, 1221, 3333, 5555, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 6666, 5555, 5555, 6666, 1221, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 5555, 1221, 1221, 3333, 6666, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 1221, 5555, 5555, 6666, 3333, 6666, 6666, 
5115, 5115, 5115, 5115, 1221, 6666, 1221, 1221, 3333, 1221, 3333, 3333, 2442, 2442, 2442, 2442, 5555, 3333, 5555, 5555, 6666, 5555, 6666, 6666, 
5115, 5115, 5115, 5115, 4554, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 2222, 4554, 4554, 4554, 3333, 6666, 6666, 6666, 
5115, 5115, 5115, 5335, 1221, 1221, 1221, 3223, 4334, 4334, 4334, 4334, 2662, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 1111, 
5115, 5115, 5115, 5445, 1221, 1221, 1221, 4224, 6336, 6336, 6336, 6336, 2112, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 3333, 
5115, 5115, 5115, 5665, 1221, 1221, 1221, 6226, 1331, 1331, 1331, 1331, 2332, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 4444, 
5115, 5115, 5115, 6116, 1331, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 3443, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5115, 6666, 1111, 2222, 2222, 2222, 5335, 1331, 1331, 1331, 3333, 2442, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
5115, 5115, 5335, 5115, 1221, 1221, 3223, 1221, 3433, 3433, 3433, 3433, 2442, 2662, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 1111, 6666, 
5115, 5115, 5445, 5115, 1221, 1221, 4224, 1221, 3633, 3633, 3633, 3633, 2442, 2112, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 3333, 6666, 
5115, 5115, 5665, 5115, 1221, 1221, 6226, 1221, 3133, 3133, 3133, 3133, 2442, 2332, 2442, 2442, 5555, 5555, 5555, 5555, 6666, 6666, 4444, 6666, 
5115, 5115, 6116, 5115, 1221, 1331, 1221, 1221, 3333, 5555, 3333, 3333, 2442, 3443, 2442, 2442, 5555, 6666, 5555, 5555, 6626, 6626, 6626, 6626, 
5115, 5115, 6666, 5115, 1221, 1221, 1221, 1221, 3533, 3133, 3133, 3133, 2442, 3333, 2442, 2442, 5555, 5555, 5555, 5555, 6626, 6646, 6646, 6646, 
5115, 5335, 5115, 5115, 1221, 3223, 1221, 1221, 3343, 3343, 3343, 3343, 2442, 2442, 2662, 2442, 5555, 5555, 5555, 5555, 6666, 1111, 6666, 6666, 
5115, 5445, 5115, 5115, 1221, 4224, 1221, 1221, 3363, 3363, 3363, 3363, 2442, 2442, 2112, 2442, 5555, 5555, 5555, 5555, 6666, 3333, 6666, 6666, 
5115, 5665, 5115, 5115, 1221, 6226, 1221, 1221, 3313, 3313, 3313, 3313, 2442, 2442, 2332, 2442, 5555, 5555, 5555, 5555, 6666, 4444, 6666, 6666, 
5115, 6116, 5115, 5115, 1221, 1221, 1331, 1221, 3333, 3333, 5555, 3333, 2442, 2442, 3443, 2442, 5555, 5555, 6666, 5555, 6266, 6266, 6266, 6266, 
5115, 6666, 5115, 5115, 1221, 1221, 1221, 1221, 3353, 3313, 3313, 3313, 2442, 2442, 3333, 2442, 5555, 5555, 5555, 5555, 6266, 6466, 6466, 6466, 
5125, 5125, 5125, 5125, 1241, 1241, 1241, 1241, 3333, 3333, 3333, 3333, 2452, 2452, 2452, 2452, 5155, 5155, 5155, 5155, 6666, 6666, 6666, 6666, 
5145, 5145, 5145, 5145, 1251, 1251, 1251, 1251, 3333, 3333, 3333, 3333, 2412, 2412, 2412, 2412, 5255, 5255, 5255, 5255, 6666, 6666, 6666, 6666, 
5155, 5155, 5155, 5155, 1211, 1211, 1211, 1211, 3333, 3333, 3333, 3333, 2422, 2422, 2422, 2422, 5455, 5455, 5455, 5455, 6666, 6666, 6666, 6666, 
5215, 5215, 5215, 5215, 1421, 1421, 1421, 1421, 3333, 3333, 3333, 3333, 2542, 2542, 2542, 2542, 5515, 5515, 5515, 5515, 6666, 6666, 6666, 6666, 
5335, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 2662, 5555, 5555, 5555, 5555, 1221, 1661, 1661, 1661, 
5335, 5115, 5115, 5115, 3223, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2662, 5555, 5555, 5555, 5555, 1111, 6666, 6666, 6666, 
5415, 5415, 5415, 5415, 1521, 1521, 1521, 1521, 3333, 3333, 3333, 3333, 2142, 2142, 2142, 2142, 5525, 5525, 5525, 5525, 6666, 6666, 6666, 6666, 
5445, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 2112, 5555, 5555, 5555, 5555, 3663, 3663, 3663, 3663, 
5445, 5115, 5115, 5115, 4224, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2112, 5555, 5555, 5555, 5555, 3333, 6666, 6666, 6666, 
5515, 5515, 5515, 5515, 1121, 1121, 1121, 1121, 3333, 3333, 3333, 3333, 2242, 2242, 2242, 2242, 5545, 5545, 5545, 5545, 6666, 6666, 6666, 6666, 
5555, 1111, 1111, 1111, 3333, 1221, 1221, 1221, 5555, 3333, 3333, 3333, 2442, 2442, 2442, 2442, 6666, 5555, 5555, 5555, 1221, 6666, 6666, 6666, 
5555, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 4444, 3333, 4554, 4554, 4554, 4554, 6666, 6666, 6666, 
5665, 1111, 1111, 1111, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 2222, 4444, 4444, 4444, 2332, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4554, 
5665, 5115, 5115, 5115, 6226, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 2332, 5555, 5555, 5555, 5555, 4444, 6666, 6666, 6666, 
6116, 2112, 2112, 2112, 4664, 4224, 4224, 4224, 2222, 3333, 3333, 3333, 5445, 5445, 5445, 3443, 3333, 5555, 5555, 5555, 5665, 5665, 5665, 5665, 
6116, 4114, 4114, 4334, 5225, 5225, 5225, 5225, 4334, 4334, 4334, 4334, 1661, 1441, 1441, 3443, 5555, 5555, 5555, 5555, 1661, 1661, 1661, 1661, 
6116, 5115, 5115, 5115, 1221, 1221, 1221, 1331, 3333, 3333, 3333, 5555, 2442, 2442, 2442, 3443, 5555, 5555, 5555, 6666, 2662, 2662, 2662, 2662, 
6116, 6116, 6116, 6116, 1331, 2222, 2222, 2222, 5555, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 6666, 5555, 5555, 5555, 2222, 6666, 6666, 6666, 
6116, 6116, 6116, 6116, 4664, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 
6266, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 3533, 5565, 5565, 5565, 5565, 4664, 4664, 4224, 4664, 
6266, 1211, 1211, 1211, 2422, 2422, 2422, 2322, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 3533, 5515, 5515, 5515, 5565, 4664, 4664, 4664, 4664, 
6336, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 3663, 5555, 5555, 5555, 5555, 1331, 1661, 1661, 1661, 
6366, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 3633, 5525, 5525, 5525, 5525, 4664, 4664, 4334, 4664, 
6466, 1411, 1411, 1311, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4644, 4144, 4144, 3133, 5525, 5525, 5525, 5525, 4664, 4664, 4664, 4664, 
6566, 1111, 1111, 1111, 2222, 2222, 6666, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 3233, 5535, 5535, 5535, 5535, 4664, 4664, 4554, 4664, 
6566, 1511, 1511, 1511, 2622, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 3233, 5535, 5545, 5545, 5545, 4664, 4664, 4664, 4664, 
6626, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 3353, 5655, 5655, 5655, 5655, 4664, 4224, 4664, 4664, 
6626, 1121, 1121, 1121, 2242, 2242, 2242, 2232, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 3353, 5155, 5155, 5155, 5655, 4664, 4664, 4664, 4664, 
6636, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 6666, 3333, 3333, 4444, 4444, 4444, 3363, 5255, 5255, 5255, 5255, 4664, 4334, 4664, 4664, 
6646, 1141, 1141, 1131, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4464, 4414, 4414, 3313, 5255, 5255, 5255, 5255, 4664, 4664, 4664, 4664, 
6656, 1111, 1111, 1111, 2222, 6666, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 3323, 5355, 5355, 5355, 5355, 4664, 4554, 4664, 4664, 
6656, 1151, 1151, 1151, 2262, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 3323, 5355, 5455, 5455, 5455, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 1111, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3553, 4554, 4554, 4554, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 1111, 4444, 4444, 4444, 3333, 1551, 1551, 1551, 6556, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 1111, 4664, 4664, 4664, 5665, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 1661, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 5555, 4444, 4664, 4664, 4664, 2662, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 3333, 3333, 3333, 3333, 5555, 4444, 4444, 4444, 4444, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 2222, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 4664, 3333, 3333, 3333, 2222, 3443, 3443, 3443, 3443, 5555, 5555, 5555, 3333, 4664, 4664, 4664, 5555, 
6666, 1111, 1111, 1111, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4664, 3333, 4444, 4444, 4444, 5555, 5555, 5555, 2222, 4664, 4664, 4664, 3333, 
6666, 1111, 1111, 1111, 2222, 2222, 3333, 2222, 3333, 3333, 5555, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 4664, 5555, 4664, 4664, 2222, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 4664, 2222, 3333, 3333, 2222, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 3333, 5555, 4664, 4664, 5555, 4664, 
6666, 1111, 1111, 1111, 2222, 2222, 5555, 2222, 3333, 3333, 4664, 3333, 4444, 4444, 4444, 3333, 5555, 5555, 2222, 5555, 4664, 4664, 3333, 4664, 
6666, 1111, 1111, 1111, 2222, 3333, 2222, 2222, 3333, 5555, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 4664, 5555, 5555, 4664, 2222, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 4664, 2222, 2222, 3333, 2222, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 3333, 5555, 5555, 4664, 5555, 4664, 4664, 
6666, 1111, 1111, 1111, 2222, 5555, 2222, 2222, 3333, 4664, 3333, 3333, 4444, 4444, 4444, 3333, 5555, 2222, 5555, 5555, 4664, 3333, 4664, 4664, 
6666, 1111, 1111, 1111, 3333, 2222, 2222, 2222, 5555, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 6556, 6556, 6556, 6556, 4224, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 1331, 1331, 1331, 3333, 4444, 4444, 4444, 2222, 5555, 5555, 5555, 1331, 6666, 6666, 6666, 
6666, 1111, 1111, 1111, 5555, 2222, 2222, 2222, 6666, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 2552, 2552, 2552, 2552, 4334, 4664, 4664, 4664, 
6666, 1111, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 3333, 3333, 3333, 4444, 4444, 4444, 3333, 3553, 3553, 3553, 3553, 4554, 4664, 4664, 4664, 
6666, 1111, 1111, 3333, 2222, 2222, 2222, 2222, 4334, 4334, 4334, 4334, 6666, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 4444, 2222, 2222, 2222, 2222, 6336, 6336, 6336, 6336, 1111, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 1111, 6666, 2222, 2222, 2222, 2222, 1331, 1331, 1331, 1331, 3333, 4444, 4444, 3333, 5555, 5555, 5555, 5555, 4664, 4664, 4664, 4664, 
6666, 1111, 3333, 1111, 2222, 2222, 2222, 2222, 3433, 3433, 3433, 3433, 4444, 6666, 4444, 3333, 5555, 5555, 5555, 5555, 4614, 4614, 4614, 4614, 
6666, 1111, 4444, 1111, 2222, 2222, 2222, 2222, 3633, 3633, 3633, 3633, 4444, 1111, 4444, 3333, 5555, 5555, 5555, 5555, 4634, 4634, 4634, 4634, 
6666, 1111, 6666, 1111, 2222, 2222, 2222, 2222, 3133, 3133, 3133, 3133, 4444, 3333, 4444, 3333, 5555, 5555, 5555, 5555, 4644, 4644, 4644, 4644, 
6666, 1121, 1121, 1121, 2242, 2242, 2242, 2242, 3333, 3333, 3333, 3333, 4454, 4454, 4454, 3333, 5555, 5555, 1111, 5555, 4664, 4664, 5665, 4664, 
6666, 1141, 1141, 1141, 2252, 2252, 2252, 2252, 3333, 3333, 3333, 3333, 4414, 4414, 4414, 3333, 5555, 5555, 2222, 5555, 4664, 4664, 1661, 4664, 
6666, 1151, 1151, 1151, 2212, 2212, 2212, 2212, 3333, 3333, 3333, 3333, 4424, 4424, 4424, 3333, 5555, 5555, 4444, 5555, 4664, 4664, 2662, 4664, 
6666, 1211, 1211, 1211, 2422, 2422, 2422, 2422, 3333, 3333, 3333, 3333, 4544, 4544, 4544, 3333, 5555, 1111, 5555, 5555, 4664, 5665, 4664, 4664, 
6666, 1411, 1411, 1411, 2522, 2522, 2522, 2522, 3333, 3333, 3333, 3333, 4144, 4144, 4144, 3333, 5555, 2222, 5555, 5555, 4664, 1661, 4664, 4664, 
6666, 1511, 1511, 1511, 2122, 2122, 2122, 2122, 3333, 3333, 3333, 3333, 4244, 4244, 4244, 3333, 5555, 4444, 5555, 5555, 4664, 2662, 4664, 4664, 
6666, 2112, 2112, 2112, 4224, 4224, 4224, 4224, 3333, 3333, 3333, 3333, 5445, 5445, 5445, 3333, 1111, 5555, 5555, 5555, 5665, 4664, 4664, 4664, 
6666, 3333, 1111, 1111, 2222, 2222, 2222, 2222, 3343, 3343, 3343, 3343, 4444, 4444, 6666, 3333, 5555, 5555, 5555, 5555, 4164, 4164, 4164, 4164, 
6666, 4114, 4114, 4114, 5225, 5225, 5225, 5225, 3333, 3333, 3333, 3333, 1441, 1441, 1441, 3333, 2222, 5555, 5555, 5555, 1661, 4664, 4664, 4664, 
6666, 4444, 1111, 1111, 2222, 2222, 2222, 2222, 3363, 3363, 3363, 3363, 4444, 4444, 1111, 3333, 5555, 5555, 5555, 5555, 4364, 4364, 4364, 4364, 
6666, 5115, 5115, 5115, 1221, 1221, 1221, 1221, 3333, 3333, 3333, 3333, 2442, 2442, 2442, 3333, 4444, 5555, 5555, 5555, 2662, 4664, 4664, 4664, 
6666, 6666, 1111, 1111, 2222, 2222, 2222, 2222, 3313, 3313, 3313, 3313, 4444, 4444, 3333, 3333, 5555, 5555, 5555, 5555, 4464, 4464, 4464, 4464};

unsigned short GLOBAL_FACE_CONVERSION_MATRIX[14] = {0,1,0,2,0,3,0,4,0,0,0,5,0,6};

void init_search_variables(void)
{
	/* counters, not settings */
	GLOBAL_TFS_1_DATABASE_PROBES = 0;
	GLOBAL_TFS_2_DATABASE_PROBES = 0;
}

void init_user_search_preferences(void)
{
	GLOBAL_SEARCH_EXTENSIONS_ON = 1;
	GLOBAL_PROBE_TFS_1_DATABASE = 1;
	GLOBAL_PROBE_TFS_2_DATABASE = 1;

}

unsigned short cube_row_to_4_digit_number(unsigned short square_1, unsigned short square_2, unsigned short square_3, unsigned short square_4)
{
	unsigned short row_value;

	row_value = (GLOBAL_FACE_CONVERSION_MATRIX[square_1] * 1000) + (GLOBAL_FACE_CONVERSION_MATRIX[square_2] * 100) + (GLOBAL_FACE_CONVERSION_MATRIX[square_3] * 10) + GLOBAL_FACE_CONVERSION_MATRIX[square_1];
	return row_value;
}

signed short top_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_top[0];
	sum += your_cube.cube_top[1];
	sum += your_cube.cube_top[2];
	sum += your_cube.cube_top[3];
	sum += your_cube.cube_top[4];
	sum += your_cube.cube_top[5];
	sum += your_cube.cube_top[6];
	sum += your_cube.cube_top[7];
	sum += your_cube.cube_top[8];
	sum += your_cube.cube_top[9];
	sum += your_cube.cube_top[10];
	sum += your_cube.cube_top[11];
	sum += your_cube.cube_top[12];
	sum += your_cube.cube_top[13];
	sum += your_cube.cube_top[14];
	sum += your_cube.cube_top[15];
	
	if(sum == TOP_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;

}

signed short front_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_front[0];
	sum += your_cube.cube_front[1];
	sum += your_cube.cube_front[2];
	sum += your_cube.cube_front[3];
	sum += your_cube.cube_front[4];
	sum += your_cube.cube_front[5];
	sum += your_cube.cube_front[6];
	sum += your_cube.cube_front[7];
	sum += your_cube.cube_front[8];
	sum += your_cube.cube_front[9];
	sum += your_cube.cube_front[10];
	sum += your_cube.cube_front[11];
	sum += your_cube.cube_front[12];
	sum += your_cube.cube_front[13];
	sum += your_cube.cube_front[14];
	sum += your_cube.cube_front[15];
	
	if(sum == FRONT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}


signed short right_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_right[0];
	sum += your_cube.cube_right[1];
	sum += your_cube.cube_right[2];
	sum += your_cube.cube_right[3];
	sum += your_cube.cube_right[4];
	sum += your_cube.cube_right[5];
	sum += your_cube.cube_right[6];
	sum += your_cube.cube_right[7];
	sum += your_cube.cube_right[8];
	sum += your_cube.cube_right[9];
	sum += your_cube.cube_right[10];
	sum += your_cube.cube_right[11];
	sum += your_cube.cube_right[12];
	sum += your_cube.cube_right[13];
	sum += your_cube.cube_right[14];
	sum += your_cube.cube_right[15];
	
	if(sum == RIGHT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short bottom_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_bottom[0];
	sum += your_cube.cube_bottom[1];
	sum += your_cube.cube_bottom[2];
	sum += your_cube.cube_bottom[3];
	sum += your_cube.cube_bottom[4];
	sum += your_cube.cube_bottom[5];
	sum += your_cube.cube_bottom[6];
	sum += your_cube.cube_bottom[7];
	sum += your_cube.cube_bottom[8];
	sum += your_cube.cube_bottom[9];
	sum += your_cube.cube_bottom[10];
	sum += your_cube.cube_bottom[11];
	sum += your_cube.cube_bottom[12];
	sum += your_cube.cube_bottom[13];
	sum += your_cube.cube_bottom[14];
	sum += your_cube.cube_bottom[15];
	
	if(sum == BOTTOM_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short back_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_back[0];
	sum += your_cube.cube_back[1];
	sum += your_cube.cube_back[2];
	sum += your_cube.cube_back[3];
	sum += your_cube.cube_back[4];
	sum += your_cube.cube_back[5];
	sum += your_cube.cube_back[6];
	sum += your_cube.cube_back[7];
	sum += your_cube.cube_back[8];
	sum += your_cube.cube_back[9];
	sum += your_cube.cube_back[10];
	sum += your_cube.cube_back[11];
	sum += your_cube.cube_back[12];
	sum += your_cube.cube_back[13];
	sum += your_cube.cube_back[14];
	sum += your_cube.cube_back[15];
	
	if(sum == BACK_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short left_solved(CUBE_4x4_ARRANGEMENT your_cube)
{
	unsigned short sum;

	sum = 0;

	sum += your_cube.cube_left[0];
	sum += your_cube.cube_left[1];
	sum += your_cube.cube_left[2];
	sum += your_cube.cube_left[3];
	sum += your_cube.cube_left[4];
	sum += your_cube.cube_left[5];
	sum += your_cube.cube_left[6];
	sum += your_cube.cube_left[7];
	sum += your_cube.cube_left[8];
	sum += your_cube.cube_left[9];
	sum += your_cube.cube_left[10];
	sum += your_cube.cube_left[11];
	sum += your_cube.cube_left[12];
	sum += your_cube.cube_left[13];
	sum += your_cube.cube_left[14];
	sum += your_cube.cube_left[15];
	
	if(sum == LEFT_IS_SOLVED)
		return ALREADY_SOLVED;

	return UNSOLVED;
}

signed short solved_distance(CUBE_4x4_ARRANGEMENT your_cube)
{
	// return 0 if solved now
	// return 1 if 1 move away from being solved
	// return 2 if 2 moves away from being solved
	// return -1 if unsolved


	signed short top_solved_status, front_solved_status, right_solved_status, bottom_solved_status, back_solved_status, left_solved_status;

	unsigned short current_cube_row_data, current_database_row_data;
	unsigned long total_entries_in_database;
	unsigned long total_bytes_in_database;
	unsigned long index_start, index_stop, index_offset;

	top_solved_status    = top_solved(your_cube);
	front_solved_status  = front_solved(your_cube);
	right_solved_status  = right_solved(your_cube);
	bottom_solved_status = bottom_solved(your_cube);
	back_solved_status   = back_solved(your_cube);
	left_solved_status   = left_solved(your_cube);

	// if all cubes are in the right place, 0 is returned by each of 6 variables. 0 means "solved now"
	if((top_solved_status == ALREADY_SOLVED) && (front_solved_status == ALREADY_SOLVED) && (right_solved_status == ALREADY_SOLVED) && (bottom_solved_status == ALREADY_SOLVED) && (back_solved_status == ALREADY_SOLVED) && (left_solved_status == ALREADY_SOLVED))
	{
		return ALREADY_SOLVED;
	}

	/*****************************************************/
	/*****************************************************/
	/**                                                 **/
	/**          2-TURN-FROM-SOLUTION DATABASE          **/
	/**                                                 **/
	/*****************************************************/
	/*****************************************************/

	test_tfs_02:
	if(GLOBAL_PROBE_TFS_2_DATABASE)
	{
		TFS_02_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 10200; break;
			case 1121: index_start = 10224; index_stop = 11184; break;
			case 1131: index_start = 11208; index_stop = 11304; break;
			case 1141: index_start = 11328; index_stop = 12312; break;
			case 1151: index_start = 12336; index_stop = 13296; break;
			case 1161: index_start = 13320; index_stop = 13416; break;
			case 1211: index_start = 13440; index_stop = 14400; break;
			case 1221: index_start = 14424; index_stop = 14424; break;
			case 1241: index_start = 14448; index_stop = 14448; break;
			case 1251: index_start = 14472; index_stop = 14472; break;
			case 1311: index_start = 14496; index_stop = 14592; break;
			case 1411: index_start = 14616; index_stop = 15600; break;
			case 1421: index_start = 15624; index_stop = 15624; break;
			case 1441: index_start = 15648; index_stop = 15672; break;
			case 1451: index_start = 15696; index_stop = 15696; break;
			case 1511: index_start = 15720; index_stop = 16680; break;
			case 1521: index_start = 16704; index_stop = 16704; break;
			case 1541: index_start = 16728; index_stop = 16728; break;
			case 1551: index_start = 16752; index_stop = 16752; break;
			case 1611: index_start = 16776; index_stop = 16872; break;
			case 2112: index_start = 16896; index_stop = 17856; break;
			case 2122: index_start = 17880; index_stop = 17880; break;
			case 2142: index_start = 17904; index_stop = 17904; break;
			case 2152: index_start = 17928; index_stop = 17928; break;
			case 2212: index_start = 17952; index_stop = 17952; break;
			case 2222: index_start = 17976; index_stop = 18000; break;
			case 2332: index_start = 18024; index_stop = 18048; break;
			case 2412: index_start = 18072; index_stop = 18072; break;
			case 2442: index_start = 18096; index_stop = 18120; break;
			case 2512: index_start = 18144; index_stop = 18144; break;
			case 2662: index_start = 18168; index_stop = 18192; break;
			case 3113: index_start = 18216; index_stop = 18312; break;
			case 3233: index_start = 18336; index_stop = 18360; break;
			case 3323: index_start = 18384; index_stop = 18408; break;
			case 3333: index_start = 18432; index_stop = 19296; break;
			case 3343: index_start = 19320; index_stop = 19320; break;
			case 3353: index_start = 19344; index_stop = 19368; break;
			case 3363: index_start = 19392; index_stop = 19392; break;
			case 3433: index_start = 19416; index_stop = 19416; break;
			case 3533: index_start = 19440; index_stop = 19464; break;
			case 3633: index_start = 19488; index_stop = 19488; break;
			case 3663: index_start = 19512; index_stop = 19512; break;
			case 4114: index_start = 19536; index_stop = 20520; break;
			case 4124: index_start = 20544; index_stop = 20544; break;
			case 4144: index_start = 20568; index_stop = 20592; break;
			case 4154: index_start = 20616; index_stop = 20616; break;
			case 4214: index_start = 20640; index_stop = 20640; break;
			case 4244: index_start = 20664; index_stop = 20688; break;
			case 4334: index_start = 20712; index_stop = 20712; break;
			case 4414: index_start = 20736; index_stop = 20760; break;
			case 4424: index_start = 20784; index_stop = 20808; break;
			case 4444: index_start = 20832; index_stop = 21816; break;
			case 4454: index_start = 21840; index_stop = 21864; break;
			case 4514: index_start = 21888; index_stop = 21888; break;
			case 4544: index_start = 21912; index_stop = 21936; break;
			case 4664: index_start = 21960; index_stop = 21960; break;
			case 5115: index_start = 21984; index_stop = 22944; break;
			case 5125: index_start = 22968; index_stop = 22968; break;
			case 5145: index_start = 22992; index_stop = 22992; break;
			case 5155: index_start = 23016; index_stop = 23016; break;
			case 5215: index_start = 23040; index_stop = 23040; break;
			case 5335: index_start = 23064; index_stop = 23088; break;
			case 5415: index_start = 23112; index_stop = 23112; break;
			case 5445: index_start = 23136; index_stop = 23160; break;
			case 5515: index_start = 23184; index_stop = 23184; break;
			case 5555: index_start = 23208; index_stop = 23232; break;
			case 5665: index_start = 23256; index_stop = 23280; break;
			case 6116: index_start = 23304; index_stop = 23400; break;
			case 6266: index_start = 23424; index_stop = 23448; break;
			case 6336: index_start = 23472; index_stop = 23472; break;
			case 6366: index_start = 23496; index_stop = 23496; break;
			case 6466: index_start = 23520; index_stop = 23520; break;
			case 6566: index_start = 23544; index_stop = 23568; break;
			case 6626: index_start = 23592; index_stop = 23616; break;
			case 6636: index_start = 23640; index_stop = 23640; break;
			case 6646: index_start = 23664; index_stop = 23664; break;
			case 6656: index_start = 23688; index_stop = 23712; break;
			case 6666: index_start = 23736; index_stop = 24600; break;
			default: goto test_tfs_01; break;
		}

	
		for(TFS_02_ARRAY_INDEX = index_start; TFS_02_ARRAY_INDEX <= index_stop; TFS_02_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_2_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* FRONT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[0], your_cube.cube_front[1], your_cube.cube_front[2], your_cube.cube_front[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[4], your_cube.cube_front[5], your_cube.cube_front[6], your_cube.cube_front[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[8], your_cube.cube_front[9], your_cube.cube_front[10], your_cube.cube_front[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[12], your_cube.cube_front[13], your_cube.cube_front[14], your_cube.cube_front[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* RIGHT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[0], your_cube.cube_right[1], your_cube.cube_right[2], your_cube.cube_right[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[4], your_cube.cube_right[5], your_cube.cube_right[6], your_cube.cube_right[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[8], your_cube.cube_right[9], your_cube.cube_right[10], your_cube.cube_right[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[12], your_cube.cube_right[13], your_cube.cube_right[14], your_cube.cube_right[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/************************************/
			/* BOTTOM face match existing cube? */
			/************************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[0], your_cube.cube_bottom[1], your_cube.cube_bottom[2], your_cube.cube_bottom[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[4], your_cube.cube_bottom[5], your_cube.cube_bottom[6], your_cube.cube_bottom[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[8], your_cube.cube_bottom[9], your_cube.cube_bottom[10], your_cube.cube_bottom[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[12], your_cube.cube_bottom[13], your_cube.cube_bottom[14], your_cube.cube_bottom[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* BACK face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[0], your_cube.cube_back[1], your_cube.cube_back[2], your_cube.cube_back[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[4], your_cube.cube_back[5], your_cube.cube_back[6], your_cube.cube_back[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[8], your_cube.cube_back[9], your_cube.cube_back[10], your_cube.cube_back[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[12], your_cube.cube_back[13], your_cube.cube_back[14], your_cube.cube_back[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* LEFT face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[0], your_cube.cube_left[1], your_cube.cube_left[2], your_cube.cube_left[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[4], your_cube.cube_left[5], your_cube.cube_left[6], your_cube.cube_left[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[8], your_cube.cube_left[9], your_cube.cube_left[10], your_cube.cube_left[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_02_DATABASE[TFS_02_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[12], your_cube.cube_left[13], your_cube.cube_left[14], your_cube.cube_left[15]);
			if(current_database_row_data == current_cube_row_data)
			{
				return SOLVED_IN_2_MORE_MOVES;
			}
		}
	}

test_tfs_01:
if(GLOBAL_PROBE_TFS_1_DATABASE)
	{
		TFS_01_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 552; break;
			case 1121: index_start = 576; index_stop = 576; break; 
			case 1141: index_start = 600; index_stop = 600; break;
			case 1151: index_start = 624; index_stop = 624; break;
			case 1211: index_start = 648; index_stop = 648; break;
			case 1411: index_start = 672; index_stop = 672; break;
			case 1511: index_start = 696; index_stop = 696; break;
			case 2112: index_start = 720; index_stop = 720; break;
			case 3333: index_start = 744; index_stop = 744; break;
			case 4114: index_start = 768; index_stop = 768; break;
			case 4444: index_start = 792; index_stop = 792; break;
			case 5115: index_start = 816; index_stop = 816; break;
			case 6666: index_start = 840; index_stop = 840; break;
			default: return UNSOLVED; break;
		}

	
		for(TFS_01_ARRAY_INDEX = index_start; TFS_01_ARRAY_INDEX <= index_stop; TFS_01_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_1_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* FRONT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[0], your_cube.cube_front[1], your_cube.cube_front[2], your_cube.cube_front[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[4], your_cube.cube_front[5], your_cube.cube_front[6], your_cube.cube_front[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[8], your_cube.cube_front[9], your_cube.cube_front[10], your_cube.cube_front[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_front[12], your_cube.cube_front[13], your_cube.cube_front[14], your_cube.cube_front[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/***********************************/
			/* RIGHT face match existing cube? */
			/***********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[0], your_cube.cube_right[1], your_cube.cube_right[2], your_cube.cube_right[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[4], your_cube.cube_right[5], your_cube.cube_right[6], your_cube.cube_right[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[8], your_cube.cube_right[9], your_cube.cube_right[10], your_cube.cube_right[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_right[12], your_cube.cube_right[13], your_cube.cube_right[14], your_cube.cube_right[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/************************************/
			/* BOTTOM face match existing cube? */
			/************************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[0], your_cube.cube_bottom[1], your_cube.cube_bottom[2], your_cube.cube_bottom[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[4], your_cube.cube_bottom[5], your_cube.cube_bottom[6], your_cube.cube_bottom[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[8], your_cube.cube_bottom[9], your_cube.cube_bottom[10], your_cube.cube_bottom[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_bottom[12], your_cube.cube_bottom[13], your_cube.cube_bottom[14], your_cube.cube_bottom[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* BACK face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[0], your_cube.cube_back[1], your_cube.cube_back[2], your_cube.cube_back[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[4], your_cube.cube_back[5], your_cube.cube_back[6], your_cube.cube_back[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[8], your_cube.cube_back[9], your_cube.cube_back[10], your_cube.cube_back[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_back[12], your_cube.cube_back[13], your_cube.cube_back[14], your_cube.cube_back[15]);
			if(current_database_row_data != current_cube_row_data) continue;

			/**********************************/
			/* LEFT face match existing cube? */
			/**********************************/
			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[0], your_cube.cube_left[1], your_cube.cube_left[2], your_cube.cube_left[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[4], your_cube.cube_left[5], your_cube.cube_left[6], your_cube.cube_left[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[8], your_cube.cube_left[9], your_cube.cube_left[10], your_cube.cube_left[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_01_DATABASE[TFS_01_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_left[12], your_cube.cube_left[13], your_cube.cube_left[14], your_cube.cube_left[15]);
			if(current_database_row_data == current_cube_row_data)
			{
				return SOLVED_IN_1_MORE_MOVE;
			}
		}
	}

	return UNSOLVED;
}



void init_array_based_cube(void)
{
	unsigned short i;

	init_user_search_preferences();
	init_search_variables();

	for(i = 0; i<16; i++)
	{
		global_4x4x4_array_cube.cube_top[i]    = CONSTANT_TOP;
		global_4x4x4_array_cube.cube_front[i]  = CONSTANT_FRONT;
		global_4x4x4_array_cube.cube_right[i]  = CONSTANT_RIGHT;

		global_4x4x4_array_cube.cube_bottom[i] = CONSTANT_BOTTOM;
		global_4x4x4_array_cube.cube_back[i]   = CONSTANT_BACK;
		global_4x4x4_array_cube.cube_left[i]   = CONSTANT_LEFT;
	}

	for(i = 1; i<= MAX_DEPTH; i++)
		GLOBAL_CUBE_SOLUTION[i-1] = 0;
}

void answer_4x4x4(unsigned short distance_returned)
{
	switch(distance_returned)
	{
		case ALREADY_SOLVED: printf("This 4x4x4 cube is already solved.\n\n"); break;
		case SOLVED_IN_1_MORE_MOVE : printf("This 4x4x4 cube is 1 move from being solved after %llu probes.\n\n", GLOBAL_TFS_1_DATABASE_PROBES); break;
		case SOLVED_IN_2_MORE_MOVES : printf("This 4x4x4 cube is 2 moves from being solved after %llu probes.\n\n", GLOBAL_TFS_2_DATABASE_PROBES); break;
		default: printf("This 4x4x4 cube is more than 2 moves from being solved.\n\n"); break;
	}
}

void enter_your_position_here(void)
{
	unsigned short how_far_away_is_solution;

	//An example of U = just change the 1st row of the 4 faces, front, right, back, left.
	//1st row = 0,1,2,3. 2nd row = 4,5,6,7. 3rd row = 8,9,10,11. 4th row = 12,13,14,15.

	printf("Testing U'\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_front[0] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[1] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[2] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_front[3] = CONSTANT_LEFT;

	global_4x4x4_array_cube.cube_right[0] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[1] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[2] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_right[3] = CONSTANT_FRONT;

	global_4x4x4_array_cube.cube_back[0] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[1] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_back[3] = CONSTANT_RIGHT;

	global_4x4x4_array_cube.cube_left[0] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[1] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_left[3] = CONSTANT_BACK;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);

	printf("Testing f2, which should be one move away (2 turns of the same side == 1 move)\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_top[8] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[9] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[10] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[11] = CONSTANT_BOTTOM;

	// holding the cube with right facing us, different indices result
	global_4x4x4_array_cube.cube_right[1] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[5] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[9] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[13] = CONSTANT_LEFT;

	//roll the cube in your hands from top to front to bottom to get this frame of reference
	global_4x4x4_array_cube.cube_bottom[4] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[5] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[6] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[7] = CONSTANT_TOP;

	// holding the cube facing front, and roll to the left to get this frame of reference
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[6] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[10] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[14] = CONSTANT_RIGHT;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);

	printf("Testing f2 R', which should be 2 moves away\n\n");

	//call this to reset the cube to solved state
	init_array_based_cube();

	global_4x4x4_array_cube.cube_top[8] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[9] =  CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_top[10] = CONSTANT_BOTTOM;

	global_4x4x4_array_cube.cube_top[3] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[7] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[11] = CONSTANT_BACK;
	global_4x4x4_array_cube.cube_top[15] = CONSTANT_BACK;

	// holding the cube with right facing us, different indices result
	global_4x4x4_array_cube.cube_right[8] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[9] =  CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[10] = CONSTANT_LEFT;
	global_4x4x4_array_cube.cube_right[11] = CONSTANT_LEFT;

	//roll the cube in your hands from top to front to bottom to get this frame of reference
	global_4x4x4_array_cube.cube_bottom[4] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[5] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_bottom[6] = CONSTANT_TOP;

	global_4x4x4_array_cube.cube_bottom[3] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[7] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[11] = CONSTANT_FRONT;
	global_4x4x4_array_cube.cube_bottom[15] = CONSTANT_FRONT;

	// holding the cube facing front, and roll to the left to get this frame of reference
	global_4x4x4_array_cube.cube_left[2] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[6] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[10] = CONSTANT_RIGHT;
	global_4x4x4_array_cube.cube_left[14] = CONSTANT_RIGHT;

	// holding the cube facing front
	global_4x4x4_array_cube.cube_front[3] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_front[7] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_front[11] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_front[15] = CONSTANT_TOP;

	// holding the cube facing front, then rotate it 180 degrees horizontally
	global_4x4x4_array_cube.cube_back[0] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_back[4] = CONSTANT_BOTTOM;
	global_4x4x4_array_cube.cube_back[8] = CONSTANT_TOP;
	global_4x4x4_array_cube.cube_back[12] = CONSTANT_BOTTOM;

	how_far_away_is_solution = solved_distance(global_4x4x4_array_cube);

	answer_4x4x4(how_far_away_is_solution);
}

int _tmain(int argc, _TCHAR* argv[])
{
	int result_code;

	init_array_based_cube();

	enter_your_position_here();

	while(1)
	{
	}

	return 0;

};
```


----------



## rokicki (Apr 18, 2014)

Another easy pruning heuristic that doesn't even require a nontrivial table is this.
This works best in the outer block turn metric, which is my favorite.

For every corner->edge pair that should be adjacent, and every edge->edge
pair that should be adjacent, but isn't, add one. Take the total sum and
divide by 4; if there is any remainder, add one. This is a lower bound on the
number of remaining moves.

The average here will probably be about 9 moves.

And for every such pair as described above, you can also determine:

1. If it is paired, what moves will unpair it;
2. If it is not paired, what moves will pair it.

Thus, you can trivially "look ahead" one move in this heuristic, so your
average distance is probably closer to 10 (if you are at 9 but no moves
bring you to 8, you must be at 10).

You can apply this one two ways, too: to the current position, and to
its inverse.

I think this one complements the corners pruning table fairly well. But
it doesn't help much with the centers.

-tom


----------



## unsolved (Apr 18, 2014)

rokicki said:


> I think this one complements the corners pruning table fairly well. But
> it doesn't help much with the centers.



Hi Tom,

I spend a fair amount of time thinking about ways to "deal with the centers" in terms of pruning. Just look at this treasure trove of possibilities:






All of those paths to 3-turn and 2-turn database solutions represent nodes with known distances that can be probed from a table to hacksaw the game tree. I modified my program to accept different search term parameters and collect all, most, or some of these positions, depending on how fast I want to see an answer to a problem, or how many answers I want to see.

For maximum speed, you treat endgame databases as "one strike, you're out." If you hit the 3-TFS database, you know every other 3-TFS position at that depth will not bring you any closer to an optimal line of play. Turn it off! Your search speed goes up, the 2-TFS and 1-TFS get hit harder, and you get an improved distance if you encounter any such database position in your search.

You could also try the "one strike, you're safe" approach, and not turn off the most-distant database until the end of the iteration depth. At ply-6 if you hit a 3-TFS entry, you might want to see all of the paths to the 3-TFS. But once you start ply-7, this would be counterproductive. You'd only probe TFS-2 and TFS-1 at ply-7, then only TFS-1 at ply-8, then none of the above at ply-9.

I still believe that having every possible 1-face vs. 1 face database of every color configuration of centers would be an awesome pruning tool. Example:

4 red, 4 blue
4 red, 3 blue + 1 white
4 red, 3 blue + 1 yellow

...

3 red + 1 blue, 3 blue + 1 white
3 red + 1 blue, 2 blue + 1 yellow

...

0 red + 1 white + 1 yellow + 1 blue+ 1 green, 0 blue + 1 orange + 1 white + 1 green + 1 red

As I mentioned before, a chain is only as strong as its weakest link. Likewise, when you consider the centers across all faces, the quickest solve can't be faster than the longest-to-solve center configuration between just 2 faces.
So knowing all of these 2-face combos would basically be almost as good as having every one of those 24!/4! centers mapped. Why? In the first case, it doesn't matter if you are 19 or God's Number for 4x4x4 away from a solution, a pruned branch is a pruned branch. And secondly, even if you had all of the centers solved, you'd never be able to access the data to make use of it! So why wish for something you can't utilize?

This 1-Face vs. 1-Face of all centers has to be the way to go for center pruning tables.


```
Solution to 4x4x4 cube center scenario U1:F1 with [B]"One strike, you're safe"[/B] configuration.

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r  u2 r' U  r   [INSIDE 3-turn database] @ 000000000007734244 nodes with 000000011995681252 3-TFS database probes           
Solution [002] =  U  f  u' f' U2 f   [INSIDE 3-turn database] @ 000000000015321430 nodes with 000000020416154204 3-TFS database probes           
Solution [003] =  U' r  u2 r' U' r   [INSIDE 3-turn database] @ 000000000028339219 nodes with 000000038812493717 3-TFS database probes           
Solution [004] =  U' b  u  b' U2 b   [INSIDE 3-turn database] @ 000000000038489054 nodes with 000000050780609717 3-TFS database probes           
Solution [005] =  U2 f  u' f' U  f   [INSIDE 3-turn database] @ 000000000056531248 nodes with 000000074888579146 3-TFS database probes           
Solution [006] =  U2 b  u  b' U' b   [INSIDE 3-turn database] @ 000000000059093963 nodes with 000000078532776871 3-TFS database probes           
Solution [007] =  u  L' u' l  u  L'  [INSIDE 3-turn database] @ 000000000071322856 nodes with 000000093838647893 3-TFS database probes           
Solution [008] =  u  L' u' l  u  L   [INSIDE 2-turn database] @ 000000000071322857 nodes with 000000004575143791 2-TFS database probes           
** TFS-3 database is now off. **
Solution [009] =  u' R' u  l  u' R   [INSIDE 2-turn database] @ 000000000084671461 nodes with 000000005469700467 2-TFS database probes           
Solution [010] =  u' b' u  F  u' b   [INSIDE 2-turn database] @ 000000000095727818 nodes with 000000006124422084 2-TFS database probes           
Solution [011] =  d' b  d  F' d' b'  [INSIDE 2-turn database] @ 000000000131859229 nodes with 000000008350977489 2-TFS database probes           
Solution [012] =  r  u2 r' U2 r  u2  [INSIDE 2-turn database] @ 000000000279311235 nodes with 000000016681909072 2-TFS database probes           
Solution [013] =  r' b2 r  F2 r' b2  [INSIDE 2-turn database] @ 000000000310945476 nodes with 000000017734270694 2-TFS database probes           
Solution [014] =  l' U  r  U' l  U   [INSIDE 2-turn database] @ 000000000331691122 nodes with 000000018447098967 2-TFS database probes           
Solution [015] =  l  F  r' F' l' F   [INSIDE 2-turn database] @ 000000000357853534 nodes with 000000019430007006 2-TFS database probes           
Solution [016] =  f  u' f' U' f  u   [INSIDE 2-turn database] @ 000000000492667483 nodes with 000000025836897273 2-TFS database probes           
Solution [017] =  b' R' b  l' b' R   [INSIDE 2-turn database] @ 000000000554149858 nodes with 000000029094999956 2-TFS database probes           
Solution [018] =  b  u  b' U  b  u'  [INSIDE 2-turn database] @ 000000000564731510 nodes with 000000029497922103 2-TFS database probes           
Solution [019] =  b  L' b' l' b  L   [INSIDE 2-turn database] @ 000000000576006881 nodes with 000000030093779536 2-TFS database probes
```


----------



## cuBerBruce (Apr 18, 2014)

unsolved said:


> And what is GAP?



GAP is a free interactive system and programming language available here. As a general programming language, it may not be anywhere as fast as C/C++, but it has a lot of useful mathematics-related built-in functions that make it quite awesome. Particularly, it has a built-in data type for permutations, and also many built-in functions for permutation groups.

so, you can make definitions for the basic moves of a puzzle as permutations of facelets, and it can automatically determine the number of different permutations of the puzzle.


```
gap> U := ( 1, 3, 8, 6)( 2, 5, 7, 4)( 9,33,25,17)(10,34,26,18)(11,35,27,19);
(1,3,8,6)(2,5,7,4)(9,33,25,17)(10,34,26,18)(11,35,27,19)
gap> L := ( 9,11,16,14)(10,13,15,12)( 1,17,41,40)( 4,20,44,37)( 6,22,46,35);
(1,17,41,40)(4,20,44,37)(6,22,46,35)(9,11,16,14)(10,13,15,12)
gap> F := (17,19,24,22)(18,21,23,20)( 6,25,43,16)( 7,28,42,13)( 8,30,41,11);
(6,25,43,16)(7,28,42,13)(8,30,41,11)(17,19,24,22)(18,21,23,20)
gap> R := (25,27,32,30)(26,29,31,28)( 3,38,43,19)( 5,36,45,21)( 8,33,48,24);
(3,38,43,19)(5,36,45,21)(8,33,48,24)(25,27,32,30)(26,29,31,28)
gap> B := (33,35,40,38)(34,37,39,36)( 3, 9,46,32)( 2,12,47,29)( 1,14,48,27);
(1,14,48,27)(2,12,47,29)(3,9,46,32)(33,35,40,38)(34,37,39,36)
gap> D := (41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40);
(14,22,30,38)(15,23,31,39)(16,24,32,40)(41,43,48,46)(42,45,47,44)
gap> Size(Group(U,D,L,R,B,F));
43252003274489856000
```



unsolved said:


> ```
> Found solution: [11]  U  u' L' f  r2 f  r2 f2 L  U' u
> ```
> 
> Now that is cool! I'll have to set that up on a test run a little later.



This alg can be expressed as a conjugated commutator.
U u' L' f r2 f r2 f2 L U' u = [U u' L' f: [r2, f]]

If you look at the inner commutator [r2, f] = r2 f r2 f', its apparent it moves at least 6 center pieces. These are in fact the only center pieces that move, and its two separate 3-cycles.



unsolved said:


> Solution [1] finds a 3-TFS solution @ depth 6.
> Solution [2] finds a 2-TFS solution @ depth 7, which you expect. By definition, there must be one solution of "distance - 1" when you find a turns-from-solved database solution from the previous iteration.
> 
> But now look at Solution [3].
> ...



With iterative deepening and proper move generator and TFS databases, you should always find the optimal solutions first using the maximum depth of your TFS database. For example, let's say the optimal solution for a given case has 11 moves and you have a database for positions 3 moves from solved. Your search should find the solutions by generating a tree to depth 8 and finding the resulting optimal solutions by searching the "depth 3" TFS database. There is no real point in searching "depth 2" and "depth 1" database since any solutions that might be found should have been found by an earlier depth in the iterative deepening. (In testing your code, you may well want to check the "depth 2" and "depth 1" TFS databases, just to verify that you never find any new optimal solutions this way. But this is essentially a waste of time. In the long run, I think you want to change the multiple TFS databases into a single hash table that stores the distance for each relevant position.)

What is happening is that you are find sub-optimal solutions by searching deeper than necessary, and many of the suboptimal solutions found will involve a move cancellation between the last move in the brute force tree and the first move for the position in the TFS database.

By "proper move generator and TFS databases" above, I mean that the "brute force" move generator builds an M-depth tree containing all algs that produce distinct supercube positions (producing the result of composing the scramble position with that supercube position), and your N-TFS databases have every non-supercube position N moves from solved.

EDIT:


unsolved said:


> I still believe that having every possible 1-face vs. 1 face database of every color configuration of centers would be an awesome pruning tool. Example:
> 
> 4 red, 4 blue
> 4 red, 3 blue + 1 white
> ...



Each center piece has four locations it can be in order to be considered solved (assuming we have some sort of reference that determines which face it must go to). So my intuition is that you will get better pruning tables if you consider full sets of 4 center pieces for a face rather than looking at a set of positions that will contain a random set of center cubies.


----------



## unsolved (Apr 19, 2014)

cuBerBruce said:


> GAP is a free interactive system and programming language



Thanks Bruce, I will check it out.



cuBerBruce said:


> This alg can be expressed as a conjugated commutator.
> U u' L' f r2 f r2 f2 L U' u = [U u' L' f: [r2, f]]



Yeah, I am going to have to learn such lingo and its application to cubing.



cuBerBruce said:


> With iterative deepening and proper move generator and TFS databases, you should always find the optimal solutions first using the maximum depth of your TFS database.



I used to probe TFS-3 first, but just today I found a counter-example. I have a text dump in one of my directories, I was running 16 instances of the program to test various TFS-usage strategies. Here is the thing: Once I have a TFS result from the lookup code, it returns the value back to the search routine, and no longer searches any other TFS databases for that particular position. So, if I hit a TFS-3 position, and TFS-2 and TFS-1 are coded to be probed afterwards, I get more "unwanted" solutions as the depths go on. I can't find a screenshot showing this right now, but I have two different implementations shown below.

This is *TFS Probing Configuration 2*:






I don't know when I will encounter a TFS position, and at most depths, I don't. So until I do, my "solution_length" variable is set to 999. Once I hit a TFS entry, my best solution is now *depth + TFS distance*. Note I have a little arrow pointing to a few entries. Each such entry is an improved solution depth. When I encounter a TFS-3 solution in this implementation, I keep that database on and active, until I encounter a TFS-2 or TFS-1 at the same depth.

Solution [008] is a TFS-2 hit, so the solution is now improved. At this point, probing TFS-3 does not make any more sense. I'll only find "oversolved" positions, like you mentioned. An additional turn is made that is just undone by a larger TFS database, so there is no point.

I continue to probe TFS-2 and TFS-1 until the end of the iteration, looking for improvements. Of course, I can always hit on a nominal depth solution, which trumps every TFS entry with an immediate solution.

At the end of depth-6, an 8-turn solution was found, and there is no need to search any longer. So the search halts, you can see some debug info on the screen "condition 02" being encountered in the code (lets me know where it was triggered).

That's one way to use the TFS databases, here is another:

*TFS Probing Configuration 3*:






In this configuration, as soon as I encounter one TFS position, I shut off probing that database immediately, without completing the iteration. Why? I know all subsequent solutions for that database cannot improve upon the solution length. You can see after one TFS-3 encounter, pow, it's off. Next it encounters a TFS-2 position, and pow, it gets shut off too. Turning off the databases speeds up the search, so the noose always tightens more quickly than before. The tradeoff is, I miss all of those other similar paths along the way, which might be some neat algos.

There are looser settings I can apply, to allow the search to continue to the next iteration to verify the TFS code is working. I have already done that, as you alluded to. I will always finds at least one TFS "n-1" solution if I search 1 ply more deeply, and a "n-2" solution two iterations beyond, etc. I have encoded all of these as user-configurable options.





cuBerBruce said:


> For example, let's say the optimal solution for a given case has 11 moves and you have a database for positions 3 moves from solved. Your search should find the solutions by generating a tree to depth 8 and finding the resulting optimal solutions by searching the "depth 3" TFS database. There is no real point in searching "depth 2" and "depth 1" database since any solutions that might be found should have been found by an earlier depth in the iterative deepening.



Remember, I am skipping more than one level of search at each iteration.

When I complete ply 4 with TFS-3 turned on, I have searched plies 4,5,6 and 7. So I can jump to ply 8 at once, at which time I am scanning plies 8,9,10 and 11. For lower levels of search, I don't always jump 4 plies. I'll go to depth 7 in the hopes of encountering a 7+ TFS-1 solution more quickly than a nominal depth 8 solution. There is a tradeoff. At higher depths, I'll be more likely to encounter the solution with the 4-ply jump since search times get more and more lengthy. My 4-ply jump is worth a factor of over 1,000,000 in full-width search time!



cuBerBruce said:


> So my intuition is that you will get better pruning tables if you consider full sets of 4 center pieces for a face rather than looking at a set of positions that will contain a random set of center cubies.



It is clearly possible, which is why computer science is so awesome. You can just code it and get the results!

Good post Bruce, thanks for all of your comments.


----------



## cuBerBruce (Apr 19, 2014)

unsolved said:


> Remember, I am skipping more than one level of search at each iteration.



In iterative deepening, you normally don't skip iterations. You would prove that there are no solutions of depth 4+3 before looking for solutions of length 5+3, and then prove there are no solutions of length 5+3 before looking for solutions of length 6+3. In your scheme, if the solution length turns out to be 7, you would probably be spending about 800 times longer finding the solutions (with a depth 6+3 search) than if you simply had tried a length 4+3 search first.


----------



## 10461394944000 (Apr 19, 2014)

unsolved said:


> Yeah, I am going to have to learn such lingo and its application to cubing.



conjugate = [P:Q] = P Q P'
commutator = [P,Q] = P Q P' Q'

P and Q are any algorithm


----------



## unsolved (Apr 19, 2014)

cuBerBruce said:


> In iterative deepening, you normally don't skip iterations. You would prove that there are no solutions of depth 4+3 before looking for solutions of length 5+3, and then prove there are no solutions of length 5+3 before looking for solutions of length 6+3. In your scheme, if the solution length turns out to be 7, you would probably be spending about 800 times longer finding the solutions (with a depth 6+3 search) than if you simply had tried a length 4+3 search first.



That would be true if the cost of probing the databases was 0.

Using your example:

Solution = 7, unbeknownst to the program.

Worst case scenario for the solver: Finish depth 3 + 3, advance to depth 7 immediately and begin a search of 7 + 3, at which time the databases are of no value and only slow the nominal search.
Better case scenario for the solver: Finish depth 2 + 3, advance to depth 6 immediately and begin a search of 6 + 3, after which a solution of 6 + 1 would be found.
Best case scenario for the solver: Finish depth 0 + 3, advance to depth 4 immediately and begin a search of 4 + 3, after which a solution of 4 + 3 would be found.

When you start incorporating overlap, the picture is not as clear. There are multiple database probes per node in this "quickie" implementation (the bitboard version is much more efficient and faster executing, but presently its also buggy).
Creeping along the nominal depth would only be recommended if you knew, in advance, a solution was of a certain probable depth.

Executing 2+3, 3+3, 4+3, etc would be awful if it were an 11-ply solution that would have otherwise been found after 0 + 3, 4 + 3, and 8 + 3. Scanning nominal depths of only 4 and 8 to find an 11-ply solution would outperform the other option handily.

The question remains: Is there a good "attack" scheme in general that will minimize the time-to-solution given various positions of different depths?


----------



## rokicki (Apr 19, 2014)

If you do the math, you realize that if you need a ply-d search, then with great
probability the ply-(d-1) search is relatively negligible (even counting every
lookup), while a ply-(d+1) search will take much too long to find the solution.

Consider the order of the search tree and what the solution distribution looks
like.

This has been done for many, many years in exactly this way by very smart
people. I'm not trying to discourage experimentation but do the math.


----------



## unsolved (Apr 19, 2014)

rokicki said:


> If you do the math, you realize that if you need a ply-d search, then with great
> probability the ply-(d-1) search is relatively negligible (even counting every
> lookup), while a ply-(d+1) search will take much too long to find the solution.
> 
> ...



I hear ya 

But the non-linear nature of my _current _implementation (stressing that, because the bitboard version, when it's working, is much more akin to the branching factor/depth tradeoffs you are speaking of) is pretty tricky. A quick refresher diagram:






Look at the bottom line there, where the program identified Solution [50] while nearing the end of ply-6.

There were 492 million nodes explored and a total of 541 billion probes of the 3-TFS database. That's roughly 1099 probes per node.

Sounds like a lot, but consider there are 1026 nodes for 2 plies from solved, and you can see I'm getting 3 plies worth of information for the cost of only 2 ply worth of calculation.
Plus, a database probe in RAM is much faster than a node being generated, or else my program would be 1099 times slower.

At lower search depths, you are absolutely correct. The near-instant location of a lower depth solution justifies the shallower depth + extensions.

But what if we are talking about a 15-ply solution?

Then it would not matter if my move generator speed was only 1000 nodes/second, the database extension at those huge depths is worth much more than cranking out nodes.

If I do searches of (nominal + extended) of 0 + 3 = 3, 4 + 3 = 7, 8 + 3 = 11, 12 + 3 = 15, even assuming if the program finds the solution on the last node and last database lookup from nominal depth 12, that must outperform searches of 0 + 3 = 3, 1 + 3 = 4, 2 + 3 = 5, 3 + 3 = 6, 4 + 3 = 7, 5 + 3 = 8, 6 + 3 = 9, 7 + 3 = 10, 8 + 3 = 11, 9 + 3 = 12, 10 + 3 = 13, 11 + 3 = 14, 12 + 3 = 15.

Change that 15-ply to 8, and you're right, I'm crushed:

0 + 3 = 3, 4 + 3 = 7, 8 + 3 finds the solution the hard way at the nominal level, and would easily lose to 0 + 3 = 3, 1 + 3 = 4, 2 + 3 = 5, 3 + 3 = 6, 4 + 3 = 7, 5 + 3 = 8.

Hey, I could be totally wrong. I just wish I had a damn corner-pruner!


----------



## qqwref (Apr 19, 2014)

Your hypothetical kind of presupposes that you know the depth of the algorithm you're looking for. So when you say "what if we are talking about a 15-ply solution" - you don't know it's 15 moves until you prove all 14-move solutions don't exist! And you definitely don't know that before starting the search.

So let's make a new hypothetical, where we do your 4-move deepening, and assume it might be 15 moves, but also might be 14 or 13. Also remember that each additional move multiplies the time taken by some factor, which for simplicity I'll call 20. Let's call the time a (12+3)-move search takes 1 unit.
- Whether it is 13, 14, or 15 moves, your approach will always do 0, 4, 8, and 12 move searches. Now even an 8-move search only takes .000006 units in this hypothetical, which is negligible. So let's call this 1 unit as well.
- For a 1-move deepening approach, it's a little more complex. If it's 13 moves, we do 0, 1, ..., 10 move searches. A 10-move search takes .0025 units, a 9-move takes .000125 units, etc., for a total of about .0026 units. Roughly 380 times as fast. If the solution is 14 moves, it's 20 times that for a total of about .0526 units, which is still about 19 times as fast. And if the solution is 15 moves, then yes, we have to do about 1.0526 units worth of computation, which is 5% slower.

So the question is, are you so worried about that 5% time loss (or less, if the branch factor is more than 20) that you will accept your program may take 19 or even 380 times as long to find the optimal solutions?


Also, I don't know what you're talking about with database probes... surely, after doing your moves, you are not checking the result against every element of the 3-TFS database? Looking through that database should be O(1) - this will be especially important if you ever increase it to 4 or 5 turns. And remember, if you deepen only one move at once, you only ever need to check the biggest database you have. If you care about solutions shorter than what you have in the database, you can just run a quick search without using the database at all - the time that takes should be absolutely negligible.


----------



## rokicki (Apr 19, 2014)

rokicki said:


> Another easy pruning heuristic that doesn't even require a nontrivial table is this.
> This works best in the outer block turn metric, which is my favorite.
> 
> For every corner->edge pair that should be adjacent, and every edge->edge
> ...



I think with some care this could be refined to yield distances of 11 for
most positions. This is interesting: a non-table-based heuristic seems to
outperform the best practical pruning tables we can think of for this metric
and puzzle. I think I'm going to start to play with this a bit.


----------



## unsolved (Apr 19, 2014)

qqwref said:


> Also, I don't know what you're talking about with database probes... surely, after doing your moves, you are not checking the result against every element of the 3-TFS database?



I'll start here since this is where I have an easy answer 

I posted my code online, so everyone could see what it does. A snippet:


```
TFS_03_ARRAY_INDEX = 0;
		current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 184656; break;
			case 1121: index_start = 184680; index_stop = 211824; break;
			case 1131: index_start = 211848; index_stop = 218160; break;
			case 1141: index_start = 218184; index_stop = 246384; break;
			case 1151: index_start = 246408; index_stop = 273384; break;
			case 1161: index_start = 273408; index_stop = 279720; break;
			case 1211: index_start = 279744; index_stop = 306888; break;
			case 1221: index_start = 306912; index_stop = 308808; break;

...

			case 6566: index_start = 656952; index_stop = 659568; break;
			case 6616: index_start = 659592; index_stop = 659976; break;
			case 6626: index_start = 660000; index_stop = 662664; break;
			case 6636: index_start = 662688; index_stop = 664152; break;
			case 6646: index_start = 664176; index_stop = 665544; break;
			case 6656: index_start = 665568; index_stop = 668184; break;
			case 6666: index_start = 668208; index_stop = 692040; break;
			default: goto test_tfs_04; break;
		}

		for(TFS_03_ARRAY_INDEX = index_start; TFS_03_ARRAY_INDEX <= index_stop; TFS_03_ARRAY_INDEX+= 24)
		{
			GLOBAL_TFS_3_DATABASE_PROBES++;

			index_offset = 0;

			/*********************************/
			/* TOP face match existing cube? */
			/*********************************/
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[4], your_cube.cube_top[5], your_cube.cube_top[6], your_cube.cube_top[7]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[8], your_cube.cube_top[9], your_cube.cube_top[10], your_cube.cube_top[11]);
			if(current_database_row_data != current_cube_row_data) continue;

			index_offset++;
			current_database_row_data = GLOBAL_TFS_03_DATABASE[TFS_03_ARRAY_INDEX + index_offset];
			current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[12], your_cube.cube_top[13], your_cube.cube_top[14], your_cube.cube_top[15]);
			if(current_database_row_data != current_cube_row_data) continue;

...

unsigned short GLOBAL_TFS_03_DATABASE[692064] = 
{1111, 1111, 1111, 1111, 2222, 1221, 1221, 1221, 6666, 3333, 3333, 3333, 5445, 2442, 2442, 2442, 1551, 5555, 5555, 5555, 6666, 6666, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1221, 2222, 2222, 3363, 3333, 3363, 3363, 4444, 4444, 4444, 4444, 1551, 5555, 1551, 1551, 6666, 3363, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1331, 2222, 2222, 3323, 5555, 3323, 3323, 4444, 4444, 4444, 4444, 1551, 6666, 1551, 1551, 6666, 3323, 6666, 6666, 
1111, 1111, 1111, 1111, 2222, 1551, 1551, 2222, 3333, 6666, 6666, 3333, 4444, 4444, 4444, 4444, 1551, 2222, 2222, 1551, 6666, 3333, 3333, 6666, 
1111, 1111, 1111, 1111, 2222, 1551, 2222, 1551, 3333, 6666, 3333, 6666, 5445, 5445, 5445, 5445, 1551, 2222, 1551, 2222, 6666, 3333, 6666, 3333, 
1111, 1111, 1111, 1111, 2222, 1551, 2222, 2222, 3333, 3333, 6666, 3333, 4444, 4444, 4444, 4444, 4554, 4224, 5555, 4554, 6666, 3333, 6666, 6666, 

...

6666, 6666, 2112, 2112, 4224, 4224, 4224, 4224, 3323, 3313, 3313, 3313, 5445, 5445, 3333, 3333, 1111, 5555, 5555, 5555, 5565, 4464, 4464, 4464, 
6666, 6666, 3333, 1111, 2222, 2222, 2222, 2222, 3413, 3413, 3413, 3413, 4444, 6666, 3333, 3333, 5555, 5555, 5555, 5555, 4414, 4414, 4414, 4414, 
6666, 6666, 4114, 4114, 5225, 5225, 5225, 5225, 3343, 3313, 3313, 3313, 1441, 1441, 3333, 3333, 2222, 5555, 5555, 5555, 1161, 4464, 4464, 4464, 
6666, 6666, 4444, 1111, 2222, 2222, 2222, 2222, 3613, 3613, 3613, 3613, 4444, 1111, 3333, 3333, 5555, 5555, 5555, 5555, 4434, 4434, 4434, 4434, 
6666, 6666, 5115, 5115, 1221, 1221, 1221, 1221, 3353, 3313, 3313, 3313, 2442, 2442, 3333, 3333, 4444, 5555, 5555, 5555, 2262, 4464, 4464, 4464, 
6666, 6666, 6666, 1111, 2222, 2222, 2222, 2222, 3113, 3113, 3113, 3113, 4444, 3333, 3333, 3333, 5555, 5555, 5555, 5555, 4444, 4444, 4444, 4444};
```

Remember this is the simple, but not highly-optimized code for the array-based move generator. The bitboard lookups are nearly instantaneous by comparison (but buggy since I need to work out a few details yet.)

So basically, casing off of a 4-digit number that represents the 1st 4 cubes on row 1 of the top, a range of indices to scan is determined. Those indices are the boundaries within the *GLOBAL_TFS_03_DATABASE[]* array. The program performs a linear scan of the array, generating 4-digit numbers for each row while there are matches occurring, and failing quickly when not, skipping to the next integer multiple of 24 to start again. I count one database probe as the (up to) 24 separate comparisons of 2-byte data elements. Multiply that by the difference in the start and stop values, and that is the worst case probe count for that particular top-row-4-digit-number serving as the key.

So given averages in the neighborhood of 1000-1200 scans per node, when it is effectively probing a tree 3-ply into the future which would be 28,836 times its size (recall I have 0-pruning until I work out the corner table) I think it is better than not scanning and performing just nominal depth searches.

I already have 4-, 5- and 6- turns from solution (tfs) databases for the bitboard version of the program. I don't want to keep adding onto the array-based version, since I know I'll have the bitboard version debugged "some day" and then *Omnia Obtorquebantur 4x4x4* will be cruising along nicely 



qqwref said:


> ...Now even an 8-move search only takes .000006 units ...
> 
> So the question is, are you so worried about that 5% time loss...



Trust me, I am not worried, this is all just experimental and fun and I am looking for all of the input I can get from more knowledgeable sources 

And when I make posts such as these, it is to encourage the very thing you are doing: telling me why I am incorrect!

I don't know where the "units" came from, so it is not the data I used to come up with my observations. I merely used a stopwatch with some random positions. I guess I need a much larger sample, because the "luck factor" of hitting a database position that no longer necessitates going to the next iteration comes into play.


----------



## qqwref (Apr 19, 2014)

unsolved said:


> case 1121: index_start = 184680; index_stop = 211824; break;
> case 1131: index_start = 211848; index_stop = 218160; break;
> case 1141: index_start = 218184; index_stop = 246384; break;
> case 1151: index_start = 246408; index_stop = 273384; break;
> ...


I've been wondering, how come the first and last digits are *always* the same? Is this a bug? Obviously for any two stickers there is a single move that moves them apart. Perhaps I just don't understand what you're doing.



unsolved said:


> So basically, casing off of a 4-digit number that represents the 1st 4 cubes on row 1 of the top, a range of indices to scan is determined. Those indices are the boundaries within the *GLOBAL_TFS_03_DATABASE[]* array. The program performs a linear scan of the array


If you are searching straight through from index_start to index_stop, then you are literally using thousands of times as much time as you should for this task - you want something that does not depend much on the actual size of the table, like a hash or some kind of tree lookup. Even if you don't want the extra memory of a data structure like that, I am sure there is a more efficient way to leverage the data structure you're already using.



unsolved said:


> I don't know where the "units" came from, so it is not the data I used to come up with my observations. I merely used a stopwatch with some random positions.


Please read what I said again, with the following in mind. A "unit" is quite literally just an arbitrary constant defined as how long a 12-move search (plus 3-TFS table) takes. If I write a task takes .0025 units, for instance, I mean it takes .0025 times the time it takes to run the 12-move search. (I'm assuming these are full searches, i.e. you go through the entire 12-move space. And as I mentioned I'm also assuming a branching factor of 20, just for simplicity.) That's it.


----------



## cuBerBruce (Apr 19, 2014)

Implementing a hash table is not that difficult. You may be able to use a hash table implementation from an existing library, or you can implement one yourself. In the spoiler is a simple program using my standard hash table code.

My implementation has a little caveat. Because of the rehash function I use, the size of the table must be a prime number; else the table may appear to fill up prematurely. In my implementation, the size of the table minus two is also used as a divisor for determining the initial hash index. (In my implementation, the initial hash is not allowed to be 0. The 0-element is a dummy element.) I suggest this also be prime. I always use the larger of a twin prime pair as my hash table size. Twin primes are sufficiently dense that I do not consider this a problem. The size of the table be about 10% larger than what the table needs to store to minimize hash collisions, which slow to access time.

The code requires something I call a "signature" for the object being added to the hash table. Basically, you want to create some big number that ideally would be different for each object stored in the hash table. The signature must be identical for objects that are considered identical (represent the same state of the puzzle).

My code also includes an array that stores hash table indices so that it is easy to iterate through the hash table in the order entries were added. This array can be eliminated if you don't need that functionality.

The code has a simple main function to illustrate adding and looking up elements.


Spoiler





```
// hash.cpp : simple hash table implementation
// Author: Bruce Norskog

#include "stdafx.h"  //Visual C++ header file for generating pre-compiled headers

typedef unsigned int UINT;
typedef unsigned char UBYTE;

const UINT HASH_TABLE_SIZE = 33073;	//prime number, since add-the-hash rehash is used.
const UINT HASH_DIVISOR = HASH_TABLE_SIZE - 2;	//also should be prime for good hashing

const UINT INVALID_DIST = 99;

class CubeState {
public:
	UBYTE m_corner[8];
	UBYTE m_distance;
	CubeState ();
	void init ();
	void swap_cubies (int i, int j);
	UINT get_signature () const;
	bool compare (const CubeState& cube2) const;
};

CubeState hash_table[HASH_TABLE_SIZE];
int hash_location[HASH_TABLE_SIZE];
int hash_count = 0;

CubeState::CubeState ()
{
	init ();
}

void
CubeState::init ()
{
	int i;
	for (i = 0; i < 8; ++i) {
		m_corner[i] = 3*i;
	}
	m_distance = 0;
}

UINT
CubeState::get_signature () const
{
	int i;
	UINT x1 = 0;
	UINT x2 = 0;
	for (i = 0; i < 6; ++i) {
		x1 = 24*x1 + m_corner[i];
	}
	for (i = 6; i < 8; ++i) {
		x2 = 24*x2 + m_corner[i];
	}
	return x1 ^ x2;
}

bool
CubeState::compare (const CubeState& cube2) const
{
	int i;
	for (i = 0; i < 8; ++i) {
		if (m_corner[i] != cube2.m_corner[i]) {
			return false;
		}
	}
	return true;
}

void
CubeState::swap_cubies (int i, int j)
{
	UBYTE t = m_corner[i];
	m_corner[i] = m_corner[j];
	m_corner[j] = t;
}

//init_hash table - initialize the hash table.
void
init_hash_table ()
{
	int i;
	hash_count = 0;
	for (i = 0; i < HASH_TABLE_SIZE; ++i) {
		hash_table[i].init ();
		hash_table[i].m_distance = INVALID_DIST;
		hash_location[i] = 0;
	}
}

//hash_table_lookup - find an object in the hash table.
bool
hash_table_lookup (const CubeState& cube1, int* hash_loc)
{
	UINT sig1 = cube1.get_signature ();
	UINT hash = sig1 % HASH_DIVISOR + 1;
	UINT i = hash;
	while (hash_table[i].m_distance < INVALID_DIST) {
		if (cube1.compare (hash_table[i])) {
			*hash_loc = i;
			return true;
		}
		i += hash;
		i %= HASH_TABLE_SIZE;
		if (i == 0) {	//relies on table being a prime number in size
			*hash_loc = 0;
			return false;
		}
	}
	*hash_loc = i;
	return false;	//not found in the table, hash_loc contains index where to add it
}

//add_to_hash_table - add an element to the hash table.
//Call lookup_hash_table first to get the hash index.
void
add_to_hash_table (const CubeState& cube2, int hash_idx, int dist)
{
	if (hash_idx == 0) {
		printf ("Hash table full! (%d)\n", hash_count);
		exit (1);
	}
	//This check can be used to declare hash table "full" before its out of room.
	//Performance tends to get drastically reduced when the table is nearly full.
	if (hash_count > HASH_TABLE_SIZE - 10) {
		printf ("Hash table full.\n");
		exit (1);
	}
	hash_table[hash_idx] = cube2;
	hash_table[hash_idx].m_distance = dist;
	hash_location[hash_count++] = hash_idx;
}

//get_distance - Look up the distance or other data associated a hash table object.
int
get_distance (const CubeState& cube2)
{
	int hash_loc = 0;
	if (! hash_table_lookup (cube2, &hash_loc)) {
		return INVALID_DIST;	//unknown distance, return ridiculously large value
	}
	return hash_table[hash_loc].m_distance;
}

int
main (int argc, char** argv)
{
	CubeState cube1;
	int hash_loc = 0;
	init_hash_table ();
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 0);
	}
	cube1.swap_cubies (3, 5);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 1);
	}
	cube1.swap_cubies (2, 6);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 2);
	}
	cube1.swap_cubies (2, 6);
	if (! hash_table_lookup (cube1, &hash_loc)) {
		add_to_hash_table (cube1, hash_loc, 2);
	} else {
		printf ("Already in hash table! Distance: %d\n", get_distance (cube1));
	}
	cube1.swap_cubies (0, 1);
	int x = get_distance (cube1);
	printf ("Distance (99 means not found): %d\n", x);
	return 0;
}
```


----------



## unsolved (Apr 19, 2014)

qqwref said:


> I've been wondering, how come the first and last digits are *always* the same? Is this a bug? Obviously for any two stickers there is a single move that moves them apart. Perhaps I just don't understand what you're doing.



This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are

1111 1111 1111 1111

The front side = 2, right side = 3, bottom = 4, back = 5, left = 6.

So if you see 1121, that means the top row of stickers on the top face are UUFU. This would be the position after the slice move r. You see so much symmetry in those numbers since there are so few turns made on the cube that are in the database.




qqwref said:


> If you are searching straight through from index_start to index_stop, then you are literally using thousands of times as much time as you should for this task...



Yes, I know. This is more of a "proof of concept" and an easy way to verify the implementation. The program I wrote that generated the data also wrote all of the C code for me, including the matrix and the case statements. What could be easier than copy/paste? 



cuBerBruce said:


> Implementing a hash table is not that difficult. You may be able to use a hash table implementation from an existing library, or you can implement one yourself. In the spoiler is a simple program using my standard hash table code.



Bruce posted code! Yay! 



cuBerBruce said:


> My implementation has a little caveat. Because of the rehash function I use, the size of the table must be a prime number;



I am familiar with both power-of-2 and prime keyed hash tables, I am just lazy  When I write code that writes itself, I am easily amused. I'll get around to a hashing function eventually, and I do appreciate your code post. I'll take a look at it. And, speaking of primes, about a year ago, I found the 84th largest prime number in the world: 7 followed by 902,707 zeroes, then the number 1.

http://primes.utm.edu/primes/page.php?id=114510

And a question for you, sir. I am not sure if I am "allowed" to send messages on here. Nothing I ever write appears in my outbox. Nothing. Ever.

I am still working out the orientation bug, and I think I am getting closer.

Can you please tell me, in your own cubicle designations, the 8 orientations of the cubies after:

U R2 U R F2 R' U' R2 F U R'

And is this a max distance of 11 in your table?

Thanks!


----------



## cuBerBruce (Apr 19, 2014)

unsolved said:


> And, speaking of primes, about a year ago, I found the 84th largest prime number in the world: 7 followed by 902,707 zeroes, then the number 1.


( Off topic: )
A couple days ago I found 2^65125001-1 to be composite. Rats, if it only had turned out to be prime .......


----------



## 10461394944000 (Apr 19, 2014)

unsolved said:


> This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are
> 
> 1111 1111 1111 1111
> 
> ...



wait, are you representing the cube using stickers instead of pieces? that just seems as though it would take longer to implement, be more complicated, and make the code less intuitive to understand (example: "case 1141: index_start = 218184; index_stop = 246384; break;" - it's definitely not obvious what that is supposed to mean)


----------



## qqwref (Apr 19, 2014)

unsolved said:


> This is data after a cube has been turned 1, 2, or 3 times. The initial values for the top face are
> 
> 1111 1111 1111 1111
> 
> ...


Yes, but why do you never have a pattern like 1122 or 1364? The way I understand what you're doing, any sequence of 4 digits (in 1-6) should be possible.

By the way, while writing code with a program may be fun, I don't recommend it for a final version. The most you should do automatically is generate arrays of data. Any code where someone might go "what are all these magic numbers for" is just going to end up hard to maintain, and will probably need to be completely redone whenever you change something.


----------



## unsolved (Apr 20, 2014)

qqwref said:


> Yes, but why do you never have a pattern like 1122 or 1364? The way I understand what you're doing, any sequence of 4 digits (in 1-6) should be possible.



Well if you really want to see the full 4,210,105 characters of text in the entire matrix, here you go (but be prepared for your browser to have a heart attack):

lightningcloudcomputing.com/huge_matrix.txt

You are correct. 1111 to 6666 are possible, with any combination/permutation in between. But a face on the cube looks like this, row by row:

1111
1111
1111
1111

So if I move R', it moves one back row to the top, and the top will look like this:

1115
1115
1115
1115

If I move f next, then the left slice cuts across the top

1115
1115
6666
1115

There are many sequences that don't disturb the top at all, such as U, U', u, u', D, D', d, d', U2, etc. While the rotations move the cubes, the numbers there do not change.



qqwref said:


> By the way, while writing code with a program may be fun, I don't recommend it for a final version. The most you should do automatically is generate arrays of data. Any code where someone might go "what are all these magic numbers for" is just going to end up hard to maintain, and will probably need to be completely redone whenever you change something.



I was a professional coder for a number of years, but thank you. This is a very new project, far from polished, far from finished. To see what one of my totally polished, final products looks like:







Free to download if you like a game that's even more challenging than chess:

http://www.lightningcloudcomputing.com/vortex.zip



10461394944000 said:


> wait, are you representing the cube using stickers instead of pieces? that just seems as though it would take longer to implement, be more complicated, and make the code less intuitive to understand (example: "case 1141: index_start = 218184; index_stop = 246384; break;" - it's definitely not obvious what that is supposed to mean)



I do all of my prototyping at the facet level, or, as you say, "using stickers." It makes the code relatively easy to understand at 2 in the morning when I "have a great idea" 


```
CUBE_4x4_ARRANGEMENT minus_top_face_move(CUBE_4x4_ARRANGEMENT original_4x4x4_cube)
{
	CUBE_4x4_ARRANGEMENT new_cube;

	new_cube = original_4x4x4_cube;

	new_cube.cube_front[0] = original_4x4x4_cube.cube_left[0];
	new_cube.cube_front[1] = original_4x4x4_cube.cube_left[1];
	new_cube.cube_front[2] = original_4x4x4_cube.cube_left[2];
	new_cube.cube_front[3] = original_4x4x4_cube.cube_left[3];

	new_cube.cube_right[0] = original_4x4x4_cube.cube_front[0];
	new_cube.cube_right[1] = original_4x4x4_cube.cube_front[1];
	new_cube.cube_right[2] = original_4x4x4_cube.cube_front[2];
	new_cube.cube_right[3] = original_4x4x4_cube.cube_front[3];

	new_cube.cube_back[0] = original_4x4x4_cube.cube_right[0];
	new_cube.cube_back[1] = original_4x4x4_cube.cube_right[1];
	new_cube.cube_back[2] = original_4x4x4_cube.cube_right[2];
	new_cube.cube_back[3] = original_4x4x4_cube.cube_right[3];

	new_cube.cube_left[0] = original_4x4x4_cube.cube_back[0];
	new_cube.cube_left[1] = original_4x4x4_cube.cube_back[1];
	new_cube.cube_left[2] = original_4x4x4_cube.cube_back[2];
	new_cube.cube_left[3] = original_4x4x4_cube.cube_back[3];

	/*********************************/
	/*       *       *       *       */
	/*  01   *  02   *  03   *   04  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  05   *  06   *  07   *   08  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  09   *  10   *  11   *   12  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  13   *  14   *  15   *   16  */
	/*       *       *       *       */
	/*********************************/


	/*********************************/
	/*       *       *       *       */
	/*  04   *  08   *  12   *   16  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  03   *  07   *  11   *   15  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  02   *  06   *  10   *   14  */
	/*       *       *       *       */
	/*********************************/
	/*       *       *       *       */
	/*  01   *  05   *  09   *   13  */
	/*       *       *       *       */
	/*********************************/

	new_cube.cube_top[1-1] = original_4x4x4_cube.cube_top[4-1];
	new_cube.cube_top[2-1] = original_4x4x4_cube.cube_top[8-1];
	new_cube.cube_top[3-1] = original_4x4x4_cube.cube_top[12-1];
	new_cube.cube_top[4-1] = original_4x4x4_cube.cube_top[16-1];

	new_cube.cube_top[5-1] = original_4x4x4_cube.cube_top[3-1];
	new_cube.cube_top[6-1] = original_4x4x4_cube.cube_top[7-1];
	new_cube.cube_top[7-1] = original_4x4x4_cube.cube_top[11-1];
	new_cube.cube_top[8-1] = original_4x4x4_cube.cube_top[15-1];

	new_cube.cube_top[9-1] = original_4x4x4_cube.cube_top[2-1];
	new_cube.cube_top[10-1] = original_4x4x4_cube.cube_top[6-1];
	new_cube.cube_top[11-1] = original_4x4x4_cube.cube_top[10-1];
	new_cube.cube_top[12-1] = original_4x4x4_cube.cube_top[14-1];

	new_cube.cube_top[13-1] = original_4x4x4_cube.cube_top[1-1];
	new_cube.cube_top[14-1] = original_4x4x4_cube.cube_top[5-1];
	new_cube.cube_top[15-1] = original_4x4x4_cube.cube_top[9-1];
	new_cube.cube_top[16-1] = original_4x4x4_cube.cube_top[13-1];

	return new_cube;
}
```

But I also have a lean, mean bitboard implementation, which is not so easy to read or understand, but it runs much, much faster on massively parallel hardware at my office.


```
CUBE_4x4_BITBOARD_ARRANGEMENT minus_top_face_bitboard_move(CUBE_4x4_BITBOARD_ARRANGEMENT original_4x4x4_bitboard_cube)
{
   CUBE_4x4_BITBOARD_ARRANGEMENT new_bitboard_cube = original_4x4x4_bitboard_cube;

   new_bitboard_cube.cube_face[FRONT_INDEX] = (original_4x4x4_bitboard_cube.cube_face[FRONT_INDEX] & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_bitboard_cube.cube_face[LEFT_INDEX] & BITMASK_CUBE_FACE_ROW_01);
   new_bitboard_cube.cube_face[RIGHT_INDEX] = (original_4x4x4_bitboard_cube.cube_face[RIGHT_INDEX] & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_bitboard_cube.cube_face[FRONT_INDEX] & BITMASK_CUBE_FACE_ROW_01);
   new_bitboard_cube.cube_face[BACK_INDEX]  = (original_4x4x4_bitboard_cube.cube_face[BACK_INDEX]  & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_bitboard_cube.cube_face[RIGHT_INDEX] & BITMASK_CUBE_FACE_ROW_01);
   new_bitboard_cube.cube_face[LEFT_INDEX]  = (original_4x4x4_bitboard_cube.cube_face[LEFT_INDEX]  & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_bitboard_cube.cube_face[BACK_INDEX] & BITMASK_CUBE_FACE_ROW_01);

   /*********************************************************************************/
   /*                                 Rotate the TOP                                */
   /*********************************************************************************/
   /*                                                                               */
   /* THESE CUBE LOCATIONS BECOME....              THESE CUBE LOCATIONS             */
   /*                                                                               */
   /*                                                                               */
   /*********************************/             /*********************************/
   /*  01   *  02   *  03   *   04  */             /*  04   *  08   *  12   *   16  */
   /*********************************/             /*********************************/
   /*  05   *  06   *  07   *   08  */             /*  03   *  07   *  11   *   15  */
   /*********************************/             /*********************************/
   /*  09   *  10   *  11   *   12  */             /*  02   *  06   *  10   *   14  */
   /*********************************/             /*********************************/
   /*  13   *  14   *  15   *   16  */             /*  01   *  05   *  09   *   13  */
   /*********************************/             /*********************************/
   /*                                                                               */
   /*                                                                               */
   /*********************************************************************************/

   new_bitboard_cube.cube_face[TOP_INDEX] = ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_04) << 12) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_08) << 24) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_12) << 36) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_16) << 48) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_03) >> 8)  |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_07) << 4)  |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_11) << 16) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_15) << 28) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_02) >> 28) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_06) >> 16) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_10) >> 4)  |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_14) << 8)  |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_01) >> 48) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_05) >> 36) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_09) >> 24) |\
                                            ((original_4x4x4_bitboard_cube.cube_face[TOP_INDEX] & BITMASK_CUBE_FACE_SQUARE_13) >> 12);

   return new_bitboard_cube;
}
```

You can see the 32 instructions in the array generator have been reduced to 5 instructions in the bitboard implementation.

The bitboard also makes use of these bit patterns...


```
#define BITMASK_CUBE_FACE_SQUARE_01 0xF000000000000000
#define BITMASK_CUBE_FACE_SQUARE_02 0x0F00000000000000
#define BITMASK_CUBE_FACE_SQUARE_03 0x00F0000000000000
#define BITMASK_CUBE_FACE_SQUARE_04 0x000F000000000000

#define BITMASK_CUBE_FACE_SQUARE_05 0x0000F00000000000
#define BITMASK_CUBE_FACE_SQUARE_06 0x00000F0000000000
#define BITMASK_CUBE_FACE_SQUARE_07 0x000000F000000000
#define BITMASK_CUBE_FACE_SQUARE_08 0x0000000F00000000

#define BITMASK_CUBE_FACE_SQUARE_09 0x00000000F0000000
#define BITMASK_CUBE_FACE_SQUARE_10 0x000000000F000000
#define BITMASK_CUBE_FACE_SQUARE_11 0x0000000000F00000
#define BITMASK_CUBE_FACE_SQUARE_12 0x00000000000F0000

#define BITMASK_CUBE_FACE_SQUARE_13 0x000000000000F000
#define BITMASK_CUBE_FACE_SQUARE_14 0x0000000000000F00
#define BITMASK_CUBE_FACE_SQUARE_15 0x00000000000000F0
#define BITMASK_CUBE_FACE_SQUARE_16 0x000000000000000F

#define BITMASK_CUBE_FACE_ROW_01 0xFFFF000000000000
#define BITMASK_CUBE_FACE_ROW_02 0x0000FFFF00000000
#define BITMASK_CUBE_FACE_ROW_03 0x00000000FFFF0000
#define BITMASK_CUBE_FACE_ROW_04 0x000000000000FFFF

#define BITMASK_CUBE_FACE_NOT_ROW_01 0x0000FFFFFFFFFFFF
#define BITMASK_CUBE_FACE_NOT_ROW_02 0xFFFF0000FFFFFFFF
#define BITMASK_CUBE_FACE_NOT_ROW_03 0xFFFFFFFF0000FFFF
#define BITMASK_CUBE_FACE_NOT_ROW_04 0xFFFFFFFFFFFF0000
```

And in other news, I am happy to report that the 4-TFS database is now working. The program solved a swap of 2 centers after a nominal depth of 4 ply 

The program only searched 90,188 nodes to find it.


----------



## cuBerBruce (Apr 20, 2014)

I now have some outer block turn numbers for certain pruning tables. Generally a little better than single slice turn metric.


```
Tripod (1 corner, 6 edge pieces):
dist  0: count =          1 total          1
dist  1: count =         18 total         19
dist  2: count =        297 total        316
dist  3: count =       3882 total       4198
dist  4: count =      43755 total      47953
dist  5: count =     425722 total     473675
dist  6: count =    3355082 total    3828757
dist  7: count =   18539247 total   22368004
dist  8: count =   51632934 total   74000938
dist  9: count =   22867700 total   96868638
dist 10: count =      40482 total   96909120

2 adjacent corners, 2 edges in between, and the 4 center pieces on a shared face
dist  0: count =          1 total          1
dist  1: count =         15 total         16
dist  2: count =        200 total        216
dist  3: count =       2619 total       2835
dist  4: count =      33261 total      36096
dist  5: count =     383470 total     419566
dist  6: count =    3652135 total    4071701
dist  7: count =   23888437 total   27960138
dist  8: count =   69517266 total   97477404
dist  9: count =   25518468 total  122995872
dist 10: count =     180720 total  123176592

3x3x1 block:
dist  0: count =          1 total          1
dist  1: count =         12 total         13
dist  2: count =        182 total        195
dist  3: count =       2792 total       2987
dist  4: count =      39648 total      42635
dist  5: count =     547562 total     590197
dist  6: count =    7107903 total    7698100
dist  7: count =   79470131 total   87168231
dist  8: count =  609252720 total  696420951
dist  9: count = 1648048451 total 2344469402
dist 10: count =  365185325 total 2709654727
dist 11: count =     230297 total 2709885024
```


----------



## unsolved (Apr 21, 2014)

Hey Bruce, how about some of these solve depths for these (otherwise) 8-ply positions?




```
Solution to 4x4x4 cube center scenario U1:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u  L' u' l   [INSIDE 4-turn database] @ 000000000000090188 nodes with 000000006056579994 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U1:F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r  U' l'  [INSIDE 4-turn database] @ 000000000000009661 nodes with 000000002205630687 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U1:F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b  d' b'  [INSIDE 4-turn database] @ 000000000000022702 nodes with 000000002762715046 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U1:F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  l' d2 l   [INSIDE 4-turn database] @ 000000000000012377 nodes with 000000002272872642 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U2:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b  u  b'  [INSIDE 4-turn database] @ 000000000000022615 nodes with 000000002754555146 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U2:F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u  L  u' r'  [INSIDE 4-turn database] @ 000000000000090869 nodes with 000000006078181188 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U2:F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r  d2 r'  [INSIDE 4-turn database] @ 000000000000009863 nodes with 000000002209938994 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U2:F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b' d  b   [INSIDE 4-turn database] @ 000000000000021974 nodes with 000000002724139997 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U3:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  f  u' f'  [INSIDE 4-turn database] @ 000000000000019376 nodes with 000000002572609883 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U3:F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  l' u2 l   [INSIDE 4-turn database] @ 000000000000012296 nodes with 000000002271827056 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U3:F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u' f  u  F   [INSIDE 4-turn database] @ 000000000000118540 nodes with 000000007433147930 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U3:F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  f' d' f   [INSIDE 4-turn database] @ 000000000000020269 nodes with 000000002625283705 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U4:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r  u2 r'  [INSIDE 4-turn database] @ 000000000000009782 nodes with 000000002208891073 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U4:F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  f' u  f   [INSIDE 4-turn database] @ 000000000000020182 nodes with 000000002617121466 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U4:F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  l' U' r   [INSIDE 4-turn database] @ 000000000000012169 nodes with 000000002268309246 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube center scenario U4:F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u  f' u' F'  [INSIDE 4-turn database] @ 000000000000095864 nodes with 000000006349029285 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube scrambled with [9] turns ----> D   l   F2  r   B2  u'  F2  r'  F'  

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|&&&&|~~~~|~~~~|   |OOOO|OOOO|XXXX|^^^^|   |~~~~|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|####|&&&&|~~~~|####|   |^^^^|####|####|####|   |OOOO|OOOO|~~~~|OOOO|
---------------------   ---------------------   ---------------------
|####|&&&&|XXXX|####|   |~~~~|~~~~|^^^^|&&&&|   |####|XXXX|XXXX|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|XXXX|&&&&|OOOO|   |OOOO|OOOO|XXXX|^^^^|   |~~~~|OOOO|OOOO|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|^^^^|^^^^|OOOO|&&&&|   |XXXX|XXXX|####|XXXX|   |OOOO|^^^^|^^^^|####|
---------------------   ---------------------   ---------------------
|~~~~|OOOO|OOOO|~~~~|   |^^^^|&&&&|XXXX|^^^^|   |&&&&|~~~~|####|~~~~|
---------------------   ---------------------   ---------------------
|~~~~|OOOO|^^^^|~~~~|   |&&&&|&&&&|####|&&&&|   |XXXX|^^^^|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|####|####|^^^^|####|   |&&&&|~~~~|OOOO|&&&&|   |XXXX|&&&&|&&&&|####|
---------------------   ---------------------   ---------------------



Solution [001] =  F  r  F2 u  B2  [INSIDE 4-turn database] @ 000000000015566457 nodes with 000000081907605965 4-TFS database probes            
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube scrambled with [9] turns ----> F'  l'  B'  u'  D2  b   F'  d2  B   

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|&&&&|   |XXXX|XXXX|~~~~|^^^^|
---------------------   ---------------------   ---------------------
|XXXX|OOOO|XXXX|^^^^|   |OOOO|^^^^|OOOO|&&&&|   |XXXX|~~~~|&&&&|&&&&|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |&&&&|&&&&|&&&&|&&&&|   |~~~~|OOOO|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|OOOO|~~~~|~~~~|   |OOOO|&&&&|OOOO|&&&&|   |XXXX|^^^^|~~~~|^^^^|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|^^^^|~~~~|&&&&|   |^^^^|####|^^^^|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|&&&&|~~~~|   |~~~~|^^^^|XXXX|&&&&|   |^^^^|####|####|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|####|^^^^|XXXX|   |OOOO|~~~~|XXXX|&&&&|   |^^^^|XXXX|~~~~|####|
---------------------   ---------------------   ---------------------
|~~~~|XXXX|XXXX|~~~~|   |OOOO|&&&&|OOOO|&&&&|   |^^^^|####|XXXX|XXXX|
---------------------   ---------------------   ---------------------



Solution [001] =  B' d2 F  b' u   [INSIDE 4-turn database] @ 000000000021385129 nodes with 000000182948722066 4-TFS database probes            
** 4-TFS database is now off. **
** Search completed. **


Solution to 4x4x4 cube scrambled with [9] turns ----> f'  U   b2  L'  f'  B   f'  D'  f   

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|&&&&|XXXX|XXXX|XXXX|   |~~~~|~~~~|XXXX|XXXX|   |&&&&|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |^^^^|OOOO|OOOO|OOOO|   |XXXX|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|OOOO|~~~~|~~~~|~~~~|   |####|OOOO|OOOO|OOOO|   |XXXX|^^^^|^^^^|~~~~|
---------------------   ---------------------   ---------------------
|OOOO|XXXX|####|####|   |XXXX|^^^^|OOOO|^^^^|   |####|&&&&|####|####|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|OOOO|####|OOOO|   |&&&&|&&&&|&&&&|^^^^|   |####|^^^^|~~~~|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|####|XXXX|^^^^|   |&&&&|&&&&|&&&&|^^^^|   |####|####|XXXX|####|
---------------------   ---------------------   ---------------------
|~~~~|####|####|OOOO|   |&&&&|&&&&|&&&&|####|   |XXXX|XXXX|XXXX|&&&&|
---------------------   ---------------------   ---------------------
|&&&&|####|&&&&|OOOO|   |XXXX|^^^^|&&&&|^^^^|   |~~~~|OOOO|XXXX|OOOO|
---------------------   ---------------------   ---------------------



Solution [001] =  f' D  f2 B'  [INSIDE 4-turn database] @ 000000000000651076 nodes with 000000002878711564 4-TFS database probes               
** 4-TFS database is now off. **
** Search completed. **
```


----------



## cuBerBruce (Apr 21, 2014)

unsolved said:


> Hey Bruce, how about some of these solve depths for these (otherwise) 8-ply positions?


I'm not sure exactly what you want, but I include my solver's output for these positions below.

```
Enter: 5uf2u8u/8l8l/5fu2f8f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        756   solved state checks        168
distance  5   node count       4917   solved state checks        201
distance  6   node count     171219   solved state checks      41226
distance  7   node count    1242078   solved state checks     113106
Found solution: [ 8]  u  L' u' l  u  L  u' l'
Found solution: [ 8]  u' R' u  l  u' R  u  l'
Found solution: [ 8]  u' b' u  F  u' b  u  F'
Found solution: [ 8]  d' b  d  F' d' b' d  F
Found solution: [ 8]  l  F  r' F' l' F  r  F'
Found solution: [ 8]  l' U  r  U' l  U  r' U'
Found solution: [ 8]  r  u2 r' U2 r  u2 r' U2
Found solution: [ 8]  r' b2 r  F2 r' b2 r  F2
Found solution: [ 8]  f  u' f' U' f  u  f' U
Found solution: [ 8]  b  u  b' U  b  u' b' U'
Found solution: [ 8]  b  L' b' l' b  L  b' l
Found solution: [ 8]  b' R' b  l' b' R  b  l
distance  8   node count   23580039   solved state checks    3756066
Enter: 5uf2u8u/8l8l/6fu9f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        762   solved state checks        168
distance  5   node count       5262   solved state checks        189
distance  6   node count     174183   solved state checks      40002
distance  7   node count    1259619   solved state checks     114039
Found solution: [ 8]  U  r  U' l' U  r' U' l
Found solution: [ 8]  U  b' u' b  U' b' u  b
Found solution: [ 8]  U' b' u' b  U  b' u  b
Found solution: [ 8]  U2 b' u' b  U2 b' u  b
Found solution: [ 8]  d' b  d  F2 d' b' d  F2
Found solution: [ 8]  l  u  L' u' l' u  L  u'
Found solution: [ 8]  l  u' R' u  l' u' R  u
Found solution: [ 8]  l' u2 l  U' l' u2 l  U
Found solution: [ 8]  r  b  L  b' r' b  L' b'
Found solution: [ 8]  r  b' R  b  r' b' R' b
Found solution: [ 8]  r' b2 r  F  r' b2 r  F'
Found solution: [ 8]  F  u' b' u  F' u' b  u
Found solution: [ 8]  F' u' b' u  F  u' b  u
Found solution: [ 8]  F' l  F  r' F' l' F  r
Found solution: [ 8]  F2 u' b' u  F2 u' b  u
Found solution: [ 8]  f' u  f  U2 f' u' f  U2
distance  8   node count   23825775   solved state checks    3713097
Enter: 5uf2u8u/8l8l/9fu6f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        846   solved state checks        234
distance  5   node count       4881   solved state checks        168
distance  6   node count     172626   solved state checks      41997
distance  7   node count    1206483   solved state checks     113703
Found solution: [ 8]  U  b  d' b' U' b  d  b'
Found solution: [ 8]  U' b  d' b' U  b  d  b'
Found solution: [ 8]  U2 b  d' b' U2 b  d  b'
Found solution: [ 8]  u' b' u  F2 u' b  u  F2
Found solution: [ 8]  r  d2 r' U  r  d2 r' U'
Found solution: [ 8]  r' b2 r  F' r' b2 r  F
Found solution: [ 8]  F  d' b  d  F' d' b' d
Found solution: [ 8]  F' d' b  d  F  d' b' d
Found solution: [ 8]  F2 d' b  d  F2 d' b' d
Found solution: [ 8]  f  d  f' U2 f  d' f' U2
distance  8   node count   23001456   solved state checks    3639489
Enter: 5uf2u8u/8l8l/8f2fu5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count         90   solved state checks          0
distance  4   node count       3150   solved state checks        669
distance  5   node count      10749   solved state checks        312
distance  6   node count     243339   solved state checks      48288
distance  7   node count    1584474   solved state checks     118113
Found solution: [ 8]  U  l' d2 l  U' l' d2 l
Found solution: [ 8]  U' l' d2 l  U  l' d2 l
Found solution: [ 8]  U2 l' d2 l  U2 l' d2 l
Found solution: [ 8]  u' b' u  F' u' b  u  F
Found solution: [ 8]  d' b  d  F  d' b' d  F'
Found solution: [ 8]  F  r' b2 r  F' r' b2 r
Found solution: [ 8]  F' r' b2 r  F  r' b2 r
Found solution: [ 8]  F2 r' b2 r  F2 r' b2 r
Found solution: [ 8]  f' d' f  U' f' d  f  U
Found solution: [ 8]  b' d  b  U  b' d' b  U'
distance  8   node count   28027737   solved state checks    3965823
Enter: 6uf9u/8l8l/5fu2f8f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        786   solved state checks        168
distance  5   node count       5913   solved state checks        285
distance  6   node count     184194   solved state checks      41991
distance  7   node count    1308462   solved state checks     116874
Found solution: [ 8]  U  b  u  b' U' b  u' b'
Found solution: [ 8]  U' l' U  r  U' l  U  r'
Found solution: [ 8]  U' b  u  b' U  b  u' b'
Found solution: [ 8]  U2 b  u  b' U2 b  u' b'
Found solution: [ 8]  d  b' d' F2 d  b  d' F2
Found solution: [ 8]  l  b2 l' F' l  b2 l' F
Found solution: [ 8]  l' b  L' b' l  b  L  b'
Found solution: [ 8]  l' b' R' b  l  b' R  b
Found solution: [ 8]  r  u2 r' U  r  u2 r' U'
Found solution: [ 8]  r' u  L  u' r  u  L' u'
Found solution: [ 8]  r' u' R  u  r  u' R' u
Found solution: [ 8]  F  u  b  u' F' u  b' u'
Found solution: [ 8]  F  r' F' l  F  r  F' l'
Found solution: [ 8]  F' u  b  u' F  u  b' u'
Found solution: [ 8]  F2 u  b  u' F2 u  b' u'
Found solution: [ 8]  f  u' f' U2 f  u  f' U2
distance  8   node count   24259326   solved state checks    3739824
Enter: 6uf9u/8l8l/6fu9f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        762   solved state checks        168
distance  5   node count       5232   solved state checks        273
distance  6   node count     171396   solved state checks      41526
distance  7   node count    1235328   solved state checks     113286
Found solution: [ 8]  u  L  u' r' u  L' u' r
Found solution: [ 8]  u  b  u' F' u  b' u' F
Found solution: [ 8]  u' R  u  r' u' R' u  r
Found solution: [ 8]  d  b' d' F  d  b  d' F'
Found solution: [ 8]  l  b2 l' F2 l  b2 l' F2
Found solution: [ 8]  l' u2 l  U2 l' u2 l  U2
Found solution: [ 8]  r  U' l' U  r' U' l  U
Found solution: [ 8]  r' F' l  F  r  F' l' F
Found solution: [ 8]  f' u  f  U  f' u' f  U'
Found solution: [ 8]  b  L  b' r  b  L' b' r'
Found solution: [ 8]  b' u' b  U' b' u  b  U
Found solution: [ 8]  b' R  b  r  b' R' b  r'
distance  8   node count   23508282   solved state checks    3767565
Enter: 6uf9u/8l8l/9fu6f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count         90   solved state checks          0
distance  4   node count       3489   solved state checks        777
distance  5   node count      11145   solved state checks        312
distance  6   node count     248913   solved state checks      49371
distance  7   node count    1605327   solved state checks     117621
Found solution: [ 8]  U  r  d2 r' U' r  d2 r'
Found solution: [ 8]  U' r  d2 r' U  r  d2 r'
Found solution: [ 8]  U2 r  d2 r' U2 r  d2 r'
Found solution: [ 8]  u  b  u' F  u  b' u' F'
Found solution: [ 8]  d  b' d' F' d  b  d' F
Found solution: [ 8]  F  l  b2 l' F' l  b2 l'
Found solution: [ 8]  F' l  b2 l' F  l  b2 l'
Found solution: [ 8]  F2 l  b2 l' F2 l  b2 l'
Found solution: [ 8]  f  d  f' U  f  d' f' U'
Found solution: [ 8]  b  d' b' U' b  d  b' U
distance  8   node count   28321017   solved state checks    4013397
Enter: 6uf9u/8l8l/8f2fu5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        822   solved state checks        234
distance  5   node count       4722   solved state checks        156
distance  6   node count     172731   solved state checks      42579
distance  7   node count    1190217   solved state checks     114537
Found solution: [ 8]  U  b' d  b  U' b' d' b
Found solution: [ 8]  U' b' d  b  U  b' d' b
Found solution: [ 8]  U2 b' d  b  U2 b' d' b
Found solution: [ 8]  u  b  u' F2 u  b' u' F2
Found solution: [ 8]  l  b2 l' F  l  b2 l' F'
Found solution: [ 8]  l' d2 l  U' l' d2 l  U
Found solution: [ 8]  F  d  b' d' F' d  b  d'
Found solution: [ 8]  F' d  b' d' F  d  b  d'
Found solution: [ 8]  F2 d  b' d' F2 d  b  d'
Found solution: [ 8]  f' d' f  U2 f' d  f  U2
distance  8   node count   22788132   solved state checks    3652269
Enter: 9uf6u/8l8l/5fu2f8f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        822   solved state checks        234
distance  5   node count       4713   solved state checks        168
distance  6   node count     171690   solved state checks      42036
distance  7   node count    1188441   solved state checks     113292
Found solution: [ 8]  U  f  u' f' U' f  u  f'
Found solution: [ 8]  U' f  u' f' U  f  u  f'
Found solution: [ 8]  U2 f  u' f' U2 f  u  f'
Found solution: [ 8]  d' f' d  F2 d' f  d  F2
Found solution: [ 8]  r  u2 r' U' r  u2 r' U
Found solution: [ 8]  r' f2 r  F  r' f2 r  F'
Found solution: [ 8]  F  u' f  u  F' u' f' u
Found solution: [ 8]  F' u' f  u  F  u' f' u
Found solution: [ 8]  F2 u' f  u  F2 u' f' u
Found solution: [ 8]  b  u  b' U2 b  u' b' U2
distance  8   node count   22812132   solved state checks    3659823
Enter: 9uf6u/8l8l/6fu9f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count         90   solved state checks          0
distance  4   node count       3417   solved state checks        741
distance  5   node count      10974   solved state checks        312
distance  6   node count     242670   solved state checks      46299
distance  7   node count    1598901   solved state checks     115506
Found solution: [ 8]  U  l' u2 l  U' l' u2 l
Found solution: [ 8]  U' l' u2 l  U  l' u2 l
Found solution: [ 8]  U2 l' u2 l  U2 l' u2 l
Found solution: [ 8]  u' f  u  F' u' f' u  F
Found solution: [ 8]  d' f' d  F  d' f  d  F'
Found solution: [ 8]  F  r' f2 r  F' r' f2 r
Found solution: [ 8]  F' r' f2 r  F  r' f2 r
Found solution: [ 8]  F2 r' f2 r  F2 r' f2 r
Found solution: [ 8]  f' u  f  U' f' u' f  U
Found solution: [ 8]  b' u' b  U  b' u  b  U'
distance  8   node count   28283214   solved state checks    4004862
Enter: 9uf6u/8l8l/9fu6f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        750   solved state checks        168
distance  5   node count       5139   solved state checks        273
distance  6   node count     168057   solved state checks      39876
distance  7   node count    1228875   solved state checks     111657
Found solution: [ 8]  u' f  u  F  u' f' u  F'
Found solution: [ 8]  d  R  d' l  d  R' d' l'
Found solution: [ 8]  d' L  d  l  d' L' d  l'
Found solution: [ 8]  d' f' d  F' d' f  d  F
Found solution: [ 8]  l  F' r' F  l' F' r  F
Found solution: [ 8]  l' U' r  U  l  U' r' U
Found solution: [ 8]  r  d2 r' U2 r  d2 r' U2
Found solution: [ 8]  r' f2 r  F2 r' f2 r  F2
Found solution: [ 8]  f  d  f' U' f  d' f' U
Found solution: [ 8]  f  R  f' l' f  R' f' l
Found solution: [ 8]  f' L  f  l' f' L' f  l
Found solution: [ 8]  b  d' b' U  b  d  b' U'
distance  8   node count   23459685   solved state checks    3754896
Enter: 9uf6u/8l8l/8f2fu5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        780   solved state checks        168
distance  5   node count       5784   solved state checks        249
distance  6   node count     179985   solved state checks      40005
distance  7   node count    1298064   solved state checks     114552
Found solution: [ 8]  U  f' d' f  U' f' d  f
Found solution: [ 8]  U' r  U  l' U' r' U  l
Found solution: [ 8]  U' f' d' f  U  f' d  f
Found solution: [ 8]  U2 f' d' f  U2 f' d  f
Found solution: [ 8]  u' f  u  F2 u' f' u  F2
Found solution: [ 8]  l  d  R  d' l' d  R' d'
Found solution: [ 8]  l  d' L  d  l' d' L' d
Found solution: [ 8]  l' d2 l  U  l' d2 l  U'
Found solution: [ 8]  r  f  R' f' r' f  R  f'
Found solution: [ 8]  r  f' L' f  r' f' L  f
Found solution: [ 8]  r' f2 r  F' r' f2 r  F
Found solution: [ 8]  F  d' f' d  F' d' f  d
Found solution: [ 8]  F  l  F' r' F  l' F' r
Found solution: [ 8]  F' d' f' d  F  d' f  d
Found solution: [ 8]  F2 d' f' d  F2 d' f  d
Found solution: [ 8]  b' d  b  U2 b' d' b  U2
distance  8   node count   24171078   solved state checks    3721233
Enter: 8u2uf5u/8l8l/5fu2f8f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count         90   solved state checks          0
distance  4   node count       3168   solved state checks        693
distance  5   node count      10692   solved state checks        312
distance  6   node count     239544   solved state checks      46164
distance  7   node count    1580553   solved state checks     115617
Found solution: [ 8]  U  r  u2 r' U' r  u2 r'
Found solution: [ 8]  U' r  u2 r' U  r  u2 r'
Found solution: [ 8]  U2 r  u2 r' U2 r  u2 r'
Found solution: [ 8]  u  f' u' F  u  f  u' F'
Found solution: [ 8]  d  f  d' F' d  f' d' F
Found solution: [ 8]  F  l  f2 l' F' l  f2 l'
Found solution: [ 8]  F' l  f2 l' F  l  f2 l'
Found solution: [ 8]  F2 l  f2 l' F2 l  f2 l'
Found solution: [ 8]  f  u' f' U  f  u  f' U'
Found solution: [ 8]  b  u  b' U' b  u' b' U
distance  8   node count   28026531   solved state checks    3963075
Enter: 8u2uf5u/8l8l/6fu9f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        852   solved state checks        234
distance  5   node count       4872   solved state checks        144
distance  6   node count     171975   solved state checks      41352
distance  7   node count    1204926   solved state checks     110571
Found solution: [ 8]  U  f' u  f  U' f' u' f
Found solution: [ 8]  U' f' u  f  U  f' u' f
Found solution: [ 8]  U2 f' u  f  U2 f' u' f
Found solution: [ 8]  d  f  d' F2 d  f' d' F2
Found solution: [ 8]  l  f2 l' F' l  f2 l' F
Found solution: [ 8]  l' u2 l  U  l' u2 l  U'
Found solution: [ 8]  F  u  f' u' F' u  f  u'
Found solution: [ 8]  F' u  f' u' F  u  f  u'
Found solution: [ 8]  F2 u  f' u' F2 u  f  u'
Found solution: [ 8]  b' u' b  U2 b' u  b  U2
distance  8   node count   23055027   solved state checks    3650946
Enter: 8u2uf5u/8l8l/9fu6f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        750   solved state checks        168
distance  5   node count       5199   solved state checks        201
distance  6   node count     171234   solved state checks      38628
distance  7   node count    1253829   solved state checks     112764
Found solution: [ 8]  U  l' U' r  U  l  U' r'
Found solution: [ 8]  U  f  d  f' U' f  d' f'
Found solution: [ 8]  U' f  d  f' U  f  d' f'
Found solution: [ 8]  U2 f  d  f' U2 f  d' f'
Found solution: [ 8]  u  f' u' F2 u  f  u' F2
Found solution: [ 8]  l  f2 l' F  l  f2 l' F'
Found solution: [ 8]  l' f  R  f' l  f  R' f'
Found solution: [ 8]  l' f' L  f  l  f' L' f
Found solution: [ 8]  r  d2 r' U' r  d2 r' U
Found solution: [ 8]  r' d  R' d' r  d  R  d'
Found solution: [ 8]  r' d' L' d  r  d' L  d
Found solution: [ 8]  F  d  f  d' F' d  f' d'
Found solution: [ 8]  F' d  f  d' F  d  f' d'
Found solution: [ 8]  F' r' F  l  F' r  F  l'
Found solution: [ 8]  F2 d  f  d' F2 d  f' d'
Found solution: [ 8]  b  d' b' U2 b  d  b' U2
distance  8   node count   23738097   solved state checks    3687081
Enter: 8u2uf5u/8l8l/8f2fu5f/8r8r/8b8b/8d8d
distance  1   node count          0   solved state checks          0
distance  2   node count          0   solved state checks          0
distance  3   node count          0   solved state checks          0
distance  4   node count        756   solved state checks        168
distance  5   node count       4884   solved state checks        189
distance  6   node count     168099   solved state checks      39606
distance  7   node count    1236513   solved state checks     111342
Found solution: [ 8]  u  f' u' F' u  f  u' F
Found solution: [ 8]  d  R' d' r' d  R  d' r
Found solution: [ 8]  d  f  d' F  d  f' d' F'
Found solution: [ 8]  d' L' d  r' d' L  d  r
Found solution: [ 8]  l  f2 l' F2 l  f2 l' F2
Found solution: [ 8]  l' d2 l  U2 l' d2 l  U2
Found solution: [ 8]  r  U  l' U' r' U  l  U'
Found solution: [ 8]  r' F  l  F' r  F  l' F'
Found solution: [ 8]  f  R' f' r  f  R  f' r'
Found solution: [ 8]  f' d' f  U  f' d  f  U'
Found solution: [ 8]  f' L' f  r  f' L  f  r'
Found solution: [ 8]  b' d  b  U' b' d' b  U
distance  8   node count   23522076   solved state checks    3739134
Enter: D l F2 r B2 u' F2 r' F'
scramble: [ 9]  D  l  F2 r  B2 u' F2 r' F'
distance  4   node count          0   solved state checks          0
distance  5   node count          0   solved state checks          0
distance  6   node count          0   solved state checks          0
distance  7   node count        150   solved state checks          0
distance  8   node count       5757   solved state checks        108
Found solution: [ 9]  F  r  F2 u  B2 r' F2 l' D'
distance  9   node count     161349   solved state checks       1404
Enter: F' l' B' u' D2 b F' d2 B
scramble: [ 9]  F' l' B' u' D2 b  F' d2 B
distance  5   node count          0   solved state checks          0
distance  6   node count         84   solved state checks          0
distance  7   node count        960   solved state checks          0
distance  8   node count      19503   solved state checks          0
Found solution: [ 9]  B' d2 F  b' u  D2 B  l  F
Found solution: [ 9]  B' d2 f' B  l  R2 B  d  F
distance  9   node count     366252   solved state checks         54
Enter: f'  U   b2  L'  f'  B   f'  D'  f
scramble: [ 9]  f' U  b2 L' f' B  f' D' f
distance  6   node count        156   solved state checks          0
distance  7   node count       2184   solved state checks          0
Found solution: [ 8]  f' D  f2 B' L  b2 U' f
distance  8   node count      38019   solved state checks         33
```


----------



## unsolved (Apr 21, 2014)

I actually was not in need of anything that time  I was just surprised at the node counts for the 8-ply solutions that were found:


```
Solution [001] =  U  r  U' l'  [INSIDE 4-turn database] @ 9661 nodes 
Solution [001] =  U  b  d' b'  [INSIDE 4-turn database] @ 22702 nodes
Solution [001] =  U  l' d2 l   [INSIDE 4-turn database] @ 12377 nodes
Solution [001] =  U  b  u  b'  [INSIDE 4-turn database] @ 22615 nodes
Solution [001] =  u  L  u' r'  [INSIDE 4-turn database] @ 90869 nodes
```

Recall, this is *WITHOUT *any corner cubie pruning from my bloated tree where 8 plies would otherwise be huge.

Now what I have to do is write some code to get the rest of the move solution out of the 4-TFS database. Right now I only check to see if the positions match, and the search retreats.


----------



## rokicki (Apr 21, 2014)

> Solution [001] = u L' u' l [INSIDE 4-turn database] @ 000000000000090188 nodes with 000000006056579994 4-TFS database probes



What's your definition of a node, and a probe? Here it looks like your probe count is some 60K greater than your
node count. Normally the probe count should be a small multiple (2?) of the node count, depending on how you
are doing your search.

It might be illustrative to add real time values as well (3.4 seconds, etc.)

-tom


----------



## cuBerBruce (Apr 21, 2014)

unsolved said:


> I was just surprised at the node counts for the 8-ply solutions that were found:


Well, part of the reason (it looks to me) is that you're only counting nodes until you find the first solution. I would assume you would have 1 + 36 + 1,026 + 28.836 + 810.891 = 840790 nodes (minus one if you don't count the starting position, or 810,891 if only counting depth 4 leaf nodes) if you continued to search for all optimal solutions of the distance 8 positions (generating all depth 4 leaf nodes). These "center swaps" have several optimal solutions, so you expect to find the first solution somewhat early in the search.

Its interesting that the first solution found by my program in each case matches the solution your program found. We must be enumerating the 36 moves in the same or close to the same order.

EDIT (appending):
By the way, in single slice turn metric, the number of unique positions (if you consider the orientation of the cube doesn't matter) for distances up to 7 moves is given below. The table below also shows symmetry-reduced counts.


```
moves  positions  cumulative   positions  cumulative pos.
                   positions     mod M         mod M

  0            1           1           1              1
  1           36          37           4              5
  2          999        1036          36             41
  3        27186       28222         619            660
  4       738096      766318       15771          16431
  5     20000066    20766384      418952         435383
  6    541569809   562336193    11297967       11733350
  7  14661687334 15224023527   305559127      317292477
```


----------



## unsolved (Apr 21, 2014)

rokicki said:


> What's your definition of a node, and a probe? Here it looks like your probe count is some 60K greater than your
> node count.



A node is just a cube position encountered at depth == 0 where move generation stops and comparison for a solved state is done.

A probe counts every cube position in the RAM database that is searched, whether found or not. Recall this is a Karnaugh Map reduction of the entire database of cubes, and each entry in the database is just one row of one side of the cube. That means I need to scan 24 database entries (4 rows x 6 faces) to get a match. But, I can scan as few as 1 entry to get a "miss" and not need to scan the other 23. Again, this was a mindless implementation where I wrote code that wrote itself. It would have been impossible to type all of this myself:

*Warning, 4.8 million bytes of text, will require a bit of time to load on a slow connection*

http://lightningcloudcomputing.com/huge_matrix.txt

Here is the code for probing all of the cubes that are one turn away from being solved (much smaller than the 3-turns-from-solved link above)


```
current_cube_row_data = cube_row_to_4_digit_number(your_cube.cube_top[0], your_cube.cube_top[1], your_cube.cube_top[2], your_cube.cube_top[3]);

		switch(current_cube_row_data)
		{
			case 1111: index_start = 0; index_stop = 552; break;
			case 1121: index_start = 576; index_stop = 576; break; 
			case 1141: index_start = 600; index_stop = 600; break;
			case 1151: index_start = 624; index_stop = 624; break;
			case 1211: index_start = 648; index_stop = 648; break;
			case 1411: index_start = 672; index_stop = 672; break;
			case 1511: index_start = 696; index_stop = 696; break;
			case 2112: index_start = 720; index_stop = 720; break;
			case 3333: index_start = 744; index_stop = 744; break;
			case 4114: index_start = 768; index_stop = 768; break;
			case 4444: index_start = 792; index_stop = 792; break;
			case 5115: index_start = 816; index_stop = 816; break;
			case 6666: index_start = 840; index_stop = 840; break;
			default: goto test_tfs_02; break;
		}
```

You can see I just obtain a 4-digit number that represents row 1 of the top face. If it does not match any of the 4-digit numbers in the case statements (1111 = all cubes are from the top face, 6666 = all are from the left face) then I know it is not in the 1-TFS database and I can skip to the 2-TFS database. If I do get a hit (top row matches) then the start and stop ranges are where in the matrix I need to scan to look for a cube match. 



rokicki said:


> It might be illustrative to add real time values as well (3.4 seconds, etc.)



Once I convert the database output to a hash function, and implement the corner pruning mechanism, I will. But you can see how slow the program is if you download it yourself. Go to the first post here, that link always has the latest version.




cuBerBruce said:


> Well, part of the reason (it looks to me) is that you're only counting nodes until you find the first solution. I would assume you would have 1 + 36 + 1,026 + 28.836 + 810.891 = 840790 nodes (minus one if you don't count the staring position, or 810,891 if only counting depth 4 leaf nodes) if you continued to search for all optimal solutions of the distance 8 positions (generating all depth 4 leaf nodes). These "center swaps" have several optimal solutions, so you expect to find the first solution somewhat early in the search.




```
Completed searching 00000000000001 nodes through DEPTH 00
Completed searching 00000000000036 nodes through DEPTH 01
Completed searching 00000000001026 nodes through DEPTH 02
Completed searching 00000000028836 nodes through DEPTH 03
Completed searching 00000000810891 nodes through DEPTH 04
Completed searching 00000022803120 nodes through DEPTH 05
Completed searching 00000641245896 nodes through DEPTH 06
Completed searching 00018032462352 nodes through DEPTH 07
Completed searching 00507090491478 nodes through DEPTH 08
```

Yes, I just wanted to see how soon in the tree the databases would come into play. Remember, this is all part of the experimental stages to see what works and what doesn't. Optimization for faster execution comes later, once I know it is worth implementing. I think this feature will be worth the trouble 



cuBerBruce said:


> Its interesting that the first solution found by my program in each case matches the solution your program found. We must be enumerating the 36 moves in the same or close to the same order.



I implemented a great suggestion by Jakube: re-order the move generator by "move group" to avoid the need to post-prune altogether.


```
typedef CUBE_4x4_ARRANGEMENT (*cube_move_ptr)(CUBE_4x4_ARRANGEMENT);
cube_move_ptr cube_move_array[GLOBAL_TOTAL_LEGAL_MOVES_PER_POSITION];

void init_axis_move_data(void)
{
	GLOBAL_AXIS_ROTATION[0][0][0] = U___PLUS____;
	GLOBAL_AXIS_ROTATION[0][0][1] = U___MINUS___;
	GLOBAL_AXIS_ROTATION[0][0][2] = U___TWICE___;
	GLOBAL_AXIS_ROTATION[0][1][0] = u___PLUS____;
	GLOBAL_AXIS_ROTATION[0][1][1] = u___MINUS___;
	GLOBAL_AXIS_ROTATION[0][1][2] = u___TWICE___;
	GLOBAL_AXIS_ROTATION[0][2][0] = D___PLUS____;
	GLOBAL_AXIS_ROTATION[0][2][1] = D___MINUS___;
	GLOBAL_AXIS_ROTATION[0][2][2] = D___TWICE___;
	GLOBAL_AXIS_ROTATION[0][3][0] = d___PLUS____;
	GLOBAL_AXIS_ROTATION[0][3][1] = d___MINUS___;
	GLOBAL_AXIS_ROTATION[0][3][2] = d___TWICE___;
	GLOBAL_AXIS_ROTATION[1][0][0] = R___PLUS____;
	GLOBAL_AXIS_ROTATION[1][0][1] = R___MINUS___;
	GLOBAL_AXIS_ROTATION[1][0][2] = R___TWICE___;
	GLOBAL_AXIS_ROTATION[1][1][0] = r___PLUS____;
	GLOBAL_AXIS_ROTATION[1][1][1] = r___MINUS___;
	GLOBAL_AXIS_ROTATION[1][1][2] = r___TWICE___;
	GLOBAL_AXIS_ROTATION[1][2][0] = l___PLUS____;
	GLOBAL_AXIS_ROTATION[1][2][1] = l___MINUS___;
	GLOBAL_AXIS_ROTATION[1][2][2] = l___TWICE___;
	GLOBAL_AXIS_ROTATION[1][3][0] = L___PLUS____;
	GLOBAL_AXIS_ROTATION[1][3][1] = L___MINUS___;
	GLOBAL_AXIS_ROTATION[1][3][2] = L___TWICE___;
	GLOBAL_AXIS_ROTATION[2][0][0] = F___PLUS____;
	GLOBAL_AXIS_ROTATION[2][0][1] = F___MINUS___;
	GLOBAL_AXIS_ROTATION[2][0][2] = F___TWICE___;
	GLOBAL_AXIS_ROTATION[2][1][0] = f___PLUS____;
	GLOBAL_AXIS_ROTATION[2][1][1] = f___MINUS___;
	GLOBAL_AXIS_ROTATION[2][1][2] = f___TWICE___;
	GLOBAL_AXIS_ROTATION[2][2][0] = B___PLUS____;
	GLOBAL_AXIS_ROTATION[2][2][1] = B___MINUS___;
	GLOBAL_AXIS_ROTATION[2][2][2] = B___TWICE___;
	GLOBAL_AXIS_ROTATION[2][3][0] = b___PLUS____;
	GLOBAL_AXIS_ROTATION[2][3][1] = b___MINUS___;
	GLOBAL_AXIS_ROTATION[2][3][2] = b___TWICE___;
}

void init_function_pointers(void)
{
	cube_move_array[U___PLUS____] = plus_top_face_move;
	cube_move_array[U___MINUS___] = minus_top_face_move;
	cube_move_array[U___TWICE___] = double_top_face_move;

/* etc etc, a function for each move indexed by the appropriate constant */

}

for(axis_of_rotation = 0; axis_of_rotation < 3; axis_of_rotation++)
			for(move_group = 0; move_group < 4; move_group++)
			{
				if((axis_of_rotation != last_move_axis) || ((axis_of_rotation == last_move_axis) && (move_group > last_move_group)))
				{
					for(move_index = 0; move_index < 3; move_index++)
					{
						which_move_to_make = GLOBAL_AXIS_ROTATION[axis_of_rotation][move_group][move_index];
						modified_cube = cube_move_array[which_move_to_make](which_cube);


						if(GLOBAL_HALT == 1) return;
						search_tree(modified_cube, which_depth-1, axis_of_rotation, move_group, which_move_to_make, unchanging_depth);
					}
				}
			}
	}
```


----------



## cuBerBruce (Apr 22, 2014)

rokicki said:


> Another easy pruning heuristic that doesn't even require a nontrivial table is this.
> This works best in the outer block turn metric, which is my favorite.
> 
> For every corner->edge pair that should be adjacent, and every edge->edge
> ...


For outer block turn metric, the true face turns (single layer) affect only the count of corner-edge pairs that are paired up. The wide turns (two layers) affect only the number of dedges that are paired up. Further, the last face turn always changes the number of corner-edge pairs that are paired up from 20 to 24. The last wide turn always changes the number of paired up dedges from 8 to 12.

Based on the above, you can create a table of lower bounds for the number of face turns and wide turns needed based upon the number of paired up corner-edge pairs and number of paired up dedges, respectively. You can add these two lower bounds to get a lower bound for the total number of outer block turns needed.


----------



## rokicki (Apr 22, 2014)

cuBerBruce said:


> For outer block turn metric, the true face turns (single layer) affect only the count of corner-edge pairs that are paired up. The wide turns (two layers) affect only the number of dedges that are paired up. Further, the last face turn always changes the number of corner-edge pairs that are paired up from 20 to 24. The last wide turn always changes the number of paired up dedges from 8 to 12.
> 
> Based on the above, you can create a table of lower bounds for the number of face turns and wide turns needed based upon the number of paired up corner-edge pairs and number of paired up dedges, respectively. You can add these two lower bounds to get a lower bound for the total number of outer block turns needed.



Indeed! And you can easily determine from a given position what the "after-the-move" pairings are, without actually doing the move,
so you can "look ahead" this way and get greater depths.

Indeed, you can identify the distance for each pairing, and which moves reduce those distances for each pairs, to possibly do even
more than that. I'm thinking one quick lookup in a small table for each pairing (36 pairings) and then some magic happens and
out pops distances of 10 or 11---maybe even 12. And this is probably highly parallel, possibly even permitting the use of SIMD.

I've looked at some sample random positions on a real cube from real scramblings and it's pretty clear 10 is the most likely value
just using the straightforward approach. I'm wondering how much complexity I have to introduce to get 11.


----------



## unsolved (Apr 25, 2014)

rokicki said:


> Indeed! And you can easily determine from a given position what the "after-the-move" pairings are, without actually doing the move,
> so you can "look ahead" this way and get greater depths.



I can now solve most 11-ply positions in 5 seconds or less.

I have successfully completed loading the 6-TFS database into a RAM buffer (it is 14 GB, about 23.69 bytes per position on average).
It solves 10-ply positions as soon as I launch the program, every time.






There is one annoying "feature" right now: The principal variation displays incorrect sequences once the database is polled. This is either a "fence post error" (one of my indices into the move list is off by one) or the indexing function pointer is getting clobbered after the solution is obtained.

The new version of the program will attempt to generate either a 5-TFS database (if you have 505 MB of RAM free) or a 6-TFS database (if you have 14 GB free) on startup. 
It still does not do any of the leaf node pruning that Bruce has. That is next on my to-do list once I nail this database access bug.

One cool thing is: It will find every possible permutation of a solution that enters a database. This might lead to some interesting, as-of-yet unseen algo.






Current version is here. It launches, and goes into a "demo mode" for now. I'll be adding an "enter scramble" interface today.

http://www.lightningcloudcomputing.com/OO_4x4x4.zip


----------



## Carrot (Apr 26, 2014)

unsolved said:


> ....



http://imgur.com/a/1aKRR

after 1-2 hours of running.


----------



## cuBerBruce (Apr 26, 2014)

unsolved said:


> There is one annoying "feature" right now: The principal variation displays incorrect sequences once the database is polled. This is either a "fence post error" (one of my indices into the move list is off by one) or the indexing function pointer is getting clobbered after the solution is obtained.



Well, you're program appears to be displaying the "generator sequence" for the positions in the TFS-database. You need to invert the sequence so that the "solver sequence" is displayed. As is, in order to apply the actual solution, you need to apply the first sequence, and then the inverse of the 2nd sequence. Or, if you have a solved cube and want to generate the postion, apply the second sequence (forward, as is), and then the inverse of the first sequence. Or perhaps you understand that, and are talking about something not apparent from what you're showing here.



Carrot said:


> after 1-2 hours of running.



Is you hard disk drive access light glowing? If your system is trying to use disk to make up for a lack of sufficient physical RAM to hold the data its trying to store in memory, its probably not worth trying to run the program.


----------



## unsolved (Apr 26, 2014)

cuBerBruce said:


> Well, you're program appears to be displaying the "generator sequence" for the positions in the TFS-database. You need to invert the sequence so that the "solver sequence" is displayed.




Bruuuuuuuuuuuuuuuuuuuuuuuuuce!!! Did I mention you are my new best friend???!!! I have been staring at the screen, debugging the heck out of the indexing functions, the loader/retriever calls.... and there you go, finding my problem by inspection!!!

Way to go dude!!!!




Carrot said:


> http://imgur.com/a/1aKRR
> 
> after 1-2 hours of running.



I timed it on my machine, it took 3:44 to load and start running (minutes and seconds). It looks like the character buffer overloaded on your screen, so I made the display a little smaller.

*UPDATE: BUG FIX! Thanks Bruce*

http://www.lightningcloudcomputing.com/OO_4x4x4.zip

Now this program is cranking at some serious solve speed, plus posting correct solves!


```
Solution to 4x4x4 cube Position asked by CMHardW

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|XXXX|OOOO|   |XXXX|####|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  f' l  F2 ---> l' f  l  F2 l' U'  [6-turn database] @ 0000000000020637 nodes with 0000000000216730 6-TFS probes            
Solution [002] =  U' b' R2 b  ---> l  R' D  L' B' f   [6-turn database] @ 0000000000048227 nodes with 0000000000333754 6-TFS probes            
Solution [003] =  u  r' F2 r  ---> f  r' F2 r  f' u'  [6-turn database] @ 0000000000086680 nodes with 0000000000496896 6-TFS probes            
Solution [004] =  u' r' f  R2 ---> D2 l  r  f' r2 F2  [6-turn database] @ 0000000000110256 nodes with 0000000000599295 6-TFS probes            
Solution [005] =  R  u' b  U2 ---> b' u  b  U2 b' R'  [6-turn database] @ 0000000000274629 nodes with 0000000001304919 6-TFS probes            
Solution [006] =  R' d' F2 d  ---> f  d' F2 d  f' R   [6-turn database] @ 0000000000302132 nodes with 0000000001422774 6-TFS probes            
Solution [007] =  r  f' U2 f  ---> R2 d  r' u  U  r2  [6-turn database] @ 0000000000366103 nodes with 0000000001699334 6-TFS probes            
Solution [008] =  r' f' u  F2 ---> u' f  u  F2 u' r   [6-turn database] @ 0000000000389676 nodes with 0000000001800368 6-TFS probes            
Solution [009] =  F  r' d  R2 ---> r' B' U' L  d2 f'  [6-turn database] @ 0000000000554046 nodes with 0000000002510352 6-TFS probes            
Solution [010] =  F' l' U2 l  ---> ^^^^^^ [6-turn database] @ 0000000000581636 nodes with 0000000002628790 6-TFS probes                        
Solution [011] =  f  u' R2 u  ---> r  u' R2 u  r' f'  [6-turn database] @ 0000000000622600 nodes with 0000000002807208 6-TFS probes            
Solution [012] =  f' u' r  U2 ---> ^^^^^^ [6-turn database] @ 0000000000646176 nodes with 0000000002909583 6-TFS probes                        
** Search completed. **


Solution to 4x4x4 cube center scenario U1,U2 vs. F1,F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U2 r  f2 ---> l  r' f2 l' U2 r'  [6-turn database] @ 0000000000350682 nodes with 0000000001638338 6-TFS probes            
Solution [002] =  r  U2 l  f2 ---> ^^^^^^ [6-turn database] @ 0000000000350796 nodes with 0000000001638834 6-TFS probes                        
Solution [003] =  r' F2 r' d2 ---> l' r  d2 l  F2 r   [6-turn database] @ 0000000000388272 nodes with 0000000001799448 6-TFS probes            
Solution [004] =  r' F2 l' d2 ---> l  r' d2 r  F2 r   [6-turn database] @ 0000000000388332 nodes with 0000000001799697 6-TFS probes            
Solution [005] =  l' U2 r' f2 ---> f  L' U2 F' L' f2  [6-turn database] @ 0000000000421344 nodes with 0000000001941269 6-TFS probes            
Solution [006] =  l' U2 l' f2 ---> u2 f2 L  B  D2 b'  [6-turn database] @ 0000000000421401 nodes with 0000000001941548 6-TFS probes            
Solution [007] =  l  F2 r  d2 ---> ^^^^^^ [6-turn database] @ 0000000000454338 nodes with 0000000002083988 6-TFS probes                        
Solution [008] =  l  F2 l  d2 ---> B' D' F2 U  F2 L'  [6-turn database] @ 0000000000454455 nodes with 0000000002084403 6-TFS probes            
** Search completed. **


Solution to 4x4x4 cube center scenario U1,U2 vs. F1,F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  r' U2 ---> L2 b2 F' U  r  R   [6-turn database] @ 0000000000000375 nodes with 0000000000006309 6-TFS probes               
Solution [002] =  U  B2 D2 ---> B2 d' F  U' b  F'  [6-turn database] @ 0000000000000915 nodes with 0000000000008319 6-TFS probes               
** Search completed. **


Solution to 4x4x4 cube center scenario U1,U2 vs. F1,F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r' F' l' b2 l  ---> F' r' b2 r  F2 r   [6-turn database] @ 0000000010894745 nodes with 0000000050338305 6-TFS probes         
Solution [002] =  r' F2 r' b2 r  ---> ^^^^^^ [6-turn database] @ 0000000010919203 nodes with 0000000050443435 6-TFS probes                     
Solution [003] =  r2 U2 B  r' u2 ---> r2 u2 r' B' U2 r2  [6-turn database] @ 0000000011200680 nodes with 0000000051647933 6-TFS probes         
Solution [004] =  r2 D2 F  l' u2 ---> l2 u2 l' F' D2 r2  [6-turn database] @ 0000000011384628 nodes with 0000000052434368 6-TFS probes         
Solution [005] =  r2 F  D2 l' u2 ---> l2 u2 l' D2 F' r2  [6-turn database] @ 0000000011524326 nodes with 0000000053033998 6-TFS probes         
Solution [006] =  r2 B  U2 r' u2 ---> B2 F  d  U2 r  f   [6-turn database] @ 0000000011749284 nodes with 0000000054003677 6-TFS probes         
Solution [007] =  l' U' l' d2 l  ---> ^^^^^^ [6-turn database] @ 0000000011823932 nodes with 0000000054328802 6-TFS probes                     
Solution [008] =  l' U2 r' d2 r  ---> B2 d2 l2 b2 U  F'  [6-turn database] @ 0000000011848309 nodes with 0000000054432007 6-TFS probes         
Solution [009] =  l2 U2 B  l' d2 ---> l2 d2 l' B' U2 l2  [6-turn database] @ 0000000013059369 nodes with 0000000059630630 6-TFS probes         
Solution [010] =  l2 D2 F  r' d2 ---> r2 d2 r' F' D2 l2  [6-turn database] @ 0000000013243197 nodes with 0000000060423666 6-TFS probes         
Solution [011] =  l2 F  D2 r' d2 ---> r2 d2 r' D2 F' l2  [6-turn database] @ 0000000013319067 nodes with 0000000060746612 6-TFS probes         
Solution [012] =  l2 B  U2 l' d2 ---> D  L  D  b  f  L2  [6-turn database] @ 0000000013544145 nodes with 0000000061719647 6-TFS probes         
** Search completed. **


Solution to 4x4x4 cube center scenario U1,U2 vs. F2,F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U  r  d2 r' ---> U  l  d2 l' U2 r'  [6-turn database] @ 0000000009809081 nodes with 0000000045714936 6-TFS probes         
Solution [002] =  r  U2 l  d2 l' ---> ^^^^^^ [6-turn database] @ 0000000009864460 nodes with 0000000045951147 6-TFS probes                     
Solution [003] =  r2 U2 B' r  d2 ---> r2 d2 r  B  U2 r2  [6-turn database] @ 0000000011199969 nodes with 0000000051690270 6-TFS probes         
Solution [004] =  r2 D2 F' l  d2 ---> ^^^^^^ [6-turn database] @ 0000000011385585 nodes with 0000000052486619 6-TFS probes                     
Solution [005] =  r2 F' D2 l  d2 ---> L  D  L2 d' r  F2  [6-turn database] @ 0000000011550411 nodes with 0000000053195322 6-TFS probes         
Solution [006] =  r2 B' U2 r  d2 ---> ^^^^^^ [6-turn database] @ 0000000011730033 nodes with 0000000053966215 6-TFS probes                     
Solution [007] =  l  F  r  b2 r' ---> F  l  b2 l' F2 l'  [6-turn database] @ 0000000012724883 nodes with 0000000058232998 6-TFS probes         
Solution [008] =  l  F2 l  b2 l' ---> F' r  b2 r' F' l'  [6-turn database] @ 0000000012780181 nodes with 0000000058470041 6-TFS probes         
Solution [009] =  l2 U2 B' l  u2 ---> D' F2 L' l' B  b   [6-turn database] @ 0000000013058709 nodes with 0000000059670258 6-TFS probes         
Solution [010] =  l2 D2 F' r  u2 ---> ^^^^^^ [6-turn database] @ 0000000013244091 nodes with 0000000060459532 6-TFS probes                     
Solution [011] =  l2 F' D2 r  u2 ---> r2 u2 r  D2 F  l2  [6-turn database] @ 0000000013345089 nodes with 0000000060889730 6-TFS probes         
Solution [012] =  l2 B' U2 l  u2 ---> ^^^^^^ [6-turn database] @ 0000000013524945 nodes with 0000000061658122 6-TFS probes                     
** Search completed. **
```

You can see there is still one bug, the "^^^^^^" getting printed out from the database hit sometimes. I am taking a look at that now.


Update! Finally fixed it! I did not convert the index from the database correctly when reading in the entries in inverted order sometimes (when they were not in the first or second dimension of the linked list, I had to hunt for it and converted the 3rd index dimension incorrectly!)

Check out this arrangement: There are 158 solutions!


```
Solution to 4x4x4 cube center scenario U1,U3 vs. F1,F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U' r  U2 r' U' l' ---> U  r  U2 r' U  l   [6-turn database] @ 0000000028268590 nodes with 0000000222862770 6-TFS probes   
Solution [002] =  U' r  b' U  b  l' ---> b' U' b  r' U  l   [6-turn database] @ 0000000028747396 nodes with 0000000224919648 6-TFS probes   
Solution [003] =  U' r  b  U  b' l' ---> b  U' b' r' U  l   [6-turn database] @ 0000000028768645 nodes with 0000000225009115 6-TFS probes   
Solution [004] =  U' l' U  r' b2 l2 ---> D  l  D' r  b2 l2  [6-turn database] @ 0000000030203472 nodes with 0000000231160023 6-TFS probes   
Solution [005] =  U' b' r  U  b  l' ---> b' U' r' b  U  l   [6-turn database] @ 0000000038142586 nodes with 0000000265243417 6-TFS probes   
Solution [006] =  U' b  r  U  b' l' ---> b  U' r' b' U  l   [6-turn database] @ 0000000038740825 nodes with 0000000267808287 6-TFS probes   
Solution [007] =  u' b' u  F' u' f  ---> b  u  F  u' f' u   [6-turn database] @ 0000000095728741 nodes with 0000000512533778 6-TFS probes   
Solution [008] =  u' b' u  F' u' b  ---> f  u  F  u' f' u   [6-turn database] @ 0000000095728745 nodes with 0000000512533786 6-TFS probes   
Solution [009] =  u2 F' f2 U2 f2 r' ---> f2 r  U2 f2 F  u2  [6-turn database] @ 0000000111392789 nodes with 0000000579820768 6-TFS probes   
Solution [010] =  u2 F' f2 D2 r  b2 ---> r' b2 D2 f2 F  u2  [6-turn database] @ 0000000111399228 nodes with 0000000579847933 6-TFS probes   
Solution [011] =  u2 F' b2 U2 b2 r  ---> b2 r' U2 b2 F  u2  [6-turn database] @ 0000000111458968 nodes with 0000000580105867 6-TFS probes   
Solution [012] =  u2 F' b2 D2 r' f2 ---> r  f2 D2 b2 F  u2  [6-turn database] @ 0000000111465351 nodes with 0000000580133062 6-TFS probes   
Solution [013] =  u2 f2 U2 F' f2 r' ---> f2 r  F  U2 f2 u2  [6-turn database] @ 0000000113662373 nodes with 0000000589555038 6-TFS probes   
Solution [014] =  u2 f2 U2 f2 B' r  ---> f2 r' B  U2 f2 u2  [6-turn database] @ 0000000113665921 nodes with 0000000589569431 6-TFS probes   
Solution [015] =  u2 f2 D2 F' r  b2 ---> r' b2 F  D2 f2 u2  [6-turn database] @ 0000000113854212 nodes with 0000000590373427 6-TFS probes   
Solution [016] =  u2 f2 D2 B' r' b2 ---> r  B  b2 D2 f2 u2  [6-turn database] @ 0000000113860875 nodes with 0000000590402273 6-TFS probes   
Solution [017] =  u2 f2 B' U2 f2 r  ---> f2 r' U2 B  f2 u2  [6-turn database] @ 0000000114199168 nodes with 0000000591846569 6-TFS probes   
Solution [018] =  u2 f2 B' D2 r' b2 ---> r  b2 D2 B  f2 u2  [6-turn database] @ 0000000114205638 nodes with 0000000591873966 6-TFS probes   
Solution [019] =  u2 b2 U2 F' b2 r  ---> b2 r' F  U2 b2 u2  [6-turn database] @ 0000000115521082 nodes with 0000000597522260 6-TFS probes   
Solution [020] =  u2 b2 U2 b2 B' r' ---> b2 r  B  U2 b2 u2  [6-turn database] @ 0000000115526816 nodes with 0000000597545683 6-TFS probes   
Solution [021] =  u2 b2 D2 F' r' f2 ---> r  f2 F  D2 b2 u2  [6-turn database] @ 0000000115712865 nodes with 0000000598343306 6-TFS probes   
Solution [022] =  u2 b2 D2 B' r  f2 ---> r' B  f2 D2 b2 u2  [6-turn database] @ 0000000115719468 nodes with 0000000598372407 6-TFS probes   
Solution [023] =  u2 b2 B' U2 b2 r' ---> b2 r  U2 B  b2 u2  [6-turn database] @ 0000000115994051 nodes with 0000000599552790 6-TFS probes   
Solution [024] =  u2 b2 B' D2 r  f2 ---> r' f2 D2 B  b2 u2  [6-turn database] @ 0000000116000403 nodes with 0000000599580824 6-TFS probes   
Solution [025] =  d' b  d  F' d' f' ---> b' d  F  d' f  d   [6-turn database] @ 0000000131859227 nodes with 0000000667652353 6-TFS probes   
Solution [026] =  d' b  d  F' d' b' ---> f' d  F  d' f  d   [6-turn database] @ 0000000131859229 nodes with 0000000667652354 6-TFS probes   
Solution [027] =  d2 F' f2 U2 l' f2 ---> l  f2 U2 f2 F  d2  [6-turn database] @ 0000000161864067 nodes with 0000000796397404 6-TFS probes   
Solution [028] =  d2 F' f2 D2 b2 l  ---> b2 l' D2 f2 F  d2  [6-turn database] @ 0000000161871293 nodes with 0000000796429632 6-TFS probes   
Solution [029] =  d2 F' b2 U2 l  b2 ---> l' b2 U2 b2 F  d2  [6-turn database] @ 0000000161930193 nodes with 0000000796684715 6-TFS probes   
Solution [030] =  d2 F' b2 D2 f2 l' ---> f2 l  D2 b2 F  d2  [6-turn database] @ 0000000161937304 nodes with 0000000796714809 6-TFS probes   
Solution [031] =  d2 f2 U2 F' l' f2 ---> l  f2 F  U2 f2 d2  [6-turn database] @ 0000000164133750 nodes with 0000000806136495 6-TFS probes   
Solution [032] =  d2 f2 U2 B' l  f2 ---> l' B  f2 U2 f2 d2  [6-turn database] @ 0000000164140410 nodes with 0000000806165396 6-TFS probes   
Solution [033] =  d2 f2 D2 F' b2 l  ---> b2 l' F  D2 f2 d2  [6-turn database] @ 0000000164326178 nodes with 0000000806961282 6-TFS probes   
Solution [034] =  d2 f2 D2 b2 B' l' ---> b2 l  B  D2 f2 d2  [6-turn database] @ 0000000164331910 nodes with 0000000806985770 6-TFS probes   
Solution [035] =  d2 f2 B' U2 l  f2 ---> l' f2 U2 B  f2 d2  [6-turn database] @ 0000000164670474 nodes with 0000000808438192 6-TFS probes   
Solution [036] =  d2 f2 B' D2 b2 l' ---> b2 l  D2 B  f2 d2  [6-turn database] @ 0000000164677672 nodes with 0000000808469060 6-TFS probes   
Solution [037] =  d2 b2 U2 F' l  b2 ---> l' b2 F  U2 b2 d2  [6-turn database] @ 0000000165992406 nodes with 0000000814121473 6-TFS probes   
Solution [038] =  d2 b2 U2 B' l' b2 ---> l  B  b2 U2 b2 d2  [6-turn database] @ 0000000165999012 nodes with 0000000814150468 6-TFS probes   
Solution [039] =  d2 b2 D2 F' f2 l' ---> f2 l  F  D2 b2 d2  [6-turn database] @ 0000000166184719 nodes with 0000000814947773 6-TFS probes   
Solution [040] =  d2 b2 D2 f2 B' l  ---> f2 l' B  D2 b2 d2  [6-turn database] @ 0000000166188269 nodes with 0000000814962757 6-TFS probes   
Solution [041] =  d2 b2 B' U2 l' b2 ---> l  b2 U2 B  b2 d2  [6-turn database] @ 0000000166465248 nodes with 0000000816153336 6-TFS probes   
Solution [042] =  d2 b2 B' D2 f2 l  ---> f2 l' D2 B  b2 d2  [6-turn database] @ 0000000166472387 nodes with 0000000816184593 6-TFS probes   
Solution [043] =  r  U  D2 B2 l' B2 ---> D2 F2 r' F2 U' r'  [6-turn database] @ 0000000275755464 nodes with 0000001285342365 6-TFS probes   
Solution [044] =  r  U  l' F2 D2 B2 ---> r' B2 D2 F2 U' r'  [6-turn database] @ 0000000275918247 nodes with 0000001286044795 6-TFS probes   
Solution [045] =  r  U  l' B2 D2 F2 ---> r' F2 D2 B2 U' r'  [6-turn database] @ 0000000275925312 nodes with 0000001286075670 6-TFS probes   
Solution [046] =  r  U  b' l' u' l  ---> u2 b2 u' b' U' r'  [6-turn database] @ 0000000276189731 nodes with 0000001287214248 6-TFS probes   
Solution [047] =  r  U  b  u  b2 u2 ---> l' u  l  b  U' r'  [6-turn database] @ 0000000276199485 nodes with 0000001287256603 6-TFS probes   
Solution [048] =  r  U  B2 l' B2 D2 ---> F2 r' F2 D2 U' r'  [6-turn database] @ 0000000276292608 nodes with 0000001287654543 6-TFS probes   
Solution [049] =  r  U' D2 F2 r  F2 ---> D2 B2 l  B2 U  r'  [6-turn database] @ 0000000276481020 nodes with 0000001288462822 6-TFS probes   
Solution [050] =  r  U' F2 D2 B2 r  ---> B2 D2 F2 l  U  r'  [6-turn database] @ 0000000276820327 nodes with 0000001289915547 6-TFS probes   
Solution [051] =  r  U' F2 r  F2 D2 ---> B2 l  B2 D2 U  r'  [6-turn database] @ 0000000276823689 nodes with 0000001289930421 6-TFS probes   
Solution [052] =  r  U' B2 D2 F2 r  ---> F2 D2 B2 l  U  r'  [6-turn database] @ 0000000277019038 nodes with 0000001290769318 6-TFS probes   
Solution [053] =  r  U2 b  U' D  l' ---> U2 l  D' U  b' r'  [6-turn database] @ 0000000277662541 nodes with 0000001293529756 6-TFS probes   
Solution [054] =  r  U2 b  u  d' b' ---> U2 b  d  u' b' r'  [6-turn database] @ 0000000277664215 nodes with 0000001293536629 6-TFS probes   
Solution [055] =  r  F  f2 U2 r' f2 ---> r  f2 U2 f2 F' r'  [6-turn database] @ 0000000287171010 nodes with 0000001334352803 6-TFS probes   
Solution [056] =  r  F  f2 D2 b2 r  ---> b2 r' D2 f2 F' r'  [6-turn database] @ 0000000287178289 nodes with 0000001334384476 6-TFS probes   
Solution [057] =  r  F  b2 U2 r  b2 ---> r' b2 U2 b2 F' r'  [6-turn database] @ 0000000287237079 nodes with 0000001334635269 6-TFS probes   
Solution [058] =  r  F  b2 D2 f2 r' ---> f2 r  D2 b2 F' r'  [6-turn database] @ 0000000287244302 nodes with 0000001334666265 6-TFS probes   
Solution [059] =  r  f  U  D' l' U2 ---> l  D  U' f' U2 r'  [6-turn database] @ 0000000288784227 nodes with 0000001341300823 6-TFS probes   
Solution [060] =  r  f  u' d  f' U2 ---> f  d' u  f' U2 r'  [6-turn database] @ 0000000288882267 nodes with 0000001341721455 6-TFS probes   
Solution [061] =  r  f2 U2 F  r' f2 ---> r  f2 F' U2 f2 r'  [6-turn database] @ 0000000290172492 nodes with 0000001347255112 6-TFS probes   
Solution [062] =  r  f2 D2 F  b2 r  ---> b2 r' F' D2 f2 r'  [6-turn database] @ 0000000290364973 nodes with 0000001348082656 6-TFS probes   
Solution [063] =  r  b2 U2 F  r  b2 ---> r' b2 F' U2 b2 r'  [6-turn database] @ 0000000292031091 nodes with 0000001355240629 6-TFS probes   
Solution [064] =  r  b2 D2 F  f2 r' ---> f2 r  F' D2 b2 r'  [6-turn database] @ 0000000292223516 nodes with 0000001356067410 6-TFS probes   
Solution [065] =  r' D' f2 l' D  b2 ---> D' l  f2 D  b2 r   [6-turn database] @ 0000000300572145 nodes with 0000001391896457 6-TFS probes   
Solution [066] =  r' f2 r  F  r' f2 ---> b2 r  F' r' b2 r   [6-turn database] @ 0000000309084993 nodes with 0000001428481948 6-TFS probes   
Solution [067] =  r' f2 r  F  r' b2 ---> f2 r  F' r' b2 r   [6-turn database] @ 0000000309084996 nodes with 0000001428481949 6-TFS probes   
Solution [068] =  r' b2 D' f2 l' D  ---> b2 D' l  f2 D  r   [6-turn database] @ 0000000310807964 nodes with 0000001435882828 6-TFS probes   
Solution [069] =  l' U  u2 r  U' r' ---> u2 l  r  U  r' U'  [6-turn database] @ 0000000331473674 nodes with 0000001524528349 6-TFS probes   
Solution [070] =  l' u2 r  U  r' u2 ---> d2 r  U' r' d2 l   [6-turn database] @ 0000000335141847 nodes with 0000001540271555 6-TFS probes   
Solution [071] =  l' u2 r  U  r' d2 ---> u2 r  U' r' d2 l   [6-turn database] @ 0000000335141850 nodes with 0000001540271570 6-TFS probes   
Solution [072] =  l' d2 F' u2 l' F  ---> d2 F' l  u2 F  l   [6-turn database] @ 0000000337159267 nodes with 0000001548933985 6-TFS probes   
Solution [073] =  l' F' u2 l' F  d2 ---> F' l  u2 F  d2 l   [6-turn database] @ 0000000341510274 nodes with 0000001567618243 6-TFS probes   
Solution [074] =  l  u2 D  F2 r  u2 ---> r' u2 F2 D' u2 l'  [6-turn database] @ 0000000351860631 nodes with 0000001612044892 6-TFS probes   
Solution [075] =  l  u2 D  B2 d2 r' ---> d2 r  B2 D' u2 l'  [6-turn database] @ 0000000351867509 nodes with 0000001612074283 6-TFS probes   
Solution [076] =  l  u2 F2 D  r  u2 ---> r' D' u2 F2 u2 l'  [6-turn database] @ 0000000352217922 nodes with 0000001613574758 6-TFS probes   
Solution [077] =  l  u2 B2 d2 D  r' ---> d2 r  D' B2 u2 l'  [6-turn database] @ 0000000352415369 nodes with 0000001614425034 6-TFS probes   
Solution [078] =  l  d  F  B' l' F2 ---> l  B  F' d' F2 l'  [6-turn database] @ 0000000353378547 nodes with 0000001618557031 6-TFS probes   
Solution [079] =  l  d  f' b  d' F2 ---> d  b' f  d' F2 l'  [6-turn database] @ 0000000353475891 nodes with 0000001618972787 6-TFS probes   
Solution [080] =  l  d2 D  F2 r' d2 ---> r  d2 F2 D' d2 l'  [6-turn database] @ 0000000353655462 nodes with 0000001619744832 6-TFS probes   
Solution [081] =  l  d2 D  B2 u2 r  ---> u2 r' B2 D' d2 l'  [6-turn database] @ 0000000353662225 nodes with 0000001619772908 6-TFS probes   
Solution [082] =  l  d2 F2 D  r' d2 ---> r  D' d2 F2 d2 l'  [6-turn database] @ 0000000354012753 nodes with 0000001621276897 6-TFS probes   
Solution [083] =  l  d2 B2 u2 D  r  ---> u2 r' D' B2 d2 l'  [6-turn database] @ 0000000354207898 nodes with 0000001622114527 6-TFS probes   
Solution [084] =  l  F  U2 l' U2 B2 ---> D2 r' D2 B2 F' l'  [6-turn database] @ 0000000357530454 nodes with 0000001636387063 6-TFS probes   
Solution [085] =  l  F  u  f  u2 f2 ---> l' f  l  u  F' l'  [6-turn database] @ 0000000357561183 nodes with 0000001636516139 6-TFS probes   
Solution [086] =  l  F  u' l' f' l  ---> f2 u2 f' u' F' l'  [6-turn database] @ 0000000357578006 nodes with 0000001636588259 6-TFS probes   
Solution [087] =  l  F  d' r' F' d  ---> l' d' F  r  d  F'  [6-turn database] @ 0000000357621125 nodes with 0000001636773648 6-TFS probes   
Solution [088] =  l  F  d  r' F' d' ---> l' d  F  r  d' F'  [6-turn database] @ 0000000357642400 nodes with 0000001636862959 6-TFS probes   
Solution [089] =  l  F  r' d' F' d  ---> l' d' F  d  r  F'  [6-turn database] @ 0000000357843875 nodes with 0000001637722946 6-TFS probes   
Solution [090] =  l  F  r' d  F' d' ---> l' d  F  d' r  F'  [6-turn database] @ 0000000357844630 nodes with 0000001637726129 6-TFS probes   
Solution [091] =  l  F  r' l' f2 l  ---> F' l' f2 F  r  F'  [6-turn database] @ 0000000357848333 nodes with 0000001637741454 6-TFS probes   
Solution [092] =  l  F  l' U2 B2 D2 ---> r' D2 B2 U2 F' l'  [6-turn database] @ 0000000357887985 nodes with 0000001637910632 6-TFS probes   
Solution [093] =  l  F  l' D2 B2 U2 ---> r' U2 B2 D2 F' l'  [6-turn database] @ 0000000357894807 nodes with 0000001637939457 6-TFS probes   
Solution [094] =  l  F  B2 U2 l' U2 ---> B2 D2 r' D2 F' l'  [6-turn database] @ 0000000358181913 nodes with 0000001639167220 6-TFS probes   
Solution [095] =  l  F' U2 B2 D2 r  ---> D2 B2 U2 l  F  l'  [6-turn database] @ 0000000358276651 nodes with 0000001639569912 6-TFS probes   
Solution [096] =  l  F' D2 r  D2 B2 ---> U2 l  U2 B2 F  l'  [6-turn database] @ 0000000358453044 nodes with 0000001640325252 6-TFS probes   
Solution [097] =  l  F' D2 B2 U2 r  ---> U2 B2 D2 l  F  l'  [6-turn database] @ 0000000358468540 nodes with 0000001640392393 6-TFS probes   
Solution [098] =  l  F' B2 D2 r  D2 ---> B2 U2 l  U2 F  l'  [6-turn database] @ 0000000358921389 nodes with 0000001642336421 6-TFS probes   
Solution [099] =  l  F2 u  F' B  l' ---> F2 l  B' F  u' l'  [6-turn database] @ 0000000359025496 nodes with 0000001642786282 6-TFS probes   
Solution [100] =  l  F2 u  f  b' u' ---> F2 u  b  f' u' l'  [6-turn database] @ 0000000359027141 nodes with 0000001642792964 6-TFS probes   
Solution [101] =  l2 b2 r' D  l' D' ---> l2 b2 r  U' l  U   [6-turn database] @ 0000000380051425 nodes with 0000001733081353 6-TFS probes   
Solution [102] =  F  l  F' u  r' F  ---> u' l' u  F' r  u'  [6-turn database] @ 0000000440238136 nodes with 0000001991465066 6-TFS probes   
Solution [103] =  F  l  F' u' r' F  ---> u  l' u' F' r  u   [6-turn database] @ 0000000440238973 nodes with 0000001991468645 6-TFS probes   
Solution [104] =  F  l  F' r' u  F  ---> u' l' u  F' u' r   [6-turn database] @ 0000000440248402 nodes with 0000001991509933 6-TFS probes   
Solution [105] =  F  l  F' r' u' F  ---> u  l' u' F' u  r   [6-turn database] @ 0000000440248432 nodes with 0000001991510045 6-TFS probes   
Solution [106] =  F  l  F' r' l' b2 ---> l  F  l' b2 F' r   [6-turn database] @ 0000000440248650 nodes with 0000001991510837 6-TFS probes   
Solution [107] =  f2 U2 u2 F' f2 r' ---> f2 r  F  u2 U2 f2  [6-turn database] @ 0000000528077570 nodes with 0000002368718624 6-TFS probes   
Solution [108] =  f2 U2 u2 f2 B' r  ---> f2 r' B  u2 U2 f2  [6-turn database] @ 0000000528081118 nodes with 0000002368734065 6-TFS probes   
Solution [109] =  f2 U2 d2 F' l' f2 ---> l  f2 F  d2 U2 f2  [6-turn database] @ 0000000528141189 nodes with 0000002368991099 6-TFS probes   
Solution [110] =  f2 U2 d2 B' l  f2 ---> l' B  f2 d2 U2 f2  [6-turn database] @ 0000000528147849 nodes with 0000002369019378 6-TFS probes   
Solution [111] =  f2 U2 r2 B  l' b2 ---> l  B' r2 b2 U2 f2  [6-turn database] @ 0000000528354978 nodes with 0000002369907760 6-TFS probes   
Solution [112] =  f2 U2 l2 F  l' f2 ---> l  F' l2 f2 U2 f2  [6-turn database] @ 0000000528410559 nodes with 0000002370146783 6-TFS probes   
Solution [113] =  f2 U2 f2 u2 F' r' ---> f2 r  F  U2 f2 u2  [6-turn database] @ 0000000528607544 nodes with 0000002370988006 6-TFS probes   
Solution [114] =  f2 U2 f2 u2 B' r  ---> f2 r' B  U2 f2 u2  [6-turn database] @ 0000000528607780 nodes with 0000002370989060 6-TFS probes   
Solution [115] =  f2 U2 f2 r2 F  r' ---> f2 r  F' r2 U2 f2  [6-turn database] @ 0000000528617123 nodes with 0000002371028648 6-TFS probes   
Solution [116] =  f2 U2 b2 r2 B  l' ---> b2 l  B' r2 U2 f2  [6-turn database] @ 0000000528683515 nodes with 0000002371315693 6-TFS probes   
Solution [117] =  f2 u2 D2 F' r  b2 ---> r' b2 F  D2 u2 f2  [6-turn database] @ 0000000530185059 nodes with 0000002377761138 6-TFS probes   
Solution [118] =  f2 u2 D2 B' r' b2 ---> r  B  b2 D2 u2 f2  [6-turn database] @ 0000000530191722 nodes with 0000002377789186 6-TFS probes   
Solution [119] =  f2 u2 F' U2 f2 r' ---> f2 r  U2 F  u2 f2  [6-turn database] @ 0000000530492243 nodes with 0000002379073143 6-TFS probes   
Solution [120] =  f2 u2 F' D2 r  b2 ---> r' b2 D2 F  u2 f2  [6-turn database] @ 0000000530498682 nodes with 0000002379100830 6-TFS probes   
Solution [121] =  f2 u2 B' U2 f2 r  ---> f2 r' U2 B  u2 f2  [6-turn database] @ 0000000530678812 nodes with 0000002379872713 6-TFS probes   
Solution [122] =  f2 u2 B' D2 r' b2 ---> r  b2 D2 B  u2 f2  [6-turn database] @ 0000000530685282 nodes with 0000002379901109 6-TFS probes   
Solution [123] =  f2 d2 D2 F' b2 l  ---> b2 l' F  D2 d2 f2  [6-turn database] @ 0000000531980237 nodes with 0000002385466404 6-TFS probes   
Solution [124] =  f2 d2 D2 b2 B' l' ---> b2 l  B  D2 d2 f2  [6-turn database] @ 0000000531985969 nodes with 0000002385490848 6-TFS probes   
Solution [125] =  f2 d2 F' U2 l' f2 ---> l  f2 U2 F  d2 f2  [6-turn database] @ 0000000532286733 nodes with 0000002386778909 6-TFS probes   
Solution [126] =  f2 d2 F' D2 b2 l  ---> b2 l' D2 F  d2 f2  [6-turn database] @ 0000000532293959 nodes with 0000002386809556 6-TFS probes   
Solution [127] =  f2 d2 B' U2 l  f2 ---> l' f2 U2 B  d2 f2  [6-turn database] @ 0000000532473330 nodes with 0000002387581250 6-TFS probes   
Solution [128] =  f2 d2 B' D2 b2 l' ---> b2 l  D2 B  d2 f2  [6-turn database] @ 0000000532480528 nodes with 0000002387612312 6-TFS probes   
Solution [129] =  f2 D2 r2 F  r  b2 ---> r' F' r2 b2 D2 f2  [6-turn database] @ 0000000533749509 nodes with 0000002393078186 6-TFS probes   
Solution [130] =  f2 D2 l2 B  r  f2 ---> r' B' l2 f2 D2 f2  [6-turn database] @ 0000000533821578 nodes with 0000002393385160 6-TFS probes   
Solution [131] =  f2 D2 f2 l2 B  r  ---> f2 r' B' l2 D2 f2  [6-turn database] @ 0000000534022546 nodes with 0000002394246349 6-TFS probes   
Solution [132] =  f2 D2 b2 l2 F  l  ---> b2 l' F' l2 D2 f2  [6-turn database] @ 0000000534088352 nodes with 0000002394527618 6-TFS probes   
Solution [133] =  b2 U2 u2 F' b2 r  ---> b2 r' F  u2 U2 b2  [6-turn database] @ 0000000580344037 nodes with 0000002593097684 6-TFS probes   
Solution [134] =  b2 U2 u2 b2 B' r' ---> b2 r  B  u2 U2 b2  [6-turn database] @ 0000000580349771 nodes with 0000002593121340 6-TFS probes   
Solution [135] =  b2 U2 d2 F' l  b2 ---> l' b2 F  d2 U2 b2  [6-turn database] @ 0000000580407603 nodes with 0000002593369218 6-TFS probes   
Solution [136] =  b2 U2 d2 B' l' b2 ---> l  B  b2 d2 U2 b2  [6-turn database] @ 0000000580414209 nodes with 0000002593397145 6-TFS probes   
Solution [137] =  b2 U2 r2 B  l  f2 ---> l' B' r2 f2 U2 b2  [6-turn database] @ 0000000580621386 nodes with 0000002594284364 6-TFS probes   
Solution [138] =  b2 U2 l2 F  l  b2 ---> l' F' l2 b2 U2 b2  [6-turn database] @ 0000000580676973 nodes with 0000002594521289 6-TFS probes   
Solution [139] =  b2 U2 f2 r2 B  l  ---> f2 l' B' r2 U2 b2  [6-turn database] @ 0000000580883804 nodes with 0000002595413130 6-TFS probes   
Solution [140] =  b2 U2 b2 u2 F' r  ---> b2 r' F  U2 b2 u2  [6-turn database] @ 0000000580940023 nodes with 0000002595653074 6-TFS probes   
Solution [141] =  b2 U2 b2 u2 B' r' ---> b2 r  B  U2 b2 u2  [6-turn database] @ 0000000580940261 nodes with 0000002595653850 6-TFS probes   
Solution [142] =  b2 U2 b2 r2 F  r  ---> b2 r' F' r2 U2 b2  [6-turn database] @ 0000000580949602 nodes with 0000002595694160 6-TFS probes   
Solution [143] =  b2 u2 D2 F' r' f2 ---> r  f2 F  D2 u2 b2  [6-turn database] @ 0000000582451470 nodes with 0000002602114576 6-TFS probes   
Solution [144] =  b2 u2 D2 B' r  f2 ---> r' B  f2 D2 u2 b2  [6-turn database] @ 0000000582458073 nodes with 0000002602143307 6-TFS probes   
Solution [145] =  b2 u2 F' U2 b2 r  ---> b2 r' U2 F  u2 b2  [6-turn database] @ 0000000582758710 nodes with 0000002603426552 6-TFS probes   
Solution [146] =  b2 u2 F' D2 r' f2 ---> r  f2 D2 F  u2 b2  [6-turn database] @ 0000000582765093 nodes with 0000002603454253 6-TFS probes   
Solution [147] =  b2 u2 B' U2 b2 r' ---> b2 r  U2 B  u2 b2  [6-turn database] @ 0000000582945281 nodes with 0000002604227079 6-TFS probes   
Solution [148] =  b2 u2 B' D2 r  f2 ---> r' f2 D2 B  u2 b2  [6-turn database] @ 0000000582951633 nodes with 0000002604255504 6-TFS probes   
Solution [149] =  b2 d2 D2 F' f2 l' ---> f2 l  F  D2 d2 b2  [6-turn database] @ 0000000584246536 nodes with 0000002609823911 6-TFS probes   
Solution [150] =  b2 d2 D2 f2 B' l  ---> f2 l' B  D2 d2 b2  [6-turn database] @ 0000000584250086 nodes with 0000002609838589 6-TFS probes   
Solution [151] =  b2 d2 F' U2 l  b2 ---> l' b2 U2 F  d2 b2  [6-turn database] @ 0000000584553147 nodes with 0000002611147737 6-TFS probes   
Solution [152] =  b2 d2 F' D2 f2 l' ---> f2 l  D2 F  d2 b2  [6-turn database] @ 0000000584560258 nodes with 0000002611178864 6-TFS probes   
Solution [153] =  b2 d2 B' U2 l' b2 ---> l  b2 U2 B  d2 b2  [6-turn database] @ 0000000584739690 nodes with 0000002611950606 6-TFS probes   
Solution [154] =  b2 d2 B' D2 f2 l  ---> f2 l' D2 B  d2 b2  [6-turn database] @ 0000000584746829 nodes with 0000002611981692 6-TFS probes   
Solution [155] =  b2 D2 r2 F  r' f2 ---> r  F' r2 f2 D2 b2  [6-turn database] @ 0000000586015920 nodes with 0000002617429809 6-TFS probes   
Solution [156] =  b2 D2 l2 B  r' b2 ---> r  B' l2 b2 D2 b2  [6-turn database] @ 0000000586087995 nodes with 0000002617738747 6-TFS probes   
Solution [157] =  b2 D2 f2 l2 F  l' ---> f2 l  F' l2 D2 b2  [6-turn database] @ 0000000586288639 nodes with 0000002618593656 6-TFS probes   
Solution [158] =  b2 D2 b2 l2 B  r' ---> b2 r  B' l2 D2 b2  [6-turn database] @ 0000000586355027 nodes with 0000002618882271 6-TFS probes   
** Search completed. **
```


----------



## Carrot (Apr 26, 2014)

unsolved said:


> ... (above post)



I made it run by releasing some more RAM for it, loaded in like 3-5 minutes now.

first 10 move solutions: Did you even include any?
first 11 move solutions: ~ 2 sec
first 12 move solutions: ~ 18 sec
full 12 move search: ~ 5 min 30 sec

Okay 13+ move searches are slow enough to make me bored


----------



## unsolved (Apr 26, 2014)

Carrot said:


> I made it run by releasing some more RAM for it, loaded in like 3-5 minutes now.
> 
> first 10 move solutions: Did you even include any?
> first 11 move solutions: ~ 2 sec
> ...



If you check your hard drive, it creates a file "solved_cubes.txt" with all of the results. It draws a picture of the starting cube and displays every solution found.


----------



## Jakube (Apr 26, 2014)

I found some wrong solutions in the resent version (from http://www.lightningcloudcomputing.com/OO_4x4x4.zip 26.04.2014, 17:40). For the case 


```
Solution to 4x4x4 cube center scenario U1:D3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|~~~~|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|####|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b2 U  l2 ---> L  u' L2 D' R2  [5-turn database] @ 0000000000023265 nodes with 0000000000225057 5-TFS probes   
Solution [002] =  U  b2 U  f2 ---> U' b2 U  f2 U2  [5-turn database] @ 0000000000023274 nodes with 0000000000225070 5-TFS probes   
Solution [003] =  U' l2 U' r2 ---> F  d  l  D' B   [5-turn database] @ 0000000000039738 nodes with 0000000000293808 5-TFS probes   
Solution [004] =  U' l2 U' b2 ---> B' d' B2 D  d   [5-turn database] @ 0000000000039753 nodes with 0000000000293847 5-TFS probes   
Solution [005] =  D' b2 D' l2 ---> D  b2 D' l2 D2  [5-turn database] @ 0000000000229320 nodes with 0000000001089331 5-TFS probes   
Solution [006] =  D' b2 D' f2 ---> D  b2 D' f2 D2  [5-turn database] @ 0000000000229329 nodes with 0000000001089378 5-TFS probes   
Solution [007] =  D  l2 D  r2 ---> B2 d' B  U' f'  [5-turn database] @ 0000000000238953 nodes with 0000000001129266 5-TFS probes   
Solution [008] =  D  l2 D  b2 ---> U' L2 d' f' l'  [5-turn database] @ 0000000000238968 nodes with 0000000001129301 5-TFS probes   
** Search completed. **
```

The solutions 1, 3, 4, 7, 8 don't work. Solution 2, 5, 6 are correct though. 

Not sure, if you fixed this already with this: 


unsolved said:


> Update! Finally fixed it! I did not convert the index from the database correctly when reading in the entries in inverted order sometimes (when they were not in the first or second dimension of the linked list, I had to hunt for it and converted the 3rd index dimension incorrectly!)


----------



## rokicki (Apr 26, 2014)

rokicki said:


> I think with some care this could be refined to yield distances of 11 for
> most positions. This is interesting: a non-table-based heuristic seems to
> outperform the best practical pruning tables we can think of for this metric
> and puzzle. I think I'm going to start to play with this a bit.



This is not only good for the outer block turn metric, but for the block turn metric
it seems to combine with the corner distance in a very nice way.


----------



## Carrot (Apr 26, 2014)

Jakube said:


> talking about some wrong solutions for a specific case




```
Solution to 4x4x4 cube center scenario U1:D3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|~~~~|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|####|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b2 U  ---> l2 U' b2 U  l2 U2  [6-turn database] @ 0000000000000829 nodes with 0000000000008496 6-TFS probes   
Solution [002] =  U' l2 U' ---> r2 U  l2 U' r2 U2  [6-turn database] @ 0000000000001415 nodes with 0000000000011120 6-TFS probes   
Solution [003] =  D' b2 D' ---> l2 D  b2 D' l2 D2  [6-turn database] @ 0000000000008155 nodes with 0000000000038776 6-TFS probes   
Solution [004] =  D  l2 D  ---> r2 D' l2 D  r2 D2  [6-turn database] @ 0000000000008498 nodes with 0000000000040552 6-TFS probes   
** Search completed. **
```

unsolved: the 10 move cases were rare, so when I quickly looked inside that file I just saw a bunch of 8-9 movers and 11-12 movers


----------



## unsolved (Apr 26, 2014)

Jakube said:


> I found some wrong solutions in the resent version....



I have some more good news/bad news: my program can solve the dreaded "single dedge flip" scenario when I turn on search extensions (which allows it to skip depths it has already seen by probing the databases). In this implementation I had it jump from 0 to 6 to 12 plies (though I could have done 0 to 7 to 14 technically) and this is what I see now:






So, in one respect, I think I was correct. Search extensions for deeper searches can (potentially) find long-distance solutions faster than crawling one iteration at a time (from 0 to 1 to 2 to 3 .... to 12, in this case). Not every time, but clearly when the outer fringe of the last jump can reach the nominal depth of a deep search because of the databases.

But I thought for sure the ridiculous start Uu d'D' was not even been processed by my move generator??


```
unsigned short GLOBAL_AXIS_ROTATION[3][4][3]

void init_axis_move_data(void)
{
	GLOBAL_AXIS_ROTATION[0][0][0] = U___PLUS____;
	GLOBAL_AXIS_ROTATION[0][0][1] = U___MINUS___;
	GLOBAL_AXIS_ROTATION[0][0][2] = U___TWICE___;
	GLOBAL_AXIS_ROTATION[0][1][0] = u___PLUS____;
	GLOBAL_AXIS_ROTATION[0][1][1] = u___MINUS___;
	GLOBAL_AXIS_ROTATION[0][1][2] = u___TWICE___;
	GLOBAL_AXIS_ROTATION[0][2][0] = d___PLUS____;
	GLOBAL_AXIS_ROTATION[0][2][1] = d___MINUS___;
	GLOBAL_AXIS_ROTATION[0][2][2] = d___TWICE___;
	GLOBAL_AXIS_ROTATION[0][3][0] = D___PLUS____;
	GLOBAL_AXIS_ROTATION[0][3][1] = D___MINUS___;
	GLOBAL_AXIS_ROTATION[0][3][2] = D___TWICE___;
	GLOBAL_AXIS_ROTATION[1][0][0] = R___PLUS____;
	GLOBAL_AXIS_ROTATION[1][0][1] = R___MINUS___;
	GLOBAL_AXIS_ROTATION[1][0][2] = R___TWICE___;
	GLOBAL_AXIS_ROTATION[1][1][0] = r___PLUS____;
	GLOBAL_AXIS_ROTATION[1][1][1] = r___MINUS___;
	GLOBAL_AXIS_ROTATION[1][1][2] = r___TWICE___;
	GLOBAL_AXIS_ROTATION[1][2][0] = l___PLUS____;
	GLOBAL_AXIS_ROTATION[1][2][1] = l___MINUS___;
	GLOBAL_AXIS_ROTATION[1][2][2] = l___TWICE___;
	GLOBAL_AXIS_ROTATION[1][3][0] = L___PLUS____;
	GLOBAL_AXIS_ROTATION[1][3][1] = L___MINUS___;
	GLOBAL_AXIS_ROTATION[1][3][2] = L___TWICE___;
	GLOBAL_AXIS_ROTATION[2][0][0] = F___PLUS____;
	GLOBAL_AXIS_ROTATION[2][0][1] = F___MINUS___;
	GLOBAL_AXIS_ROTATION[2][0][2] = F___TWICE___;
	GLOBAL_AXIS_ROTATION[2][1][0] = f___PLUS____;
	GLOBAL_AXIS_ROTATION[2][1][1] = f___MINUS___;
	GLOBAL_AXIS_ROTATION[2][1][2] = f___TWICE___;
	GLOBAL_AXIS_ROTATION[2][2][0] = b___PLUS____;
	GLOBAL_AXIS_ROTATION[2][2][1] = b___MINUS___;
	GLOBAL_AXIS_ROTATION[2][2][2] = b___TWICE___;
	GLOBAL_AXIS_ROTATION[2][3][0] = B___PLUS____;
	GLOBAL_AXIS_ROTATION[2][3][1] = B___MINUS___;
	GLOBAL_AXIS_ROTATION[2][3][2] = B___TWICE___;
}


		for(axis_of_rotation = 0; axis_of_rotation < 3; axis_of_rotation++)
			for(move_group = 0; move_group < 4; move_group++)
			{
				if((axis_of_rotation != last_move_axis) || ((axis_of_rotation == last_move_axis) && (move_group > last_move_group)))
				{
					for(move_index = 0; move_index < 3; move_index++)
					{
						which_move_to_make = GLOBAL_AXIS_ROTATION[axis_of_rotation][move_group][move_index];
						modified_cube = cube_move_array[which_move_to_make](which_cube);


						if(GLOBAL_HALT == 1) return;
						new_search_tree(modified_cube, which_depth-1, axis_of_rotation, move_group, which_move_to_make, unchanging_depth);
						
					}
				}
			}
```


----------



## qqwref (Apr 26, 2014)

Yeah, there must be something wrong, because those two "solutions" just scramble my cube.



unsolved said:


> So, in one respect, I think I was correct. Search extensions for deeper searches can (potentially) find long-distance solutions faster than crawling one iteration at a time (from 0 to 1 to 2 to 3 .... to 12, in this case). Not every time, but clearly when the outer fringe of the last jump can reach the nominal depth of a deep search because of the databases.


As I already showed you, the gains are negligible... and they only apply when the optimal solution length is right on that edge (which I don't think it is here). If the optimal movecount is right on that edge, your jumping version takes a few percent less time (since the searches of 0, 1, ..., 11 moves are very small compared to the search for 12 moves), but if it's anywhere in between, your jumping version takes far longer.


----------



## Jakube (Apr 26, 2014)

The code I gave you, deals only with things like U D U, R R, ... Not stuff like Uud'D'. 

Look at my post here: http://www.speedsolving.com/forum/s...e-Force-Solver&p=965261&viewfull=1#post965261

My code for these three rules was quite ugly, so I only sent you the nice stuff. 
If you want too add it, I might have the code anywhere. 

But there's something else wrong. Like qqwerf said, these solutions doesn't solve this case.


----------



## unsolved (Apr 27, 2014)

Jakube said:


> nall
> 36*33^(n-1)canceling moves
> (U d U = U2 d)cancel by rotation
> (U u = d D)01​1​1​136​36​36​21.188​1.026​999​339.204​28.836​27.288​41.293.732​810.891​746.562​542.693.156​22.803.120​20.421.648​61.408.874.148​641.245.896​558.627.948​
> ...



I am not entirely convinced you can start parallel-rotation pruning, universally, at depths 2 and 3. There are certain cases, which are handled by the Axis Rotation/Move Group implementation in the move generator you suggested. But a move sequence such as U u2 d should be allowed to proceed to the next iteration. However, U u2 d D2 should be disallowed at depth == 4, since it is the same position as u d2 D'.

I am implementing a pre-emptive retroactive cascade check through the prior 4 plies at every depth == 3 about to make a 4th move. So at depth == 3, I look to see if the next move is a 4th parallel rotation. At depth == 4, I check depths 1-3 and the move I am about to make @ 4, at depth == 5 I check depths 2-4 and the move I am about to make @5, etc.

It just bothers me that my program thought it was doing an 18-ply search when the first 4 plies recreated the starting position!

But, on the other hand, that could mean, if the only bug was in the database text output and NOT the actual positions in the database, then the single dedge flip has a solution < 18 plies.

The following are the moves that get pruned if they are generated in cascade:


```
U  u  d' D' 
 U  u  d' D  
 U  u  d' D2 
 U  u  d  D' 
 U  u  d  D  
 U  u  d  D2 
 U  u  d2 D' 
 U  u  d2 D  
 U  u  d2 D2 
 U  u' d' D' 
 U  u' d' D  
 U  u' d' D2 
 U  u' d  D' 
 U  u' d  D  
 U  u' d  D2 
 U  u' d2 D' 
 U  u' d2 D  
 U  u' d2 D2 
 U  u2 d' D' 
 U  u2 d' D  
 U  u2 d' D2 
 U  u2 d  D' 
 U  u2 d  D  
 U  u2 d  D2 
 U  u2 d2 D' 
 U  u2 d2 D  
 U  u2 d2 D2 
 U' u  d' D' 
 U' u  d' D  
 U' u  d' D2 
 U' u  d  D' 
 U' u  d  D  
 U' u  d  D2 
 U' u  d2 D' 
 U' u  d2 D  
 U' u  d2 D2 
 U' u' d' D' 
 U' u' d' D  
 U' u' d' D2 
 U' u' d  D' 
 U' u' d  D  
 U' u' d  D2 
 U' u' d2 D' 
 U' u' d2 D  
 U' u' d2 D2 
 U' u2 d' D' 
 U' u2 d' D  
 U' u2 d' D2 
 U' u2 d  D' 
 U' u2 d  D  
 U' u2 d  D2 
 U' u2 d2 D' 
 U' u2 d2 D  
 U' u2 d2 D2 
 U2 u  d' D' 
 U2 u  d' D  
 U2 u  d' D2 
 U2 u  d  D' 
 U2 u  d  D  
 U2 u  d  D2 
 U2 u  d2 D' 
 U2 u  d2 D  
 U2 u  d2 D2 
 U2 u' d' D' 
 U2 u' d' D  
 U2 u' d' D2 
 U2 u' d  D' 
 U2 u' d  D  
 U2 u' d  D2 
 U2 u' d2 D' 
 U2 u' d2 D  
 U2 u' d2 D2 
 U2 u2 d' D' 
 U2 u2 d' D  
 U2 u2 d' D2 
 U2 u2 d  D' 
 U2 u2 d  D  
 U2 u2 d  D2 
 U2 u2 d2 D' 
 U2 u2 d2 D  
 U2 u2 d2 D2 
 R  r  l' L' 
 R  r  l' L  
 R  r  l' L2 
 R  r  l  L' 
 R  r  l  L  
 R  r  l  L2 
 R  r  l2 L' 
 R  r  l2 L  
 R  r  l2 L2 
 R  r' l' L' 
 R  r' l' L  
 R  r' l' L2 
 R  r' l  L' 
 R  r' l  L  
 R  r' l  L2 
 R  r' l2 L' 
 R  r' l2 L  
 R  r' l2 L2 
 R  r2 l' L' 
 R  r2 l' L  
 R  r2 l' L2 
 R  r2 l  L' 
 R  r2 l  L  
 R  r2 l  L2 
 R  r2 l2 L' 
 R  r2 l2 L  
 R  r2 l2 L2 
 R' r  l' L' 
 R' r  l' L  
 R' r  l' L2 
 R' r  l  L' 
 R' r  l  L  
 R' r  l  L2 
 R' r  l2 L' 
 R' r  l2 L  
 R' r  l2 L2 
 R' r' l' L' 
 R' r' l' L  
 R' r' l' L2 
 R' r' l  L' 
 R' r' l  L  
 R' r' l  L2 
 R' r' l2 L' 
 R' r' l2 L  
 R' r' l2 L2 
 R' r2 l' L' 
 R' r2 l' L  
 R' r2 l' L2 
 R' r2 l  L' 
 R' r2 l  L  
 R' r2 l  L2 
 R' r2 l2 L' 
 R' r2 l2 L  
 R' r2 l2 L2 
 R2 r  l' L' 
 R2 r  l' L  
 R2 r  l' L2 
 R2 r  l  L' 
 R2 r  l  L  
 R2 r  l  L2 
 R2 r  l2 L' 
 R2 r  l2 L  
 R2 r  l2 L2 
 R2 r' l' L' 
 R2 r' l' L  
 R2 r' l' L2 
 R2 r' l  L' 
 R2 r' l  L  
 R2 r' l  L2 
 R2 r' l2 L' 
 R2 r' l2 L  
 R2 r' l2 L2 
 R2 r2 l' L' 
 R2 r2 l' L  
 R2 r2 l' L2 
 R2 r2 l  L' 
 R2 r2 l  L  
 R2 r2 l  L2 
 R2 r2 l2 L' 
 R2 r2 l2 L  
 R2 r2 l2 L2 
 F  f  b' B' 
 F  f  b' B  
 F  f  b' B2 
 F  f  b  B' 
 F  f  b  B  
 F  f  b  B2 
 F  f  b2 B' 
 F  f  b2 B  
 F  f  b2 B2 
 F  f' b' B' 
 F  f' b' B  
 F  f' b' B2 
 F  f' b  B' 
 F  f' b  B  
 F  f' b  B2 
 F  f' b2 B' 
 F  f' b2 B  
 F  f' b2 B2 
 F  f2 b' B' 
 F  f2 b' B  
 F  f2 b' B2 
 F  f2 b  B' 
 F  f2 b  B  
 F  f2 b  B2 
 F  f2 b2 B' 
 F  f2 b2 B  
 F  f2 b2 B2 
 F' f  b' B' 
 F' f  b' B  
 F' f  b' B2 
 F' f  b  B' 
 F' f  b  B  
 F' f  b  B2 
 F' f  b2 B' 
 F' f  b2 B  
 F' f  b2 B2 
 F' f' b' B' 
 F' f' b' B  
 F' f' b' B2 
 F' f' b  B' 
 F' f' b  B  
 F' f' b  B2 
 F' f' b2 B' 
 F' f' b2 B  
 F' f' b2 B2 
 F' f2 b' B' 
 F' f2 b' B  
 F' f2 b' B2 
 F' f2 b  B' 
 F' f2 b  B  
 F' f2 b  B2 
 F' f2 b2 B' 
 F' f2 b2 B  
 F' f2 b2 B2 
 F2 f  b' B' 
 F2 f  b' B  
 F2 f  b' B2 
 F2 f  b  B' 
 F2 f  b  B  
 F2 f  b  B2 
 F2 f  b2 B' 
 F2 f  b2 B  
 F2 f  b2 B2 
 F2 f' b' B' 
 F2 f' b' B  
 F2 f' b' B2 
 F2 f' b  B' 
 F2 f' b  B  
 F2 f' b  B2 
 F2 f' b2 B' 
 F2 f' b2 B  
 F2 f' b2 B2 
 F2 f2 b' B' 
 F2 f2 b' B  
 F2 f2 b' B2 
 F2 f2 b  B' 
 F2 f2 b  B  
 F2 f2 b  B2 
 F2 f2 b2 B' 
 F2 f2 b2 B  
 F2 f2 b2 B2
```


----------



## cuBerBruce (Apr 27, 2014)

unsolved said:


> However, U u2 d D2 should be disallowed at depth == 4, since it is the same position as u d2 D'.



These are the same position as long as you consider that the orientation of the cube doesn't matter. I didn't think you were doing that so far, but I could be wrong. If you consider that the orientation of the cube doesn't matter, then you should consider the solved cube in any of 24 orientation is still a solved cube. You may be able to consider only one orientation as solved if you do 24 separate searches with each search using a different orientation of the initial cube or a different orientation of the solved cube, but this seems inefficient to me.

Relating to the above, consider the simple scramble U u d'. This scramble should have a 1-move solution.



unsolved said:


> It just bothers me that my program thought it was doing a 18-ply search when the first 4 plies recreated the starting position!



Again, it does as long as you're considering the orientation of the cube doesn't matter.



unsolved said:


> then the single dedge flip has a solution < 18 plies.



It does have a solution of less than 18 plies. There is a well-known maneuver that is 15 moves long: r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 r2. Any reduction state of an odd parity of edge pieces (aka OLL parity) is known to require at least 13 block turns (and 13 is also minimal for this situation for both single-slice turns and outer block turns). A reduction state is where the center pieces are solved (all 4 of each color are on a single face, and in the proper arrangement with respect to each other for the cube's color scheme) and all dedges are paired up.



unsolved said:


> The following are the moves that get pruned if they are generated in cascade:



I note that you are simply listing all possible 81 combinations of all 4 layers being turned for each of the 3 axes.


----------



## unsolved (Apr 27, 2014)

cuBerBruce said:


> These are the same position as long as you consider that the orientation of the cube doesn't matter. I didn't think you were doing that so far, but I could be wrong.



I am trying to implement this now, and am testing it.



cuBerBruce said:


> If you consider that the orientation of the cube doesn't matter, then you should consider the solved cube in any of 24 orientation is still a solved cube. You may be able to consider only one orientation as solved if you do 24 separate searches with each search using a different orientation of the initial cube or a different orientation of the solved cube, but this seems inefficient to me.



The supercomputer at work I feed each of the 24 possible orientations, each to a different CPU. The move generators generate the same moves, just on each possible orientation. The solution then gets "translated" to a cube with UFR orientation during a solve. I don't have access to this over the weekend though, and am having enough trouble with version control for the array and bitboard move generators.



cuBerBruce said:


> Relating to the above, consider the simple scramble U u d'. This scramble should have a 1-move solution.



Yes, I wholeheartedly agree! And, of course, my program handles such a case.



cuBerBruce said:


> It does have a solution of less than 18 plies. There is a well-known maneuver that is 15 moves long: r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 r2.



Now that is interesting. According to my broken version, there are at least two different 14-ply nuggets out there waiting to be found. It tripped over an 18-ply solution after playing U u d' D' first, which is.... grrrrrrrr.... makes me so mad! Anyway, it printed out the wrong PV due to that lingering bug that I think I have all tracked down now (ha! famous last words!)

Anyway, I have search extensions turned off for now, I want to see what the cumulative effect is of pruning out the "UuD'd' junk." I should have a version ready for testing in a few minutes, once I try one last thing.



cuBerBruce said:


> I note that you are simply listing all possible 81 combinations of all 4 layers being turned for each of the 3 axes.



Is that what it was? I just turned on the pruner and had it scan depth == 4 and print out any PV that met my code's criteria for elimination. This is my first leaf node pruning algorithm, I will finally show non-zero results in my pruning variable that I print out!







Now you can see the prune counts through 7 plies. And this sheds some light on the mysterious bugs regarding the principal variations that hit some of the TFS databases. There are 178,605 nodes that have been pruned through ply 6. That means there are 178,605 positions in the TFS databases with duplicate turns-from-solved distances. And, worst of all, I solved them in an order that would have the most bloated solution with the highest count go about generating an index corresponding to a smaller number of moves in a solution already placed in the database.

I need to re-implement the TFS solver using the new pruning technique to eliminate those entries. Or, more accurately, never have included them in the first place.

*UPDATE:*

So now I cut the 6-TFS database down to 12 GB after avoiding all of the no-net-gain positions. I also changed the compression scheme so it averages exactly 20.01 bytes per position, better than before. And while I was waiting for the thing to run, I messed up one of my own 4x4x4 solves pretty bad. So I give it to the new version to try and test.






Top = white, front = red, right = blue, bottom = yellow, back = orange, left = green. Hold the cube with top-front-right facing you, and the solutions work.
With search extensions on, it finds a 14-ply solution for me, and it works, no problem!


----------



## unsolved (Apr 28, 2014)

*New Version With "Enter Scramble" Code*

Thanks to Bruce for sharing his "enter scramble" code, I now have a version where you can test your own scrambles:

http://lightningcloudcomputing.com/OO_4x4x4.zip

Please enter scrambles longer than 6 moves if you are able to load the entire 6-TFS database into RAM.

And, can someone test these solutions out on a cube? Mine is a mess right now 

*EDIT: Use the scramble shown by the input arrow, not the one re-printed onto the screen. Fixed the "reprint scramble entered" bug, so if you have version 1.1.8 or later, this is fixed.*








```
Nodes: The count of 4x4x4 positions generated by the program as it searches.

Leaf Nodes Pruned: The number of nodes (positions) that were filtered out before going to the next level. This reduces the size of the game tree. Bruce's program has excellent leaf node pruning right now.

Depth XX-YY: XX is the distance from the parent position that the move generator has reached. YY is the deepest search completed using the RAM-based databases.

TFS = "turns from solution." This is a number from 1 to 6 currently, and it measures the distance a cube position is from a solved state.

TFS Database Probes: This is a count of how many times the database was queried for ANY distance to solve: 1, 2, 3, 4, 5 and 6 (if you have 12 GB of RAM to load the 6-TFS database).

1-TFS Probes, 2-TFS Probes... 6-TFS Probes: These are individual counts of database queries only within the respective turns-from-solution.

TFS Database Misses: The counts all of the times the database was queried and DID NOT find a database entry.

Database Activity: The sum of all probes, misses, and leaf node prunes

Solution (with arrow): The first solution at an improved solving distance. Other solutions of EQUAL distance will be shown. If the distance ever improves (gets less) then only the shortest distances will be reported from that point forward.

[Inside X-TFS] --->: Moves to the left of the bracket are from the move generator. Moves to the right of the arrow come from the RAM-database. "X" is the distance measure of the database that was probed.
```


----------



## cuBerBruce (Apr 28, 2014)

I have tried running this program on my computer which has 12 GB RAM. It tries to create the TFS database, but apparently tries to allocate so much memory the computer becomes almost totally unresponsive except for some ability to move the mouse around some of the time. Trying to terminate the process from the Task Manager can take several minutes (no exaggeration) before the confirmation popup appears.

I will not try downloading another version of this program unless I have the ability to force what size TFS database to use, or have the ability to limit how much memory it will be allowed to allocate.


----------



## unsolved (Apr 28, 2014)

cuBerBruce said:


> I have tried running this program on my computer which has 12 GB RAM. It tries to create the TFS database, but apparently tries to allocate so much memory the computer becomes almost totally unresponsive except for some ability to move the mouse around some of the time. Trying to terminate the process from the Task Manager can take several minutes (no exaggeration) before the confirmation popup appears.
> 
> I will not try downloading another version of this program unless I have the ability to force what size TFS database to use, or have the ability to limit how much memory it will be allowed to allocate.



Here is a 5-TFS only version of the program. Requires 450 MB.

http://lightningcloudcomputing.com/4x4x4_5.zip

The program checks to see if the OS grants a request to "malloc()" memory. If you are using Virtual Memory and don't have actual RAM available, that can be a bad thing for any high performance piece of software.
I've run 2 instances of my 6-TFS on this machine at the same time with no problems, then loaded another copy of it, and it automatically switched to the 5-TFS load. There is also a 4-TFS only load if that fails.

I suggest a clean reboot and running it all alone if you have a machine with 16 GB or more. Who knows how much the OS is grabbing or what other background task might be stealing.

*UPDATE: I am working on a new version with more options at startup for you Bruce:*






I'll let you know when it is online.


----------



## Carrot (Apr 28, 2014)

```
Solution to 4x4x4 cube Scramble = r2 U2 r2 u2 U2 r2 u2 L2 R2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|~~~~|####|####|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|~~~~|   |&&&&|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|~~~~|   |&&&&|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|~~~~|####|####|~~~~|   |&&&&|OOOO|OOOO|&&&&|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|OOOO|OOOO|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|####|~~~~|~~~~|####|   |OOOO|&&&&|&&&&|OOOO|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u2 R2 l2 [inside 6-TFS] ---> L2 D2 d2 r2 D2 l2  @ 0000000004692 nodes with 0000000061918 6-TFS probes 
...
Solution [065] =  L2 d2 l2 [inside 6-TFS] ---> U2 l2 U2 l2 d2 R2  @ 0000000018795 nodes with 0000000212901 6-TFS probes   
** Search completed. **

****** PICTURE WAS MISSING!!!! AND SCRAMBLE!!!!! *****
→ u l f r d b u' l' f' r' d' b'

 TOP                     FRONT                   RIGHT
 ---------------------   ---------------------   ---------------------
 |####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
 ---------------------   ---------------------   ---------------------
 |####|OOOO|OOOO|####|   |OOOO|XXXX|~~~~|OOOO|   |XXXX|&&&&|XXXX|XXXX|
 ---------------------   ---------------------   ---------------------
 |####|####|^^^^|####|   |OOOO|XXXX|OOOO|OOOO|   |XXXX|~~~~|####|XXXX|
 ---------------------   ---------------------   ---------------------
 |####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
 ---------------------   ---------------------   ---------------------


 BOTTOM                  BACK                    LEFT
 ---------------------   ---------------------   ---------------------
 |~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
 ---------------------   ---------------------   ---------------------
 |~~~~|~~~~|XXXX|~~~~|   |&&&&|####|^^^^|&&&&|   |^^^^|^^^^|OOOO|^^^^|
 ---------------------   ---------------------   ---------------------
 |~~~~|&&&&|&&&&|~~~~|   |&&&&|&&&&|^^^^|&&&&|   |^^^^|~~~~|####|^^^^|
 ---------------------   ---------------------   ---------------------
 |~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
 ---------------------   ---------------------   ---------------------

Solution [066] =  d' l  d2 f  b' [inside 6-TFS] ---> d' u  l' f' u' b   @ 0000004416550 nodes with 0000058015996 6-TFS probes   
... 
Solution [073] =  b  d  r  b' l2 [inside 6-TFS] ---> f' d' f2 r' f' l2  @ 0000020149482 nodes with 0000230714530 6-TFS probes   
** Search completed. **
```

Worked for me


----------



## unsolved (Apr 28, 2014)

Carrot said:


> ```
> Worked for me[/QUOTE]
> 
> Wow, did it really find 73 solutions?
> ```


----------



## Carrot (Apr 28, 2014)

unsolved said:


> Wow, did it really find 73 solutions?



obviously it's 2 different cases.

but I have a few questions:
_"However, due to the very large branching factor there
is a limit to its horizon of approximately 12 turns on a slow computer, 13 turns on a fairly fast system & 14
turns on a top-of-the-line computer. I have access to hardware at my office that can find 16-turn solutions."_

How fast is it supposed to find those 12, 13 and 14 move solutions? like a day? xD



Whenever I input a sequence it will obviously load it and everything seems fine, just until I load the next scramble, because then it applies that AFTER the end of the previous scramble, but it still works. So I figured, I can just reset it by entering the solutions it found. which also works, and then I enter the new sequence, which also works. it does indeed find the solutions, but that's it, it just finds them, it doesn't actually output. and after this it refuses to output solutions (in both the prompt and the file)
I can obviously reset all these bugs by just re-opening, but given that takes 3:30 on average it is maybe not the best solution


----------



## unsolved (Apr 28, 2014)

Carrot said:


> obviously it's 2 different cases.



This is what I get when I run it:


```
Solutions To Scramble = u l' f r d' b' u' l f' r' d b 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|XXXX|~~~~|OOOO|   |XXXX|&&&&|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|^^^^|####|   |OOOO|XXXX|OOOO|OOOO|   |XXXX|~~~~|####|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|XXXX|~~~~|   |&&&&|####|^^^^|&&&&|   |^^^^|^^^^|OOOO|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|&&&&|&&&&|~~~~|   |&&&&|&&&&|^^^^|&&&&|   |^^^^|~~~~|####|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  d' l  d2 f  b' [inside 6-TFS] ---> d' u  l' f' u' b   @ 0000004416550 nodes with 0000057691095 6-TFS probes   
Solution [002] =  r2 l  f' l2 d2 [inside 6-TFS] ---> r  d' f  l  d' r   @ 0000011424132 nodes with 0000134693534 6-TFS probes   
Solution [003] =  r2 l2 f' l  d  [inside 6-TFS] ---> r  f  l' d' l2 r   @ 0000011445380 nodes with 0000134924652 6-TFS probes   
Solution [004] =  l  u  l2 d' l  [inside 6-TFS] ---> d  b  r  b' u' r'  @ 0000012466208 nodes with 0000146133299 6-TFS probes   
Solution [005] =  l  u  l2 b  r  [inside 6-TFS] ---> b' d' l  d  u' r'  @ 0000012466654 nodes with 0000146137179 6-TFS probes   
Solution [006] =  l  u  b  r  b' [inside 6-TFS] ---> l2 d' l  d  u' r'  @ 0000012475330 nodes with 0000146230770 6-TFS probes   
Solution [007] =  b' l' u2 l' f2 [inside 6-TFS] ---> u' l2 b2 f2 u' b'  @ 0000019799598 nodes with 0000226557067 6-TFS probes   
Solution [008] =  b  d  r  b' l2 [inside 6-TFS] ---> f' d' f2 r' f' l2  @ 0000020149482 nodes with 0000230389629 6-TFS probes   
** Search completed. **
```



Carrot said:


> but I have a few questions:
> _"However, due to the very large branching factor there
> is a limit to its horizon of approximately 12 turns on a slow computer, 13 turns on a fairly fast system & 14
> turns on a top-of-the-line computer. I have access to hardware at my office that can find 16-turn solutions."_
> ...



Well, it used to take the program about an hour to find an 8-ply solution, but it has made a fair amount of progress. If I ever figure out the corner orientation code (which is giving me fits!) the program will be able to reach about 5-7 plies deeper, getting close to 20 plies.



Carrot said:


> Whenever I input a sequence it will obviously load it and everything seems fine, just until I load the next scramble, because then it applies that AFTER the end of the previous scramble, but it still works. So I figured, I can just reset it by entering the solutions it found. which also works, and then I enter the new sequence, which also works. it does indeed find the solutions, but that's it, it just finds them, it doesn't actually output. and after this it refuses to output solutions (in both the prompt and the file)
> I can obviously reset all these bugs by just re-opening, but given that takes 3:30 on average it is maybe not the best solution



Yeah, somewhere I am missing a re-initialization of the search parameters. All I need to do is add one line of code to fix this. Thanks for letting me know, I'll start on that now.


----------



## Carrot (Apr 28, 2014)

unsolved said:


> .. above post..



Ohh ya I forgot: it reads the sequences you input correctly, but stores the moves wrong, so the scramble you see in the file was not the scramble it actually solved.

the original scramble it had to solve was: u l f r d b u' l' f' r' d' b'


----------



## cuBerBruce (Apr 28, 2014)

unsolved said:


> If I ever figure out the corner orientation code (which is giving me fits!) the program will be able to reach about 5-7 plies deeper, getting close to 20 plies.


Corner pruning will allow pruning about 9-10 moves from solved. You are (in effect) pruning 6 moves from solved right now with your 6-TFS database. So with corner pruning you will only be getting about 4 moves deeper, not 5-7. Maybe deeper if you're also considering edge pairing combined with corner configuration.


----------



## unsolved (Apr 28, 2014)

Carrot said:


> Ohh ya I forgot: it reads the sequences you input correctly, but stores the moves wrong, so the scramble you see in the file was not the scramble it actually solved.
> 
> the original scramble it had to solve was: u l f r d b u' l' f' r' d' b'



I think it only draws U' when the input is U, and U when the input is U'. I fixed that bug now (still did not upload it but will later on).

Also, I fixed the "keeps scrambling from the previous scramble" bug.

Thanks for your feedback, it has been very helpful!


cuBerBruce said:


> Corner pruning will allow pruning about 9-10 moves from solved. You are (in effect) pruning 6 moves from solved right now with your 6-TFS database. So with corner pruning you will only be getting about 4 moves deeper, not 5-7. Maybe deeper if you're also considering edge pairing combined with corner configuration.



Yes, but the program will be able to prune 6 moves from whatever position it reaches. If the corner pruning extends 9-10, I am wondering if TFS would be purely additive and extend that to 15-16?


----------



## qqwref (Apr 28, 2014)

I don't think the pruning is additive in this case. Given a position far from solved, your 6-TFS table tells you if it cannot be solved in les than 7 moves, and the corner pruning table tells you (maybe) if it cannot be solved in less than about 9-10 moves. You can only add the two if you want to apply every 6-move sequence to the position and then check THAT against the corner pruning table.


----------



## unsolved (Apr 29, 2014)

qqwref said:


> I don't think the pruning is additive in this case. Given a position far from solved, your 6-TFS table tells you if it cannot be solved in les than 7 moves, and the corner pruning table tells you (maybe) if it cannot be solved in less than about 9-10 moves. You can only add the two if you want to apply every 6-move sequence to the position and then check THAT against the corner pruning table.



Very true.

But look at my node counts when I miss the TFS databases: they are huge.

Now, imagine Bruce's node counts for the same nominal depths (very small) and then speculate what would happen if you could apply the 6-TFS on top of that.

You would not "get deeper" by virtue of the two disjoint pruning methods acting as if they are the same type of mechanism, but you would get deeper via probing a much smaller tree! Even my slowest move generator (array-based laden with the 12 GB 6-TFS being probed heavily) can average 40,000,000 turns per second.

Some of Bruce's postings don't even have 40,000,000 nodes total! So that means if I pruned the leaf nodes as heavily, *OO_4x4x4* would reach the same conclusion in less than one second. Of course this operates under the conjecture that there is 0-overhead for the leaf node pruner, which is not the case, but it would be minimal.

*UPDATE: Version 1.2.1 now online*

http://lightningcloudcomputing.com/OO_4x4x4.zip






The newest version of *OO_4x4x4* has the following features:

1. The new Memory Menu (above) recommended by Bruce has been implemented and heavily tested. As you can see, the program differentiates from Bill Gate's absurd assumption that Virtual RAM is just as good as Physical RAM when it comes to trying to load a program under Windows. I now look at the Physical RAM that is available, and recommend options based on that. If you have less Physical RAM than any TFS database would need for a 100% loading factor, you don't even have the option to try and access it. You could always down-step though.

2. The Principal Variation bug was located, taken out back, and shot. Hopefully, it will remain dead. Please test this and let me know! It was a "conversion" issue that arose from (again, Bruce being a big help here) the fact that the moves were entered into the database in the order they were generated, and the position is being identified during a search. Well, the moves you made to create the position are really not of interest! What is of great help though, are the moves to make in order to solve the cube. The issue was complicated by the fact that any database also contains every smaller database within the same RAM cluster. So, when the 6-TFS database finds a solution with 5 moves, it would attempt to "convert" the 6th move and show it first in the PV, then convert the 5th move and show it second (which is normal when you flip the entire move order from scramble to solve), and so on. The problem is, in this case, *there was no 6th move*, it was a 5-move solution! This was also the case for a 4-mover inside 6-TFS, a 3-mover, etc., as well as 4-movers inside 5-TFS, 3-movers inside 5-TFS .... all the way down to 1 movers inside 2-TFS. This took a re-coding effort to fully purge.

3. The Enter Scramble bug seems to have gone away after some shotgun style coding. I am not 100% convinced it is gone for good. Test multiple scrambles of different sorts, and see if you get all correct solutions for everything *OO_4x4x4* throws out there. Let me know if you find a bug, I will smack it silly if I can locate it.

So this is the most stable version so far. Thanks for all of the debugging help to all of those who have contributed.

P.S. I pronounce the nickname of the program as "Oh Oh 4 by 4 by 4" if anyone actually cares


----------



## cuBerBruce (Apr 29, 2014)

unsolved said:


> Now, imagine Bruce's node counts for the same nominal depths (very small) and then speculate what would happen if you could apply the 6-TFS on top of that.



You need to understand that the pruning is based upon the *solution length that is currently being sought*. If I'm seeking a solution of length n, and I reach a node at depth n from the scramble position, then I merely need to check if that node represents a solved cube. Now I could look up that position in a "TFS" database if I have one, to see if that position that I've reached is within 6 moves from solved. The problem with this is that if the optimal solution is actually n + 6 moves, then I likely may have already pruned the branch containing the optimal solution *too early*, because my pruning decisions were been based upon finding a solution of length n, not for a length n + 6. If you don't want to miss a solution of length n + 6, your pruning decision must be based upon finding a solution of length n + 6. And if you base your pruning on finding of length n + 6, you will have less pruning at shorter depths from the scramble position than if your pruning had been based upon finding a solution of length n.


----------



## unsolved (Apr 29, 2014)

cuBerBruce said:


> You need to understand that the pruning is based upon the *solution length that is currently being sought*. If I'm seeking a solution of length n, and I reach a node at depth n from the scramble position, then I merely need to check if that node represents a solved cube.



And I do 

My thinking was to prune for the sake of thinning out the tree, forgetting the fact a hypothetical TFS database exists. At depth 0 of the very first search, and for the root position only, apply the TFS check one time just to see if you are within a 6-ply radius of being done before you even start. If not, use the leaf node pruning mechanism to thin out the game tree for the remainder of all searches. Only apply the TFS query to the nodes that pass through your pruning check. Any such position, by definition, must require more than (terminal depth - current depth) moves to solve, since even the corner state with the rest of the cube in immaculate condition could not be solved in fewer than that number of moves.

You get the best of both worlds. You won't misevaluate any obvious quick solutions, and by thinning out the game tree, you make the TFS much more effective at finding truly lengthy solves.


----------



## cuBerBruce (Apr 29, 2014)

unsolved said:


> My thinking was to prune for the sake of thinning out the tree, forgetting the fact a hypothetical TFS database exists. At depth 0 of the very first search, and for the root position only, apply the TFS check one time just to see if you are within a 6-ply radius of being done before you even start. If not, use the leaf node pruning mechanism to thin out the game tree for the remainder of all searches. Only apply the TFS query to the nodes that pass through your pruning check. Any such position, by definition, must require more than (terminal depth - current depth) moves to solve, since even the corner state with the rest of the cube in immaculate condition could not be solved in fewer than that number of moves.



Let's say you have a "TFS" database of depth 6. Let's say you are currently looking for a solution of length 14, having previously guaranteed no solution of length 13 exists. Then we know we don't have to check the TFS database until we've reached a depth of 8 moves from the scramble position. The TFS database will then tell us whether or not we can reach a solution of distance 14 from this search branch. But to be sure we haven't pruned away a good branch up to this point, we must have been making pruning decisions based upon a desired solution length of *14*, not 8. This generally makes a big difference in how much pruning you can do.

For instance, let's say your best pruning table can only guarantee (at best) a position being at least 11 moves from solved. Then you will not be able to do any pruning at all until you're at least 4 moves from the scramble position. (Technically there may be tricks that might allow pruning at only 3 moves out in this case, but I'll ignore that for now.) At 4 moves out, if the pruning table tells you that you're at least 11 moves from solved, then you know you're not going to get a solution < 15 moves on this branch, and that is larger than your current goal of 14. So you might be able to get some pruning at 4 moves away from your scramble.

If we were doing pruning based upon a goal of 8 moves, we likely might find out right off that we're 9, 10, or 11 moves away from solved, and not have to generate any nodes at all. But this does not guarantee we're at least 15 moves from solved so we could be pruning away a good branch if we did this. Having the TFS database basically does us no good at all until we're out far enough from the scramble position to have a chance at hitting a database position.



unsolved said:


> You get the best of both worlds. You won't misevaluate any obvious quick solutions, and by thinning out the game tree, you make the TFS much more effective at finding truly lengthy solves.



You can look at the TFS database as being just another pruning table - "perfect" for when you're at position within its depth, and basically not useful beyond that. But it generally requires a lot of memory for what you get from it. Most solvers use a smaller pruning table for pruning at shallow depths without using up a huge amount of memory. This can get you close to the same pruning quality and save a lot of memory. This is why such TFS databases aren't generally used.

EDIT (appending):
I've been using the 5-TFS version to search for O-Perm solutions for about a day. I knew there existed a 13-move solution, so I knew it would not have to search deeper than that. The spoiler has my results so far.


Spoiler





```
→Solution [170] =  u2 r2 U2 r2 b2 U' u2 b2 [inside 5-TFS] ---> r2 U  b2 U2 r2  @ 0083747294322 nodes with 1113921230625 5-TFS probes
  Solution [171] =  u2 r2 U2 r2 b2 U' r2 b2 [inside 5-TFS] ---> U  b2 U2 r2 u2  @ 0083747294664 nodes with 1113921234958 5-TFS probes
  Solution [172] =  u2 r2 U2 r2 b2 U' b2 r2 [inside 5-TFS] ---> U  b2 U2 r2 u2  @ 0083747295081 nodes with 1113921239047 5-TFS probes
  Solution [173] =  u2 r2 U2 r2 b2 D' r2 f2 [inside 5-TFS] ---> D  b2 U2 r2 u2  @ 0083747301051 nodes with 1113921299992 5-TFS probes
  Solution [174] =  u2 r2 U2 r2 b2 D' f2 r2 [inside 5-TFS] ---> D  b2 U2 r2 u2  @ 0083747301387 nodes with 1113921303658 5-TFS probes
  Solution [175] =  u2 r2 U2 f2 U  r2 u2 f2 [inside 5-TFS] ---> U' f2 r2 U2 r2  @ 0083754318918 nodes with 1113997133485 5-TFS probes
  Solution [176] =  u2 r2 U2 f2 U  r2 f2 U' [inside 5-TFS] ---> f2 r2 U2 r2 u2  @ 0083754319391 nodes with 1113997138019 5-TFS probes
  Solution [177] =  u2 r2 U2 f2 U  f2 r2 U' [inside 5-TFS] ---> f2 r2 U2 r2 u2  @ 0083754328850 nodes with 1113997242654 5-TFS probes
  Solution [178] =  u2 r2 U2 f2 D  r2 b2 D' [inside 5-TFS] ---> f2 r2 U2 r2 u2  @ 0083754544447 nodes with 1113999588875 5-TFS probes
  Solution [179] =  u2 r2 U2 f2 D  b2 r2 D' [inside 5-TFS] ---> f2 r2 U2 r2 u2  @ 0083754556171 nodes with 1113999720171 5-TFS probes
  Solution [180] =  u2 r2 u2 f2 U  r2 U2 f2 [inside 5-TFS] ---> U' f2 U2 r2 f2  @ 0083810148564 nodes with 1114600320056 5-TFS probes
  Solution [181] =  u2 r2 u2 f2 U  r2 D2 b2 [inside 5-TFS] ---> U' b2 D2 r2 f2  @ 0083810148810 nodes with 1114600322673 5-TFS probes
  Solution [182] =  u2 r2 u2 f2 U' f2 U2 r2 [inside 5-TFS] ---> U  f2 U2 r2 f2  @ 0083810184192 nodes with 1114600701781 5-TFS probes
  Solution [183] =  u2 r2 D2 l2 f2 U' l2 f2 [inside 5-TFS] ---> U  f2 D2 r2 u2  @ 0083900882406 nodes with 1115580379071 5-TFS probes
  Solution [184] =  u2 r2 D2 l2 f2 U' f2 l2 [inside 5-TFS] ---> U  f2 D2 r2 u2  @ 0083900882664 nodes with 1115580382325 5-TFS probes
  Solution [185] =  u2 r2 D2 l2 f2 D' l2 b2 [inside 5-TFS] ---> D  f2 D2 r2 u2  @ 0083900888799 nodes with 1115580448514 5-TFS probes
  Solution [186] =  u2 r2 D2 l2 f2 D' b2 l2 [inside 5-TFS] ---> D  f2 D2 r2 u2  @ 0083900889138 nodes with 1115580452852 5-TFS probes
  Solution [187] =  u2 r2 D2 b2 U  l2 b2 U' [inside 5-TFS] ---> b2 l2 D2 r2 u2  @ 0083908039331 nodes with 1115657726602 5-TFS probes
  Solution [188] =  u2 r2 D2 b2 U  b2 l2 U' [inside 5-TFS] ---> b2 l2 D2 r2 u2  @ 0083908048871 nodes with 1115657829165 5-TFS probes
  Solution [189] =  u2 r2 D2 b2 D  l2 f2 D' [inside 5-TFS] ---> b2 l2 D2 r2 u2  @ 0083908264219 nodes with 1115660138632 5-TFS probes
  Solution [190] =  u2 r2 D2 b2 D  f2 l2 D' [inside 5-TFS] ---> b2 l2 D2 r2 u2  @ 0083908271494 nodes with 1115660214473 5-TFS probes
  Solution [191] =  u2 r2 f2 U  r2 U2 f2 U' [inside 5-TFS] ---> f2 U2 r2 f2 u2  @ 0084105544976 nodes with 1117791755364 5-TFS probes
  Solution [192] =  u2 r2 f2 U  r2 D2 b2 U' [inside 5-TFS] ---> b2 D2 r2 f2 u2  @ 0084105551891 nodes with 1117791829576 5-TFS probes
  Solution [193] =  u2 r2 f2 U' f2 U2 u2 r2 [inside 5-TFS] ---> U  f2 U2 r2 f2  @ 0084106546434 nodes with 1117802579851 5-TFS probes
  Solution [194] =  u2 r2 f2 U' f2 U2 r2 U  [inside 5-TFS] ---> f2 U2 r2 f2 u2  @ 0084106546765 nodes with 1117802583769 5-TFS probes
  Solution [195] =  u2 r2 f2 U' f2 D2 l2 U  [inside 5-TFS] ---> b2 D2 r2 f2 u2  @ 0084106553680 nodes with 1117802660632 5-TFS probes
  Solution [196] =  u2 r2 f2 U2 r2 U  u2 f2 [inside 5-TFS] ---> U2 r2 U' r2 f2  @ 0084107006292 nodes with 1117807541810 5-TFS probes
  Solution [197] =  u2 r2 f2 U2 r2 U  f2 U2 [inside 5-TFS] ---> r2 U' r2 f2 u2  @ 0084107006955 nodes with 1117807548487 5-TFS probes
  Solution [198] =  u2 r2 f2 U2 r2 U' u2 r2 [inside 5-TFS] ---> U2 f2 U  r2 f2  @ 0084107007207 nodes with 1117807551312 5-TFS probes
  Solution [199] =  u2 r2 f2 U2 r2 U' r2 U2 [inside 5-TFS] ---> f2 U  r2 f2 u2  @ 0084107007540 nodes with 1117807554827 5-TFS probes
  Solution [200] =  u2 r2 f2 U2 r2 D' f2 U2 [inside 5-TFS] ---> l2 D  r2 f2 u2  @ 0084107014272 nodes with 1117807624558 5-TFS probes
  Solution [201] =  u2 r2 f2 U2 r2 D  r2 U2 [inside 5-TFS] ---> b2 D' r2 f2 u2  @ 0084107014614 nodes with 1117807628116 5-TFS probes
  Solution [202] =  u2 r2 f2 D' l2 U2 f2 D  [inside 5-TFS] ---> f2 U2 r2 f2 u2  @ 0084111395453 nodes with 1117854904425 5-TFS probes
  Solution [203] =  u2 r2 f2 D' l2 D2 b2 D  [inside 5-TFS] ---> b2 D2 r2 f2 u2  @ 0084111402368 nodes with 1117854981490 5-TFS probes
  Solution [204] =  u2 r2 f2 D  b2 U2 u2 r2 [inside 5-TFS] ---> D' f2 U2 r2 f2  @ 0084112205418 nodes with 1117863676903 5-TFS probes
  Solution [205] =  u2 r2 f2 D  b2 U2 r2 D' [inside 5-TFS] ---> f2 U2 r2 f2 u2  @ 0084112205758 nodes with 1117863680958 5-TFS probes
  Solution [206] =  u2 r2 f2 D  b2 D2 l2 D' [inside 5-TFS] ---> b2 D2 r2 f2 u2  @ 0084112212673 nodes with 1117863755903 5-TFS probes
  Solution [207] =  u2 r2 f2 D2 l2 U  b2 D2 [inside 5-TFS] ---> r2 U' r2 f2 u2  @ 0084112474548 nodes with 1117866578932 5-TFS probes
  Solution [208] =  u2 r2 f2 D2 l2 U' l2 D2 [inside 5-TFS] ---> f2 U  r2 f2 u2  @ 0084112475133 nodes with 1117866585636 5-TFS probes
  Solution [209] =  u2 r2 f2 D2 l2 D' b2 D2 [inside 5-TFS] ---> l2 D  r2 f2 u2  @ 0084112481865 nodes with 1117866655723 5-TFS probes
  Solution [210] =  u2 r2 f2 D2 l2 D  l2 D2 [inside 5-TFS] ---> b2 D' r2 f2 u2  @ 0084112482207 nodes with 1117866659746 5-TFS probes
  Solution [211] =  u2 l2 U2 l2 f2 U' u2 l2 [inside 5-TFS] ---> f2 U  f2 U2 l2  @ 0085217765070 nodes with 1129809640428 5-TFS probes
  Solution [212] =  u2 l2 U2 l2 f2 U' u2 f2 [inside 5-TFS] ---> l2 U  f2 U2 l2  @ 0085217765079 nodes with 1129809640582 5-TFS probes
  Solution [213] =  u2 l2 U2 l2 f2 U' l2 f2 [inside 5-TFS] ---> U  f2 U2 l2 u2  @ 0085217765502 nodes with 1129809645236 5-TFS probes
  Solution [214] =  u2 l2 U2 l2 f2 U' f2 l2 [inside 5-TFS] ---> U  f2 U2 l2 u2  @ 0085217765760 nodes with 1129809648592 5-TFS probes
  Solution [215] =  u2 l2 U2 l2 f2 D' l2 b2 [inside 5-TFS] ---> D  f2 U2 l2 u2  @ 0085217771895 nodes with 1129809713006 5-TFS probes
  Solution [216] =  u2 l2 U2 l2 f2 D' b2 l2 [inside 5-TFS] ---> D  f2 U2 l2 u2  @ 0085217772234 nodes with 1129809716896 5-TFS probes
  Solution [217] =  u2 l2 U2 b2 U  l2 u2 b2 [inside 5-TFS] ---> U' b2 l2 U2 l2  @ 0085224921954 nodes with 1129887027383 5-TFS probes
  Solution [218] =  u2 l2 U2 b2 U  l2 b2 U' [inside 5-TFS] ---> b2 l2 U2 l2 u2  @ 0085224922427 nodes with 1129887033344 5-TFS probes
  Solution [219] =  u2 l2 U2 b2 U  b2 l2 U' [inside 5-TFS] ---> b2 l2 U2 l2 u2  @ 0085224931967 nodes with 1129887138228 5-TFS probes
  Solution [220] =  u2 l2 U2 b2 D  l2 f2 D' [inside 5-TFS] ---> b2 l2 U2 l2 u2  @ 0085225147315 nodes with 1129889463734 5-TFS probes
  Solution [221] =  u2 l2 U2 b2 D  f2 l2 D' [inside 5-TFS] ---> b2 l2 U2 l2 u2  @ 0085225154590 nodes with 1129889542322 5-TFS probes
  Solution [222] =  u2 l2 u2 b2 U  l2 U2 b2 [inside 5-TFS] ---> U' b2 U2 l2 b2  @ 0085280751600 nodes with 1130490262796 5-TFS probes
  Solution [223] =  u2 l2 u2 b2 U  l2 D2 f2 [inside 5-TFS] ---> U' f2 D2 l2 b2  @ 0085280751840 nodes with 1130490264951 5-TFS probes
  Solution [224] =  u2 l2 u2 b2 U' b2 U2 l2 [inside 5-TFS] ---> U  b2 U2 l2 b2  @ 0085280787228 nodes with 1130490650817 5-TFS probes
  Solution [225] =  u2 l2 D2 r2 b2 U' r2 b2 [inside 5-TFS] ---> U  b2 D2 l2 u2  @ 0085367896656 nodes with 1131432103264 5-TFS probes
  Solution [226] =  u2 l2 D2 r2 b2 U' b2 r2 [inside 5-TFS] ---> U  b2 D2 l2 u2  @ 0085367897073 nodes with 1131432107167 5-TFS probes
  Solution [227] =  u2 l2 D2 r2 b2 D' r2 f2 [inside 5-TFS] ---> D  b2 D2 l2 u2  @ 0085367903043 nodes with 1131432171310 5-TFS probes
  Solution [228] =  u2 l2 D2 r2 b2 D' f2 r2 [inside 5-TFS] ---> D  b2 D2 l2 u2  @ 0085367903379 nodes with 1131432175499 5-TFS probes
  Solution [229] =  u2 l2 D2 f2 U  r2 f2 U' [inside 5-TFS] ---> f2 r2 D2 l2 u2  @ 0085374921383 nodes with 1131507934912 5-TFS probes
  Solution [230] =  u2 l2 D2 f2 U  f2 r2 U' [inside 5-TFS] ---> f2 r2 D2 l2 u2  @ 0085374930842 nodes with 1131508042038 5-TFS probes
  Solution [231] =  u2 l2 D2 f2 D  r2 b2 D' [inside 5-TFS] ---> f2 r2 D2 l2 u2  @ 0085375146439 nodes with 1131510379984 5-TFS probes
  Solution [232] =  u2 l2 D2 f2 D  b2 r2 D' [inside 5-TFS] ---> f2 r2 D2 l2 u2  @ 0085375158163 nodes with 1131510507608 5-TFS probes
  Solution [233] =  u2 l2 b2 U  l2 U2 b2 U' [inside 5-TFS] ---> b2 U2 l2 b2 u2  @ 0085576148012 nodes with 1133681479203 5-TFS probes
  Solution [234] =  u2 l2 b2 U  l2 D2 f2 U' [inside 5-TFS] ---> f2 D2 l2 b2 u2  @ 0085576154759 nodes with 1133681550673 5-TFS probes
  Solution [235] =  u2 l2 b2 U' b2 U2 u2 l2 [inside 5-TFS] ---> U  b2 U2 l2 b2  @ 0085577149389 nodes with 1133692283704 5-TFS probes
  Solution [236] =  u2 l2 b2 U' b2 U2 l2 U  [inside 5-TFS] ---> b2 U2 l2 b2 u2  @ 0085577149801 nodes with 1133692288053 5-TFS probes
  Solution [237] =  u2 l2 b2 U' b2 D2 r2 U  [inside 5-TFS] ---> f2 D2 l2 b2 u2  @ 0085577156548 nodes with 1133692364284 5-TFS probes
  Solution [238] =  u2 l2 b2 U2 l2 U  u2 b2 [inside 5-TFS] ---> U2 l2 U' l2 b2  @ 0085577609247 nodes with 1133697254688 5-TFS probes
  Solution [239] =  u2 l2 b2 U2 l2 U  b2 U2 [inside 5-TFS] ---> l2 U' l2 b2 u2  @ 0085577609991 nodes with 1133697262885 5-TFS probes
  Solution [240] =  u2 l2 b2 U2 l2 U' u2 l2 [inside 5-TFS] ---> U2 b2 U  l2 b2  @ 0085577610162 nodes with 1133697264536 5-TFS probes
  Solution [241] =  u2 l2 b2 U2 l2 U' l2 U2 [inside 5-TFS] ---> b2 U  l2 b2 u2  @ 0085577610576 nodes with 1133697268465 5-TFS probes
  Solution [242] =  u2 l2 b2 U2 l2 D' b2 U2 [inside 5-TFS] ---> r2 D  l2 b2 u2  @ 0085577617308 nodes with 1133697339323 5-TFS probes
  Solution [243] =  u2 l2 b2 U2 l2 D  l2 U2 [inside 5-TFS] ---> f2 D' l2 b2 u2  @ 0085577617650 nodes with 1133697342744 5-TFS probes
  Solution [244] =  u2 l2 b2 D' r2 U2 b2 D  [inside 5-TFS] ---> b2 U2 l2 b2 u2  @ 0085581866297 nodes with 1133743278786 5-TFS probes
  Solution [245] =  u2 l2 b2 D' r2 D2 f2 D  [inside 5-TFS] ---> f2 D2 l2 b2 u2  @ 0085581873044 nodes with 1133743352056 5-TFS probes
  Solution [246] =  u2 l2 b2 D  f2 U2 u2 l2 [inside 5-TFS] ---> D' b2 U2 l2 b2  @ 0085582676181 nodes with 1133752021712 5-TFS probes
  Solution [247] =  u2 l2 b2 D  f2 U2 l2 D' [inside 5-TFS] ---> b2 U2 l2 b2 u2  @ 0085582676602 nodes with 1133752025613 5-TFS probes
  Solution [248] =  u2 l2 b2 D  f2 D2 r2 D' [inside 5-TFS] ---> f2 D2 l2 b2 u2  @ 0085582683349 nodes with 1133752100673 5-TFS probes
  Solution [249] =  u2 l2 b2 D2 r2 U  f2 D2 [inside 5-TFS] ---> l2 U' l2 b2 u2  @ 0085582945224 nodes with 1133754937971 5-TFS probes
  Solution [250] =  u2 l2 b2 D2 r2 U' r2 D2 [inside 5-TFS] ---> b2 U  l2 b2 u2  @ 0085582945809 nodes with 1133754944784 5-TFS probes
  Solution [251] =  u2 l2 b2 D2 r2 D' f2 D2 [inside 5-TFS] ---> r2 D  l2 b2 u2  @ 0085582952541 nodes with 1133755017068 5-TFS probes
  Solution [252] =  u2 l2 b2 D2 r2 D  r2 D2 [inside 5-TFS] ---> f2 D' l2 b2 u2  @ 0085582952883 nodes with 1133755020714 5-TFS probes
  DEPTHS 08-13 MOVE (06/36)  u2 F' l2 B  L  U  D  f   NODES: 0087879251587 DATABASE ACTIVITY: 000002544721722703 probes
```


----------



## unsolved (Apr 29, 2014)

cuBerBruce said:


> Let's say you have a "TFS" database of depth 6. Let's say you are currently looking for a solution of length 14, having previously guaranteed no solution of length 13 exists. Then we know we don't have to check the TFS database until we've reached a depth of 8 moves from the scramble position. The TFS database will then tell us whether or not we can reach a solution of distance 14 from this search branch. But to be sure we haven't pruned away a good branch up to this point, we must have been making pruning decisions based upon a desired solution length of *14*, not 8. This generally makes a big difference in how much pruning you can do.



Hmmmm. Yes, I see your point now. I was hoping that something along these lines would not crop up.



cuBerBruce said:


> If we were doing pruning based upon a goal of 8 moves, we likely might find out right off that we're 9, 10, or 11 moves away from solved, and not have to generate any nodes at all. But this does not guarantee we're at least 15 moves from solved so we could be pruning away a good branch if we did this. Having the TFS database basically does us no good at all until we're out far enough from the scramble position to have a chance at hitting a database position.



And turning it on or off in certain situations is plenty tricky. I was having fits with the "collapsing the noose" implementation. This is when you find a TFS hit of distance N at depth D, then you find another line of distance N-1. Do you turn off the higher distance database right away? Or do you let the iteration finish out, and then turn it off? There could be interesting gold nuggets in there that are just one move longer. Or, as you have seen, you can get hundreds of solutions that are basically every permutation of a means to enter the database at the optimal distance.

In an aggressive mining mode, you can even turn off the optimal distance TFS, if you want to search for something only better than what you have just found, and you don't care for the (possibly hundreds) of solutions of equal length pouring out of the thing. The configuration possibilities require a great deal of thought.



cuBerBruce said:


> I've been using the 5-TFS version to search for O-Perm solutions for about a day. I knew there existed a 13-move solution, so I knew it would not have to search deeper than that. The spoiler has my results so far.
> 
> * Solution [252] = u2 l2 b2 D2 r2 D r2 D2 [inside 5-TFS] ---> f2 D' l2 b2 u2 @ 0085582952883 nodes with 1133755020714 5-TFS probes
> DEPTHS 08-13 MOVE (06/36) u2 F' l2 B L U D f NODES: 0087879251587 DATABASE ACTIVITY: 000002544721722703 probes*



That is a fair number of solutions! Now I really hope I purged the PV bug for good! (I am pretty sure I did, I rewrote like 300 lines of code yesterday.)

And now a little sneak peek at tomorrow's version:







I made a couple of changes, as you can see.

The first one is pretty apparent: I added color.

The second new feature is the ability to parse a 1-line text file to input a scramble, and the interface could not be easier.
Name the text file "scramble.txt" and just put your move sequence in there. Make sure it is in the same directory as the program.
Next, at the "enter scramble" prompt, just type the lower-case letter "i," and it will load it and start searching right away.

Trying the spoiler thingee to show how easy it is to get a pre-loaded entry into the program:


Spoiler










This is "just a start" for now. Eventually I have an entire text file of scrambles process automatically, but I am not there yet.

And... whenever a new "best line of play" outdoes any of the others, or if it is the first solution found, I have it appear in yellow. 

And something you guys will probably hate me for now, but will like later once I do some leaf node pruning: I went ahead and implemented Iteration Jumping. It just seemed like a waste to rescan all of those positions constantly when they were already probed at prior iterations. If you have the 5-TFS loaded, it will jump in 2-ply increments. If you have 6-TFS, for now, I have it jump in 3-ply increments.

I may change it back if enough people start throwing stones my way.


----------



## cuBerBruce (Apr 29, 2014)

unsolved said:


> That is a fair number of solutions!



Remember this version did not reset the solution count. The first solution of this scramble was counted as #170.



unsolved said:


> And something you guys will probably hate me for now, but will like later once I do some leaf node pruning: I went ahead and implemented Iteration Jumping. It just seemed like a waste to rescan all of those positions constantly when they were already probed at prior iterations. If you have the 5-TFS loaded, it will jump in 2-ply increments. If you have 6-TFS, for now, I have it jump in 3-ply increments.
> 
> I may change it back if enough people start throwing stones my way.



*Please ... please ... please ... Make iteration jumping an optional feature only, and certainly don't even consider making it the default behavior.*

It appears it would take me days to finish a depth 13 search for O-Perm (with the 5-TFS database). It would probably take months to complete a depth 14 search to get the 13-move solutions! This makes no sense at all to enforce upon the user!

OK, I guess it would do a depth 8+5 search in this case, not a depth 14 search, but the problem will still exist for any case where the optimal solutions aren't hit using the maximum TFS depth.


----------



## unsolved (Apr 29, 2014)

cuBerBruce said:


> It appears it would take me days to finish a depth 13 search for O-Perm (with the 5-TFS database). It would probably take months to complete a depth 14 search to get the 13-move solutions! This makes no sense at all to enforce upon the user!



Days? Are you being serious?

I started this one like 20 minutes ago,






Already cruising through the 8th ply. I added an extra move onto the end of an algo just to test to see if maybe it was out of range of the 4-TFS database. You can see it hit it, then improved with a 3-TFS solution.

I have the software set to use one variable, SEARCH_EXTENSIONS, so I guess I'll add an on/off switch for you. I'll make the default option OFF.

*Edit: Why don't you send me some scrambles and I can run them here for you?*


----------



## Jakube (Apr 29, 2014)

There must be still something wrong with your solver, because none of these 13 solutions solve the scramble.


----------



## unsolved (Apr 29, 2014)

Switch l' with l and vice versa. Older version had a bug. The U, F, and R solutions were always correct. The signs of the D, B, and L solutions always had to be switched with regard to having the ' or not.


----------



## Jakube (Apr 29, 2014)

O.k. I see.


----------



## unsolved (Apr 29, 2014)

Jakube said:


> O.k. I see.



If anybody has any algos that have solves that are not merely the moves played back in reverse with the prime mark logically negated, feel free to post a bunch of them here. I want to really test this principal variation code thoroughly.

Thanks!


----------



## cuBerBruce (Apr 30, 2014)

unsolved said:


> Days? Are you being serious?



Yes. It's taken about a day just to go through { U, U' U2, u, u' u2 } as the first move at depth 13 (8+5). (First generation Core i7 processor.) That means it will take something on the order 6 days to go all the way through depth 13 if I let it continue. Of course, after it finishes r2 (halfway through), it will have found essentially every solution mod symmetries for that position (O-perm) - so no point in going farther than that. Actually I think I'll stop it and try today's version.

Regardless of how fast you can make your program or how fast the hardware you use, it is known that there are positions requiring at least 32 moves. So making the program faster will just result in people attempting to find solutions to deeper and deeper positions.


----------



## unsolved (Apr 30, 2014)

cuBerBruce said:


> Yes. It's taken about a day just to go through { U, U' U2, u, u' u2 } as the first move at depth 13 (8+5). (First generation Core i7 processor.) That means it will take something on the order 6 days to go all the way through depth 13 if I let it continue. Of course, after it finishes r2 (halfway through), it will have found essentially every solution mod symmetries for that position (O-perm) - so no point in going farther than that. Actually I think I'll stop it and try today's version.
> 
> Regardless of how fast you can make your program or how fast the hardware you use, it is known that there are positions requiring at least 32 moves. So making the program faster will just result in people attempting to find solutions to deeper and deeper positions.



I will be posting the new version, without search extensions enabled, in a few minutes. In the meantime, do you have a "scramble" for this position?

http://alg.garron.us/?alg=f2_u-_r2_Uw2_S-_r2_S_D_S-_r_S_y_Uw_d_r2_u_f2&cube=4x4x4&notation=WCA

I just want to test a few algos and see if the PV is 100% working.

I tried to turn it into a scramble and got r2 u' b2 d' u' U' b f' r' b' f D' b f' r2 b' f u' U' r2 u f2 but that does not seem to be right. I do not have a rotation option or "wide" option in my program, so I need to convert it.

And here it is, online:

http://lightningcloudcomputing.com/OO_4x4x4.zip

Tomorrow's version, delivered a little early.


----------



## cuBerBruce (Apr 30, 2014)

unsolved said:


> I will be posting the new version, without search extensions enabled, in a few minutes. In the meantime, do you have a "scramble" for this position?
> 
> http://alg.garron.us/?alg=f2_u-_r2_Uw2_S-_r2_S_D_S-_r_S_y_Uw_d_r2_u_f2&cube=4x4x4¬ation=WCA
> 
> ...



I think this is what you want:

f2 u' r2 U2 u2 D f' b r' f b' D' f' b r2 f b' U2 u2 r2 u f2

Is suggest copy/paste. Those f followed by ' can look like just an f.


----------



## unsolved (Apr 30, 2014)

cuBerBruce said:


> I think this is what you want:
> 
> f2 u' r2 U2 u2 D f' b r' f b' D' f' b r2 f b' U2 u2 r2 u f2
> 
> Is suggest copy/paste. Those f followed by ' can look like just an f.



Which was my prime motivation for building the "read scramble.txt file" feature.
It was like 10-12 lines of code too. I just read the file, "faked" it being like 
one of your null-terminated list so as to resemble a "string," then passed it
into the move parsing procedure. Simplest code I ever wrote.

And speaking of primes, I almost found the world's largest twin prime on my machine today. *1026738 x 10^200701 + 1* is prime, but its counterpart at -1 is not. Bummer!






*UPDATE: Looks like this 22 move scramble has a 13-turn solution!*

...and...
I have a question for you guys. I was testing the scramble:

R B r2 U2 r2 U u U u r2 u2 B' R' (entered as 13 moves) on *OO_4x4x4* with just the 4-TFS loaded in order to test out the smaller databases. I wanted to create positions with longer scramble entries than "solves" to make sure the optimal PV is just not spitting out the reversed scramble.

The program spit out a 12-turn solution with the 4-TFS:

R F u2 R2 u2 R2 r2 u' -----> [inside 4-TFS] u' r2 F' R'

Usually that would make me nervous, since the u' @ ply-1 of the TFS should have not been the same move as the last play of the PV, then I realized that u2 is generated after u' in the move generator, so my heart rate went back to normal. I was also holding my breath, waiting for an 11-turn solution, which must be right around the corner. Expecting to see "u2" next, instead out came:

R F u2 R2 u2 R2 l2 u2 -----> [inside 3-TFS] l2 F' R' = 11 turns

The rest of the solutions that were coming out were all 11 turn solutions.

My question is, are there any faster solutions for this scramble?

I am hoping not, the program is still running and only finding 11 as best.


----------



## cuBerBruce (May 1, 2014)

unsolved said:


> I have a question for you guys. I was testing the scramble:
> 
> R B r2 U2 r2 U u U u r2 u2 B' R' (entered as 13 moves) on *OO_4x4x4* with just the 4-TFS loaded in order to test out the smaller databases. I wanted to create positions with longer scramble entries than "solves" to make sure the optimal PV is just not spitting out the reversed scramble.
> 
> ...



My program did not find any solutions of length 10 or less. It hasn't checked distance-10 maneuvers starting with an F-B axis turn, but that's unnecessary due to the symmetry of the position. (I imagine your search completed by now, but you'll probably appreciate an independent confirmation is anyway.)


----------



## unsolved (May 1, 2014)

cuBerBruce said:


> My program did not find any solutions of length 10 or less. It hasn't checked distance-10 maneuvers starting with an F-B axis turn, but that's unnecessary due to the symmetry of the position. (I imagine your search completed by now, but you'll probably appreciate an independent confirmation is anyway.)



Yes, thank you Bruce. So do you like the memory menu?


----------



## cuBerBruce (May 1, 2014)

I think it's a bit "wordy." I might be happy with simply having a command line switch to override the default decision. But I like the ability to choose the depth. That way the user can experiment with what depth works best if the available memory is near the the threshold of what what is needed for a given depth. Also, the user might want to limit the memory used if running multiple copies.


----------



## Christopher Mowla (May 1, 2014)

@unsolved,
I didn't think of this before, but since you searched for the 2 2-cycle, R F u2 R2 u2 R2 l2 u2 l2 F' R', here is a list of the shortest solutions I could find (in single slice turn metric, at least) for the "worst" cases (all other 2 2-cycle cases have algorithms which have fewer moves than these cases, so I just picked out the longest ones for now).

 l2 F D L F R2 D r2 D' R2 F' L' D' F' l2 (15)
r2 F D L F R2 D l2 D' R2 F' L' D' F' r2 (15)
F2 U' l' r' U F' L U' F l r F' U L' F' (15)
r2 U' B2 U' F L F' r2 F L' F' U B2 U r2 (15)
l2 U' B2 U' F L F' l2 F L' F' U B2 U l2 (15)
r2 U l r U' F R' U F' l' r' F U' R F' r2 (16)
R2 r' F' L R F r' F' R' F r2 F' L' F R2 (15)
r2 U F2 U B' R B r2 B' R' B U' F2 U' r2 (15)

They all work on the nxnxn, so I am guessing that it might be possible for shorter solutions to exist for the 4x4x4.


----------



## unsolved (May 1, 2014)

cmowla said:


> @unsolved,
> I didn't think of this before, but since you searched for the 2 2-cycle, R F u2 R2 u2 R2 l2 u2 l2 F' R', here is a list of the shortest solutions I could find (in single slice turn metric, at least) for the "worst" cases (all other 2 2-cycle cases have algorithms which have fewer moves than these cases, so I just picked out the longest ones for now).



Thanks Chris, this is what I have been searching for. Are there any positions like this that can be solved with as few as 8 turns? I looked at all 506,489,884,416 leaf nodes @ depth 8 in my solver (507,090,491,478 if you do not have the NNP pruning mechanism which filters out sequences of No Net Progress) and if I coded my search for 3-layers-solved properly, I got a grand total of 0.

I have all of these cranking on my machine now, 1 with the 6-TFS database, the rest with 5-TFS. So far no solutions through depth 12 for any of them, starting depth 13 now.


----------



## Carrot (May 1, 2014)

```
Found 18 moves to parse: Scramble = L U F L' U' L U L F' L2 U L U L' U' L U' L'



  3x3x3-F-perm


  Completed searching 0000000000001  nodes through DEPTHS 00-06:  LEAF NODES: 0000000000000  pruned
  TFS Database probes 0000000000000: 1-TFS probes 0000000000000: 2-TFS probes 0000000000000: 3-TFS probes 0000000000000
  TFS Database misses 0000000000001: 4-TFS probes 0000000000000: 5-TFS probes 0000000000000: 6-TFS probes 0000000000000

  Completed searching 0000000000036  nodes through DEPTHS 01-07:  LEAF NODES: 0000000000000  pruned
  TFS Database probes 0000000000449: 1-TFS probes 0000000000000: 2-TFS probes 0000000000000: 3-TFS probes 0000000000000
  TFS Database misses 0000000000476: 4-TFS probes 0000000000000: 5-TFS probes 0000000000026: 6-TFS probes 0000000000423

  Completed searching 0000000001026  nodes through DEPTHS 02-08:  LEAF NODES: 0000000000000  pruned
  TFS Database probes 0000000012608: 1-TFS probes 0000000000000: 2-TFS probes 0000000000000: 3-TFS probes 0000000000001
  TFS Database misses 0000000013457: 4-TFS probes 0000000000026: 5-TFS probes 0000000000724: 6-TFS probes 0000000011857

  Completed searching 0000000028836  nodes through DEPTHS 03-09:  LEAF NODES: 0000000000000  pruned
  TFS Database probes 0000000345417: 1-TFS probes 0000000000000: 2-TFS probes 0000000000000: 3-TFS probes 0000000000031
  TFS Database misses 0000000369351: 4-TFS probes 0000000000845: 5-TFS probes 0000000019487: 6-TFS probes 0000000325054

  Completed searching 0000000810648  nodes through DEPTHS 04-10:  LEAF NODES: 0000000000243  pruned
  TFS Database probes 0000009820846: 1-TFS probes 0000000000001: 2-TFS probes 0000000000065: 3-TFS probes 0000000000901
  TFS Database misses 0000010493547: 4-TFS probes 0000000022968: 5-TFS probes 0000000549175: 6-TFS probes 0000009247736

  Completed searching 0000022791456  nodes through DEPTHS 05-11:  LEAF NODES: 0000000006318  pruned
  TFS Database probes 0000275742675: 1-TFS probes 0000000000041: 2-TFS probes 0000000001697: 3-TFS probes 0000000025704
  TFS Database misses 0000294639627: 4-TFS probes 0000000644096: 5-TFS probes 0000015398462: 6-TFS probes 0000259672675

  Completed searching 0000640773504  nodes through DEPTHS 06-12:  LEAF NODES: 0000000178605  pruned
  TFS Database probes 0007751265664: 1-TFS probes 0000000001602: 2-TFS probes 0000000049005: 3-TFS probes 0000000725197
  TFS Database misses 0008282540120: 4-TFS probes 0000018154350: 5-TFS probes 0000432815535: 6-TFS probes 0007299519975

  Completed searching 0018015141312  nodes through DEPTHS 07-13:  LEAF NODES: 0000005022324  pruned
  TFS Database probes 0217932691727: 1-TFS probes 0000000046248: 2-TFS probes 0000001376598: 3-TFS probes 0000020418607
  TFS Database misses 0232869509950: 4-TFS probes 0000510423339: 5-TFS probes 0012167819428: 6-TFS probes 0205232607507

 →Solution [001] =  U  B2 L2 F  B2 U' F  R2 [inside 6-TFS] ---> B' D  F' R2 B  F'  @ 0016258098507 nodes with 0383864430139 6-TFS probes
  Solution [002] =  U' R  L' B2 R  D' L  B2 [inside 6-TFS] ---> R' U  L2 R' F2 L2  @ 0020869344258 nodes with 0434530203171 6-TFS probes
  Solution [003] =  U' F2 L2 F2 B' U  B' R2 [inside 6-TFS] ---> F  D' B  R2 B  F'  @ 0028103704626 nodes with 0514018495013 6-TFS probes
  Solution [004] =  U2 R  b' r' F' R  f2 D2 [inside 6-TFS] ---> f' L' r' R' f' r'  @ 0037295041680 nodes with 0615006622147 6-TFS probes
  Solution [005] =  U2 F  R' B  U2 F' L  F' [inside 6-TFS] ---> B2 D2 B2 L' B' F   @ 0043043091593 nodes with 0678163126931 6-TFS probes
  Solution [006] =  U2 F  R' B  U2 F' L  B2 [inside 6-TFS] ---> F' D2 B2 L' B' F   @ 0043043091603 nodes with 0678163127099 6-TFS probes
  Solution [007] =  U2 F  B' R  F2 D2 F2 B  [inside 6-TFS] ---> R' B  U2 F' L  B'  @ 0043346151619 nodes with 0681493331675 6-TFS probes
  Solution [008] =  U2 F  B' R' B2 D2 F' B2 [inside 6-TFS] ---> R  F' U2 B  L' F   @ 0043347082440 nodes with 0681503573627 6-TFS probes
  Solution [009] =  U2 B' R  F' U2 B  L' F2 [inside 6-TFS] ---> B  D2 F2 L  B' F   @ 0048167959503 nodes with 0734473686232 6-TFS probes
  Solution [010] =  U2 B' R  F' U2 B  L' B  [inside 6-TFS] ---> F2 D2 F2 L  B' F   @ 0048167959510 nodes with 0734473686270 6-TFS probes
  DEPTHS 08-14 MOVE (04/36)  u  D2 r  f' d  D2 B' U   NODES: 0051143357617 DATABASE ACTIVITY: 000001685125389786 probes
```

Solution [004] = U2 R b' r' F' R f2 D2 [inside 6-TFS] ---> f' L' r' R' f' r' @ 0037295041680 nodes with 0615006622147 6-TFS probes 
^^ is wrong


----------



## unsolved (May 1, 2014)

Carrot said:


> ```
> Found 18 moves to parse: Scramble = L U F L' U' L U L F' L2 U L U L' U' L U' L'
> 
> Solution [004] =  U2 R  b' r' F' R  f2 D2 [inside 6-TFS] ---> f' L' r' R' f' r'  @ 0037295041680 nodes with 0615006622147 6-TFS probes
> ...


----------



## Christopher Mowla (May 1, 2014)

unsolved said:


> Thanks Chris, this is what I have been searching for. Are there any positions like this that can be solved with as few as 8 turns?


In the K4 thread, I posted a PDF which has algorithms for all 58 cases (which includes mirror cases).

PLL parity requires 7 turns (r2 F2 U2 r2 U2 F2 r2), as you know, but the next magic number seems to be 9 turns (so no, I don't think any can be solved in 8 turns optimally):
r2 U' F2 U' r2 U F2 U r2 (9)
r2 U F2 U r2 U' F2 U' r2 (9)

_To believe it or not, I thought the two cases above were bad cases, but when I found the algs above, I changed my mind!_

I will now list a lot of last layer wing edge algorithms I found by hand or used Cube Explorer to find. Please do not feel pressured to find solutions to any of these cases. I listed them here for your convenience, as it's all of the shortest last layer algorithms for wing edges I have (besides those listed in the 2 2-cycle document above, 3-cycles, and those on the 4x4x4 parity algorithms page, although I did include two adjacent 4-cycle cases).

I have removed all rotations and rotated all algorithms to affect the last layer, for your convenience.
In this document, View attachment K4LL_OLL_PLL_CASES.pdf, I list all possible wing edge last layer cases which have all wing edges "oriented". I find that these cases, more often than not, require more moves than many cases which do not have all wing edges "oriented". So maybe this could be a good small subset of all 8! positions you can use to develop your solver.

A few years ago, I found short (but not necessarily optimal) algs for some of these cases. I list them by cycle type. I already posted a link to the 2 2-cycle algorithms, and therefore the algs for all "oriented" wings for 2 2-cycles is in that document.


Spoiler: Oriented Last Layer Wing Edge Algorithms



*A 3-cycle and a 2-cycle ({3,2})* (here are algs for all unique cases)
l2 r' D2 l F2 l F2 l' U l' F2 l F2 D2 U' l2 r (17) (my alg)
l2 r' D2 U' F2 l' F2 l U l F2 l' F2 l' D2 l2 r (17) (my alg)
r2 F2 U2 r2 U2 l' F2 l D2 r' D2 F' R' F' r' F R F r' (19) (my alg)
B2 U l r U' r F2 r' F2 U l' U2 r' U2 r' U' B2 (17) (my alg)
F2 l U' D2 r U2 R r' B r' U2 r U2 r B' R' U' D2 l' F2 (20) (my alg)
F2 r D b' R B' R b' R' B R' b' R2 b' R2 b' D' r' F2 (19) (my alg)
*
4-cycles ({4})* (here are algs for all unique cases)
l2 r2 U' F2 l F2 U2 r2 U2 l' U2 r2 B2 r B2 U' l2 r2 (18) (Found using Cube Explorer)
l2 r2 U l U2 B2 r2 B2 l' B2 r2 D2 r D2 B2 U l2 r2 (18) (Found using Cube Explorer)

*2 3-cycles ({3,3})* (here are algs for all unique cases)
l2 r2 U r2 F2 r2 F2 U' l2 u2 r2 u2 (12) (my alg)
l2 r2 U' r2 F2 r2 F2 U l2 u2 r2 u2 (12) (my alg)
r2 U' r2 F2 r2 F2 U2 F2 r2 F2 r2 U' r2 (13) (Found using Cube Explorer)
F' R' d R U R' d' u' R U' R' u R F (14) (my alg)
R2 D' F2 f' U f U2 f' U F2 U' f U2 f' U' f D R2 (18) (my alg)
R2 r2 U2 R2 U' r U2 l r U' R2 U l' r' U2 r' U' R2 r2 (19) (my alg)
F L d' L' U' L d L' U F' L B u B' U' B u' B' U L' (20) (my alg)

*3 2-cycles ({2,2,2})* (here are algs which represent half of the unique cases)
l2 r2 U r l2 U2 B2 r2 F2 r F2 l2 U2 l' U2 B2 U l2 r2 (19) (Found using Cube Explorer)
l2 r2 U F2 r l2 F2 U2 r2 D2 r D2 l2 F2 l' F2 U l2 r2 (19) (Found using Cube Explorer)
l2 r2 U B2 U2 r l2 U2 B2 r2 F2 r F2 l2 U2 l' U l2 r2 (19) (Found using Cube Explorer)

*4 2-cycles ({2,2,2,2})* (here are algs which represent all cases, except of course, for cases equivalent to the 3x3x3 H and Z perms)
(F2 r2 F2 U' l2 r2 U) l2 r2 (U' r2 l2 U F2 r2 F2) (16) (my alg)
l2 r2 U' l' r U2 F2 l r F2 D2 F2 l2 F2 l2 D2 r2 U' l2 r2 (20) (found using cube explorer)


Lastly, here are some random algs for different cycle types of wing edges in which not all of them are "oriented" (again, one alg for each case listed. I do not include mirrors or inverses because that's redundant):


Spoiler: Misc Last Layer Wing Edge Algorithms



*2 3-cycles ({3,3})*
l r U' r2 F2 r2 U r2 U' F2 U l' r (13) (my alg)

*4 2-cycles ({2,2,2,2})*
(B2 r2 U2 F l' r U) r2 l2 (U' r' l F' U2 r2 B2) (16) (my alg)
(B2 r2 U2 F' l' r U') r2 l2 (U r' l F U2 r2 B2) (16) (my alg)

*3-cycle and a 2 2-cycle ({3,2,2})*
R2 U2 R u R U' R' u' d' R U R' d2 R' U R d' R' U R2 (20) (my alg)

*4-cycles in 2 dedges* (I omit the most 3 common parity cases, as they all have unquestionably optimal algs)
R B r U2 r2 U2 r' U2 r U2 r' U2 r2 U2 r B' R' (17) (someone found using Cube Explorer)
(l' U2 l2 r2 U) l r' U2 l U2 l2 U2 l U2 r (U' l2 r2 U2 l) (20) (my alg)

*4-cycles in 3 dedges* (Below are algs for all cases except 4, which I didn't have/make algs for)
l r2 U' F2 r' F2 r' F2 r' F2 r2 U r2 l' (14) (my alg)
r2 U' F2 U' r' U F2 U r2 F2 l' U2 l r U2 r' F2 (17) (my alg)
r2 U F2 U r' U' F2 U' r2 F2 l' U2 l r U2 r' F2 (17) (my alg)
l r2 U F2 r' F2 r' F2 r' F2 r2 U' l' r2 (14) (my alg)
r U2 r2 U' r' U2 r' U2 r2 U2 r' U' r2 U2 r' (15) (my alg)
r U2 r2 U r' U2 r' U2 r2 U2 r' U r2 U2 r' (15) (my alg)
r U2 r U' r' U2 r2 U2 r' U2 r' U' r' U2 r' (15) (my alg)
r U2 r U r' U2 r2 U2 r' U2 r' U r' U2 r' (15) (my alg)
r' F2 l U l2 F2 l F2 l2 F2 l F2 l' U' l' F2 r (17) (my alg)
R2 U' r U2 R2 r2 U r U2 r2 U2 r U2 r U r2 R2 U2 r' U R2 (21) (my alg)
r F' R' F r2 F2 r' F2 r' F2 r' F R F r' (15) (my alg)
r' F2 l U' l F2 l' F2 l2 F2 l' F2 l2 U l' F2 r (17) (my alg)
r' B' R B' r B2 r B2 r' B2 r2 B R' B r' B' R B2 R' B r2 (21) (my alg)
R' r' U R B2 U' r U2 r U2 r U2 r2 U' B2 R' U' R r (19) (my alg)
l' U2 l2 r' U l F2 l F2 l F2 l2 F2 U' r l2 U2 l (18) (my alg)
r U2 r R U' l U F2 U' r U F2 U' l' r' U R' U r U' r' U2 r' (23) (my alg)
F l U2 r U' r U2 r U2 r2 U2 r U' r' U2 l' F' (17) (my alg)

*4-cycles in 4 dedges* (I omit the "oriented" cases, as I have already posted them above. I don't have an alg listed for just 1 case)
F2 U r B R B' r2 B2 r' B2 r' B2 r' B' R' B' r' U' F2 (19) (my alg)
l r U' r U2 F2 r F2 U2 r' U2 l U2 r' U2 r U2 l' U l' r' (21) (found using cube explorer)
R' r' U B2 U r' U2 r' U2 r' U2 r U R U' r U R' B2 U' r R (22) (my alg)
l r U r U2 F2 r F2 U2 r' U2 l U2 r' U2 r U2 l' U' l' r' (21) (my alg)
F2 l' L F' D2 F r' F' D2 F L' l' F R' F r' F' R F' r l2 F2 (22) (my alg)
l2 r2 D' R2 r2 f R2 b' R2 b R2 D2 b D2 f' R2 b2 r2 R2 D r2 l2 (22) (my alg)
r B2 R U' l U F2 U' r U F2 U' l' r' U R' U r U' B2 r' (21) (my alg)
f2 b2 D' r F2 r F2 r F2 r F2 r D b2 f2 (15) (my alg)





unsolved said:


> I have all of these cranking on my machine now, 1 with the 6-TFS database, the rest with 5-TFS. So far no solutions through depth 12 for any of them, starting depth 13 now.


It would really be interesting to see if you can find shorter solutions!


----------



## Carrot (May 1, 2014)

unsolved said:


> And the others with L and B in the solution are correct? There was a bug where L, B, and D moves had the ' sign reversed (but I fixed it). What version of OO_4x4x4 is this?



It's the latest one linked in this thread (it's got colours and tells me I have 8 TB virtual RAM)

I tested most of them, but the only one that didn't seem to work was the one with inner slice turns


----------



## unsolved (May 1, 2014)

Carrot said:


> It's the latest one linked in this thread (it's got colours and tells me I have 8 TB virtual RAM)
> 
> I tested most of them, but the only one that didn't seem to work was the one with inner slice turns



Thanks. I looked at the code and saw that the position generates the same index to the solution. It was bound to happen. I only have 2 to the 64th power different indices, but those jillions of 4x4x4 positions. I will see if I can come up with a new indexing function that solves this. I thought after like 5 years maybe there would be one position like this, but not so soon! I could make the program only generate 3x3x3 moves when there are no slice turns in the scramble.


----------



## Carrot (May 1, 2014)

unsolved said:


> Thanks. I looked at the code and saw that the position generates the same index to the solution. It was bound to happen. I only have 2 to the 64th power different indices, but those jillions of 4x4x4 positions. I will see if I can come up with a new indexing function that solves this. I thought after like 5 years maybe there would be one position like this, but not so soon! I could make the program only generate 3x3x3 moves when there are no slice turns in the scramble.



Please keep the slice turns, I'm just using 3x3x3 cases because it's faster to setup and check solutions with  (also, I would be really amazed if suddenly an optimal solution for an outer layer scramble would include inner slice turns)


----------



## Christopher Mowla (May 1, 2014)

Carrot said:


> (also, I would be really amazed if suddenly an optimal solution for an outer layer scramble would include inner slice turns)


Oh yeah, that reminds me of this thread.


----------



## cuBerBruce (May 1, 2014)

unsolved said:


> Thanks. I looked at the code and saw that the position generates the same index to the solution. It was bound to happen. I only have 2 to the 64th power different indices, but those jillions of 4x4x4 positions. I will see if I can come up with a new indexing function that solves this. I thought after like 5 years maybe there would be one position like this, but not so soon! I could make the program only generate 3x3x3 moves when there are no slice turns in the scramble.



Based upon your earlier comments in this thread, I guess I'm not too surprised by your trying to cheat by not checking for an exact match between the reached position and the database position.

When one has access to all positions to some depth, a common approach to figure out the path to the solution is to simply do a series of depth-1 searches and checking for reaching a position one move closer to solved at each step. If you were doing that, and you reached a false match at depth 6, you would probably eventually have miss for all 36 moves at some point along the path to depth 0 (probably at depth 5). I suppose to be safe, backtrack and continue checking alternate paths until you're sure there is no valid path to solved of the expected length.


----------



## qqwref (May 2, 2014)

Hm, you're using some kind of cryptographic hash? That should more or less work for "small" tables like you're using here (whereas it definitely wouldn't work for a God's Algorithm calculation, if anyone ever did one). Of course you will get collisions... how often? Well if your table does take 12982642 KB to store, and it takes 4 bytes per position, one in every 5.5 billion buckets is full, so that's about the probability of a collision. With all the positions we check in a search it's not too crazy to find one of these. If your storage method is more efficient, that would only increase the probability of a collision (1 bit per position = one in every 170 million buckets is full).

Bruce's solution of backtracking is very clever - collisions are rare, so when you get one it doesn't hurt to make sure by actually tracing backwards through those 6 moves. I like it.


----------



## rokicki (May 2, 2014)

And that leads to your standard distances-only, direct-mapped hash table implementation,
where you use only one byte (or half byte) per position, and always search all the way to
zero on a "hit". It's guaranteed to be a lower bound on the distance so it's an admissible
heuristic.

Collision-free, dense indexing is often best, but a simple hash function and a table too
large frequently performs just as well---and sometimes a lot better. 

The only difficulty is you can't do a simple breadth-first scan to build it (at least not without
additional memory). But once it is built, you can drop the extra memory.


----------



## unsolved (May 2, 2014)

cmowla said:


> @unsolved,
> I didn't think of this before, but since you searched for the 2 2-cycle, R F u2 R2 u2 R2 l2 u2 l2 F' R', here is a list of the shortest solutions I could find (in single slice turn metric, at least) for the "worst" cases (all other 2 2-cycle cases have algorithms which have fewer moves than these cases, so I just picked out the longest ones for now).
> 
> l2 F D L F R2 D r2 D' R2 F' L' D' F' l2 (15)
> ...



And... we have a winner!


```
Solutions To Scramble = r2 U l r U' F R' U F' l' r' F U' R F' r2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|^^^^|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|####|####|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|####|&&&&|&&&&|   |^^^^|^^^^|####|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u2 f' D  B2 U' B2 r2 B2 [inside 5-TFS] ---> U  B2 D' f  u2  @ 0089361202383 nodes with 0740808355065 5-TFS probes
```



qqwref said:


> Hm, you're using some kind of cryptographic hash? That should more or less work for "small" tables like you're using here (whereas it definitely wouldn't work for a God's Algorithm calculation, if anyone ever did one). Of course you will get collisions... how often? Well if your table does take 12982642 KB to store, and it takes 4 bytes per position, one in every 5.5 billion buckets is full, so that's about the probability of a collision. With all the positions we check in a search it's not too crazy to find one of these. If your storage method is more efficient, that would only increase the probability of a collision (1 bit per position = one in every 170 million buckets is full).
> 
> Bruce's solution of backtracking is very clever - collisions are rare, so when you get one it doesn't hurt to make sure by actually tracing backwards through those 6 moves. I like it.



I'm doing something a little more complex. I can store 3 of the 96 pieces of facet color information in one byte, 32 bytes gives me a guaranteed unique position (note: bytes, not bits). I perform a lookup/compare of every position against every other position, and filter out the bits of each byte that are identical and keep only the bits that are unique. An ad hoc compression of only that which is germane. Beforehand I had to search for "magic numbers" to make this work, plus a fair amount of trial and error tweaking. I then re-ran up to 6-TFS one db at a time and verified uniqueness within each db.


----------



## Christopher Mowla (May 2, 2014)

unsolved said:


> And... we have a winner!


Yay!  [u2 f' D B2 U' B2: r2] (13)! 3 moves less! Nice.


----------



## unsolved (May 2, 2014)

cmowla said:


> Yay!  [u2 f' D B2 U' B2: r2] (13)! 3 moves less! Nice.



Yeah all it took was 740,808,355,065 probes of the 5-TFS database after searching 89,361,202,383 nodes.


----------



## rokicki (May 2, 2014)

unsolved said:


> u2 f' D B2 U' B2 r2 B2 [inside 5-TFS] ---> U B2 D' f u2
> [/code]



Interesting; it's self-inverse---by inspection!



unsolved said:


> And... we have a winner!
> 
> 
> ```
> ...



I don't get this. r2 U l r U' F R' U F' l' r' F U' R F' r2 followed by u2 f' D B2 U' B2 r2 B2 followed by U B2 D' f u2 leaves my 4x4x4 totally scrambled.

What am I missing?


----------



## unsolved (May 2, 2014)

rokicki said:


> I don't get this. r2 U l r U' F R' U F' l' r' F U' R F' r2 followed by u2 f' D B2 U' B2 r2 B2 followed by U B2 D' f u2 leaves my 4x4x4 totally scrambled.
> 
> What am I missing?



It worked for me. Slow down, try it again.

Also a second solution now:

d2 f' D B2 U' B2 r2 B2 U B2 D' f d2


----------



## uberCuber (May 2, 2014)

rokicki said:


> I don't get this. r2 U l r U' F R' U F' l' r' F U' R F' r2 followed by u2 f' D B2 U' B2 r2 B2 followed by U B2 D' f u2 leaves my 4x4x4 totally scrambled.
> 
> What am I missing?



alg.cubing.net


----------



## unsolved (May 2, 2014)

rokicki said:


> And that leads to your standard distances-only, direct-mapped hash table implementation,
> where you use only one byte (or half byte) per position, and always search all the way to
> zero on a "hit". It's guaranteed to be a lower bound on the distance so it's an admissible
> heuristic.
> ...



Actually, that's not exactly how hashing works. A hash modulo some number is never a final index. What you do is visit the index, and see what is there. If the slot is empty, you write your very long full hash number, without the modulo divide result, into that slot, along with your other data. If the slot is taken, compare very long hash numbers. If they are different, both hash numbers merely have the same remainder, so you find a new home for the next number. There are many ways to go about this, the simplest being a linear scan for the next free spot. Once you find it, write the full hash number plus it's data at that location.


*update:* two more solutions, from a different scramble

Scramble: r2 U' B2 U' F L F' r2 F L' F' U B2 U r2

Solves:

u2 b' U' b' l D2 f2 D2 l' b U b u2 
u2 b' U' b' *l'* D2 f2 D2 *l* b U b u2


----------



## rokicki (May 2, 2014)

unsolved said:


> A hash modulo some number is never a final index.



Never is a strong word.



uberCuber said:


> alg.cubing.net



Ahh, thanks for the alg link; that's what I needed. But wait, d is not d? Apparently the solve given
by the program uses "d" to mean, a single slice turn, but (for instance) alg.cubing.net uses "d" to
mean, an outer block turn of depth two. What good is a notation that's ambiguous?


----------



## cuBerBruce (May 2, 2014)

rokicki said:


> Ahh, thanks for the alg link; that's what I needed. But wait, d is not d? Apparently the solve given
> by the program uses "d" to mean, a single slice turn, but (for instance) alg.cubing.net uses "d" to
> mean, an outer block turn of depth two. What good is a notation that's ambiguous?



Singmaster used the convention that d represent an inner layer turn. Initially, the WCA used d to represent a double-layer turn for scrambles. Also d had been widely used on 3x3x3 to represent wide turns. In Asia, a "w" after a letter was used to represent a double-layer turn. The WCA started using that to avoid possible confusion on what a lower case letter meant. Then there's also SiGN notation where a lower case letter means the outer two layers, but can be prefixed to represent arbitrary mult-layer turns. So basically, you should say what convention you're using.


----------



## unsolved (May 2, 2014)

rokicki said:


> Never is a strong word.



Well, the point being, if some number x modulo n = i, and i is always unique, then x is always some integer multiple of n, plus i, and there will never be more than n - 1 unique values. Since n is usually much smaller than x, your effective table size is diminished.

What you really want is some magic function, h(x), which really does the opposite. For any domain of x as input, you want voluminous, almost chaotically, seemingly random output that spans a huge range.


----------



## Lucas Garron (May 2, 2014)

rokicki said:


> Ahh, thanks for the alg link; that's what I needed. But wait, d is not d? Apparently the solve given
> by the program uses "d" to mean, a single slice turn, but (for instance) alg.cubing.net uses "d" to
> mean, an outer block turn of depth two. What good is a notation that's ambiguous?



SiGN is defined here: http://www.mzrg.com/rubik/nota.shtml
Short version: Use SiGN, and the world will live as one.


Story time:

Back in the day (mid-'00s), r had two meanings: turn the two outermost slices together, or turn the second-outermost slice.
The Japanese also had Rw for "wide" outer turns. But the rest of the world didn't use it, except Macky. For 3x3x3, the "Western" world basically used r to represent wide turns.

For big cubes, people sometimes used r to mean one thing, sometimes the other thing, and sometimes switched depending on whether their alg had more slice turns or more block turns. Of course, people didn't really specify which notation they were using, so this was all not very good. There is no reason that every time someone writes a 4x4 alg it should be ambiguous.

A few of us on IRC, including me, qqwref, and probably Kirjava, took some of the common conventions and formulated a simple notation we called SiGN.
It was simple because an uppercase letter meant a single slice and a lowercase letter meant multiple slices; adding a number like 3R or 3r would specify which slice/how deep to go. In addition, R simply meant the outer slice, and r was the simplest multi-slice outer block turn (two slices) -- which was consistent with one common conventions.
Apart from allowing 3-5r for non-outer block turns, that's just about it: If you see an R it means a single slice, if you see an r it means multiple slices.

Everything was great because we now had a simple standard that we were going to start using, and encouraging everyone to use. It was easy to learn, consistent, and at least *something* we would hopefully all agree on. Some day, people would forget r had ever had another meaning. (Slight dramatization, but that's basically how I felt.)

Unfortunately, this was exactly the time when the WCA saw a need for an official notation. It was introduced in 2008. Ron probably saw the notations that were in use and thought that it would be clearest to use Rw for wide turns.
But for some reason still unknown to me, the Regulations also defined r turns... as inner slice turns slice. I don't know the reason for this, because the links to the official scramble pages never used these turns, and 3x3x3 FMC didn't really need them.

This kind of threw a wrench in the whole thing, because the WCA notation was the closest the community had to a standard. SiGN was fairly common, but (partially because of the WCA notation, I assume) people still used r to mean a single slice when it was convenient -- after all, now everyone was comfortable with the meaning of Rw if you needed some wide turns to go with that.
In the end, I don't *really* care which meaning r takes on, but I was annoyed because this directly contradicted the most important detail of our effort to get everyone speaking the same notation -- all due to a Regulation that defined a turn the WCA didn't even use or need.

When I was writing alg.garron.us, I begrudgingly used Randelshofer's tools to generate a secondary WCA notation specification, but I set SiGN.

I was going to start a small "unofficial" cubing standards body and start getting the community to agree on RFCs for things like this, but the Regulations sort of fell into disrepair and Tyson brought me on to start the WRC instead. There were a lot of things to do, but I took out those "Inner Slice Moves" before we even reached the first draft].
I still want to get to the standards body thing some day (the Regulations aren't the place for all these things, and in fact it might actually be better to use an external definition for the notation), but I've been busy with the WRC.

Anyhow, the 2012 Regs finally meant that WCA notation and SiGN don't contradict each other, and we can have a universal notation. That's why alg.cubing.net simply uses SiGN with the addition that Rw is an alias for r (this will be permanent).

But the damage has been done. While most people use SiGN, some people like cmowla will still use old WCA notation. I'm not blaming them, but it makes me sad that as a community we still haven't fully settled on a single notation.

Of course, I can't control what notation people use. But we should have a standard, and SiGN is as good as any. It's simple, and I believe it makes the most sense: r can only stand for one of 2R or Rw, and if we're going to have a standard we need to pick on. I believe the latter is better because I find the following reasons for r = Rw more important than the arguments for r = 2R:


 It makes "lower case = multiple slices, uppercase = single slice" very simple to understand for cubes of all sizes.
 Humans can execute wide turns more easily. I think it's better to use the shorter "r" turn notation for the reconstructions and algs people actually use in practice.

In any case, alg.garron.us will start redirecting to alg.cubing.net in a few months (whenever I take a breath from working on the WRC and fix a few alg.cubing.net details first), and all "old WCA" algs will be translated to SiGN. That is, r will be redirected to 2R.


----------



## qqwref (May 2, 2014)

Cool story! The only thing I'd like to add is that I think Eidolon (Andrew Nelson) helped with the development of SiGN too


----------



## rokicki (May 2, 2014)

unsolved said:


> Well, the point being, if some number x modulo n = i, and i is always unique, then x is always some integer multiple of n, plus i, and there will never be more than n - 1 unique values. Since n is usually much smaller than x, your effective table size is diminished.
> 
> What you really want is some magic function, h(x), which really does the opposite. For any domain of x as input, you want voluminous, almost chaotically, seemingly random output that spans a huge range.



I'm just sharing ideas that have been used to great effect in the past.

You are welcome to dismiss them, of course; the ideas stand on their
own, with no need for me to defend them.


----------



## unsolved (May 2, 2014)

rokicki said:


> I'm just sharing ideas that have been used to great effect in the past.
> 
> You are welcome to dismiss them, of course; the ideas stand on their
> own, with no need for me to defend them.



Your statement about a hash function @ 1-byte per entry is what I was referring to as not being correct. A hash number is usually 32- or 64-bits (4 or 8 bytes in size) and you store the hash number + other information with every entry.

What you don't is precisely what you mentioned: execute hash_number modulo some_number = index, then visit database[index] and get your info. At database[index] you have multiple pieces of info, one of which is the FULL 32- bit or 64-bit number. So there is no 1-byte/entry version of a hash table.

There are 1-byte/entry implementations that use indexing functions. An indexing function magically knows exactly where everything is, and there is no need to store anything else at the slot. When I solved the 19 billion endgames for the game of checkers with wins up to 253 plies in length, that is exactly what I did: 1 byte per position, and no need of storing a position with the win/loss lengths.


----------



## rokicki (May 2, 2014)

unsolved said:


> What you don't is precisely what you mentioned: execute hash_number modulo some_number = index, then visit database[index] and get your info. At database[index] you have multiple pieces of info, one of which is the FULL 32- bit or 64-bit number. So there is no 1-byte/entry version of a hash table.



For doing an IDA* search, where we just need an admissible heuristic, this approach actually works
*perfectly*; you ensure the single entry contains the minimum distance-to-solved from all values
that collide here, and your table then functions admirably. Further, if you use a fast hash function
(it doesn't have to be cryptographically secure), the elimination of collision detection, etc. cuts the
code down and the performance (with no inessential branching) can be excellent.

You can even use this idea with only one *bit* per entry that says a position is either at a distance
> d for some d, or "no information". I frequently use it with two bits per entry, giving me information
that the position is >d, >d+1, >d+2, and "no information" for a given d. Using 1.6 bits per entry also
works well, in which case you get >d, >d+1, and "no information".



Lucas Garron said:


> Story time:



Great writeup, Lucas; thanks! That clarifies things tremendously. I think the bulk of this prose should
be on a wiki somewhere for others to profit from.

Everyone on this thread: should we follow the sage advice of Lucas and go with SiGN exclusively, or
should we continue to use whatever we are using? In particular, if we plan to exchange positions
and compare solves it would be nice if we could just copy and paste.


----------



## unsolved (May 2, 2014)

Lucas Garron said:


> Of course, I can't control what notation people use. But we should have a standard, and SiGN is as good as any. It's simple, and I believe it makes the most sense: r can only stand for one of 2R or Rw, and if we're going to have a standard we need to pick on...



As an outsider, what I am about to offer may be unpopular, but here is my input regarding notation.

The very first cube book that I ever saw in 1980-1981 featured upper case letters for the sides and + for clockwise and - for counterclockwise. Just my opinion, I like this best. How many times have you had to squint and see if a ' was or was not in the middle of a sequences of moves? Then you check over the moves over and over until you see what you missed, etc. But with a + and - after the moves, you get a nice delimeter and your eye does not lose track as easily.

When the 4x4x4 came out, lower case meant slice moves. No problem, I like that.

But 5x5x5 and larger presented problems, of course. Personally, I find E and M and S counterintuitive. I use notation such as {f/r} to indicate a middle slice turn from the front in the direction of the right face. In the opposite direction, it is {r/f}.

I have not given larger cubes any thought, or how to describe multiple slice turns.

Also, I use a right- handed rotational vector notation. R+ and L+ both turn in the same direction, so your L- is my L+. Ditto for top and bottom, your U = my T+ and your D' = my B+, since I use K for the back slice. B = bottom to me, T = top.

Why should r'l and l'r be opposite in direction when you turn them both the same way? In my notation it would be (lr)+ when both turn like r and (lr)- when both spin like r'.

[Ff]+ would be F f and [Tt]- would be U' u'. Slice and face turns use square brackets, pairs of slice turns use round parenthesis, and middle slices use curly braces.


----------



## Christopher Mowla (May 2, 2014)

Lucas Garron said:


> While most people use SiGN, some people like cmowla will still use old WCA notation. I'm not blaming them, but it makes me sad that as a community we still haven't fully settled on a single notation.


I'm set in my ways! No, I understand the significance of unity (that was the core idea of my single commutator project!), as I made an effort to make my derivation of the "Holy Grail" alg in SiGN notation. I did this because I assumed that in the future, we would all have agreed on SiGN by then. However, for 2 layer wide turns, I used a 2 coefficient in front of the lowercase letter.

Speaking of which,


Lucas Garron said:


> In addition, R simply meant the outer slice, and r was the simplest multi-slice outer block turn (two slices) -- which was consistent with one common conventions.





Lucas Garron said:


> It was easy to learn, *consistent*, and at least *something* we would hopefully all agree on.



Having r = Rw is logically flawed based on the structure of SiGN. r (in SiGN) = 1r = a* 1* layer outer block turn. That is, r = 1r = *R* in SiGN. But in SiGN also wants to make capital letters mean a single slice...so here is a conflict in SiGN, and thus if you omit the "convention" that r = Rw, then SiGN will be consistent.

With the same flawed logic that r = Rw for the sake that r = (R M') on the 3x3x3, then why isn't x = (Rw l') on the 4x4x4 in SiGN? I of course know the answer, but how obvious you think that answer is, I feel it's just as obvious that you shouldn't say that since r = (R M') on the 3x3x3 (which is really equivalent to doing a single slice turn which obviously also has a cube rotation), it's equal to Rw on the 4x4x4.

Since SiGN was claimed to be "simple" and based on "logic", making the exception that 1r = Rw is illogical. Get rid of it, and you will have a good notation. I know it makes things more compact if you keep it, but should that one advantage make it logically inconsistent, and worse, make SiGN cause confusion?



Lucas Garron said:


> Some day, people would forget r had ever had another meaning. (Slight dramatization, but that's basically how I felt.)


That's never going to happen. r, as I have said before, has no place in SiGN, so omit it (including give a syntax error in alg.cubing.net if someone types r,l,u,d,f,b without a 2 or larger number coefficient, that is, if you eventually make selectable options to use WCA and SiGN separately as is on alg.garron.us), and all of your problems are solved for all time. Until then, I will continue to use WCA whenever I can because there is no mistake about what moves I mean when I post algorithms because almost everyone knows WCA, but I still can't say as many people know SiGN.



Lucas Garron said:


> In any case, alg.garron.us will start redirecting to alg.cubing.net in a few months (whenever I take a breath from working on the WRC and fix a few alg.cubing.net details first), and all "old WCA" algs will be translated to SiGN. That is, r will be redirected to 2R.


It's good to see that you will be making r become 2R, but I'm sorry to hear that you will be getting rid of alg.garron.us. Oh well, I'm sure for those who prefer alg.garron can always still use CubeTwister on their computers.

EDIT:
I will modify template Alg4 in the wiki to go to alg.cubing.net so that there are not so many redirects because of the 4x4x4 parity algorithm page, but this is of course after you redirect r to 2R. So maybe let me know by pm when this gets done (or you can do it whenever it gets done, if that makes things easier for you).

EDIT2:
And Lucas, what are you going to do about capital M,E,S at alg.cubing.net? It will be a mess unless you make a button like you did in alg.garron.us to use WCA or SiGN.


----------



## cuBerBruce (May 2, 2014)

SiGN notation may be a good idea for a consistent notation across arbitrary size cubes, but for the 4x4x4, it is a bit clumsy, and less consistent with standard mathematical notation. Singmaster notation, in its "pure" form, is actually just a use of mathematical notation (albeit it adds the prime/apostrophe to represent inverses, which alternatively can be expressed as raising to a power of -1). Singmaster extended his notation to 4x4x4 in1982 with the lower case letters representing inner layer turns, and has a *long-standing history* of being the de facto standard notation. I think SiGN enthusiasts have somewhat of an uphill battle to convince everyone one to use this clumsier notation (as a 4x4x4 notation) in place of the long-standing Singmaster standard.

As far as I know the use of lower case letters for wide turns is a relatively recent addition for 3x3x3. Can anyone show that this convention was in use before 2000?

Using +/- has had some use in cubing, but is also not consistent with standard mathematical notation.

I suppose programs should give the user the choice of notation, because I think a lot of people still prefer the long-standing Singmaster convention as a 4x4x4 notation.


----------



## rokicki (May 2, 2014)

I have no beef with anything you say, Bruce. But for our efforts here in this thread it would be great
if we can agree on a notation and use that consistently. If that notation uses "l" for an inner slice turn,
I'm okay with that, and that seems to be what people are doing.

Long term, big picture, I do plan a 4x4x4 contest, and I need to pick a notation for that, and I doubt
I can make everyone happy there. I personally prefer a notation that extends naturally to bigger cubes
and for this reason I prefer the SiGN notation.

It looks to me like the solver created by unsolved uses single-slice-turn metric (SSTM), and your two
solvers use outer-block-turn metric (OBTM) and block-turn metric (BTM). Is this accurate? In that
case I guess there is no direct comparison between the solvers. I am doing my experiments with OBTM
but plan to also support BTM; I find it hard to be interested in SSTM. Is there a motivation for using
SSTM that I'm not seeing?


----------



## cuBerBruce (May 2, 2014)

rokicki said:


> I have no beef with anything you say, Bruce. But for our efforts here in this thread it would be great
> if we can agree on a notation and use that consistently. If that notation uses "l" for an inner slice turn,
> I'm okay with that, and that seems to be what people are doing.
> 
> ...



If you go to the first post of my thread, you'll find 3 versions, one for each of these 3 metrics.

In SSTM, each of the standard moves affect a minimal number of pieces; and the basic moves correspond directly with the Singmaster letters and their powers. If you have multiple turns in a row on the same axis, it's more straightforward to see what the effect on a single piece or single layer is for those turns. These properties are perhaps of more interest to mathematicians than speedcubers. Like on the 15 puzzle, mathematicians seem to be mostly interested in single-tile metric, while the way normal people manipulate the physical puzzle corresponds more with multi-tile metric.


----------



## cmhardw (May 2, 2014)

I think Chris's arguments that the change r /= Rw should be added to the rules for SiGN very convincing. In particular the following is very convincing to me:



cmowla said:


> Having r = Rw is logically flawed based on the structure of SiGN. r (in SiGN) = 1r = a* 1* layer outer block turn. That is, r = 1r = *R* in SiGN. But in SiGN also wants to make capital letters mean a single slice...so here is a conflict in SiGN, and thus if you omit the "convention" that r = Rw, then SiGN will be consistent.



I would try very hard to use SiGN exclusively if there is consensus to use it as a community standard, but I would prefer that r=Rw be done away with if this happens. Those are my thoughts.


----------



## bobthegiraffemonkey (May 2, 2014)

> thoughts on r=(1)r = R


Since lowercase letters are multiple layer turns, why would it make sense to think of the default as a single layer turn? 'r' is a shortcut for '2r', the simplest multiple layer turn. I realise it may be confusing since it conflicts with another notation, but having r=1r=R would be even worse IMO since 1r contradicts itself (it can't be both a single layer turn and a double layer turn).


----------



## Lucas Garron (May 3, 2014)

cuBerBruce said:


> SiGN notation may be a good idea for a consistent notation across arbitrary size cubes, but for the 4x4x4, it is a bit clumsy, and less consistent with standard mathematical notation. Singmaster notation, in its "pure" form, is actually just a use of mathematical notation (albeit it adds the prime/apostrophe to represent inverses, which alternatively can be expressed as raising to a power of -1). Singmaster extended his notation to 4x4x4 in1982 with the lower case letters representing inner layer turns, and has a *long-standing history* of being the de facto standard notation. I think SiGN enthusiasts have somewhat of an uphill battle to convince everyone one to use this clumsier notation (as a 4x4x4 notation) in place of the long-standing Singmaster standard.
> 
> As far as I know the use of lower case letters for wide turns is a relatively recent addition for 3x3x3. Can anyone show that this convention was in use before 2000?
> 
> Using +/- has had some use in cubing, but is also not consistent with standard mathematical notation.



I'm somewhat sympathetic to the historical argument, but what you call "relatively recent" is practically all of modern speedcubing.
I also don't think it's so much of an uphill battle. If it weren't for the 2008 Regs, I'm confident we would already be there.

While I care about the math, too, I don't think we should be too beholden to all arbitrary choices.
For example, alg composition is the reverse order of regular group theory.



cuBerBruce said:


> I suppose programs should give the user the choice of notation, because I think a lot of people still prefer the long-standing Singmaster convention as a 4x4x4 notation.



Programs should not give the user the choice of notation if it is contradictory (but I'm totally fine with allowing non-conflicting aliases like r=Rw, as on alg.cubing.net).

I would rather use Rw and r=2R than have two contradicting definitions for an indefinite period of time. Perhaps that's a discussion for elsewhere.


----------



## qqwref (May 3, 2014)

unsolved said:


> How many times have you had to squint and see if a ' was or was not in the middle of a sequences of moves?


This may be a font issue. For the fonts I use, I see 's very clearly. On your computer, do you also have trouble visually seeing the difference between its and it's?



unsolved said:


> I use notation such as {f/r} to indicate a middle slice turn from the front in the direction of the right face. In the opposite direction, it is {r/f}.


Ewwwwww. For methods/algs that use a lot of these slices, this would get annoying extremely quickly. (For instance: here's a popular Z perm: {f,u}2 U {f,u}2 U {f,u} U2 {f,u}2 U2 {f,u} U2)



unsolved said:


> Why should r'l and l'r be opposite in direction when you turn them both the same way?


Because R and L are on opposite sides of the cube  With SiGN, sure, you could write it 2R' 2L, but you could also write it 2R' 3R' (or 2-3r', or M) and it would be very clear that they go the same direction.



cmowla said:


> Having r = Rw is logically flawed based on the structure of SiGN. r (in SiGN) = 1r = a* 1* layer outer block turn.


You only think it's flawed because your mental definition is wrong. A lack of number does not mean "1 goes here", it means "the move of this type that is furthest from the center of the puzzle". So r = 2r because 1r wouldn't be lowercase, and M = all but the outermost two layers. And in fact, it's perfectly valid to write 2r - but nobody would, because it wastes time.



cmowla said:


> With the same flawed logic that r = Rw for the sake that r = (R M') on the 3x3x3, then why isn't x = (Rw l') on the 4x4x4 in SiGN? I of course know the answer, but how obvious you think that answer is, I feel it's just as obvious that you shouldn't say that since r = (R M') on the 3x3x3 (which is really equivalent to doing a single slice turn which obviously also has a cube rotation), it's equal to Rw on the 4x4x4.


Huh? x is a rotation of the whole cube, which will never be equivalent to (r 2L'). The idea that "lowercase letter with no number = two layer turn" is in fact a generalization of the 3x3x3 notation you mentioned, whereas the Singmaster notation of a lowercase letter being a slice is not. Again, the notation only doesn't make sense to you because you have the wrong idea of what things mean.



cuBerBruce said:


> SiGN notation may be a good idea for a consistent notation across arbitrary size cubes, but for the 4x4x4, it is a bit clumsy, and less consistent with standard mathematical notation.


Actually I find SiGN a lot less clumsy for algs or reconstructions which use very few slice moves. And compared to the WCA 4x4x4/5x5x5 notation, which really cannot be extended nicely to bigger cubes, SiGN makes writing algs on larger cubes very easy. WCA 6x6x6+ notation is also pretty clumsy and really makes no accommodation for people who need slice turns or inner block turns, such as anyone working on pretty pattern algs.

And IMO there is no "standard mathematical notation" for what letters go to what turns - Singmaster chose one convention, but math is not known for forcing people to use particular letters. Math does define what the suffixes should be, but both SiGN and WCA notation use an easy-to-type version of the standard (' = ^-1, 2 = ^2).



cuBerBruce said:


> As far as I know the use of lower case letters for wide turns is a relatively recent addition for 3x3x3. Can anyone show that this convention was in use before 2000?


Maybe this is my young-person bias showing, but I don't consider any non-theoretical writing about cubes before 2003 to be important in deciding what we do now. And besides, this is a new sport, and we can make new rules - almost everything we do now was decided, by the community, since the founding of the WCA.


Anyway, unrelated to all this stuff: the optimal algs people have been finding for ELL cases (such as u2 b' U' b' l D2 f2 D2 l' b U b u2) are extremely interesting, and generally unknown. Keep it up!


----------



## cmhardw (May 3, 2014)

qqwref said:


> You only think it's flawed because your mental definition is wrong. A lack of number does not mean "1 goes here", it means "the move of this type that is furthest from the center of the puzzle". So r = 2r because 1r wouldn't be lowercase, and M = all but the outermost two layers. And in fact, it's perfectly valid to write 2r - but nobody would, because it wastes time.



That makes sense to me. Lowercase letters denote multiple layer turns, the smallest of which is a turning of two layers. I retract my earlier statement. SiGN notation does appear to be internally consistent.


----------



## rokicki (May 3, 2014)

Here are some distance-14 (OBTM) optimal solves, I believe.

(There could be a bug in my program).

These are for the ELL positions posted earlier.

First line is the position, second is the solution.

Sorry for all the three-wide turns; I haven't yet added code
to "untwist" solutions from my optimal solver (which always
holds the DBL corner fixed).

If there is interest I will post some more. Similarly, if anyone
can confirm these that would be great too.


```
F2 U' 2L' 2R' U F' L U' F 2L 2R F' U L' F'    
      Uw2 Fw 3Uw2 3Rw' 3Uw' 3Fw Uw2 3Uw2 3Fw' 3Uw 3Rw 3Uw2 Fw' Uw2
2R2 U F2 U B' R B 2R2 B' R' B U' F2 U' 2R2    
      R U' Fw2 3Fw U2 Fw2 R Fw2 U2 Fw2 R 3Fw' U R'
F' R' 2D R U R' 2D' 2U' R U' R' 2U R F     
      F2 Rw2 U R2 U' R2 3Rw2 U R2 U' R2 Rw2 3Rw2 F2
R2 2R2 U2 R2 U' 2R U2 2L 2R U' R2 U 2L' 2R' U2 2R' U' R2 2R2
      F2 Rw2 U' F2 U F2 3Fw2 U' F2 U F2 3Fw2 Rw2 F2
```


----------



## Christopher Mowla (May 3, 2014)

rokicki said:


> If there is interest I will post some more. Similarly, if anyone
> can confirm these that would be great too.



They are all correct and amazing!
Uw2 Fw 3Uw2 3Rw' 3Uw' 3Fw Uw2 3Uw2 3Fw' 3Uw 3Rw 3Uw2 Fw' Uw2 =
[Uw2 Fw D2 R' B' L: u2](13 btm, 17 ltm, 14 ftm, 20 qtm)

R U' Fw2 3Fw U2 Fw2 R Fw2 U2 Fw2 R 3Fw' U R' =
R U' B Fw2 L2 Fw2 U Fw2 L2 Fw2 U B' U R' (14 btm, 18 ltm, 14 ftm, 20 qtm)

F2 Rw2 U R2 U' R2 3Rw2 U R2 U' R2 Rw2 3Rw2 F2 =
F2 Rw2 U R2 U' M2 U R2 U' R2 l2 F2 (12 btm, 14 ltm, 14 ftm, 24 qtm)

F2 Rw2 U' F2 U F2 3Fw2 U' F2 U F2 3Fw2 Rw2 F2 =
F2 Rw2 U' F2 U S2 U' F2 U S2 Rw2 F2 (12 btm, 16 ltm, 14 ftm, 24 qtm)

Yes there is a position I would like you to find the optimal OBTM (ftm) solution for.

I'm not sure if 18 OBTM is out of reach for your solver, but 18 OBTM is the briefest I have found (and currently exists) for this case (which I have studied extensively).
(Rw2 Uw U S Lw2 u2) r (u2 Lw2 S' U' Uw' Rw2)
(Rw2 Uw' U' S Lw2 u2) r (u2 Lw2 S' U Uw Rw2)


----------



## unsolved (May 3, 2014)

cmowla said:


> They are all correct and amazing!
> Uw2 Fw 3Uw2 3Rw' 3Uw' 3Fw Uw2 3Uw2 3Fw' 3Uw 3Rw 3Uw2 Fw' Uw2 =
> [Uw2 Fw D2 R' B' L: u2](13 btm, 17 ltm, 14 ftm, 20 qtm)
> 
> ...



I forgot to post your solved scrambles.


```
Solutions To Scramble = F2 U' l' r' U F' L U' F l r F' U L' F' 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|####|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|^^^^|####|####|OOOO|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|XXXX|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|####|####|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  d2 f  D  F2 U' F2 r2 F2 [inside 5-TFS] ---> U  F2 D' f' d2  @ 0128707314012 nodes with 1010604690894 5-TFS probes   



Solutions To Scramble = r2 U' B2 U' F L F' r2 F L' F' U B2 U r2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|&&&&|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|XXXX|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u2 b' U' b' l  D2 f2 D2 [inside 5-TFS] ---> l' b  U  b  u2  @ 0090736443045 nodes with 0750247004859 5-TFS probes   
Solution [002] =  u2 b' U' b' l' D2 f2 D2 [inside 5-TFS] ---> l  b  U  b  u2  @ 0090736464321 nodes with 0750247150267 5-TFS probes   
Solution [003] =  d' r2 d  B2 D2 F' R2 D2 [inside 5-TFS] ---> L2 B  l2 r' u'  @ 0110414034303 nodes with 0885175449290 5-TFS probes   
Solution [004] =  d2 r' U' B2 D' r' f2 r  [inside 5-TFS] ---> D  B2 U  r  d2  @ 0123089215000 nodes with 0972086306647 5-TFS probes   
Solution [005] =  d2 b' U' b' l  D2 f2 D2 [inside 5-TFS] ---> l' b  U  b  d2  @ 0130611366693 nodes with 1023666280309 5-TFS probes   
Solution [006] =  d2 b' U' b' l' D2 f2 D2 [inside 5-TFS] ---> l  b  U  b  d2  @ 0130611387969 nodes with 1023666424889 5-TFS probes   
Solution [007] =  r2 b  U  r  D  l' b2 l  [inside 5-TFS] ---> D' r' U' b' r2  @ 0259062671872 nodes with 1904439161555 5-TFS probes  



Solutions To Scramble = l2 U' B2 U' F L F' l2 F L' F' U B2 U l2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|####|OOOO|   |XXXX|&&&&|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|XXXX|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u2 f  U' f  r  D2 b2 D2 [inside 5-TFS] ---> r' f' U  f' u2  @ 0088691387205 nodes with 0736229771312 5-TFS probes   
Solution [002] =  u2 f  U' f  r' D2 b2 D2 [inside 5-TFS] ---> r  f' U  f' u2  @ 0088691410749 nodes with 0736229934429 5-TFS probes   
Solution [003] =  d2 l  U' B2 D' l  b2 l' [inside 5-TFS] ---> D  B2 U  l' d2  @ 0124135640777 nodes with 0979264921448 5-TFS probes   
Solution [004] =  d2 f  U' f  r  D2 b2 D2 [inside 5-TFS] ---> r' f' U  f' d2  @ 0128566310853 nodes with 1009645389864 5-TFS probes   
Solution [005] =  d2 f  U' f  r' D2 b2 D2 [inside 5-TFS] ---> r  f' U  f' d2  @ 0128566334397 nodes with 1009645555635 5-TFS probes   



Solutions To Scramble = r2 U l r U' F R' U F' l' r' F U' R F' r2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|^^^^|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|####|####|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|&&&&|####|####|XXXX|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|####|&&&&|&&&&|   |^^^^|^^^^|####|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u2 f' D  B2 U' B2 r2 B2 [inside 5-TFS] ---> U  B2 D' f  u2  @ 0089361202383 nodes with 0740808355065 5-TFS probes   
Solution [002] =  d2 f' D  B2 U' B2 r2 B2 [inside 5-TFS] ---> U  B2 D' f  d2  @ 0129236126031 nodes with 1014223718305 5-TFS probes   
Solution [003] =  l2 f' U  R2 U' L2 b2 L2 [inside 5-TFS] ---> U  R2 U' f  l2  @ 0297890262609 nodes with 2170654243169 5-TFS probes   
Solution [004] =  l2 f' U  R2 D' B2 r2 B2 [inside 5-TFS] ---> D  R2 U' f  l2  @ 0297890471079 nodes with 2170655663948 5-TFS probes   
Solution [005] =  l2 f' U' b2 D' B2 r2 B2 [inside 5-TFS] ---> D  b2 U  f  l2  @ 0297922559391 nodes with 2170875725249 5-TFS probes   
Solution [006] =  l2 f' L2 U  R2 U' b2 U  [inside 5-TFS] ---> R2 U' L2 f  l2  @ 0298295606800 nodes with 2173433925721 5-TFS probes   
Solution [007] =  l2 f' L2 D  B2 U' l2 U  [inside 5-TFS] ---> B2 D' L2 f  l2  @ 0298301859982 nodes with 2173476807387 5-TFS probes   



Solutions To Scramble = R2 r' F' L R F r' F' R' F r2 F' L' F R2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|####|XXXX|
---------------------   ---------------------   ---------------------
|XXXX|####|####|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|&&&&|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|####|&&&&|&&&&|   |^^^^|####|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  F2 r  U  b' L  B' L' [inside 5-TFS] ---> l  B' U2 f  l2  @ 0227762813531 nodes with 1689809785046 5-TFS probes   
Solution [002] =  r  B' R  L' B  r  B' L  [inside 5-TFS] ---> B  r2 B' R' B   @ 0231706464436 nodes with 1716850086155 5-TFS probes   
Solution [003] =  r' u2 r  u2 b' l  U  F2 [inside 5-TFS] ---> F  r  B  L2 R2  @ 0235278692736 nodes with 1741344225356 5-TFS probes   
Solution [004] =  r' F' R' L  F  r' F' R  [inside 5-TFS] ---> F  r2 F' L' F   @ 0241864066531 nodes with 1786499735871 5-TFS probes   
Solution [005] =  L  F' L' b2 L  B  L' b' [inside 5-TFS] ---> L  B' F  L' b'  @ 0308623479380 nodes with 2244260809189 5-TFS probes   



Solutions To Scramble = r2 U F2 U B' R B r2 B' R' B U' F2 U' r2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|&&&&|OOOO|   |XXXX|####|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|XXXX|####|####|^^^^|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|OOOO|&&&&|   |^^^^|^^^^|####|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  R2 f' D  F2 f' u2 l2 u2 [inside 5-TFS] ---> f  F2 D' f  R2  @ 0214056276801 nodes with 1595827407974 5-TFS probes   
Solution [002] =  R2 f' D  F2 f' d2 l2 d2 [inside 5-TFS] ---> f  F2 D' f  R2  @ 0214056279072 nodes with 1595827423505 5-TFS probes   
Solution [003] =  R2 f' D  b' B2 u2 r2 u2 [inside 5-TFS] ---> B2 b  D' f  R2  @ 0214059607653 nodes with 1595850227820 5-TFS probes   
Solution [004] =  R2 f' D  b' B2 d2 r2 d2 [inside 5-TFS] ---> B2 b  D' f  R2  @ 0214059609924 nodes with 1595850243100 5-TFS probes   
Solution [005] =  R2 f' D  B2 d2 b' r2 b  [inside 5-TFS] ---> d2 B2 D' f  R2  @ 0214061510578 nodes with 1595863321622 5-TFS probes   
Solution [006] =  R2 f' D' F2 u2 b' l2 b  [inside 5-TFS] ---> u2 F2 D  f  R2  @ 0214071048247 nodes with 1595928696941 5-TFS probes   
Solution [007] =  R2 f' D' F2 b' u2 l2 u2 [inside 5-TFS] ---> b  F2 D  f  R2  @ 0214071539037 nodes with 1595932069181 5-TFS probes   
Solution [008] =  R2 f' D' F2 b' d2 l2 d2 [inside 5-TFS] ---> b  F2 D  f  R2  @ 0214071541308 nodes with 1595932084901 5-TFS probes   
Solution [009] =  R2 f' D' f' B2 u2 r2 u2 [inside 5-TFS] ---> B2 f  D  f  R2  @ 0214072943817 nodes with 1595941686238 5-TFS probes   
Solution [010] =  R2 f' D' f' B2 d2 r2 d2 [inside 5-TFS] ---> B2 f  D  f  R2  @ 0214072946088 nodes with 1595941701785 5-TFS probes   
Solution [011] =  R2 f' D' B2 u2 f' r2 f  [inside 5-TFS] ---> u2 B2 D  f  R2  @ 0214076638621 nodes with 1595967056929 5-TFS probes   
Solution [012] =  F  L  f2 D' B  r2 d2 r2 [inside 5-TFS] ---> B' D  f2 L' F'  @ 0348708026223 nodes with 2519103241100 5-TFS probes   
Solution [013] =  F  L  f2 D' B  l2 d2 l2 [inside 5-TFS] ---> B' D  f2 L' F'  @ 0348708028575 nodes with 2519103256699 5-TFS probes   



Solutions To Scramble = L U F L' U' L U L F' L2 U L U L' U' L U' L' 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |^^^^|&&&&|&&&&|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|OOOO|OOOO|^^^^|   |OOOO|^^^^|^^^^|&&&&|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  B2 L2 F  B2 U' F  R2 B' [inside 5-TFS] ---> D  F' R2 B  F'  @ 0001119126581 nodes with 0017853193809 5-TFS probes   
Solution [002] =  U' R  L' B2 R  D' L  B2 R' [inside 5-TFS] ---> U  L2 R' F2 L2  @ 0001371388154 nodes with 0019582866730 5-TFS probes   
Solution [003] =  U' F2 L2 F2 B' U  B' R2 F  [inside 5-TFS] ---> D' B  R2 B  F'  @ 0002020120411 nodes with 0024031075167 5-TFS probes   
Solution [004] =  U2 F  R' B  U2 F' L  F' B2 [inside 5-TFS] ---> D2 B2 L' B' F   @ 0002951816961 nodes with 0030420382639 5-TFS probes   
Solution [005] =  U2 F  B' R  F2 D2 F2 B  R' [inside 5-TFS] ---> B  U2 F' L  B'  @ 0002982652928 nodes with 0030631752492 5-TFS probes   
Solution [006] =  U2 F  B' R' B2 D2 F' B2 R  [inside 5-TFS] ---> F' U2 B  L' F   @ 0002983217161 nodes with 0030635615750 5-TFS probes   
Solution [007] =  U2 B' R  F' U2 B  L' F2 B  [inside 5-TFS] ---> D2 F2 L  B' F   @ 0003265166068 nodes with 0032568908988 5-TFS probes   
Solution [008] =  R2 F  R  B' R' F' R' D2 L' [inside 5-TFS] ---> F' L  D2 R' B   @ 0009056298908 nodes with 0072277389472 5-TFS probes   
Solution [009] =  R2 F  R' D2 L  B' L' D2 R' [inside 5-TFS] ---> B' R' F' R  B   @ 0009059132519 nodes with 0072296853649 5-TFS probes   
Solution [010] =  R2 B' R  D2 L' F  L  D2 R  [inside 5-TFS] ---> F  R  B  R' F'  @ 0009373437574 nodes with 0074452290522 5-TFS probes   
Solution [011] =  R2 B' R' F  R  B  R  D2 L  [inside 5-TFS] ---> B  L' D2 R  F'  @ 0009381341449 nodes with 0074506439427 5-TFS probes   
Solution [012] =  L2 U2 D  R' L  F2 R  D' L  [inside 5-TFS] ---> B2 R' U  R  B2  @ 0011473651735 nodes with 0088853541481 5-TFS probes   
Solution [013] =  L2 U2 D' R  L' B2 R' D  L' [inside 5-TFS] ---> F2 R  U' R' F2  @ 0011478354296 nodes with 0088885796272 5-TFS probes   
Solution [014] =  L2 D  R  U2 R' L  F2 D' L  [inside 5-TFS] ---> B2 R' U  R  B2  @ 0011558045923 nodes with 0089432096854 5-TFS probes   
Solution [015] =  L2 D' R' U2 R  L' B2 D  L' [inside 5-TFS] ---> F2 R  U' R' F2  @ 0011632890326 nodes with 0089945242796 5-TFS probes   
Solution [016] =  L2 F2 R  L2 U' R  B2 L' D  [inside 5-TFS] ---> R' B2 L  R' U   @ 0011968390258 nodes with 0092245688140 5-TFS probes   
Solution [017] =  L2 B2 R' L2 U  R' F2 L  D' [inside 5-TFS] ---> R  F2 L' R  U'  @ 0012195816719 nodes with 0093805095305 5-TFS probes   
Solution [018] =  F  R  B' R' F' R' D2 L' F' [inside 5-TFS] ---> L  D2 R' B  R2  @ 0012755309015 nodes with 0097641491153 5-TFS probes   
Solution [019] =  F  R' D2 L  B' L' D2 R' B' [inside 5-TFS] ---> R' F' R  B  R2  @ 0012793133387 nodes with 0097900948987 5-TFS probes   
Solution [020] =  F  R' L2 D2 L  B' L' D2 R2 [inside 5-TFS] ---> F' R' F  L2 F'  @ 0012809096856 nodes with 0098010381424 5-TFS probes   
Solution [021] =  F  L2 F' R  F  R2 D2 L  B  [inside 5-TFS] ---> L' D2 L2 R  F'  @ 0013110831019 nodes with 0100079073946 5-TFS probes   
Solution [022] =  F  B' R2 F  D' B  R2 F' U  [inside 5-TFS] ---> B2 F' L2 B2 U'  @ 0013255306225 nodes with 0101069575163 5-TFS probes   
Solution [023] =  F  B' R2 B' D  F' R2 B  U' [inside 5-TFS] ---> B  F2 L2 F2 U   @ 0013257071300 nodes with 0101081687503 5-TFS probes   
Solution [024] =  F' U  D2 R2 D' F  D  R2 U2 [inside 5-TFS] ---> B  U  B' D2 F   @ 0013353083421 nodes with 0101740007997 5-TFS probes   
Solution [025] =  F' D2 B  U' B' U2 R2 D' F' [inside 5-TFS] ---> D  R2 D2 U' F   @ 0013784940047 nodes with 0104701441777 5-TFS probes   
Solution [026] =  F' L  B' U2 F  R' F  B2 D2 [inside 5-TFS] ---> B2 R  B  F' U2  @ 0014111006466 nodes with 0106937420192 5-TFS probes   
Solution [027] =  F' B  L  B2 D2 F  B2 L' F  [inside 5-TFS] ---> U2 B' R  F' U2  @ 0014315314555 nodes with 0108338340723 5-TFS probes   
Solution [028] =  F' B  L' F2 D2 F2 B' L  B' [inside 5-TFS] ---> U2 F  R' B  U2  @ 0014319216425 nodes with 0108365054083 5-TFS probes   
Solution [029] =  F2 R  U  R' F2 L  D' R  B2 [inside 5-TFS] ---> L  R' D  U2 L2  @ 0014922710151 nodes with 0112502821614 5-TFS probes   
Solution [030] =  F2 R  U  R' F2 L  D' B2 R' [inside 5-TFS] ---> L  U2 R  D  L2  @ 0014922710294 nodes with 0112502822550 5-TFS probes   
Solution [031] =  F2 R  U  R' F2 L  D' B2 L  [inside 5-TFS] ---> R' U2 R  D  L2  @ 0014922710296 nodes with 0112502822551 5-TFS probes   
Solution [032] =  B  U' D2 R2 D  B' D' R2 U2 [inside 5-TFS] ---> F' U' F  D2 B'  @ 0015679560453 nodes with 0117692608142 5-TFS probes   
Solution [033] =  B  D2 F' U  F  U2 R2 D  B  [inside 5-TFS] ---> D' R2 D2 U  B'  @ 0016014245689 nodes with 0119987577690 5-TFS probes   
Solution [034] =  B  L' F  U2 B' R  F2 B' D2 [inside 5-TFS] ---> F2 R' B  F' U2  @ 0016398204444 nodes with 0122620173492 5-TFS probes   
Solution [035] =  B' R  D2 L' F  L  D2 R  F  [inside 5-TFS] ---> R  B  R' F' R2  @ 0016988624704 nodes with 0126668356753 5-TFS probes   
Solution [036] =  B' R  L2 D2 L' F  L  D2 R2 [inside 5-TFS] ---> B  R  B' L2 B   @ 0017004358800 nodes with 0126776299331 5-TFS probes   
Solution [037] =  B' R' F  R  B  R  D2 L  B  [inside 5-TFS] ---> L' D2 R  F' R2  @ 0017094129355 nodes with 0127392092332 5-TFS probes   
Solution [038] =  B' L2 B  R' B' R2 D2 L' F' [inside 5-TFS] ---> L  D2 L2 R' B   @ 0017403264353 nodes with 0129512031676 5-TFS probes   
Solution [039] =  B2 R' U' R  B2 L' D  R' F2 [inside 5-TFS] ---> L' R  D' U2 L2  @ 0017964864801 nodes with 0133362816543 5-TFS probes   
Solution [040] =  B2 R' U' R  B2 L' D  F2 R  [inside 5-TFS] ---> L' U2 R' D' L2  @ 0017964864892 nodes with 0133362817287 5-TFS probes   
Solution [041] =  B2 R' U' R  B2 L' D  F2 L' [inside 5-TFS] ---> R  U2 R' D' L2  @ 0017964864896 nodes with 0133362817359 5-TFS probes
```



cmhardw said:


> That makes sense to me. Lowercase letters denote multiple layer turns, the smallest of which is a turning of two layers. I retract my earlier statement. SiGN notation does appear to be internally consistent.






A Move Notation Proposal: Lodino = Logigcal Direction Notation

Background: In reviewing the various notations used by cubers,
and offering a fresh perspective as an outsider (I am no speed
cuber and can't even solve a 5x5x5 without constantly referencing
cmowla's numerous PDFs on the subject), I decided to start with a
tabula rasa. 

A summary first for those who can't read this in its entirety
without falling asleep.

Goals for a hypothetical new system:

1. A notation system that reads in such a way that the cubies
to which a formula applies is obvious, with an intuitive
direction indicator.

2. The system should be telescoping and inclusive of all
cubes from 2x2x2 through NxNxN (with N currently at 11 max)
with no need to add terms as the size of the cube grows.

3. No dependence on the knowledge of mathematical notation
or symbology to ease the burden on the newly initiated.

4. System should resolve the present ambiguity concerning the
ambiguous rotation notation governing the middle slices for 
all NxNxN cubes with odd N >= 5.

5. The system should be neither cumbersome for the human
to learn, nor difficult for the programmer to implement.

With these goals in mind, the system below accomplishes all
of the above.


========================================================

Logical Direction Notation (Lodino) has the following
good features.

1. Easy to understand direction notation. It eliminates
the arbitrary prime mark (') assignment altogether,
and the unitiated can understand which way to turn the
cube at once. Older systems may even have a right-handed
bias in that clockwise turns (no prime notation) are more
easily performed with a right hand on the R and U faces
than a left hand on the L and D faces.

2. Rotation notation is also "global" and not "relative."
There is a rotation indicator for every direction, not
merely the absence of one for the arbitrary unprimed move.
In this way, lodino supports positive reinforcement with
a standard number of descriptors per move of the same
cube size.

3. Moves are of the form: cubie_subset.direction

4. Lodino corrects the defect where larger cubes have
some move designations with no bearing or resemblance
to smaller cubes. All moves on larger cubes look like 
those already seen before on smaller cubes.

5. Lodino corrects larger cube notations that complicate
situations where:

A. Multiple slices with or without the center slice
are involved in the move.
B. Slice turns + face turns are required for a move.
C. Moves involve only the center slice, which, by definition,
cannot have a rotation indicator that is unambiguous.

6. Lodino smooths out the 4x4x4 move description defect
where 2 slices in motion being turned at once have
opposing direction indicators. For example, ud' moves
the up and down slices in the same direction, yet the
move notation is inconsistent and not natural.

========================================================

Sample of Moves

========================================================

2X2X2 and larger

U.L = turn the top towards the left = U presently
U.R = turn the top towards the right = U' presently
U.2 = turn the top twice

F.R = F
F.L = F'
F.2 = F2

R.B = R
R.F = R'
R.2 = R2

D.R = D
D.L = D'
D.2 = D2

B.L = B
B.R = B'
B.2 = B2

L.F = L
L.B = L'
L.2 = L2

========================================================

4x4x4 single slice turns

Only time to use lower case for the direction is when
all moves are slices.

u.l = turn the top slice towards the left = u presently
u.r = turn the top slice towards the right = u' presently
u.2 = turn the top slice twice

f.r = f
f.l = f'
f.2 = f2

r.b = r
r.f = r'
r.2 = r2

d.r = d
d.l = d'
d.2 = d2

b.l = b
b.r = b'
b.2 = b2

l.f = l
l.b = l'
l.2 = l2

4x4x4 double slice turns

ud.l = ud'
ud.r = u'd

fb.r = fb'
fb.l = f'b

rl.b = rl'
rl.f = r'l

4x4x4 face and slice turns

Uu.L = U u
Uu.R = U' u'
Uu.2 = U2 u2

Ff.R = F f
Ff.L = F' f'

Rr.B = R r
Rr.F = R' r'

Dd.R = D d
Dd.L = D' d'

Bb.L = B b
Bb.R = B' b'

Ll.F = L l
Ll.B = L' l'

========================================================

5x5x5 middle slice turns

Enclose the moves in round parenthesis to demarcate a middle edge.

(uf) = turn the middle slice towards the front face from the top face.
When stand alone, it is both a cube selector and a direction selector.

(fu) = the opposite direction of (uf). Move from the front towards
the top

(uf).2 = move the slice twice.
(fu).2 = same as (uf).2


l.(fu) = adjoin the l slice to the middle slice and turn it from f to u.

lr.(uf) = turn 3 slices at once; l, the middle, and r, all from u to f.
This is essentially like moving R and L' on separate moves.

L.(uf).2 = turn the L face and the middle edge at the same time, from u to f.

d.(fr).2 = Turn the d and middle slices twice, in the direction of f to r.


u.(fr) = adjoin the middle slice to the top slice and it them from f to r.


========================================================

NxNxN very large cubes with multiple slice turns for N > 5

"Build" the moves from the perspective of looking either from UFR with the
middle edge rotating vertically or from DBL, likewise. Pad moves to the
left or right of the middle edge in the order in which they appear.
Enclose the moves in round parenthesis to demarcate a middle edge.

Add a padded 0 for any ommited slice not in a series of consecutive slices.
Repeat the same slice letter as many times as needed if it is in relative
motion. Always use all N terms when describing a move sequence.

There should never be more than N/2 terms in motion for a move sequence.

11x11x11 examples:

F00ff(u.r)00000
0000f(u.r)bb000

000ll(u.f)0r00R


----------



## Carrot (May 3, 2014)

unsolved said:


> ========================================================
> 
> NxNxN very large cubes with multiple slice turns for N > 5
> 
> ...



I prefer this:
5F 3F' F
5F 4F' 5B' 3B

or this:
5f 4f F
5f 5b' 4b'


assuming f is understood as short for 2f. (reason why I would write F and not f)

one could however however argue for this notation (working for nxnxn for n<22):
145f = F 4f 5f = 5F 3F' F
124f = F f 4f = 4F 3F' 2F

and this (but this would give problems with consistency as 4F=4f=/=4F, so bad idea, let's keep 4F=/=4f):
145F = F 4f 5f = 5F 3F' F
124F = F f 4f = 4F 3F' 2F

so in your cases you could write them as:
F00ff(u.r)00000 = 145f
0000f(u.r)bb000 = 5f 45b'

and since this shouldn't ruin the consistency too much of what things mean, you can write things like(completely made up conjugated commutator, I doubt it's for ANY use except it shouldn't scramble too much):
[f: [24u 5b, 2L' U 2L]] = f 24u 5b 2L' u 2L 5b' 24u' 2L' U' 2L f'


----------



## unsolved (May 3, 2014)

Carrot said:


> I prefer this:
> 5F 3F' F
> 5F 4F' 5B' 3B
> 
> ...



I don't have any experience with these larger cubes, so I defer to you. The idea was to toss something out there that made sense. I gave it a fair amount of thought.

In other news, the first implementation of the massively parallel version of *OO_4x4x4* was not a success, but for the opposite reason you might suspect. It is too parallel!







I've never seen my 32-threaded computer (16 physical cores) get pegged at 100% before, but then again, the software thinks there are 1.3 million cores (2.6 million threads).


----------



## Herbert Kociemba (May 3, 2014)

unsolved said:


> A Move Notation Proposal: Lodino = Logigcal Direction Notation



I must admit that I do not like this notation at all. Why we can't just accept these simple rules:

1. A letter *without* a number as prefix means a *single* slice move, upper cases like U , F etc. mean the outer slice, lower cases like u , f etc mean the adjacent slice. 

2. With a number prefix, with upper case letters we denote a single slice move like 3U, 3F etc. With lower case letters we denote outer block turns, like 3u, 3f etc.


----------



## Carrot (May 3, 2014)

Herbert Kociemba said:


> I must admit that I do not like this notation at all. Why we can't just accept these simple rules:
> 
> 1. A letter *without* a number as prefix means a *single* slice move, upper cases like U , F etc. mean the outer slice, lower cases like u , f etc mean the adjacent slice.
> 
> 2. With a number prefix, with upper case letters we denote a single slice move like 3U, 3F etc. With lower case letters we denote outer block turns, like 3u, 3f etc.



Why not:

lowercase letter: single slice turns
uppercase letter: outer block turns
prefixes: defines "how deep" the turn should be (3f = 3rd layer single slice turn of the f-face in a clockwise direction etc.)
postfixes: defines the direction of the turn
special case: since f=F we denote all f's as F. We can then denote all 2f's as f for more compactness.


Your notation gives unconsistency in when uppercase and lower cases means what, it shouldn't. Why should U=OBT and U=SS, u=SS => 3U=SS, 3u=OBT? that makes no sense.


----------



## rokicki (May 3, 2014)

Here's another six optimal OTBM solves; some are 14, some are 15. Still all
from the ELL list.


```
2R2 U' B2 U' F L F' 2R2 F L' F' U B2 U 2R2
        Rw2 U 3Rw 3Uw' Fw Rw2 Uw2 3Uw2 Rw2 Fw' 3Uw 3Rw' U' Rw2
R2 2R' F' L R F 2R' F' R' F 2R2 F' L' F R2
        U F 3Fw' Rw 3Fw U' 3Fw' Rw2 3Rw U' 3Rw' F Rw F' 3Fw
2L2 2R2 U 2R2 F2 2R2 F2 U' 2L2 2U2 2R2 2U2
        F2 3Fw2 U Uw2 3Fw2 R2 Fw2 U2 Uw2 3Fw2 R2 Fw2 U F2 3Fw2
2L2 2R2 U' 2R2 F2 2R2 F2 U 2L2 2U2 2R2 2U2
        F2 3Fw2 U' Uw2 F2 R2 Fw2 U2 Uw2 F2 R2 Fw2 U' F2 3Fw2
R2 D' F2 2F' U 2F U2 2F' U F2 U' 2F U2 2F' U' 2F D R2
        Fw2 R2 F' Fw Rw2 F 3Rw U' Rw2 U Uw' R2 Uw 3Rw' Fw
2L2 2R2 U' 2L' 2R U2 F2 2L 2R F2 D2 F2 2L2 F2 2L2 D2 2R2 U' 2L2 2R2
        Fw2 U2 Rw2 3Uw R2 3Fw2 Rw2 3Uw2 R2 Rw2 3Uw' Fw2 U2 3Fw2 Rw2
```

I may not be able to solve all of them with my current program.

Working on the double-edge flip; I've found no solution through
length 14 in the outer block metric and am now looking on a length
15 solution.



cmowla said:


> I'm not sure if 18 OBTM is out of reach for your solver, but 18 OBTM is the briefest I have found (and currently exists) for this case (which I have studied extensively).
> (Rw2 Uw U S Lw2 u2) r (u2 Lw2 S' U' Uw' Rw2)
> (Rw2 Uw' U' S Lw2 u2) r (u2 Lw2 S' U Uw Rw2)



That one was easy; 13 outer block turns:


```
Rw2 Uw U S Lw2 2U2 2R 2U2 Lw2 S' U' Uw' Rw2
    Rw2 U2 R2 Rw' U2 3Uw2 R' Rw U2 3Uw2 Rw' U2 Rw2
```

And another ELL just popped out.


```
2R2 U' 2R2 F2 2R2 F2 U2 F2 2R2 F2 2R2 U' 2R2
     R2 Fw2 Rw2 U' R2 F2 R2 U2 R2 F2 R2 U' Rw2 Fw2 R2
```


----------



## Christopher Mowla (May 3, 2014)

rokicki said:


> That one was easy; 13 outer block turns:
> 
> 
> ```
> ...


You just lowered the BHTM for this case by 1 move, the BQTM by 1 move, and the OBTM by 5 moves! It also works on the nxnxn! How did I miss this?!
Rw2 U2 R r' E2 r E2 Rw' U2 Rw2

Now, I'm wondering...

Single Dedge Flip (Current minimum, 19 OBTM)
Rw2 B r B U2 B' r' B U2 Lw' B2 r' B2 Lw B2 Rw2
Rw2 B' r B' U2 B r' B' U2 Lw' B2 r' B2 Lw B2 Rw2

Double Parity (Current minimum, 21 OBTM)
Rw2 U B2 U' r' U B2 U' Rw r U B2 U r' U' B2 U' Rw

Adjacent Double Parity (Current minimum, 22 OBTM)
r2 F Rw' F' r2 U2 r' U2 r' U2 r' U2 F Rw F' r2

Adjacent checkerboard case (Current minimum, 22 OBTM)
Rw' F2 M2 F U2 l U2 l2 U2 l U2 l F' M2 F2 Rw

Adjacent hourglass case (Current minimum, 22 OBTM)
(Lw' U2 M2 U' x) r' U2 r' U2 r2 U2 r' U2 (x' U M2 U2 Lw)


Lastly, algs for all 6 unique "oriented" 3-cycle and 2-cycle last layer cases:


Spoiler: 3-cycle and a 2-cycle cases



In 3 dedges:

Case 1
R2 Lw F2 Lw U' R2 U' l U2 l' U' R2 U Lw' U2 l U2 F2 Lw' R2 (23)

Case 2
Lw F2 U2 l' U2 Lw U' R U l U2 l' U R' U Lw' F2 Lw' (21)

Case 3
R B Rw' S2 B' U2 r U2 r' B Rw' U2 r U2 Rw S2 Rw B' R' (24)

In 4 dedges:

Case 1
B2 U l Rw U' r F2 r' F2 U l' U2 r' U2 Rw' U' B2 (22)
B2 U l Rw U' Rw F2 r' F2 R' U Rw' F2 r' F2 l' U' B2 (22)

Case 2 (I doubt this is alg is close to optimal!)
F2 l U' D2 r U2 R r' B Rw' U2 r U2 Rw B' R' U' D2 l' F2 (25)

Case 3
F2 U Rw2 F R F' r F2 r' F' R' F' Rw' F2 r' F2 Rw' U' F2 (22)


----------



## rokicki (May 3, 2014)

I'll run those cases too.

I've finally got my "untwister" working, and usually there are multiple
solution sequences that it finds; I don't know which might be easiest
for speedsolvers so I'm dumping them all (at least the ones that
preserve overall cube orientation).

Here are the current set of solutions to the sequences you've posted.
I've given each a unique number.

(Note that I'm using the JavaScript alg.cubing.net and not the
Java applet, so I change r to 2R and so on.)



Spoiler



For (seq1002): F2 U' 2L' 2R' U F' L U' F 2L 2R F' U L' F'
Uw2 Fw D2 R' B' L Dw2 U2 R' F L D2 Bw' Dw2
Uw2 Fw D2 R' B' L Uw2 U2 L' B R D2 Fw' Uw2
Uw2 Bw R2 U' B' D Lw2 L2 D' B U R2 Bw' Uw2
Dw2 Bw D2 L' F' R Dw2 U2 L' B R D2 Fw' Uw2
Dw2 Bw D2 L' F' R Uw2 U2 R' F L D2 Bw' Dw2
Dw2 Fw L2 U' F' D Rw2 R2 D' F U L2 Fw' Dw2

For (seq1003): 2R2 U' B2 U' F L F' 2R2 F L' F' U B2 U 2R2
Rw2 U L B' Lw Dw2 Fw2 B2 Dw2 Lw' F L' D' Lw2
Rw2 U L B' Lw Dw2 Bw2 B2 Dw2 Lw' B L' U' Rw2
Rw2 U L B' Lw Uw2 Bw2 F2 Uw2 Lw' F L' D' Lw2
Rw2 U L B' Lw Uw2 Fw2 F2 Uw2 Lw' B L' U' Rw2
Rw2 U L B' Rw Fw2 Uw2 D2 Fw2 Rw' F L' D' Lw2
Rw2 U L B' Rw Fw2 Dw2 D2 Fw2 Rw' B L' U' Rw2
Rw2 U L B' Rw Bw2 Dw2 U2 Bw2 Rw' F L' D' Lw2
Rw2 U L B' Rw Bw2 Uw2 U2 Bw2 Rw' B L' U' Rw2
Lw2 D L F' Lw Uw2 Bw2 F2 Uw2 Lw' B L' U' Rw2
Lw2 D L F' Lw Uw2 Fw2 F2 Uw2 Lw' F L' D' Lw2
Lw2 D L F' Lw Dw2 Fw2 B2 Dw2 Lw' B L' U' Rw2
Lw2 D L F' Lw Dw2 Bw2 B2 Dw2 Lw' F L' D' Lw2
Lw2 D L F' Rw Bw2 Dw2 U2 Bw2 Rw' B L' U' Rw2
Lw2 D L F' Rw Bw2 Uw2 U2 Bw2 Rw' F L' D' Lw2
Lw2 D L F' Rw Fw2 Uw2 D2 Fw2 Rw' B L' U' Rw2
Lw2 D L F' Rw Fw2 Dw2 D2 Fw2 Rw' F L' D' Lw2

For (seq1006): R2 2R' F' L R F 2R' F' R' F 2R2 F' L' F R2
U F B' Dw B U' B' Dw2 U F' U' F Dw F' B
U F B' Uw R U' R' Uw2 U R' U' R Uw F' B

For (seq1007): 2R2 U F2 U B' R B 2R2 B' R' B U' F2 U' 2R2
R U' Fw2 B L2 Fw2 U Fw2 L2 Fw2 U B' U R'
R U' Fw2 B L2 Fw2 U Bw2 R2 Bw2 U B' U R'
R U' Fw2 B L2 Bw2 D Fw2 R2 Bw2 U B' U R'
R U' Fw2 B L2 Bw2 D Bw2 L2 Fw2 U B' U R'
R U' Bw2 B R2 Fw2 D Fw2 R2 Bw2 U B' U R'
R U' Bw2 B R2 Fw2 D Bw2 L2 Fw2 U B' U R'
R U' Bw2 B R2 Bw2 U Fw2 L2 Fw2 U B' U R'
R U' Bw2 B R2 Bw2 U Bw2 R2 Bw2 U B' U R'

For (seq1016): 2L2 2R2 U 2R2 F2 2R2 F2 U' 2L2 2U2 2R2 2U2 
F2 B2 D Dw2 B2 R2 Fw2 U2 Uw2 B2 L2 Fw2 D F2 B2
F2 B2 D Dw2 B2 R2 Bw2 D2 Dw2 B2 R2 Bw2 D F2 B2
F2 B2 D Uw2 F2 L2 Bw2 U2 Dw2 B2 L2 Fw2 D F2 B2
F2 B2 D Uw2 F2 L2 Fw2 D2 Uw2 B2 R2 Bw2 D F2 B2

For (seq1017): 2L2 2R2 U' 2R2 F2 2R2 F2 U 2L2 2U2 2R2 2U2 
F2 B2 D' Dw2 F2 L2 Fw2 D2 Dw2 F2 L2 Fw2 D' F2 B2
F2 B2 D' Dw2 F2 L2 Bw2 U2 Uw2 F2 R2 Bw2 D' F2 B2
F2 B2 D' Uw2 B2 R2 Bw2 D2 Uw2 F2 L2 Fw2 D' F2 B2
F2 B2 D' Uw2 B2 R2 Fw2 U2 Dw2 F2 R2 Bw2 D' F2 B2

For (seq1018): 2R2 U' 2R2 F2 2R2 F2 U2 F2 2R2 F2 2R2 U' 2R2 
R2 Fw2 Rw2 U' R2 F2 R2 U2 R2 F2 R2 U' Rw2 Fw2 R2
R2 Fw2 Lw2 D' R2 B2 R2 D2 R2 B2 R2 D' Lw2 Fw2 R2
R2 Bw2 Lw2 D' L2 F2 L2 D2 L2 F2 L2 D' Lw2 Bw2 R2
R2 Bw2 Rw2 U' L2 B2 L2 U2 L2 B2 L2 U' Rw2 Bw2 R2

For (seq1019): F' R' 2D R U R' 2D' 2U' R U' R' 2U R F 
F2 Rw2 U R2 U' R2 L2 D R2 D' R2 Rw2 L2 F2
F2 Lw2 D R2 D' R2 L2 U R2 U' R2 Lw2 L2 F2

For (seq1020): R2 D' F2 2F' U 2F U2 2F' U F2 U' 2F U2 2F' U' 2F D R2 
Fw2 R2 F' Fw Rw2 F L F' Rw2 F Fw' R2 Fw L' Fw
Fw2 R2 F' Fw Rw2 F L F' Rw2 F Bw' D2 Fw U' Bw
Fw2 R2 F' Fw Rw2 F L F' Rw2 F Bw' D2 Bw L' Fw
Fw2 R2 F' Fw Lw2 B L B' Lw2 F Fw' R2 Fw L' Fw
Fw2 R2 F' Fw Lw2 B L B' Lw2 F Bw' D2 Fw U' Bw
Fw2 R2 F' Fw Lw2 B L B' Lw2 F Bw' D2 Bw L' Fw
Fw2 R2 F' Bw Uw2 F D F' Uw2 F Bw' R2 Fw L' Fw
Fw2 R2 F' Bw Dw2 B D B' Dw2 F Bw' R2 Fw L' Fw
Bw2 L2 F' Fw Lw2 F R F' Lw2 F Fw' L2 Bw U' Bw
Bw2 L2 F' Fw Rw2 B R B' Rw2 F Fw' L2 Bw U' Bw
Bw2 L2 F' Bw Dw2 F U F' Dw2 F Fw' D2 Fw U' Bw
Bw2 L2 F' Bw Dw2 F U F' Dw2 F Fw' D2 Bw L' Fw
Bw2 L2 F' Bw Dw2 F U F' Dw2 F Bw' L2 Bw U' Bw
Bw2 L2 F' Bw Uw2 B U B' Uw2 F Fw' D2 Fw U' Bw
Bw2 L2 F' Bw Uw2 B U B' Uw2 F Fw' D2 Bw L' Fw
Bw2 L2 F' Bw Uw2 B U B' Uw2 F Bw' L2 Bw U' Bw

For (seq1021): R2 2R2 U2 R2 U' 2R U2 2L 2R U' R2 U 2L' 2R' U2 2R' U' R2 2R2 
F2 Rw2 U' F2 U F2 B2 D' F2 D F2 B2 Rw2 F2
F2 Lw2 D' B2 D B2 F2 U' B2 U B2 F2 Lw2 F2

For (seq1026): 2L2 2R2 U' 2L' 2R U2 F2 2L 2R F2 D2 F2 2L2 F2 2L2 D2 2R2 U' 2L2 2R2 
Fw2 U2 Rw2 D B2 L2 Fw2 U2 B2 Bw2 U' Fw2 D2 B2 Rw2
Fw2 U2 Rw2 D B2 L2 Fw2 U2 B2 Fw2 D' Bw2 D2 B2 Rw2
Fw2 U2 Rw2 D B2 L2 Bw2 D2 B2 Bw2 D' Bw2 D2 B2 Rw2
Fw2 U2 Rw2 D B2 L2 Bw2 D2 B2 Fw2 U' Fw2 D2 B2 Rw2
Fw2 U2 Lw2 U F2 L2 Bw2 D2 F2 Fw2 D' Bw2 U2 F2 Lw2
Fw2 U2 Lw2 U F2 L2 Bw2 D2 F2 Bw2 U' Fw2 U2 F2 Lw2
Fw2 U2 Lw2 U F2 L2 Fw2 U2 F2 Fw2 U' Fw2 U2 F2 Lw2
Fw2 U2 Lw2 U F2 L2 Fw2 U2 F2 Bw2 D' Bw2 U2 F2 Lw2
Bw2 D2 Lw2 U B2 R2 Fw2 D2 B2 Bw2 D' Bw2 D2 B2 Rw2
Bw2 D2 Lw2 U B2 R2 Fw2 D2 B2 Fw2 U' Fw2 D2 B2 Rw2
Bw2 D2 Lw2 U B2 R2 Bw2 U2 B2 Bw2 U' Fw2 D2 B2 Rw2
Bw2 D2 Lw2 U B2 R2 Bw2 U2 B2 Fw2 D' Bw2 D2 B2 Rw2
Bw2 D2 Rw2 D F2 R2 Bw2 U2 F2 Fw2 U' Fw2 U2 F2 Lw2
Bw2 D2 Rw2 D F2 R2 Bw2 U2 F2 Bw2 D' Bw2 U2 F2 Lw2
Bw2 D2 Rw2 D F2 R2 Fw2 D2 F2 Fw2 D' Bw2 U2 F2 Lw2
Bw2 D2 Rw2 D F2 R2 Fw2 D2 F2 Bw2 U' Fw2 U2 F2 Lw2

For (seq2000): Rw2 Uw U S Lw2 2U2 2R 2U2 Lw2 S' U' Uw' Rw2
Rw2 U2 R2 Rw' U2 D2 L' Lw U2 D2 Rw' U2 Rw2
Rw2 U2 R2 Rw' U2 D2 L' Rw B2 F2 Lw' D2 Lw2
Rw2 U2 R2 Lw' B2 F2 L' Lw B2 F2 Lw' D2 Lw2
Rw2 U2 R2 Lw' B2 F2 L' Rw D2 U2 Rw' D2 Lw2
Lw2 D2 R2 Rw' D2 U2 L' Lw D2 U2 Rw' D2 Lw2
Lw2 D2 R2 Rw' D2 U2 L' Rw F2 B2 Lw' U2 Rw2
Lw2 D2 R2 Lw' F2 B2 L' Lw F2 B2 Lw' U2 Rw2
Lw2 D2 R2 Lw' F2 B2 L' Rw U2 D2 Rw' U2 Rw2



Almost all of these optimal solves show significant structure.

I should probably make my untwister recognize and reformat explicit
commutators and conjugates.

I've finished depth 15 for a few of these positions, and am starting
depth 16. I don't think I will be able to complete a depth-16 solve for
any of these in any reasonable amount of time; my depth-15 searches
for some of these took about half a day, and the others may take
longer.


----------



## qqwref (May 4, 2014)

Alg.garron doesn't show the algs properly for me - can someone please post images for these (e.g. http://cube.crider.co.uk/visualcube...U2R2Rw'U2D2L'LwU2D2Rw'U2Rw2&fmt=png&view=plan)? Or put them on the wiki somewhere? The few I've actually executed on a real cube are really cool, though.


----------



## rokicki (May 4, 2014)

Here's a pretty one that just finished. The first solution only moves from two faces,
U and F. Length-16 optimal in OBTM.


```
For (seq1022):  F L 2D' L' U' L 2D L' U F' L B 2U B' U' B 2U' B' U L' 
U Fw2 U' F2 U2 F2 U' Fw2 U Fw2 U' F2 U2 F2 U' Fw2
U Fw2 U' F2 U2 F2 U' Fw2 U Bw2 D' F2 D2 F2 D' Bw2
U Fw2 U' F2 U2 F2 U' Bw2 D Fw2 D' F2 D2 F2 D' Bw2
U Fw2 U' F2 U2 F2 U' Bw2 D Bw2 U' F2 U2 F2 U' Fw2
U Bw2 D' F2 D2 F2 D' Fw2 D Fw2 D' F2 D2 F2 D' Bw2
U Bw2 D' F2 D2 F2 D' Fw2 D Bw2 U' F2 U2 F2 U' Fw2
U Bw2 D' F2 D2 F2 D' Bw2 U Fw2 U' F2 U2 F2 U' Fw2
U Bw2 D' F2 D2 F2 D' Bw2 U Bw2 D' F2 D2 F2 D' Bw2
```



qqwref said:


> Alg.garron doesn't show the algs properly for me - can someone please post images for these (e.g. http://cube.crider.co.uk/visualcube...U2R2Rw'U2D2L'LwU2D2Rw'U2Rw2&fmt=png&view=plan)? Or put them on the wiki somewhere? The few I've actually executed on a real cube are really cool, though.



Here you go. I had to make a lot of changes since everyone seems to support
their own subset of notations and the like, but I think it works now. I'm
using the cool cube.crider.co.uk to get images, and the excellent alg.cubing.net
to get playback. Thanks to both for their wonderful code!

http://tomas.rokicki.com/ell4x4.html


----------



## unsolved (May 4, 2014)

rokicki said:


> Here you go. I had to make a lot of changes since everyone seems to support
> their own subset of notations and the like, but I think it works now. I'm
> using the cool cube.crider.co.uk to get images, and the excellent alg.cubing.net
> to get playback. Thanks to both for their wonderful code!
> ...



I like that "exploded cube view" there, it's the nicest one I have seen.


----------



## unsolved (May 4, 2014)

cmowla said:


> You just lowered the BHTM for this case by 1 move, the BQTM by 1 move, and the OBTM by 5 moves! It also works on the nxnxn! How did I miss this?!
> Rw2 U2 R r' E2 r E2 Rw' U2 Rw2
> 
> Now, I'm wondering...
> ...



Here's a position I have not seen on any list, including...

http://www.speedsolving.com/wiki/index.php/4x4x4_Parity_Algorithms


----------



## Christopher Mowla (May 4, 2014)

unsolved said:


> Here's a position I have not seen on any list, including...
> 
> http://www.speedsolving.com/wiki/index.php/4x4x4_Parity_Algorithms


I guess you meant to say algorithm instead of position (I don't list mirror cases because it would take up too much room and it's harder to maintain). Yeah, that's a nice list of 14 movers. I only listed all optimal half turn single slice algorithms for the single dedge flip case on that page (well, I excluded a handful but I explained why), but if I can add any of these algorithms if anyone wants me to. In fact, maybe I should add all of them since the promise of the page (by qqwref, who actually started it) is to list all efficient solutions.

It would really be interesting if you searched for this position: r B2 l' D2 l' B2 r2 B2 U2 l' D2 l U2 l2 B2, which I have algs listed for here.

I used Cube Explorer, and I only got two unique (25,15) solutions, but I'm really curious to see if your solver can find all possible algorithms which are up to 17 moves in length, because, I want to see if your solver can spit out solutions like:
l r F2 l B u' B D2 B' u B r' D2 B2 l2 F2 r' (23,17), as well as all other 23q's and 24q's which are not confined to the moveset <U2,F2,D2,B2,l,r>.

I also found all of these type of algorithms, which are listed for that case, using Cube Explorer, but I didn't do an exhaustive search of depth 17 (I got too tired...I could easily now write a program which goes through a list of all of Cube Explorer's algs to detect if they actually solve the case without having to manually check them like I did for these algorithms, but I want to give your solver some practice!). I had (maybe have a huge list of 17 movers...I think there were only a handful of 16 movers, and as I have said, only 2 15 movers), but I didn't list any of the 17 movers except the ones at the bottom of the list and those which had fewer than 25 quarter turns.


----------



## qqwref (May 4, 2014)

rokicki said:


> Here you go. I had to make a lot of changes since everyone seems to support
> their own subset of notations and the like, but I think it works now. I'm
> using the cool cube.crider.co.uk to get images, and the excellent alg.cubing.net
> to get playback. Thanks to both for their wonderful code!
> ...


Awesome! Thanks a lot!


And it's very cool to see these programs getting good enough to generate optimal positions to tricky cases. Any possibility of a qtm solver? 


unsolved: Would you consider some kind of cube-net view, such as http://www.dembot.net/images/rubik.jpg? Your current view works, but it's a bit hard to convert into a 3D view in my head, and I have a lot of trouble telling which edge sticker connects to which other edge sticker.


----------



## Christopher Mowla (May 4, 2014)

cmowla said:


> You just lowered the BHTM for this case by 1 move, the BQTM by 1 move, and the OBTM by 5 moves! It also works on the nxnxn! How did I miss this?!
> Rw2 U2 R r' E2 r E2 Rw' U2 Rw2


I can't believe I didn't notice this, but, Tom, actually have a (15q, 9 btm) algorithm(s) here!
Rw2 U2 r' E2 r E2 r' U2 Rw2

So it turns out to be equal in btm length to (r U2)4 r, and it only affects two dedges instead of four! (Is this the new and improved quick parity fix?). I believe Kirjava asked me to find an algorithm like this in the past. I hope he's seeing this!

I will definitely add these to the wiki and modify the "minimum move count" table section, but I will first wait a few more days to see if you (Tom) find any new solutions (even if they are not optimal or are equal in length to my algs) and also for cuBerBruce and unsolved to find solutions.

Lastly, Tom, if you adjust your solver to find the optimal OBTM solutions for this case, Uw Lw' Uw' l' Uw Lw Fw' Lw2 Uw' l' Uw Lw' L' Fw Uw' (17 OBTM, one of the current shortest algorithms for this case), then you could very well have a solver which can find the optimal BQTM solution for the single dedge flip case!


----------



## unsolved (May 4, 2014)

qqwref said:


> unsolved: Would you consider some kind of cube-net view, such as http://www.dembot.net/images/rubik.jpg? Your current view works, but it's a bit hard to convert into a 3D view in my head, and I have a lot of trouble telling which edge sticker connects to which other edge sticker.



At present, each view is as if you rotated the cube to stare right at the 2D face. Top is as viewing with UFR as the 3 visible sides. Front is the same as in that view, so the bottom 4 white cubes attach to the top 4 red ones. I can make the change easy enough, if others say that is what they would want also.




cmowla said:


> I guess you meant to say algorithm instead of position (I don't list mirror cases because it would take up too much room and it's harder to maintain). Yeah, that's a nice list of 14 movers. I only listed all optimal half turn single slice algorithms for the single dedge flip case on that page (well, I excluded a handful but I explained why), but if I can add any of these algorithms if anyone wants me to. In fact, maybe I should add all of them since the promise of the page (by qqwref, who actually started it) is to list all efficient solutions.
> 
> It would really be interesting if you searched for this position: r B2 l' D2 l' B2 r2 B2 U2 l' D2 l U2 l2 B2, which I have algs listed for here.
> 
> ...



My solver stops after the iteration of a proven optimal solve, but I have variables which can have it search longer. The problem is, on longer depths than the optimal, at the tail end of a solution it starts making moves that "oversolve," and the TFS databases just undo that last move. So say your solution was [....] then the next iteration the program adds R' to the end of it, well the first move in the TFS will be R and the rest of the solution just follows from there. So you get 33 times as many "solutions" at each subsequent depth. You can go from 10 optimal solves at depth N, to 330 at N+1, to over 10,000 at N+2.

By the way, why don't you just download it and run it for yourself?


----------



## rokicki (May 4, 2014)

cmowla said:


> have a (15q, 9 btm) algorithm(s) here!
> Rw2 U2 r' E2 r E2 r' U2 Rw2



Yeah, I noticed that; I think I'm going to modify my solver or
untwister to collapse move sequences like that that have a
concise name, but aren't actually in the set of moves the
solver is considering.

I think my solver is running out of steam on some of those positions;
I can tell you for sure most are depth 16 or more in the OBTM and
*maybe* we'll get solutions in the next few days, but the programs
have been silent and the node count has been increasing.

I've been doing some thinking and I believe I now understand the
interest in single-slice-turn metric. It's not too far off what cubers
use in general; at 36 moves it has a slightly larger ply than OBTM
(which has 27) but a much smaller ply than the general BTM (at 54!);
and it has a very nice structural+color prune heuristic that's very
deep. Put these together and it appears to be a very nice metric
indeed!

I will be modifying my optimal solver to support SSTM and BTM and
we'll see what happens. I'd be curious to put together a sample of
random-but-solvable positions in the various metrics and doing a
bake-off of our various programs. Of course each has distinct
advantages, but it would be interesting just to compare node count
and node generation rate.

I'm enjoying this thread immensely, by the way; thank you for
starting it all off, unsolved!


----------



## unsolved (May 4, 2014)

rokicki said:


> I'm enjoying this thread immensely, by the way; thank you for
> starting it all off, unsolved!



No problem at all! And thanks everyone for being patient with me, I promise, it has finally paid off. My program, on "normal" hardware, with a new pruning algorithm, can now solve the single dedge flip in 15 minutes flat.






The 6th-ply is a little slow, because it is accumulating some pruning data to be used subsequently. Ply-7 finishes in a blink, and ply-8 motors by. Of course, these are really plies 7 to 13 and 8 to 14 if you have the 6-TFS loaded in RAM.


```
TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------


Solution [001] =  U2 l2 U2 F2 l  F2 l' F2 l2 [inside 6-TFS] ---> U2 r  U2 r' F2 l   @ 0000406465872 nodes with 0006985517899 6-TFS probes   
Solution [002] =  D2 r2 F2 r  F2 r' F2 D2 r2 [inside 6-TFS] ---> D2 r' F2 l  D2 l'  @ 0001824428262 nodes with 0013045561714 6-TFS probes   
Solution [003] =  D2 l2 F2 l' F2 l  F2 D2 l2 [inside 6-TFS] ---> D2 l  F2 r' D2 r   @ 0001844715291 nodes with 0013132289376 6-TFS probes   
Solution [004] =  r  F2 r' F2 l  B2 r2 B2 D2 [inside 6-TFS] ---> l  B2 r' B2 l2 D2  @ 0002432573235 nodes with 0015644898845 6-TFS probes   
Solution [005] =  r  F2 l' U2 l  U2 r2 F2 r' [inside 6-TFS] ---> F2 r  F2 U2 r2 U2  @ 0002433795581 nodes with 0015650127901 6-TFS probes   
Solution [006] =  r  B2 r' U2 r  U2 l2 B2 r' [inside 6-TFS] ---> U2 l  U2 F2 l2 F2  @ 0002506684772 nodes with 0015961661391 6-TFS probes   
Solution [007] =  r  B2 l' B2 l  D2 l2 D2 B2 [inside 6-TFS] ---> r  D2 l' D2 r2 B2  @ 0002508549198 nodes with 0015969630617 6-TFS probes   
Solution [008] =  r' U2 r  U2 l' D2 r2 D2 B2 [inside 6-TFS] ---> l' D2 r  D2 l2 B2  @ 0002522780481 nodes with 0016030397406 6-TFS probes   
Solution [009] =  r' U2 l  F2 l' F2 r2 U2 r  [inside 6-TFS] ---> U2 r' U2 F2 r2 F2  @ 0002524884073 nodes with 0016039380665 6-TFS probes   
Solution [010] =  r' D2 r  F2 r' F2 l2 D2 r  [inside 6-TFS] ---> F2 l' F2 U2 l2 U2  @ 0002596731391 nodes with 0016346481888 6-TFS probes   
Solution [011] =  r' D2 l  D2 l' B2 l2 B2 D2 [inside 6-TFS] ---> r' B2 l  B2 r2 D2  @ 0002597956752 nodes with 0016351719712 6-TFS probes   
Solution [012] =  r2 U2 l  B2 l' B2 U2 l' U2 [inside 6-TFS] ---> r  B2 r' B2 U2 r2  @ 0002747524641 nodes with 0016990985473 6-TFS probes   
Solution [013] =  r2 U2 B2 r  B2 r' U2 l  U2 [inside 6-TFS] ---> B2 l  B2 l' U2 r2  @ 0002751046563 nodes with 0017006008250 6-TFS probes   
Solution [014] =  r2 D2 r' F2 r  F2 D2 r  D2 [inside 6-TFS] ---> l' F2 l  F2 D2 r2  @ 0002825128098 nodes with 0017322600433 6-TFS probes   
Solution [015] =  r2 D2 F2 l' F2 l  D2 r' D2 [inside 6-TFS] ---> F2 r' F2 r  D2 r2  @ 0002827829850 nodes with 0017334167141 6-TFS probes   
Solution [016] =  r2 F2 D2 r' D2 r  F2 l' F2 [inside 6-TFS] ---> D2 l' D2 l  F2 r2  @ 0002881673268 nodes with 0017564313609 6-TFS probes   
Solution [017] =  r2 F2 l' D2 l  D2 F2 l  F2 [inside 6-TFS] ---> r' D2 r  D2 F2 r2  @ 0002884748805 nodes with 0017577468407 6-TFS probes   
Solution [018] =  r2 B2 U2 l  U2 l' B2 r  B2 [inside 6-TFS] ---> U2 r  U2 r' B2 r2  @ 0002960641173 nodes with 0017901912452 6-TFS probes   
Solution [019] =  r2 B2 r  U2 r' U2 B2 r' B2 [inside 6-TFS] ---> l  U2 l' U2 B2 r2  @ 0002962953789 nodes with 0017911794185 6-TFS probes   
Solution [020] =  l  U2 r' F2 r  F2 l2 U2 l' [inside 6-TFS] ---> U2 l  U2 F2 l2 F2  @ 0002979990728 nodes with 0017984693002 6-TFS probes   
Solution [021] =  l  U2 l' U2 r  D2 l2 D2 B2 [inside 6-TFS] ---> r  D2 l' D2 r2 B2  @ 0002981197491 nodes with 0017989861581 6-TFS probes   
Solution [022] =  l  D2 r' D2 r  B2 r2 B2 D2 [inside 6-TFS] ---> l  B2 r' B2 l2 D2  @ 0003052273770 nodes with 0018293833975 6-TFS probes   
Solution [023] =  l  D2 l' F2 l  F2 r2 D2 l' [inside 6-TFS] ---> F2 r  F2 U2 r2 U2  @ 0003053791577 nodes with 0018300315731 6-TFS probes   
Solution [024] =  l' F2 r  U2 r' U2 l2 F2 l  [inside 6-TFS] ---> F2 l' F2 U2 l2 U2  @ 0003273128257 nodes with 0019237753588 6-TFS probes   
Solution [025] =  l' F2 l  F2 r' B2 l2 B2 D2 [inside 6-TFS] ---> r' B2 l  B2 r2 D2  @ 0003274758399 nodes with 0019244714236 6-TFS probes   
Solution [026] =  l' B2 r  B2 r' D2 r2 D2 B2 [inside 6-TFS] ---> l' D2 r  D2 l2 B2  @ 0003347037486 nodes with 0019553798611 6-TFS probes   
Solution [027] =  l' B2 l  U2 l' U2 r2 B2 l  [inside 6-TFS] ---> U2 r' U2 F2 r2 F2  @ 0003348060802 nodes with 0019558169258 6-TFS probes   
Solution [028] =  l2 U2 r' B2 r  B2 U2 r  U2 [inside 6-TFS] ---> l' B2 l  B2 U2 l2  @ 0003364198932 nodes with 0019627163938 6-TFS probes   
Solution [029] =  l2 U2 B2 l' B2 l  U2 r' U2 [inside 6-TFS] ---> B2 r' B2 r  U2 l2  @ 0003369490926 nodes with 0019649801644 6-TFS probes   
Solution [030] =  l2 D2 l  F2 l' F2 D2 l' D2 [inside 6-TFS] ---> r  F2 r' F2 D2 l2  @ 0003443109375 nodes with 0019964366824 6-TFS probes   
Solution [031] =  l2 D2 F2 r  F2 r' D2 l  D2 [inside 6-TFS] ---> F2 l  F2 l' D2 l2  @ 0003444731127 nodes with 0019971291358 6-TFS probes   
Solution [032] =  l2 F2 D2 l  D2 l' F2 r  F2 [inside 6-TFS] ---> D2 r  D2 r' F2 l2  @ 0003473351547 nodes with 0020093607115 6-TFS probes   
Solution [033] =  l2 F2 r  D2 r' D2 F2 r' F2 [inside 6-TFS] ---> l  D2 l' D2 F2 l2  @ 0003473844888 nodes with 0020095711385 6-TFS probes   
Solution [034] =  l2 B2 U2 r' U2 r  B2 l' B2 [inside 6-TFS] ---> U2 l' U2 l  B2 l2  @ 0003550753275 nodes with 0020424406989 6-TFS probes   
Solution [035] =  l2 B2 l' U2 l  U2 B2 l  B2 [inside 6-TFS] ---> r' U2 r  U2 B2 l2  @ 0003554860137 nodes with 0020441962628 6-TFS probes   
Solution [036] =  F2 r2 F2 U2 r  U2 r' U2 r2 [inside 6-TFS] ---> F2 l  F2 l' U2 r   @ 0004208077860 nodes with 0023234154839 6-TFS probes   
Solution [037] =  F2 l2 F2 U2 l' U2 l  U2 l2 [inside 6-TFS] ---> F2 r' F2 r  U2 l'  @ 0004233105906 nodes with 0023341109196 6-TFS probes   
Solution [038] =  B2 r2 U2 r' U2 r  U2 B2 r2 [inside 6-TFS] ---> B2 r  U2 l' B2 l   @ 0005675301648 nodes with 0029506158594 6-TFS probes   
Solution [039] =  B2 l2 U2 l  U2 l' U2 B2 l2 [inside 6-TFS] ---> B2 l' U2 r  B2 r'  @ 0005696510847 nodes with 0029596830064 6-TFS probes
```


----------



## unsolved (May 4, 2014)

cmowla said:


> I can't believe I didn't notice this, but, Tom, actually have a (15q, 9 btm) algorithm(s) here!
> Rw2 U2 r' E2 r E2 r' U2 Rw2
> 
> So it turns out to be equal in btm length to (r U2)4 r, and it only affects two dedges instead of four! (Is this the new and improved quick parity fix?). I believe Kirjava asked me to find an algorithm like this in the past. I hope he's seeing this!
> ...





cmowla said:


> I can't believe I didn't notice this, but, Tom, actually have a (15q, 9 btm) algorithm(s) here!
> Rw2 U2 r' E2 r E2 r' U2 Rw2
> 
> So it turns out to be equal in btm length to (r U2)4 r, and it only affects two dedges instead of four! (Is this the new and improved quick parity fix?). I believe Kirjava asked me to find an algorithm like this in the past. I hope he's seeing this!
> ...



Solved this one in about 5 seconds.


```
Solutions To Scramble = R2 r2 U2 r' u2 d2 r u2 d2 r' U2 R2 r2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|OOOO|&&&&|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|&&&&|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|####|####|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r2 U2 r  u2 d2 [inside 6-TFS] ---> r' d2 u2 r  U2 r2  @ 0000011178567 nodes with 0000051385399 6-TFS probes   
Solution [002] =  r2 D2 l  U2 D2 [inside 6-TFS] ---> r' D2 U2 l  D2 r2  @ 0000011373123 nodes with 0000052213073 6-TFS probes   
Solution [003] =  r2 D2 l  u2 d2 [inside 6-TFS] ---> l' d2 u2 l  D2 r2  @ 0000011373210 nodes with 0000052213548 6-TFS probes   
Solution [004] =  l2 U2 l  U2 D2 [inside 6-TFS] ---> r' D2 U2 l  U2 l2  @ 0000013039131 nodes with 0000059331529 6-TFS probes   
Solution [005] =  l2 U2 l  u2 d2 [inside 6-TFS] ---> l' d2 u2 l  U2 l2  @ 0000013039218 nodes with 0000059331911 6-TFS probes   
Solution [006] =  l2 D2 r  U2 D2 [inside 6-TFS] ---> l' D2 U2 r  D2 l2  @ 0000013228752 nodes with 0000060138361 6-TFS probes   
Solution [007] =  l2 D2 r  u2 d2 [inside 6-TFS] ---> r' d2 u2 r  D2 l2  @ 0000013228839 nodes with 0000060138726 6-TFS probes
```


----------



## cuBerBruce (May 5, 2014)

rokicki said:


> I will be modifying my optimal solver to support SSTM and BTM and
> we'll see what happens. I'd be curious to put together a sample of
> random-but-solvable positions in the various metrics and doing a
> bake-off of our various programs. Of course each has distinct
> ...



I might suggest also doing apples-to-apples comparisons of the same program on different hardware. Unsolved's program on my computer appeared to be much slower than on his, but it wasn't running the same position and using the same TFS database. But still, it makes me wonder if my computer was emulating instructions that his was performing in hardware or something like that. I also know that it was running on a single thread on my computer, and if programs make use of parallel execution, I would like to have some way of controlling how many threads will be used. My program is not currently multithreaded, so I think side-by-side comparisons should also take number of threads into consideration. Assuming there is a big difference in execution speed, I am curious what is causing the difference in speed to be so big.

I also note that my program runs on 32-bit Windows, while unsolved's executable is a 64-bit executable and won't run on a 32-bit machine. I might try making 64-bit executables just to see if that has any effect on the performance on 64-bit machines. But I would also be using a different compiler to do that.

I've also been thinking of using a fixed DLB model like Tom is doing. It seemed convenient at first to simply apply the actual moves so that no tricky translation of the moves are needed. Right now my program (working with a copy of the cube's state) has to find the DLB cubie, and then apply cube rotations that put that cubie into its solved location and orientation. But I also use a couple of other corners as reference when doing pruning table lookups, and these would seem not to benefit at all in using a fixed DLB model. Maybe I should be tracking the necessary state info separately for each combination of pruning table and reference piece?


----------



## unsolved (May 5, 2014)

cuBerBruce said:


> I might suggest also doing apples-to-apples comparisons of the same program on different hardware. Unsolved's program on my computer appeared to be much slower than on his, but it wasn't running the same position and using the same TFS database. But still, it makes me wonder if my computer was emulating instructions that his was performing in hardware or something like that. I also know that it was running on a single thread on my computer, and if programs make use of parallel execution, I would like to have some way of controlling how many threads will be used. My program is not currently multithreaded, so I think side-by-side comparisons should also take number of threads into consideration. Assuming there is a big difference in execution speed, I am curious what is causing the difference in speed to be so big.
> 
> I also note that my program runs on 32-bit Windows, while unsolved's executable is a 64-bit executable and won't run on a 32-bit machine. I might try making 64-bit executables just to see if that has any effect on the performance on 64-bit machines. But I would also be using a different compiler to do that.
> 
> I've also been thinking of using a fixed DLB model like Tom is doing. It seemed convenient at first to simply apply the actual moves so that no tricky translation of the moves are needed. Right now my program (working with a copy of the cube's state) has to find the DLB cubie, and then apply cube rotations that put that cubie into its solved location and orientation. But I also use a couple of other corners as reference when doing pruning table lookups, and these would seem not to benefit at all in using a fixed DLB model. Maybe I should be tracking the necessary state info separately for each combination of pruning table and reference piece?



You have to understand, at the office, I have access to systems running at speeds up to 5.40 GHz and at temperatures of -42 degrees Fahrenheit.






So they will be finding solves pretty fast, even with an inefficient array-based move generator.

I had to finally give up on my massively parallel version. Warning, this next screen shot shows me being mad and placing a few curses in my debugging...



Spoiler











I am not sure why the code would peg my 32-threaded hardware and then produce all kinds of errors when doing corner pruning.

The single-threaded, multi-core aware code seems most stable, and I will be making it available soon.


----------



## Carrot (May 5, 2014)

unsolved said:


> You have to understand, at the office, I have access to systems running at speeds up to 5.40 GHz and at temperatures of -42 degrees Fahrenheit.
> 
> 
> 
> ...



Looks more like cooking equipments than a computer.


----------



## qqwref (May 5, 2014)

unsolved said:


> You have to understand, at the office, I have access to systems running at speeds up to 5.40 GHz and at temperatures of -42 degrees Fahrenheit.


That's pretty awesome - maybe you're just gonna have to run the other solver yourself and see how the timings compare


----------



## unsolved (May 5, 2014)

qqwref said:


> That's pretty awesome - maybe you're just gonna have to run the other solver yourself and see how the timings compare



And to answer Bruce's other question about why I have a 64-bit only version of the program:


```
CUBE_4x4_BITBOARD_ARRANGEMENT double_front_face_bitboard_move(CUBE_4x4_BITBOARD_ARRANGEMENT original)
{
CUBE_4x4_BITBOARD_ARRANGEMENT new = original;

new.cube_face[BITBOARD_TOP_INDEX]    = (original.cube_face[BITBOARD_TOP_INDEX] & BITMASK_CUBE_FACE_NOT_ROW_04) | BIT_TRANSFORM_ROW_1_TO_ROW_4(original.cube_face[BITBOARD_BOTTOM_INDEX] & BITMASK_CUBE_FACE_ROW_01);
new.cube_face[BITBOARD_BOTTOM_INDEX] = (original.cube_face[BITBOARD_BOTTOM_INDEX] & BITMASK_CUBE_FACE_NOT_ROW_01) | BIT_TRANSFORM_ROW_4_TO_ROW_1(original.cube_face[BITBOARD_TOP_INDEX] & BITMASK_CUBE_FACE_ROW_04);
new.cube_face[BITBOARD_LEFT_INDEX]   = (original.cube_face[BITBOARD_LEFT_INDEX]   & BITMASK_CUBE_FACE_NOT_COL_04) | BIT_TRANSFORM_COL_1_TO_COL_4(original.cube_face[BITBOARD_RIGHT_INDEX] & BITMASK_CUBE_FACE_COL_01);
new.cube_face[BITBOARD_RIGHT_INDEX]  = (original.cube_face[BITBOARD_RIGHT_INDEX]  & BITMASK_CUBE_FACE_NOT_COL_01) | BIT_TRANSFORM_COL_4_TO_COL_1(original.cube_face[BITBOARD_LEFT_INDEX] & BITMASK_CUBE_FACE_COL_04);

		/*********************************************************************************/
		/*                                 Rotate the TOP                                */
		/*********************************************************************************/
		/*                                                                               */
		/* THESE CUBE LOCATIONS BECOME....              THESE CUBE LOCATIONS             */
		/*                                                                               */
		/*                                                                               */
		/*********************************/             /*********************************/
		/*  01   *  02   *  03   *   04  */             /*  16   *  15   *  14   *   13  */
		/*********************************/             /*********************************/
		/*  05   *  06   *  07   *   08  */             /*  12   *  11   *  10   *   09  */
		/*********************************/             /*********************************/
		/*  09   *  10   *  11   *   12  */             /*  08   *  07   *  06   *   05  */
		/*********************************/             /*********************************/
		/*  13   *  14   *  15   *   16  */             /*  04   *  03   *  02   *   01  */
		/*********************************/             /*********************************/
		/*                                                                               */
		/*                                                                               */
		/*********************************************************************************/

new.cube_face[BITBOARD_TOP_INDEX] = ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_16) << 60) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_15) << 52) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_14) << 44) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_13) << 36) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_12) << 28) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_11) << 20) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_10) << 12) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_09) << 4)  |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_08) >> 4)  |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_07) >> 12) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_06) >> 20) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_05) >> 28) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_04) >> 36) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_03) >> 44) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_02) >> 52) |\
			                                ((original.cube_face[BITBOARD_FRONT_INDEX] & BITMASK_CUBE_FACE_SQUARE_01) >> 60);

		return new;
}
```

Technically, I can make any move on the cube using only 5 instruction with 64-bits. You can see the ">>" and "<<" operators are shifting bits as far as 60 slots at a time. You can't do that on a 32-bit computer.


----------



## irontwig (May 5, 2014)

Pretty cool with all those 15 move dedge flips, but as for the display wouldn't having two characters instead of four between make the squares look more, well square? And also just so you know the de facto standard is having green on front and white on top.


----------



## Kirjava (May 5, 2014)

cmowla said:


> I believe Kirjava asked me to find an algorithm like this in the past. I hope he's seeing this!



Watching thread with great interest. Looking forward to seeing what else turns up.


----------



## unsolved (May 5, 2014)

irontwig said:


> Pretty cool with all those 15 move dedge flips, but as for the display wouldn't having two characters instead of four between make the squares look more, well square? And also just so you know the de facto standard is having green on front and white on top.



All reasonable suggestions made by the posters here will be taken into consideration and possibly implemented. The reason I have it so wide is that on my 72 inch monitor, with "just square" squares, they look pinched and too skinny 

As for the cube colors, they mirror my own 4x4x4 MF8-whatever-that-other-name-was before the stickers started peeling. In fact, one of my prime motivations for writing the program was to be able to finish solves I messed up when applying the algos from here!






That is what my current cube looks like. Somehow, some way, My URb edge is at ULf, UFr is at UBl, ULf is at UFr, and UBl is at URb.

I can't find an algo for this, and it looks like 15 turns is not enough to solve this? Unless my pruning is over-doing it, as Bruce alluded to in an earlier warning, but I thought I took all necessary precautions before implementing it.

*UPDATE: Looks like it found it in 16 moves. Can anyone confirm there is no faster solve?*


----------



## unsolved (May 5, 2014)

*OO_4x4x4 Version 1.2.8 is available*



irontwig said:


> Pretty cool with all those 15 move dedge flips, but as for the display wouldn't having two characters instead of four between make the squares look more, well square? And also just so you know the de facto standard is having green on front and white on top.



*Omnia Obtorquebantur Version 1.2.8 With Leaf Node + Massive Tree Branch Pruning Without Parallel Search*

http://lightningcloudcomputing.com/OO_4x4x4.zip







I placed the new version online. There is a known bug where it will miss an optimal line since it over-pruned one critical position too early. Other than that, it is very fast *AFTER DEPTH 6* (explained below).

Features:


New Pruning Data Collector + Branch Pruning Algorithm
Bi-Directional Searching from the scramble to the TFS databases, and the databases back towards the current position being solved
Leaf Nodes are pruned to prevent duplicate positions, and Branches are pruned (entire lines of play, reducing the tree tremendously) based on a new experimental algorithm
New graphics, as requested, shows Top over Front, and Left-Front-Right-Back, then Bottom under Front

This new version, while still with an embedded bug, will prove very valuable should enough of the cubing population test it and submit the solves it does find. After examining enough of them, I will be able to track it down and make the algorithm water-tight. Some of you will notice that during the pass of either depth-5 or depth-6, the search seems to slow down. It is because it is performing a massive RAM-based sort of data that it is collecting as it gathers Branch Pruning Data. What it is doing is a little lengthy to explain, but the short version is the program is trying to determine what *branches* of play, not what *moves*, are getting nowhere fast. If subsequent branches (varying moves in length) show up in later searches, a quick poll against the TFS databases will give a pass/fail regarding taking that branch to the next level of search. It's pretty complicated, but once I get this nailed down, OO_4x4x4 will be able to search with blinding speed.

Depth 7- 8- and 9- will fly by at much faster than expected speeds. Don't forget, if you are probing the 5-TFS database, you are really searching up to ply 14 .

The single dedge flip, by luck or just plain matching all the specs of the algorithm, is able to be solved in just under 15 minutes on a "normal" 3.1 GHz Westmere. Some of you will have even faster systems, so please test it out.

Features Still To Come:

1. Fix that bug!
2. Fixed-Core Multiprocessing for 2-, 4-, 8-, 10-, 12-, and 16-core implementations.
3. Massively Parallel Bitboard version for those with >= 20 cores
4. Solving the 7-TFS database on my 192 GB machine at work 

As always, any feedback is appreciated.


----------



## 10461394944000 (May 5, 2014)

unsolved said:


> http://lightningcloudcomputing.com/depth_16.jpg



that just seems to scramble the cube

edit: jus downloaded it and found a 14 move bldparity

U2 r2 U2 B2 r' U2 B2 r2 B2 r' U2 r2 B2 r'

any chance of qtm mode?


----------



## cuBerBruce (May 5, 2014)

unsolved said:


> Bi-Directional Searching from the scramble to the TFS databases, and the databases back towards the current position being solved



This sounds scary. The solved state contains matching color centers on each face while the scrambled position in general does not. So you can't use the same database in both directions, unless perhaps if you are using a supercube model and then properly accounting for which pieces are indistinguishable in each direction of the search.

EDIT: I would like you to keep a link to a known good version of the program in the initial post of thread. Your experimental versions with bugs aren't of that much interest to me.

EDIT 2:


unsolved said:


> This new version, while still with an embedded bug, will prove very valuable should enough of the cubing population test it and submit the solves it does find. After examining enough of them, I will be able to track it down and make the algorithm water-tight. Some of you will notice that during the pass of either depth-5 or depth-6, the search seems to slow down. It is because it is performing a massive RAM-based sort of data that it is collecting as it gathers Branch Pruning Data. What it is doing is a little lengthy to explain, but the short version is the program is trying to determine what *branches* of play, not what *moves*, are getting nowhere fast. If subsequent branches (varying moves in length) show up in later searches, a quick poll against the TFS databases will give a pass/fail regarding taking that branch to the next level of search. It's pretty complicated, but once I get this nailed down, OO_4x4x4 will be able to search with blinding speed.



It almost sounds here that you are *guessing* whether or not you can prune a given branch. In a proper optimal solver, you *never* prune a branch *based upon a guess* that it is safe to do so. You always make certain it is safe to do so.


----------



## unsolved (May 5, 2014)

10461394944000 said:


> that just seems to scramble the cube
> 
> edit: jus downloaded it and found a 14 move bldparity
> 
> ...



That is an interesting algo! What was the scramble you used to get there? How long did it take to reach 14 moves?



cuBerBruce said:


> This sounds scary. The solved state contains matching color centers on each face while the scrambled position in general does not. So you can't use the same database in both directions, unless perhaps if you are using a supercube model and then properly accounting for which pieces are indistinguishable in each direction of the search.
> 
> EDIT: I would like you to keep a link to a known good version of the program in the initial post of thread. Your experimental versions with bugs aren't of that much interest to me.



I have a 96-color move generator, so I am safe. I have tested this very thoroughly. I just spawn 6 threads, one for each face, and look for independent face-matching. I relinquish thread control to the main core so that the additional cores do not overburden the computer. It is a tame version of what can be done with a system with 24 CPU cores/threads, one for each possible rotation state, but that is in a #define statement I can change and bring on full force when on the proper hardware.

I just can't halt progress and only release squeaky-clean versions, not when there is little-to-no adverse effects and* much to gain* with a significant amount of input from the cubers. If this branch-pruning algorithm turns out to be water-tight, it will allow for huge strides to be taken. Depth-6 and Depth-7 both examine fewer nodes than at Depth-5, and Depth-8 is not much larger than Depth-5. 

I would prefer that others download this version and run a few scrambles up and report back which ones don't find optimal solves, and which ones do. Without a fair amount of documenting the ones that work and fail, I'll never track it down on my own.


----------



## 10461394944000 (May 5, 2014)

unsolved said:


> That is an interesting algo! What was the scramble you used to get there? How long did it take to reach 14 moves?



used 5tfs, I think it was about 10 minutes. r U2 F2 r2 F2 r U2 r2 F2 r' F2 U2 r2 U2 is a better alg for speed though


----------



## Christopher Mowla (May 5, 2014)

Kirjava said:


> Watching thread with great interest. Looking forward to seeing what else turns up.


Me too!

By the way, you probably already did this (or someone did), but if we conjugate that alg differently, we have a (13,9) (but it affects the entire r slice, and of course it only works on the 4x4x4).
f2 E r E2 r' E2 r E' f2


----------



## Kirjava (May 6, 2014)

This is the worst case I have at the moment;






Did you already find something better that I missed?


----------



## unsolved (May 6, 2014)

cuBerBruce said:


> It almost sounds here that you are *guessing* whether or not you can prune a given branch. In a proper optimal solver, you *never* prune a branch *based upon a guess* that it is safe to do so. You always make certain it is safe to do so.



To me it is an obvious, well-behaved algorithm with one or maybe two small and very unlikely scenarios that are cropping up that spoil it. I am trying to generate a fail condition with random moves, and the thing runs all day and behaves without flaw. There is some fluke, such as the move generator creating a position it already created, or something like that, which is causing the over-pruning condition. Once it is located, it will be overly-obvious what was missed, but until then, it is a stumper.

Kind of like how I used to bet people I could finish 3 full mugs of beer before they could finish a shot of whatever they wanted to have. I'd bet them $50 and win it every time. Once I say how I do it, it is obvious. Until then, you are most likely perplexed and would probably accept the wager. I never lost it in over 100 demonstrations.


----------



## Carrot (May 6, 2014)

Kirjava said:


> This is the worst case I have at the moment;
> 
> 
> 
> ...



l2 U2 l' B2 l' B2 U2 D2 l F2 l' F2 D2 l

This one is only 14 moves  But it seems very bad...


----------



## qqwref (May 6, 2014)

I worry about the double-direction pruning, but the new view looks pretty good. Much easier to see what the case would look like on a real cube.

Here's the problem - you may have two algs which look like they do the same thing on the 4x4x4, but their inverses do NOT do the same thing. An example: (a) U r U l' U' r' U l U2 and (b) F l F r' F' l' F r F2. This happens because of indistinguishable centers. Now, as long as you test positions that do not change centers, you can go in both directions... BUT when you try positions with centers out of place you may find that your algs do not quite work. If you want to make sure your new approach is valid, I suggest testing it on some of the positions you had earlier with 4 or 6 centers wrong, or on a position you get from doing 12ish random moves on a solved cube.


----------



## Christopher Mowla (May 6, 2014)

Kirjava said:


> Did you already find something better that I missed?


I guess not, if you've checked the wiki. This is best alg I put there:
r U2 r U2 M' U2 r U2 r' U2 M r' Uw2 r2 u2

(Which is just a combo of the <l,r,U> opp wing edge + Chris Hardwick's PLL parity).


----------



## unsolved (May 6, 2014)

Carrot said:


> l2 U2 l' B2 l' B2 U2 D2 l F2 l' F2 D2 l
> 
> This one is only 14 moves  But it seems very bad...



Bad for... speed solving? Or is the move sequence bad? Was this generated by my solver?



qqwref said:


> I worry about the double-direction pruning



It is a *bi-directional search*, but the *pruning is only directed towards the solve*.

Here's what the program is doing.

1. You enter a scramble. There is a single move generator that makes moves on the scrambled cube.

2. At terminal depths, it stops to check for a solved state. If it is solved, done. If not solved:

3. Probe the 6-TFS database. Is a 6-turn through 1-turn solution found? Yes, done, no, continue.

4. Add the move sequences in move group chunks and axis rotator chunks to the pruning information collector.

5. Start 6 threads, one for each face. Go to the largest TFS database in RAM. Visit each position in the TFS.
Each thread applys a different set of moves to the TFS. Does the move land in the 1- through "MAX - 1" TFS?
Then that move makes NO PROGRESS toward the scramble solver, skip it, and try another one. Otherwise...

6. Compare the position against positions being processed by the forward solver. Did the two ends meet? Reverse
the retro-solver moves, create a PV from the forward solver, the reverse retro solver, and the TFS databases.
That whole line is the solution, done. Otherwise...

7. Are we (MAX_TFS_DATABASE + 1) moves or more from the root? (At least 5, 6, or 7, depending on your RAM and elections at startup). 
No, go to step 9.

8. Consult the pruning collector. Apply the "chunking algorithm" and determine if the BRANCH, not the MOVE,
is getting closer to moves coming off of the retro solver. Branches can be in the early move generation stage,
the middle, or the end. There are no hard-coded boundaries. If there is a solution that will happen in
N turns, then consult the pruning data collector for moves 1 to (N/2) + 1. An algorithm determines if there
is either a "progress", "scramble", or "not much progress" happening. Only the "progress" branches are
allowed to continue. *Occasionally the algorithm makes a "no decision."* <--- this is new code, attempting to fix over-aggressive pruning.

9. Generate more forward moves and reverse moves, then go to step 2. When back at step 5, there is no need to start more threads,
just use the existing ones to process more moves.

*UPDATE: I am getting better results now after I changed 2 lines of code!*






I am hoping the solutions below are all correct and there are no faster ones available. Anyone care to "spot check" a few?


```
Solution [001] =  R  F  u2 R2 u2 r2 [inside 5-TFS] ---> R2 u2 r2 F' R'  @ 0000226702773 nodes with 0001051015719 5-TFS probes          
Solution [002] =  R  F  u2 R2 u2 l2 [inside 5-TFS] ---> R2 u2 l2 F' R'  @ 0000226702776 nodes with 0001051015723 5-TFS probes          
Solution [003] =  R  F  u2 F2 R2 u2 [inside 5-TFS] ---> R2 F2 u2 F' R'  @ 0000226712628 nodes with 0001051058090 5-TFS probes          
Solution [004] =  R  F  u2 F2 L2 d2 [inside 5-TFS] ---> L2 F2 u2 F' R'  @ 0000226712883 nodes with 0001051059194 5-TFS probes          
Solution [005] =  R  F  u2 B2 R2 u2 [inside 5-TFS] ---> R2 B2 u2 F' R'  @ 0000226719702 nodes with 0001051087397 5-TFS probes          
Solution [006] =  R  F  u2 B2 L2 d2 [inside 5-TFS] ---> L2 B2 u2 F' R'  @ 0000226719957 nodes with 0001051088528 5-TFS probes          
Solution [007] =  R  F  d2 R2 d2 R2 [inside 5-TFS] ---> r2 d2 r2 F' R'  @ 0000226766679 nodes with 0001051284391 5-TFS probes          
Solution [008] =  R  F  d2 R2 d2 r2 [inside 5-TFS] ---> R2 d2 r2 F' R'  @ 0000226766682 nodes with 0001051284407 5-TFS probes          
Solution [009] =  R  F  d2 R2 d2 l2 [inside 5-TFS] ---> R2 d2 l2 F' R'  @ 0000226766685 nodes with 0001051284415 5-TFS probes          
Solution [010] =  R  F  d2 F2 R2 d2 [inside 5-TFS] ---> R2 F2 d2 F' R'  @ 0000226776459 nodes with 0001051324598 5-TFS probes          
Solution [011] =  R  F  d2 F2 L2 u2 [inside 5-TFS] ---> L2 F2 d2 F' R'  @ 0000226776708 nodes with 0001051325689 5-TFS probes          
Solution [012] =  R  F  d2 B2 R2 d2 [inside 5-TFS] ---> R2 B2 d2 F' R'  @ 0000226783533 nodes with 0001051354683 5-TFS probes          
Solution [013] =  R  F  d2 B2 L2 u2 [inside 5-TFS] ---> L2 B2 d2 F' R'  @ 0000226783782 nodes with 0001051355840 5-TFS probes          
Solution [014] =  R  F  r2 u2 R2 u2 [inside 5-TFS] ---> R2 u2 r2 F' R'  @ 0000226971324 nodes with 0001052143552 5-TFS probes          
Solution [015] =  R  F  r2 u2 R2 r2 [inside 5-TFS] ---> u2 R2 u2 F' R'  @ 0000226971333 nodes with 0001052143602 5-TFS probes          
Solution [016] =  R  F  r2 u2 L2 d2 [inside 5-TFS] ---> L2 u2 r2 F' R'  @ 0000226971579 nodes with 0001052144772 5-TFS probes          
Solution [017] =  R  F  r2 d2 R2 d2 [inside 5-TFS] ---> R2 d2 r2 F' R'  @ 0000226973595 nodes with 0001052153139 5-TFS probes          
Solution [018] =  R  F  r2 d2 R2 r2 [inside 5-TFS] ---> d2 R2 d2 F' R'  @ 0000226973601 nodes with 0001052153155 5-TFS probes          
Solution [019] =  R  F  r2 d2 L2 u2 [inside 5-TFS] ---> L2 d2 r2 F' R'  @ 0000226973844 nodes with 0001052154079 5-TFS probes          
Solution [020] =  R  F  l2 u2 R2 u2 [inside 5-TFS] ---> R2 u2 l2 F' R'  @ 0000227037420 nodes with 0001052422228 5-TFS probes          
Solution [021] =  R  F  l2 u2 R2 l2 [inside 5-TFS] ---> u2 R2 u2 F' R'  @ 0000227037432 nodes with 0001052422236 5-TFS probes          
Solution [022] =  R  F  l2 u2 L2 d2 [inside 5-TFS] ---> L2 u2 l2 F' R'  @ 0000227037675 nodes with 0001052423173 5-TFS probes          
Solution [023] =  R  F  l2 d2 R2 d2 [inside 5-TFS] ---> R2 d2 l2 F' R'  @ 0000227039691 nodes with 0001052431559 5-TFS probes          
Solution [024] =  R  F  l2 d2 R2 l2 [inside 5-TFS] ---> d2 R2 d2 F' R'  @ 0000227039700 nodes with 0001052431565 5-TFS probes          
Solution [025] =  R  F  l2 d2 L2 u2 [inside 5-TFS] ---> L2 d2 l2 F' R'  @ 0000227039940 nodes with 0001052432554 5-TFS probes          
Solution [026] =  R  B  u2 r2 U2 u2 [inside 5-TFS] ---> r2 U2 r2 B' R'  @ 0000232681128 nodes with 0001076114491 5-TFS probes          
Solution [027] =  R  B  u2 r2 U2 r2 [inside 5-TFS] ---> U2 r2 u2 B' R'  @ 0000232681140 nodes with 0001076114525 5-TFS probes          
Solution [028] =  R  B  u2 r2 D2 l2 [inside 5-TFS] ---> D2 r2 u2 B' R'  @ 0000232681386 nodes with 0001076115666 5-TFS probes          
Solution [029] =  R  B  u2 l2 U2 u2 [inside 5-TFS] ---> l2 U2 l2 B' R'  @ 0000232683477 nodes with 0001076124404 5-TFS probes          
Solution [030] =  R  B  u2 l2 U2 l2 [inside 5-TFS] ---> U2 l2 u2 B' R'  @ 0000232683492 nodes with 0001076124470 5-TFS probes          
Solution [031] =  R  B  u2 l2 D2 r2 [inside 5-TFS] ---> D2 l2 u2 B' R'  @ 0000232683732 nodes with 0001076125519 5-TFS probes          
Solution [032] =  R  B  d2 r2 U2 d2 [inside 5-TFS] ---> r2 U2 r2 B' R'  @ 0000232744959 nodes with 0001076384035 5-TFS probes          
Solution [033] =  R  B  d2 r2 U2 r2 [inside 5-TFS] ---> U2 r2 d2 B' R'  @ 0000232744968 nodes with 0001076384044 5-TFS probes          
Solution [034] =  R  B  d2 r2 D2 l2 [inside 5-TFS] ---> D2 r2 d2 B' R'  @ 0000232745214 nodes with 0001076385088 5-TFS probes          
Solution [035] =  R  B  d2 l2 U2 d2 [inside 5-TFS] ---> l2 U2 l2 B' R'  @ 0000232747308 nodes with 0001076393420 5-TFS probes          
Solution [036] =  R  B  d2 l2 U2 l2 [inside 5-TFS] ---> U2 l2 d2 B' R'  @ 0000232747320 nodes with 0001076393457 5-TFS probes          
Solution [037] =  R  B  d2 l2 D2 r2 [inside 5-TFS] ---> D2 l2 d2 B' R'  @ 0000232747560 nodes with 0001076394289 5-TFS probes          
Solution [038] =  R  B  r2 U2 r2 U2 [inside 5-TFS] ---> u2 r2 u2 B' R'  @ 0000232944759 nodes with 0001077224817 5-TFS probes          
Solution [039] =  R  B  r2 U2 r2 u2 [inside 5-TFS] ---> U2 r2 u2 B' R'  @ 0000232944762 nodes with 0001077224819 5-TFS probes          
Solution [040] =  R  B  r2 U2 r2 d2 [inside 5-TFS] ---> U2 r2 d2 B' R'  @ 0000232944765 nodes with 0001077224826 5-TFS probes          
Solution [041] =  R  B  r2 F2 U2 r2 [inside 5-TFS] ---> U2 F2 r2 B' R'  @ 0000232958367 nodes with 0001077283616 5-TFS probes          
Solution [042] =  R  B  r2 F2 D2 l2 [inside 5-TFS] ---> D2 F2 r2 B' R'  @ 0000232958613 nodes with 0001077284560 5-TFS probes          
Solution [043] =  R  B  r2 B2 U2 r2 [inside 5-TFS] ---> U2 B2 r2 B' R'  @ 0000232965441 nodes with 0001077313080 5-TFS probes          
Solution [044] =  R  B  r2 B2 D2 l2 [inside 5-TFS] ---> D2 B2 r2 B' R'  @ 0000232965687 nodes with 0001077314071 5-TFS probes          
Solution [045] =  R  B  l2 U2 l2 U2 [inside 5-TFS] ---> u2 l2 u2 B' R'  @ 0000233010939 nodes with 0001077502656 5-TFS probes          
Solution [046] =  R  B  l2 U2 l2 u2 [inside 5-TFS] ---> U2 l2 u2 B' R'  @ 0000233010942 nodes with 0001077502660 5-TFS probes          
Solution [047] =  R  B  l2 U2 l2 d2 [inside 5-TFS] ---> U2 l2 d2 B' R'  @ 0000233010945 nodes with 0001077502673 5-TFS probes          
Solution [048] =  R  B  l2 F2 U2 l2 [inside 5-TFS] ---> U2 F2 l2 B' R'  @ 0000233022198 nodes with 0001077549893 5-TFS probes          
Solution [049] =  R  B  l2 F2 D2 r2 [inside 5-TFS] ---> D2 F2 l2 B' R'  @ 0000233022438 nodes with 0001077550884 5-TFS probes          
Solution [050] =  R  B  l2 B2 U2 l2 [inside 5-TFS] ---> U2 B2 l2 B' R'  @ 0000233029272 nodes with 0001077579541 5-TFS probes          
Solution [051] =  R  B  l2 B2 D2 r2 [inside 5-TFS] ---> D2 B2 l2 B' R'  @ 0000233029512 nodes with 0001077580568 5-TFS probes          
Solution [052] =  F' R' u2 R2 F2 u2 [inside 5-TFS] ---> F2 R2 u2 R  F   @ 0000456220647 nodes with 0002014315744 5-TFS probes          
Solution [053] =  F' R' u2 R2 B2 d2 [inside 5-TFS] ---> B2 R2 u2 R  F   @ 0000456220902 nodes with 0002014316786 5-TFS probes          
Solution [054] =  F' R' u2 L2 F2 u2 [inside 5-TFS] ---> F2 L2 u2 R  F   @ 0000456227478 nodes with 0002014344879 5-TFS probes          
Solution [055] =  F' R' u2 L2 B2 d2 [inside 5-TFS] ---> B2 L2 u2 R  F   @ 0000456227733 nodes with 0002014345813 5-TFS probes          
Solution [056] =  F' R' u2 F2 u2 F2 [inside 5-TFS] ---> f2 u2 f2 R  F   @ 0000456229782 nodes with 0002014354359 5-TFS probes          
Solution [057] =  F' R' u2 F2 u2 f2 [inside 5-TFS] ---> F2 u2 f2 R  F   @ 0000456229785 nodes with 0002014354363 5-TFS probes          
Solution [058] =  F' R' u2 F2 u2 b2 [inside 5-TFS] ---> F2 u2 b2 R  F   @ 0000456229788 nodes with 0002014354372 5-TFS probes          
Solution [059] =  F' R' d2 R2 F2 d2 [inside 5-TFS] ---> F2 R2 d2 R  F   @ 0000456284478 nodes with 0002014580316 5-TFS probes          
Solution [060] =  F' R' d2 R2 B2 u2 [inside 5-TFS] ---> B2 R2 d2 R  F   @ 0000456284727 nodes with 0002014581313 5-TFS probes          
Solution [061] =  F' R' d2 L2 F2 d2 [inside 5-TFS] ---> F2 L2 d2 R  F   @ 0000456291309 nodes with 0002014609311 5-TFS probes          
Solution [062] =  F' R' d2 L2 B2 u2 [inside 5-TFS] ---> B2 L2 d2 R  F   @ 0000456291558 nodes with 0002014610497 5-TFS probes          
Solution [063] =  F' R' d2 F2 d2 F2 [inside 5-TFS] ---> f2 d2 f2 R  F   @ 0000456293691 nodes with 0002014619726 5-TFS probes          
Solution [064] =  F' R' d2 F2 d2 f2 [inside 5-TFS] ---> F2 d2 f2 R  F   @ 0000456293694 nodes with 0002014619747 5-TFS probes          
Solution [065] =  F' R' d2 F2 d2 b2 [inside 5-TFS] ---> F2 d2 b2 R  F   @ 0000456293697 nodes with 0002014619771 5-TFS probes          
Solution [066] =  F' R' f2 u2 F2 u2 [inside 5-TFS] ---> F2 u2 f2 R  F   @ 0000456680538 nodes with 0002016240014 5-TFS probes          
Solution [067] =  F' R' f2 u2 F2 f2 [inside 5-TFS] ---> u2 F2 u2 R  F   @ 0000456680559 nodes with 0002016240088 5-TFS probes          
Solution [068] =  F' R' f2 u2 B2 d2 [inside 5-TFS] ---> B2 u2 f2 R  F   @ 0000456680793 nodes with 0002016240962 5-TFS probes          
Solution [069] =  F' R' f2 d2 F2 d2 [inside 5-TFS] ---> F2 d2 f2 R  F   @ 0000456682809 nodes with 0002016249584 5-TFS probes          
Solution [070] =  F' R' f2 d2 F2 f2 [inside 5-TFS] ---> d2 F2 d2 R  F   @ 0000456682827 nodes with 0002016249612 5-TFS probes          
Solution [071] =  F' R' f2 d2 B2 u2 [inside 5-TFS] ---> B2 d2 f2 R  F   @ 0000456683058 nodes with 0002016250483 5-TFS probes          
Solution [072] =  F' R' b2 u2 F2 u2 [inside 5-TFS] ---> F2 u2 b2 R  F   @ 0000456746634 nodes with 0002016518597 5-TFS probes          
Solution [073] =  F' R' b2 u2 F2 b2 [inside 5-TFS] ---> u2 F2 u2 R  F   @ 0000456746658 nodes with 0002016518674 5-TFS probes          
Solution [074] =  F' R' b2 u2 B2 d2 [inside 5-TFS] ---> B2 u2 b2 R  F   @ 0000456746889 nodes with 0002016519577 5-TFS probes          
Solution [075] =  F' R' b2 d2 F2 d2 [inside 5-TFS] ---> F2 d2 b2 R  F   @ 0000456748905 nodes with 0002016528206 5-TFS probes          
Solution [076] =  F' R' b2 d2 F2 b2 [inside 5-TFS] ---> d2 F2 d2 R  F   @ 0000456748926 nodes with 0002016528295 5-TFS probes          
Solution [077] =  F' R' b2 d2 B2 u2 [inside 5-TFS] ---> B2 d2 b2 R  F   @ 0000456749154 nodes with 0002016529245 5-TFS probes          
Solution [078] =  F' L' u2 f2 U2 u2 [inside 5-TFS] ---> f2 U2 f2 L  F   @ 0000462016644 nodes with 0002038668170 5-TFS probes          
Solution [079] =  F' L' u2 f2 U2 f2 [inside 5-TFS] ---> U2 f2 u2 L  F   @ 0000462016668 nodes with 0002038668234 5-TFS probes          
Solution [080] =  F' L' u2 f2 D2 b2 [inside 5-TFS] ---> D2 f2 u2 L  F   @ 0000462016914 nodes with 0002038669347 5-TFS probes          
Solution [081] =  F' L' u2 b2 U2 u2 [inside 5-TFS] ---> b2 U2 b2 L  F   @ 0000462018993 nodes with 0002038678296 5-TFS probes          
Solution [082] =  F' L' u2 b2 U2 b2 [inside 5-TFS] ---> U2 b2 u2 L  F   @ 0000462019020 nodes with 0002038678371 5-TFS probes          
Solution [083] =  F' L' u2 b2 D2 f2 [inside 5-TFS] ---> D2 b2 u2 L  F   @ 0000462019260 nodes with 0002038679525 5-TFS probes          
Solution [084] =  F' L' d2 f2 U2 d2 [inside 5-TFS] ---> f2 U2 f2 L  F   @ 0000462080475 nodes with 0002038937634 5-TFS probes          
Solution [085] =  F' L' d2 f2 U2 f2 [inside 5-TFS] ---> U2 f2 d2 L  F   @ 0000462080496 nodes with 0002038937781 5-TFS probes          
Solution [086] =  F' L' d2 f2 D2 b2 [inside 5-TFS] ---> D2 f2 d2 L  F   @ 0000462080742 nodes with 0002038938805 5-TFS probes          
Solution [087] =  F' L' d2 b2 U2 d2 [inside 5-TFS] ---> b2 U2 b2 L  F   @ 0000462082824 nodes with 0002038947580 5-TFS probes          
Solution [088] =  F' L' d2 b2 U2 b2 [inside 5-TFS] ---> U2 b2 d2 L  F   @ 0000462082848 nodes with 0002038947666 5-TFS probes          
Solution [089] =  F' L' d2 b2 D2 f2 [inside 5-TFS] ---> D2 b2 d2 L  F   @ 0000462083088 nodes with 0002038948558 5-TFS probes          
Solution [090] =  F' L' f2 U2 f2 U2 [inside 5-TFS] ---> u2 f2 u2 L  F   @ 0000462271005 nodes with 0002039734524 5-TFS probes          
Solution [091] =  F' L' f2 U2 f2 u2 [inside 5-TFS] ---> U2 f2 u2 L  F   @ 0000462271008 nodes with 0002039734534 5-TFS probes          
Solution [092] =  F' L' f2 U2 f2 d2 [inside 5-TFS] ---> U2 f2 d2 L  F   @ 0000462271011 nodes with 0002039734539 5-TFS probes          
Solution [093] =  F' L' f2 R2 U2 f2 [inside 5-TFS] ---> U2 R2 f2 L  F   @ 0000462279963 nodes with 0002039771443 5-TFS probes          
Solution [094] =  F' L' f2 R2 D2 b2 [inside 5-TFS] ---> D2 R2 f2 L  F   @ 0000462280209 nodes with 0002039772336 5-TFS probes          
Solution [095] =  F' L' f2 L2 U2 f2 [inside 5-TFS] ---> U2 L2 f2 L  F   @ 0000462287037 nodes with 0002039801428 5-TFS probes          
Solution [096] =  F' L' f2 L2 D2 b2 [inside 5-TFS] ---> D2 L2 f2 L  F   @ 0000462287283 nodes with 0002039802353 5-TFS probes          
Solution [097] =  F' L' b2 U2 b2 U2 [inside 5-TFS] ---> u2 b2 u2 L  F   @ 0000462337185 nodes with 0002040007770 5-TFS probes          
Solution [098] =  F' L' b2 U2 b2 u2 [inside 5-TFS] ---> U2 b2 u2 L  F   @ 0000462337188 nodes with 0002040007791 5-TFS probes          
Solution [099] =  F' L' b2 U2 b2 d2 [inside 5-TFS] ---> U2 b2 d2 L  F   @ 0000462337191 nodes with 0002040007792 5-TFS probes          
Solution [100] =  F' L' b2 R2 U2 b2 [inside 5-TFS] ---> U2 R2 b2 L  F   @ 0000462346062 nodes with 0002040046228 5-TFS probes          
Solution [101] =  F' L' b2 R2 D2 f2 [inside 5-TFS] ---> D2 R2 b2 L  F   @ 0000462346302 nodes with 0002040047129 5-TFS probes          
Solution [102] =  F' L' b2 L2 U2 b2 [inside 5-TFS] ---> U2 L2 b2 L  F   @ 0000462353136 nodes with 0002040075398 5-TFS probes          
Solution [103] =  F' L' b2 L2 D2 f2 [inside 5-TFS] ---> D2 L2 b2 L  F   @ 0000462353376 nodes with 0002040076394 5-TFS probes
```


----------



## rokicki (May 6, 2014)

Five new optimal distance-16 (OBTM) solutions popped up this morning.
They are numbers 1004 1005 1028 3002 3003 on

http://tomas.rokicki.com/ell4x4.html

My initial attempt at other metrics (SSTM and BTM) work but are too
slow to be useful; I will have to continue working on them.


----------



## 10461394944000 (May 6, 2014)

rokicki said:


> Five new optimal distance-16 (OBTM) solutions popped up this morning.
> They are numbers 1004 1005 1028 3002 3003 on
> 
> http://tomas.rokicki.com/ell4x4.html
> ...



wouldn't it be faster to not use any Lw/Bw/Dw moves?

edit: cool, z perm on 4x4 is 2 moves shorter than 3x3

r2 U r2 D' f2 l2 U' l2 D f2


----------



## rokicki (May 6, 2014)

10461394944000 said:


> wouldn't it be faster to not use any Lw/Bw/Dw moves?
> 
> edit: cool, z perm on 4x4 is 2 moves shorter than 3x3
> 
> r2 U r2 D' f2 l2 U' l2 D f2



Hmm, remember, I'm computing OBTM sequences---outer block turns only, which
includes the Lw/Bw/Dw moves. I presume you mean for speed solvers it would be
faster to execute without these moves, and this is assuredly true; OBTM-optimal
sequences are not necessarily the fastest for speedsolving. (I'm also stopping at
the first solution, instead of finding all solutions, but I may rerun some of these
finding all solutions.)

Your Z-perm 10-mover; is this new? How did you find this? I confirm that this is
optimal in single-slice-turn metric.

Of course for the 3x3 there are well-known seven-turn sequences in the slice turn
metric for Z-perm; these are optimal in the BTM on the 4x4 as well.

Best solution in OBTM for zperm is 12 moves.


----------



## 10461394944000 (May 6, 2014)

rokicki said:


> Hmm, remember, I'm computing OBTM sequences---outer block turns only, which
> includes the Lw/Bw/Dw moves. I presume you mean for speed solvers it would be
> faster to execute without these moves, and this is assuredly true; OBTM-optimal
> sequences are not necessarily the fastest for speedsolving. (I'm also stopping at
> ...



well I thought you wouldn't have needed Lw/Bw/Dw because they are just the same as Rw/Fw/Uw with a rotation.

found the Z perm with unsolveds solver, I don't know if its been found before.


----------



## rokicki (May 6, 2014)

10461394944000 said:


> well I thought you wouldn't have needed Lw/Bw/Dw because they are just the same as Rw/Fw/Uw with a rotation.



Ahh, I see. My twisted solves as they come out of the solver don't use Lw/Bw/Dw because they keep
the DBL corner fixed, but they *do* use moves like 3Lw and 3Bw which are unusual.

My "untwister" considers all the various reorientations of the sequences possible by converting Uw to Dw
and the like, and picks out those sequences that have a short text description (preferring U over
3Dw for instance). It *only* shows the ones that come up with short descriptions.

To make them speed-solving friendly, we probably want to revise the metric used to pick the solutions to
reflect how fast a typical speedsolver can manipulate the cube. If we could come up with such a simple
metric, that would be greatly useful. Different people can do different moves at different speeds, but
certainly there's some common denominator we can use. At the start maybe we can just assign a
"time" to each possible move (including slice moves) and see what happens with that. For the BTM on the
4x4x4 there are 54 different moves; that's a lot of numbers.


----------



## uberCuber (May 6, 2014)

rokicki said:


> To make them speed-solving friendly, we probably want to revise the metric used to pick the solutions to
> reflect how fast a typical speedsolver can manipulate the cube. If we could come up with such a simple
> metric, that would be greatly useful. Different people can do different moves at different speeds, but
> certainly there's some common denominator we can use. At the start maybe we can just assign a
> ...



I know this kind of thing has been discussed before somewhere, but I don't think it ever got as far as trying to assign specific numbers to each move. The problem is that not only does it depend on the person, but it also depends on the cube itself. It is harder to perform slice turns quickly on some cubes, while others might not have as fast outer layers. And depending on tensions, performing a lot of D moves (say, the common <R,U,D> E-perm) may or may not be easy.


----------



## cuBerBruce (May 6, 2014)

uberCuber said:


> I know this kind of thing has been discussed before somewhere, but I don't think it ever got as far as trying to assign specific numbers to each move. The problem is that not only does it depend on the person, but it also depends on the cube itself. It is harder to perform slice turns quickly on some cubes, while others might not have as fast outer layers. And depending on tensions, performing a lot of D moves (say, the common <R,U,D> E-perm) may or may not be easy.



I think it's even more complicated as you really need to consider sequences of moves. Some sequences called triggers (e.g. R' U R') can be particularly fast to perform. Likewise some sequences can be awkward and slow. A regrip (usually to perform a whole cube rotation) can result in a significant delay even though it doesn't change the intrinsic state of the cube, but if it can set up the use of nice triggers, the cost of a regrip may be made up for. I think basically, you may need to take into account how executing moves affects the state of the fingers. I'm clearly not the expert on this, though.

EDIT (appending):
I tried the following scramble on OO4x4x4 version 1.2.3 and 1.2.8:

L l r' F f b' R r l' F2 f2 b2 L l U u d' R2 r2 l2

My solver solved this in around 1 second to finish a depth 8 search (yes, corners pruning really helps on this one). OO4x4x4 (using 5-TFS) took a few minutes to search up to a "depths 6-11" and still did not find the solution. Even though this position can be solved back to the original cube orientation in 11 moves, it might be that OO4x4x4 didn't find it due to its restricting to no more than 3 consecutive turns on an axis. The rule that you shouldn't need more than 3 turns in a row on the same axis is based upon an assumption that the orientation of the cube shouldn't matter. OO4x4x4 is using this rule, but it still apparently considering the orientation of the cube to matter.

On version 1.2.8, it took until the iteration for "depths 10-15" where the solutions found were initially at depth 14, and then later on depth 13 solutions were found. These solutions had obvious cancellations between the tree search part and the TFS part. It looks to me that these cancellations are what allows the program to actually find these solutions, since after removing these moves that cancel out, you end up with a solution containing 4 consecutive moves on an axis - necessary in this case to get an optimal solution that leaves the cube in the original pre-scramble orientation.

The output from Version 1.2.8 is in the spoiler.



Spoiler





```
Completed searching 0000000000000001  nodes through DEPTHS 00-05:     LEAF NODES: 0000000000000000 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000000000010: 1-TFS probes 0000000000000000: 2-TFS probes 0000000000000000: 3-TFS probes 0000000000000000
  TFS Database misses 0000000000000011: 4-TFS probes 0000000000000001: 5-TFS probes 0000000000000009: 6-TFS probes 0000000000000000

  Completed searching 0000000000000036  nodes through DEPTHS 01-06:     LEAF NODES: 0000000000000000 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000000000077: 1-TFS probes 0000000000000000: 2-TFS probes 0000000000000000: 3-TFS probes 0000000000000000
  TFS Database misses 0000000000000096: 4-TFS probes 0000000000000006: 5-TFS probes 0000000000000071: 6-TFS probes 0000000000000000

  Completed searching 0000000000001026  nodes through DEPTHS 02-07:     LEAF NODES: 0000000000000000 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000000004483: 1-TFS probes 0000000000000000: 2-TFS probes 0000000000000000: 3-TFS probes 0000000000000016
  TFS Database misses 0000000000005216: 4-TFS probes 0000000000000222: 5-TFS probes 0000000000004245: 6-TFS probes 0000000000000000

  Completed searching 0000000000028836  nodes through DEPTHS 03-08:     LEAF NODES: 0000000000000000 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000000131255: 1-TFS probes 0000000000000000: 2-TFS probes 0000000000000008: 3-TFS probes 0000000000000308
  TFS Database misses 0000000000152192: 4-TFS probes 0000000000007092: 5-TFS probes 0000000000123847: 6-TFS probes 0000000000000000

  Completed searching 0000000000810648  nodes through DEPTHS 04-09:     LEAF NODES: 0000000000000243 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000003734589: 1-TFS probes 0000000000000005: 2-TFS probes 0000000000000269: 3-TFS probes 0000000000007848
  TFS Database misses 0000000004321908: 4-TFS probes 0000000000201370: 5-TFS probes 0000000003525097: 6-TFS probes 0000000000000000

  Completed searching 0000000022791456  nodes through DEPTHS 05-10:     LEAF NODES: 0000000000006318 cut BRANCHES: 0000000000000000 pruned
  TFS Database probes 0000000105060036: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223766
  TFS Database misses 0000000121593540: 4-TFS probes 0000000005669000: 5-TFS probes 0000000099159181: 6-TFS probes 0000000000000000

  Completed searching 0000000000000000  nodes through DEPTHS 06-11:     LEAF NODES: 0000000000006318 cut BRANCHES: 0000000000000677 pruned
  TFS Database probes 0000000105060036: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223766
  TFS Database misses 0000000121593540: 4-TFS probes 0000000005669000: 5-TFS probes 0000000099159181: 6-TFS probes 0000000000000000

  Completed searching 0000000000000000  nodes through DEPTHS 07-12:     LEAF NODES: 0000000000006327 cut BRANCHES: 0000000000032308 pruned
  TFS Database probes 0000000105060036: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223766
  TFS Database misses 0000000121593540: 4-TFS probes 0000000005669000: 5-TFS probes 0000000099159181: 6-TFS probes 0000000000000000

  Completed searching 0000000000000000  nodes through DEPTHS 08-13:     LEAF NODES: 0000000000006696 cut BRANCHES: 0000000001161567 pruned
  TFS Database probes 0000000105060036: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223766
  TFS Database misses 0000000121593540: 4-TFS probes 0000000005669000: 5-TFS probes 0000000099159181: 6-TFS probes 0000000000000000

  Completed searching 0000000000000000  nodes through DEPTHS 09-14:     LEAF NODES: 0000000000018531 cut BRANCHES: 0000000036078657 pruned
  TFS Database probes 0000000105060036: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223766
  TFS Database misses 0000000121593540: 4-TFS probes 0000000005669000: 5-TFS probes 0000000099159181: 6-TFS probes 0000000000000000

  Completed searching 0000000000000822  nodes through DEPTHS 10-15:     LEAF NODES: 0000000000345645 cut BRANCHES: 0000001054370361 pruned
  TFS Database probes 0000000105063957: 1-TFS probes 0000000000000251: 2-TFS probes 0000000000007838: 3-TFS probes 0000000000223774
  TFS Database misses 0000000121598034: 4-TFS probes 0000000005669198: 5-TFS probes 0000000099162896: 6-TFS probes 0000000000000000

 ?Solution [001] =  L2 U' F' f' R2 B' U2 u2 d2 R' U' [inside 4-TFS] ---> U  R  D  R'  @ 0000000009908 nodes with 0000005671622 4-TFS probes          e!
  Solution [002] =  L2 U' F' f' R2 B' U2 u2 d2 R' U2 [inside 4-TFS] ---> U2 R  D  R'  @ 0000000009909 nodes with 0000005671623 4-TFS probes
  Solution [003] =  L2 U' F' f' R2 B' U2 u2 d2 R' u  [inside 4-TFS] ---> u' R  D  R'  @ 0000000009910 nodes with 0000005671624 4-TFS probes
  Solution [004] =  L2 U' F' f' R2 B' U2 u2 d2 R' u' [inside 4-TFS] ---> u  R  D  R'  @ 0000000009911 nodes with 0000005671625 4-TFS probes
  Solution [005] =  L2 U' F' f' R2 B' U2 u2 d2 R' u2 [inside 4-TFS] ---> u2 R  D  R'  @ 0000000009912 nodes with 0000005671626 4-TFS probes
  Solution [006] =  L2 U' F' f' R2 B' U2 u2 d2 R' d  [inside 4-TFS] ---> d' R  D  R'  @ 0000000009913 nodes with 0000005671627 4-TFS probes
  Solution [007] =  L2 U' F' f' R2 B' U2 u2 d2 R' d' [inside 4-TFS] ---> d  R  D  R'  @ 0000000009914 nodes with 0000005671628 4-TFS probes
  Solution [008] =  L2 U' F' f' R2 B' U2 u2 d2 R' d2 [inside 4-TFS] ---> d2 R  D  R'  @ 0000000009915 nodes with 0000005671629 4-TFS probes
  Solution [009] =  L2 U' F' f' R2 B' U2 u2 d2 R' D  [inside 4-TFS] ---> D' R  D  R'  @ 0000000009916 nodes with 0000005671630 4-TFS probes
  Solution [010] =  L2 U' F' f' R2 B' U2 u2 d2 R' D' [inside 4-TFS] ---> D  R  D  R'  @ 0000000009917 nodes with 0000005671631 4-TFS probes
  Solution [011] =  L2 U' F' f' R2 B' U2 u2 d2 R' D2 [inside 4-TFS] ---> D2 R  D  R'  @ 0000000009918 nodes with 0000005671632 4-TFS probes
  Solution [012] =  L2 U' F' f' R2 B' U2 u2 d2 R' r  [inside 4-TFS] ---> r' R  D  R'  @ 0000000009919 nodes with 0000005671633 4-TFS probes
  Solution [013] =  L2 U' F' f' R2 B' U2 u2 d2 R' r' [inside 4-TFS] ---> r  R  D  R'  @ 0000000009920 nodes with 0000005671634 4-TFS probes
  Solution [014] =  L2 U' F' f' R2 B' U2 u2 d2 R' r2 [inside 4-TFS] ---> r2 R  D  R'  @ 0000000009921 nodes with 0000005671635 4-TFS probes
  Solution [015] =  L2 U' F' f' R2 B' U2 u2 d2 R' l  [inside 4-TFS] ---> l' R  D  R'  @ 0000000009922 nodes with 0000005671636 4-TFS probes
  Solution [016] =  L2 U' F' f' R2 B' U2 u2 d2 R' l' [inside 4-TFS] ---> l  R  D  R'  @ 0000000009923 nodes with 0000005671637 4-TFS probes
  Solution [017] =  L2 U' F' f' R2 B' U2 u2 d2 R' l2 [inside 4-TFS] ---> l2 R  D  R'  @ 0000000009924 nodes with 0000005671638 4-TFS probes
  Solution [018] =  L2 U' F' f' R2 B' U2 u2 d2 R' L  [inside 4-TFS] ---> L' R  D  R'  @ 0000000009925 nodes with 0000005671639 4-TFS probes
  Solution [019] =  L2 U' F' f' R2 B' U2 u2 d2 R' L' [inside 4-TFS] ---> L  R  D  R'  @ 0000000009926 nodes with 0000005671640 4-TFS probes
  Solution [020] =  L2 U' F' f' R2 B' U2 u2 d2 R' L2 [inside 4-TFS] ---> L2 R  D  R'  @ 0000000009927 nodes with 0000005671641 4-TFS probes
  Solution [021] =  L2 U' F' f' R2 B' U2 u2 d2 R' F  [inside 4-TFS] ---> F' R  D  R'  @ 0000000009928 nodes with 0000005671642 4-TFS probes
  Solution [022] =  L2 U' F' f' R2 B' U2 u2 d2 R' F' [inside 4-TFS] ---> F  R  D  R'  @ 0000000009929 nodes with 0000005671643 4-TFS probes
  Solution [023] =  L2 U' F' f' R2 B' U2 u2 d2 R' F2 [inside 4-TFS] ---> F2 R  D  R'  @ 0000000009930 nodes with 0000005671644 4-TFS probes
  Solution [024] =  L2 U' F' f' R2 B' U2 u2 d2 R' f  [inside 4-TFS] ---> f' R  D  R'  @ 0000000009931 nodes with 0000005671645 4-TFS probes
  Solution [025] =  L2 U' F' f' R2 B' U2 u2 d2 R' f' [inside 4-TFS] ---> f  R  D  R'  @ 0000000009932 nodes with 0000005671646 4-TFS probes
  Solution [026] =  L2 U' F' f' R2 B' U2 u2 d2 R' f2 [inside 4-TFS] ---> f2 R  D  R'  @ 0000000009933 nodes with 0000005671647 4-TFS probes
  Solution [027] =  L2 U' F' f' R2 B' U2 u2 d2 R' b  [inside 4-TFS] ---> b' R  D  R'  @ 0000000009934 nodes with 0000005671649 4-TFS probes
  Solution [028] =  L2 U' F' f' R2 B' U2 u2 d2 R' b' [inside 4-TFS] ---> b  R  D  R'  @ 0000000009935 nodes with 0000005671650 4-TFS probes
  Solution [029] =  L2 U' F' f' R2 B' U2 u2 d2 R' b2 [inside 4-TFS] ---> b2 R  D  R'  @ 0000000009936 nodes with 0000005671651 4-TFS probes
  Solution [030] =  L2 U' F' f' R2 B' U2 u2 d2 R' B  [inside 4-TFS] ---> B' R  D  R'  @ 0000000009937 nodes with 0000005671652 4-TFS probes
  Solution [031] =  L2 U' F' f' R2 B' U2 u2 d2 R' B' [inside 4-TFS] ---> B  R  D  R'  @ 0000000009938 nodes with 0000005671653 4-TFS probes
  Solution [032] =  L2 U' F' f' R2 B' U2 u2 d2 R' B2 [inside 4-TFS] ---> B2 R  D  R'  @ 0000000009939 nodes with 0000005671654 4-TFS probes
  Solution [033] =  L2 U' F' f' R2 B' U2 u2 D  R  U  [inside 4-TFS] ---> U' R' d2 R'  @ 0000000009940 nodes with 0000005671655 4-TFS probes
  Solution [034] =  L2 U' F' f' R2 B' U2 u2 D  R  U' [inside 4-TFS] ---> U  R' d2 R'  @ 0000000009941 nodes with 0000005671656 4-TFS probes
  Solution [035] =  L2 U' F' f' R2 B' U2 u2 D  R  U2 [inside 4-TFS] ---> U2 R' d2 R'  @ 0000000009942 nodes with 0000005671657 4-TFS probes
  Solution [036] =  L2 U' F' f' R2 B' U2 u2 D  R  u  [inside 4-TFS] ---> u' R' d2 R'  @ 0000000009943 nodes with 0000005671658 4-TFS probes
  Solution [037] =  L2 U' F' f' R2 B' U2 u2 D  R  u' [inside 4-TFS] ---> u  R' d2 R'  @ 0000000009944 nodes with 0000005671659 4-TFS probes
  Solution [038] =  L2 U' F' f' R2 B' U2 u2 D  R  u2 [inside 4-TFS] ---> u2 R' d2 R'  @ 0000000009945 nodes with 0000005671660 4-TFS probes
  Solution [039] =  L2 U' F' f' R2 B' U2 u2 D  R  d  [inside 4-TFS] ---> d' R' d2 R'  @ 0000000009946 nodes with 0000005671661 4-TFS probes
  Solution [040] =  L2 U' F' f' R2 B' U2 u2 D  R  d' [inside 4-TFS] ---> d  R' d2 R'  @ 0000000009947 nodes with 0000005671662 4-TFS probes
  Solution [041] =  L2 U' F' f' R2 B' U2 u2 D  R  d2 [inside 4-TFS] ---> d2 R' d2 R'  @ 0000000009948 nodes with 0000005671663 4-TFS probes
  Solution [042] =  L2 U' F' f' R2 B' U2 u2 D  R  D  [inside 4-TFS] ---> D' R' d2 R'  @ 0000000009949 nodes with 0000005671664 4-TFS probes
  Solution [043] =  L2 U' F' f' R2 B' U2 u2 D  R  D' [inside 4-TFS] ---> D  R' d2 R'  @ 0000000009950 nodes with 0000005671665 4-TFS probes
  Solution [044] =  L2 U' F' f' R2 B' U2 u2 D  R  D2 [inside 4-TFS] ---> D2 R' d2 R'  @ 0000000009951 nodes with 0000005671667 4-TFS probes
  Solution [045] =  L2 U' F' f' R2 B' U2 u2 D  R  r  [inside 4-TFS] ---> r' R' d2 R'  @ 0000000009952 nodes with 0000005671668 4-TFS probes
  Solution [046] =  L2 U' F' f' R2 B' U2 u2 D  R  r' [inside 4-TFS] ---> r  R' d2 R'  @ 0000000009953 nodes with 0000005671669 4-TFS probes
  Solution [047] =  L2 U' F' f' R2 B' U2 u2 D  R  r2 [inside 4-TFS] ---> r2 R' d2 R'  @ 0000000009954 nodes with 0000005671670 4-TFS probes
  Solution [048] =  L2 U' F' f' R2 B' U2 u2 D  R  l  [inside 4-TFS] ---> l' R' d2 R'  @ 0000000009955 nodes with 0000005671671 4-TFS probes
  Solution [049] =  L2 U' F' f' R2 B' U2 u2 D  R  l' [inside 4-TFS] ---> l  R' d2 R'  @ 0000000009956 nodes with 0000005671672 4-TFS probes
  Solution [050] =  L2 U' F' f' R2 B' U2 u2 D  R  l2 [inside 4-TFS] ---> l2 R' d2 R'  @ 0000000009957 nodes with 0000005671673 4-TFS probes
  Solution [051] =  L2 U' F' f' R2 B' U2 u2 D  R  L  [inside 4-TFS] ---> L' R' d2 R'  @ 0000000009958 nodes with 0000005671674 4-TFS probes
  Solution [052] =  L2 U' F' f' R2 B' U2 u2 D  R  L' [inside 4-TFS] ---> L  R' d2 R'  @ 0000000009959 nodes with 0000005671675 4-TFS probes
  Solution [053] =  L2 U' F' f' R2 B' U2 u2 D  R  L2 [inside 4-TFS] ---> L2 R' d2 R'  @ 0000000009960 nodes with 0000005671676 4-TFS probes
  Solution [054] =  L2 U' F' f' R2 B' U2 u2 D  R  F  [inside 4-TFS] ---> F' R' d2 R'  @ 0000000009961 nodes with 0000005671677 4-TFS probes
  Solution [055] =  L2 U' F' f' R2 B' U2 u2 D  R  F' [inside 4-TFS] ---> F  R' d2 R'  @ 0000000009962 nodes with 0000005671678 4-TFS probes
  Solution [056] =  L2 U' F' f' R2 B' U2 u2 D  R  F2 [inside 4-TFS] ---> F2 R' d2 R'  @ 0000000009963 nodes with 0000005671679 4-TFS probes
  Solution [057] =  L2 U' F' f' R2 B' U2 u2 D  R  f  [inside 4-TFS] ---> f' R' d2 R'  @ 0000000009964 nodes with 0000005671680 4-TFS probes
  Solution [058] =  L2 U' F' f' R2 B' U2 u2 D  R  f' [inside 4-TFS] ---> f  R' d2 R'  @ 0000000009965 nodes with 0000005671681 4-TFS probes
  Solution [059] =  L2 U' F' f' R2 B' U2 u2 D  R  f2 [inside 4-TFS] ---> f2 R' d2 R'  @ 0000000009966 nodes with 0000005671682 4-TFS probes
  Solution [060] =  L2 U' F' f' R2 B' U2 u2 D  R  b  [inside 4-TFS] ---> b' R' d2 R'  @ 0000000009967 nodes with 0000005671683 4-TFS probes
  Solution [061] =  L2 U' F' f' R2 B' U2 u2 D  R  b' [inside 4-TFS] ---> b  R' d2 R'  @ 0000000009968 nodes with 0000005671684 4-TFS probes
  Solution [062] =  L2 U' F' f' R2 B' U2 u2 D  R  b2 [inside 4-TFS] ---> b2 R' d2 R'  @ 0000000009969 nodes with 0000005671686 4-TFS probes
  Solution [063] =  L2 U' F' f' R2 B' U2 u2 D  R  B  [inside 4-TFS] ---> B' R' d2 R'  @ 0000000009970 nodes with 0000005671687 4-TFS probes
  Solution [064] =  L2 U' F' f' R2 B' U2 u2 D  R  B' [inside 4-TFS] ---> B  R' d2 R'  @ 0000000009971 nodes with 0000005671688 4-TFS probes
  Solution [065] =  L2 U' F' f' R2 B' U2 u2 D  R  B2 [inside 4-TFS] ---> B2 R' d2 R'  @ 0000000009972 nodes with 0000005671689 4-TFS probes
  Solution [066] =  L2 U' F' f' R2 B' U2 u2 D  R' U  [inside 4-TFS] ---> U' R  d2 R'  @ 0000000009973 nodes with 0000005671690 4-TFS probes
  Solution [067] =  L2 U' F' f' R2 B' U2 u2 D  R' U' [inside 4-TFS] ---> U  R  d2 R'  @ 0000000009974 nodes with 0000005671691 4-TFS probes
  Solution [068] =  L2 U' F' f' R2 B' U2 u2 D  R' U2 [inside 4-TFS] ---> U2 R  d2 R'  @ 0000000009975 nodes with 0000005671692 4-TFS probes
  Solution [069] =  L2 U' F' f' R2 B' U2 u2 D  R' u  [inside 4-TFS] ---> u' R  d2 R'  @ 0000000009976 nodes with 0000005671693 4-TFS probes
  Solution [070] =  L2 U' F' f' R2 B' U2 u2 D  R' u' [inside 4-TFS] ---> u  R  d2 R'  @ 0000000009977 nodes with 0000005671694 4-TFS probes
  Solution [071] =  L2 U' F' f' R2 B' U2 u2 D  R' u2 [inside 4-TFS] ---> u2 R  d2 R'  @ 0000000009978 nodes with 0000005671695 4-TFS probes
  Solution [072] =  L2 U' F' f' R2 B' U2 u2 D  R' d  [inside 4-TFS] ---> d' R  d2 R'  @ 0000000009979 nodes with 0000005671696 4-TFS probes
  Solution [073] =  L2 U' F' f' R2 B' U2 u2 D  R' d' [inside 4-TFS] ---> d  R  d2 R'  @ 0000000009980 nodes with 0000005671697 4-TFS probes
  Solution [074] =  L2 U' F' f' R2 B' U2 u2 D  R' d2 [inside 4-TFS] ---> d2 R  d2 R'  @ 0000000009981 nodes with 0000005671698 4-TFS probes
  Solution [075] =  L2 U' F' f' R2 B' U2 u2 D  R' D  [inside 4-TFS] ---> D' R  d2 R'  @ 0000000009982 nodes with 0000005671699 4-TFS probes
  Solution [076] =  L2 U' F' f' R2 B' U2 u2 D  R' D' [inside 4-TFS] ---> D  R  d2 R'  @ 0000000009983 nodes with 0000005671700 4-TFS probes
  Solution [077] =  L2 U' F' f' R2 B' U2 u2 D  R' D2 [inside 4-TFS] ---> D2 R  d2 R'  @ 0000000009984 nodes with 0000005671702 4-TFS probes
  Solution [078] =  L2 U' F' f' R2 B' U2 u2 D  R' r  [inside 4-TFS] ---> r' R  d2 R'  @ 0000000009985 nodes with 0000005671703 4-TFS probes
  Solution [079] =  L2 U' F' f' R2 B' U2 u2 D  R' r' [inside 4-TFS] ---> r  R  d2 R'  @ 0000000009986 nodes with 0000005671704 4-TFS probes
  Solution [080] =  L2 U' F' f' R2 B' U2 u2 D  R' r2 [inside 4-TFS] ---> r2 R  d2 R'  @ 0000000009987 nodes with 0000005671705 4-TFS probes
  Solution [081] =  L2 U' F' f' R2 B' U2 u2 D  R' l  [inside 4-TFS] ---> l' R  d2 R'  @ 0000000009988 nodes with 0000005671706 4-TFS probes
  Solution [082] =  L2 U' F' f' R2 B' U2 u2 D  R' l' [inside 4-TFS] ---> l  R  d2 R'  @ 0000000009989 nodes with 0000005671707 4-TFS probes
  Solution [083] =  L2 U' F' f' R2 B' U2 u2 D  R' l2 [inside 4-TFS] ---> l2 R  d2 R'  @ 0000000009990 nodes with 0000005671708 4-TFS probes
  Solution [084] =  L2 U' F' f' R2 B' U2 u2 D  R' L  [inside 4-TFS] ---> L' R  d2 R'  @ 0000000009991 nodes with 0000005671709 4-TFS probes
  Solution [085] =  L2 U' F' f' R2 B' U2 u2 D  R' L' [inside 4-TFS] ---> L  R  d2 R'  @ 0000000009992 nodes with 0000005671710 4-TFS probes
  Solution [086] =  L2 U' F' f' R2 B' U2 u2 D  R' L2 [inside 4-TFS] ---> L2 R  d2 R'  @ 0000000009993 nodes with 0000005671711 4-TFS probes
  Solution [087] =  L2 U' F' f' R2 B' U2 u2 D  R' F  [inside 4-TFS] ---> F' R  d2 R'  @ 0000000009994 nodes with 0000005671712 4-TFS probes
  Solution [088] =  L2 U' F' f' R2 B' U2 u2 D  R' F' [inside 4-TFS] ---> F  R  d2 R'  @ 0000000009995 nodes with 0000005671713 4-TFS probes
  Solution [089] =  L2 U' F' f' R2 B' U2 u2 D  R' F2 [inside 4-TFS] ---> F2 R  d2 R'  @ 0000000009996 nodes with 0000005671714 4-TFS probes
  Solution [090] =  L2 U' F' f' R2 B' U2 u2 D  R' f  [inside 4-TFS] ---> f' R  d2 R'  @ 0000000009997 nodes with 0000005671715 4-TFS probes
  Solution [091] =  L2 U' F' f' R2 B' U2 u2 D  R' f' [inside 4-TFS] ---> f  R  d2 R'  @ 0000000009998 nodes with 0000005671716 4-TFS probes
  Solution [092] =  L2 U' F' f' R2 B' U2 u2 D  R' f2 [inside 4-TFS] ---> f2 R  d2 R'  @ 0000000009999 nodes with 0000005671717 4-TFS probes
  Solution [093] =  L2 U' F' f' R2 B' U2 u2 D  R' b  [inside 4-TFS] ---> b' R  d2 R'  @ 0000000010000 nodes with 0000005671718 4-TFS probes
  Solution [094] =  L2 U' F' f' R2 B' U2 u2 D  R' b' [inside 4-TFS] ---> b  R  d2 R'  @ 0000000010001 nodes with 0000005671719 4-TFS probes
  Solution [095] =  L2 U' F' f' R2 B' U2 u2 D  R' b2 [inside 4-TFS] ---> b2 R  d2 R'  @ 0000000010002 nodes with 0000005671720 4-TFS probes
  Solution [096] =  L2 U' F' f' R2 B' U2 u2 D  R' B  [inside 4-TFS] ---> B' R  d2 R'  @ 0000000010003 nodes with 0000005671721 4-TFS probes
  Solution [097] =  L2 U' F' f' R2 B' U2 u2 D  R' B' [inside 4-TFS] ---> B  R  d2 R'  @ 0000000010004 nodes with 0000005671722 4-TFS probes
  Solution [098] =  L2 U' F' f' R2 B' U2 u2 D  R' B2 [inside 4-TFS] ---> B2 R  d2 R'  @ 0000000010005 nodes with 0000005671723 4-TFS probes
  Solution [099] =  L2 U' F' f' R2 B' U2 u2 D  R2 u  [inside 4-TFS] ---> u' R2 d2 R'  @ 0000000010009 nodes with 0000005671724 4-TFS probes
  Solution [100] =  L2 U' F' f' R2 B' U2 u2 D  R2 u' [inside 4-TFS] ---> u  R2 d2 R'  @ 0000000010010 nodes with 0000005671725 4-TFS probes
  Solution [101] =  L2 U' F' f' R2 B' U2 u2 D  R2 u2 [inside 4-TFS] ---> u2 R2 d2 R'  @ 0000000010011 nodes with 0000005671726 4-TFS probes
  Solution [102] =  L2 U' F' f' R2 B' U2 u2 D  R2 d  [inside 4-TFS] ---> d' R2 d2 R'  @ 0000000010012 nodes with 0000005671727 4-TFS probes
  Solution [103] =  L2 U' F' f' R2 B' U2 u2 D  R2 d' [inside 4-TFS] ---> d  R2 d2 R'  @ 0000000010013 nodes with 0000005671728 4-TFS probes
  Solution [104] =  L2 U' F' f' R2 B' U2 u2 D  R2 d2 [inside 4-TFS] ---> d2 R2 d2 R'  @ 0000000010014 nodes with 0000005671729 4-TFS probes
  Solution [105] =  L2 U' F' f' R2 B' U2 u2 D  R2 r  [inside 4-TFS] ---> r' R2 d2 R'  @ 0000000010018 nodes with 0000005671730 4-TFS probes
  Solution [106] =  L2 U' F' f' R2 B' U2 u2 D  R2 r' [inside 4-TFS] ---> r  R2 d2 R'  @ 0000000010019 nodes with 0000005671731 4-TFS probes
  Solution [107] =  L2 U' F' f' R2 B' U2 u2 D  R2 r2 [inside 4-TFS] ---> r2 R2 d2 R'  @ 0000000010020 nodes with 0000005671732 4-TFS probes
  Solution [108] =  L2 U' F' f' R2 B' U2 u2 D  R2 l  [inside 4-TFS] ---> l' R2 d2 R'  @ 0000000010021 nodes with 0000005671733 4-TFS probes
  Solution [109] =  L2 U' F' f' R2 B' U2 u2 D  R2 l' [inside 4-TFS] ---> l  R2 d2 R'  @ 0000000010022 nodes with 0000005671735 4-TFS probes
  Solution [110] =  L2 U' F' f' R2 B' U2 u2 D  R2 l2 [inside 4-TFS] ---> l2 R2 d2 R'  @ 0000000010023 nodes with 0000005671736 4-TFS probes
  Solution [111] =  L2 U' F' f' R2 B' U2 u2 D  R2 L  [inside 4-TFS] ---> L' R2 d2 R'  @ 0000000010024 nodes with 0000005671737 4-TFS probes
  Solution [112] =  L2 U' F' f' R2 B' U2 u2 D  R2 L' [inside 4-TFS] ---> L  R2 d2 R'  @ 0000000010025 nodes with 0000005671738 4-TFS probes
  Solution [113] =  L2 U' F' f' R2 B' U2 u2 D  R2 L2 [inside 4-TFS] ---> L2 R2 d2 R'  @ 0000000010026 nodes with 0000005671740 4-TFS probes
  Solution [114] =  L2 U' F' f' R2 B' U2 u2 D  R2 F  [inside 4-TFS] ---> F' R2 d2 R'  @ 0000000010027 nodes with 0000005671741 4-TFS probes
  Solution [115] =  L2 U' F' f' R2 B' U2 u2 D  R2 F' [inside 4-TFS] ---> F  R2 d2 R'  @ 0000000010028 nodes with 0000005671742 4-TFS probes
  Solution [116] =  L2 U' F' f' R2 B' U2 u2 D  R2 F2 [inside 4-TFS] ---> F2 R2 d2 R'  @ 0000000010029 nodes with 0000005671743 4-TFS probes
  Solution [117] =  L2 U' F' f' R2 B' U2 u2 D  R2 f  [inside 4-TFS] ---> f' R2 d2 R'  @ 0000000010030 nodes with 0000005671744 4-TFS probes
  Solution [118] =  L2 U' F' f' R2 B' U2 u2 D  R2 f' [inside 4-TFS] ---> f  R2 d2 R'  @ 0000000010031 nodes with 0000005671745 4-TFS probes
  Solution [119] =  L2 U' F' f' R2 B' U2 u2 D  R2 b  [inside 4-TFS] ---> b' R2 d2 R'  @ 0000000010033 nodes with 0000005671746 4-TFS probes
  Solution [120] =  L2 U' F' f' R2 B' U2 u2 D  R2 b' [inside 4-TFS] ---> b  R2 d2 R'  @ 0000000010034 nodes with 0000005671747 4-TFS probes
  Solution [121] =  L2 U' F' f' R2 B' U2 u2 D  R2 B  [inside 4-TFS] ---> B' R2 d2 R'  @ 0000000010036 nodes with 0000005671748 4-TFS probes
  Solution [122] =  L2 U' F' f' R2 B' U2 u2 D  R2 B' [inside 4-TFS] ---> B  R2 d2 R'  @ 0000000010037 nodes with 0000005671749 4-TFS probes
  Solution [123] =  L2 U' F' f' R2 B' U2 u2 D  R2 B2 [inside 4-TFS] ---> B2 R2 d2 R'  @ 0000000010038 nodes with 0000005671751 4-TFS probes
  Solution [124] =  L2 U' F' f' R2 B' U2 d2 D  R  U  [inside 4-TFS] ---> U' R' u2 R'  @ 0000000010039 nodes with 0000005671752 4-TFS probes
  Solution [125] =  L2 U' F' f' R2 B' U2 d2 D  R  U' [inside 4-TFS] ---> U  R' u2 R'  @ 0000000010040 nodes with 0000005671753 4-TFS probes
  Solution [126] =  L2 U' F' f' R2 B' U2 d2 D  R  U2 [inside 4-TFS] ---> U2 R' u2 R'  @ 0000000010041 nodes with 0000005671754 4-TFS probes
  Solution [127] =  L2 U' F' f' R2 B' U2 d2 D  R  u  [inside 4-TFS] ---> u' R' u2 R'  @ 0000000010042 nodes with 0000005671755 4-TFS probes
  Solution [128] =  L2 U' F' f' R2 B' U2 d2 D  R  u' [inside 4-TFS] ---> u  R' u2 R'  @ 0000000010043 nodes with 0000005671756 4-TFS probes
  Solution [129] =  L2 U' F' f' R2 B' U2 d2 D  R  u2 [inside 4-TFS] ---> u2 R' u2 R'  @ 0000000010044 nodes with 0000005671757 4-TFS probes
  Solution [130] =  L2 U' F' f' R2 B' U2 d2 D  R  d  [inside 4-TFS] ---> d' R' u2 R'  @ 0000000010045 nodes with 0000005671758 4-TFS probes
  Solution [131] =  L2 U' F' f' R2 B' U2 d2 D  R  d' [inside 4-TFS] ---> d  R' u2 R'  @ 0000000010046 nodes with 0000005671759 4-TFS probes
  Solution [132] =  L2 U' F' f' R2 B' U2 d2 D  R  d2 [inside 4-TFS] ---> d2 R' u2 R'  @ 0000000010047 nodes with 0000005671760 4-TFS probes
  Solution [133] =  L2 U' F' f' R2 B' U2 d2 D  R  D  [inside 4-TFS] ---> D' R' u2 R'  @ 0000000010048 nodes with 0000005671761 4-TFS probes
  Solution [134] =  L2 U' F' f' R2 B' U2 d2 D  R  D' [inside 4-TFS] ---> D  R' u2 R'  @ 0000000010049 nodes with 0000005671762 4-TFS probes
  Solution [135] =  L2 U' F' f' R2 B' U2 d2 D  R  D2 [inside 4-TFS] ---> D2 R' u2 R'  @ 0000000010050 nodes with 0000005671763 4-TFS probes
  Solution [136] =  L2 U' F' f' R2 B' U2 d2 D  R  r  [inside 4-TFS] ---> r' R' u2 R'  @ 0000000010051 nodes with 0000005671764 4-TFS probes
  Solution [137] =  L2 U' F' f' R2 B' U2 d2 D  R  r' [inside 4-TFS] ---> r  R' u2 R'  @ 0000000010052 nodes with 0000005671765 4-TFS probes
  Solution [138] =  L2 U' F' f' R2 B' U2 d2 D  R  r2 [inside 4-TFS] ---> r2 R' u2 R'  @ 0000000010053 nodes with 0000005671767 4-TFS probes
  Solution [139] =  L2 U' F' f' R2 B' U2 d2 D  R  l  [inside 4-TFS] ---> l' R' u2 R'  @ 0000000010054 nodes with 0000005671768 4-TFS probes
  Solution [140] =  L2 U' F' f' R2 B' U2 d2 D  R  l' [inside 4-TFS] ---> l  R' u2 R'  @ 0000000010055 nodes with 0000005671769 4-TFS probes
  Solution [141] =  L2 U' F' f' R2 B' U2 d2 D  R  l2 [inside 4-TFS] ---> l2 R' u2 R'  @ 0000000010056 nodes with 0000005671770 4-TFS probes
  Solution [142] =  L2 U' F' f' R2 B' U2 d2 D  R  L  [inside 4-TFS] ---> L' R' u2 R'  @ 0000000010057 nodes with 0000005671771 4-TFS probes
  Solution [143] =  L2 U' F' f' R2 B' U2 d2 D  R  L' [inside 4-TFS] ---> L  R' u2 R'  @ 0000000010058 nodes with 0000005671772 4-TFS probes
  Solution [144] =  L2 U' F' f' R2 B' U2 d2 D  R  L2 [inside 4-TFS] ---> L2 R' u2 R'  @ 0000000010059 nodes with 0000005671773 4-TFS probes
  Solution [145] =  L2 U' F' f' R2 B' U2 d2 D  R  F  [inside 4-TFS] ---> F' R' u2 R'  @ 0000000010060 nodes with 0000005671774 4-TFS probes
  Solution [146] =  L2 U' F' f' R2 B' U2 d2 D  R  F' [inside 4-TFS] ---> F  R' u2 R'  @ 0000000010061 nodes with 0000005671775 4-TFS probes
  Solution [147] =  L2 U' F' f' R2 B' U2 d2 D  R  F2 [inside 4-TFS] ---> F2 R' u2 R'  @ 0000000010062 nodes with 0000005671776 4-TFS probes
  Solution [148] =  L2 U' F' f' R2 B' U2 d2 D  R  f  [inside 4-TFS] ---> f' R' u2 R'  @ 0000000010063 nodes with 0000005671777 4-TFS probes
  Solution [149] =  L2 U' F' f' R2 B' U2 d2 D  R  f' [inside 4-TFS] ---> f  R' u2 R'  @ 0000000010064 nodes with 0000005671778 4-TFS probes
  Solution [150] =  L2 U' F' f' R2 B' U2 d2 D  R  f2 [inside 4-TFS] ---> f2 R' u2 R'  @ 0000000010065 nodes with 0000005671779 4-TFS probes
  Solution [151] =  L2 U' F' f' R2 B' U2 d2 D  R  b  [inside 4-TFS] ---> b' R' u2 R'  @ 0000000010066 nodes with 0000005671780 4-TFS probes
  Solution [152] =  L2 U' F' f' R2 B' U2 d2 D  R  b' [inside 4-TFS] ---> b  R' u2 R'  @ 0000000010067 nodes with 0000005671781 4-TFS probes
  Solution [153] =  L2 U' F' f' R2 B' U2 d2 D  R  b2 [inside 4-TFS] ---> b2 R' u2 R'  @ 0000000010068 nodes with 0000005671782 4-TFS probes
  Solution [154] =  L2 U' F' f' R2 B' U2 d2 D  R  B  [inside 4-TFS] ---> B' R' u2 R'  @ 0000000010069 nodes with 0000005671784 4-TFS probes
  Solution [155] =  L2 U' F' f' R2 B' U2 d2 D  R  B' [inside 4-TFS] ---> B  R' u2 R'  @ 0000000010070 nodes with 0000005671785 4-TFS probes
  Solution [156] =  L2 U' F' f' R2 B' U2 d2 D  R  B2 [inside 4-TFS] ---> B2 R' u2 R'  @ 0000000010071 nodes with 0000005671786 4-TFS probes
  Solution [157] =  L2 U' F' f' R2 B' U2 d2 D  R' U  [inside 4-TFS] ---> U' R  u2 R'  @ 0000000010072 nodes with 0000005671787 4-TFS probes
  Solution [158] =  L2 U' F' f' R2 B' U2 d2 D  R' U' [inside 4-TFS] ---> U  R  u2 R'  @ 0000000010073 nodes with 0000005671788 4-TFS probes
  Solution [159] =  L2 U' F' f' R2 B' U2 d2 D  R' U2 [inside 4-TFS] ---> U2 R  u2 R'  @ 0000000010074 nodes with 0000005671790 4-TFS probes
  Solution [160] =  L2 U' F' f' R2 B' U2 d2 D  R' u  [inside 4-TFS] ---> u' R  u2 R'  @ 0000000010075 nodes with 0000005671791 4-TFS probes
  Solution [161] =  L2 U' F' f' R2 B' U2 d2 D  R' u' [inside 4-TFS] ---> u  R  u2 R'  @ 0000000010076 nodes with 0000005671792 4-TFS probes
  Solution [162] =  L2 U' F' f' R2 B' U2 d2 D  R' u2 [inside 4-TFS] ---> u2 R  u2 R'  @ 0000000010077 nodes with 0000005671793 4-TFS probes
  Solution [163] =  L2 U' F' f' R2 B' U2 d2 D  R' d  [inside 4-TFS] ---> d' R  u2 R'  @ 0000000010078 nodes with 0000005671794 4-TFS probes
  Solution [164] =  L2 U' F' f' R2 B' U2 d2 D  R' d' [inside 4-TFS] ---> d  R  u2 R'  @ 0000000010079 nodes with 0000005671795 4-TFS probes
  Solution [165] =  L2 U' F' f' R2 B' U2 d2 D  R' d2 [inside 4-TFS] ---> d2 R  u2 R'  @ 0000000010080 nodes with 0000005671796 4-TFS probes
  Solution [166] =  L2 U' F' f' R2 B' U2 d2 D  R' D  [inside 4-TFS] ---> D' R  u2 R'  @ 0000000010081 nodes with 0000005671797 4-TFS probes
  Solution [167] =  L2 U' F' f' R2 B' U2 d2 D  R' D' [inside 4-TFS] ---> D  R  u2 R'  @ 0000000010082 nodes with 0000005671798 4-TFS probes
  Solution [168] =  L2 U' F' f' R2 B' U2 d2 D  R' D2 [inside 4-TFS] ---> D2 R  u2 R'  @ 0000000010083 nodes with 0000005671799 4-TFS probes
  Solution [169] =  L2 U' F' f' R2 B' U2 d2 D  R' r  [inside 4-TFS] ---> r' R  u2 R'  @ 0000000010084 nodes with 0000005671800 4-TFS probes
  Solution [170] =  L2 U' F' f' R2 B' U2 d2 D  R' r' [inside 4-TFS] ---> r  R  u2 R'  @ 0000000010085 nodes with 0000005671801 4-TFS probes
  Solution [171] =  L2 U' F' f' R2 B' U2 d2 D  R' r2 [inside 4-TFS] ---> r2 R  u2 R'  @ 0000000010086 nodes with 0000005671802 4-TFS probes
  Solution [172] =  L2 U' F' f' R2 B' U2 d2 D  R' l  [inside 4-TFS] ---> l' R  u2 R'  @ 0000000010087 nodes with 0000005671803 4-TFS probes
  Solution [173] =  L2 U' F' f' R2 B' U2 d2 D  R' l' [inside 4-TFS] ---> l  R  u2 R'  @ 0000000010088 nodes with 0000005671804 4-TFS probes
  Solution [174] =  L2 U' F' f' R2 B' U2 d2 D  R' l2 [inside 4-TFS] ---> l2 R  u2 R'  @ 0000000010089 nodes with 0000005671805 4-TFS probes
  Solution [175] =  L2 U' F' f' R2 B' U2 d2 D  R' L  [inside 4-TFS] ---> L' R  u2 R'  @ 0000000010090 nodes with 0000005671806 4-TFS probes
  Solution [176] =  L2 U' F' f' R2 B' U2 d2 D  R' L' [inside 4-TFS] ---> L  R  u2 R'  @ 0000000010091 nodes with 0000005671807 4-TFS probes
  Solution [177] =  L2 U' F' f' R2 B' U2 d2 D  R' L2 [inside 4-TFS] ---> L2 R  u2 R'  @ 0000000010092 nodes with 0000005671808 4-TFS probes
  Solution [178] =  L2 U' F' f' R2 B' U2 d2 D  R' F  [inside 4-TFS] ---> F' R  u2 R'  @ 0000000010093 nodes with 0000005671809 4-TFS probes
  Solution [179] =  L2 U' F' f' R2 B' U2 d2 D  R' F' [inside 4-TFS] ---> F  R  u2 R'  @ 0000000010094 nodes with 0000005671810 4-TFS probes
  Solution [180] =  L2 U' F' f' R2 B' U2 d2 D  R' F2 [inside 4-TFS] ---> F2 R  u2 R'  @ 0000000010095 nodes with 0000005671811 4-TFS probes
  Solution [181] =  L2 U' F' f' R2 B' U2 d2 D  R' f  [inside 4-TFS] ---> f' R  u2 R'  @ 0000000010096 nodes with 0000005671812 4-TFS probes
  Solution [182] =  L2 U' F' f' R2 B' U2 d2 D  R' f' [inside 4-TFS] ---> f  R  u2 R'  @ 0000000010097 nodes with 0000005671813 4-TFS probes
  Solution [183] =  L2 U' F' f' R2 B' U2 d2 D  R' f2 [inside 4-TFS] ---> f2 R  u2 R'  @ 0000000010098 nodes with 0000005671814 4-TFS probes
  Solution [184] =  L2 U' F' f' R2 B' U2 d2 D  R' b  [inside 4-TFS] ---> b' R  u2 R'  @ 0000000010099 nodes with 0000005671815 4-TFS probes
  Solution [185] =  L2 U' F' f' R2 B' U2 d2 D  R' b' [inside 4-TFS] ---> b  R  u2 R'  @ 0000000010100 nodes with 0000005671816 4-TFS probes
  Solution [186] =  L2 U' F' f' R2 B' U2 d2 D  R' b2 [inside 4-TFS] ---> b2 R  u2 R'  @ 0000000010101 nodes with 0000005671817 4-TFS probes
  Solution [187] =  L2 U' F' f' R2 B' U2 d2 D  R' B  [inside 4-TFS] ---> B' R  u2 R'  @ 0000000010102 nodes with 0000005671818 4-TFS probes
  Solution [188] =  L2 U' F' f' R2 B' U2 d2 D  R' B' [inside 4-TFS] ---> B  R  u2 R'  @ 0000000010103 nodes with 0000005671819 4-TFS probes
  Solution [189] =  L2 U' F' f' R2 B' U2 d2 D  R' B2 [inside 4-TFS] ---> B2 R  u2 R'  @ 0000000010104 nodes with 0000005671820 4-TFS probes
  Solution [190] =  L2 U' F' f' R2 B' U2 d2 D  R2 u  [inside 4-TFS] ---> u' R2 u2 R'  @ 0000000010108 nodes with 0000005671821 4-TFS probes
  Solution [191] =  L2 U' F' f' R2 B' U2 d2 D  R2 u' [inside 4-TFS] ---> u  R2 u2 R'  @ 0000000010109 nodes with 0000005671822 4-TFS probes
  Solution [192] =  L2 U' F' f' R2 B' U2 d2 D  R2 u2 [inside 4-TFS] ---> u2 R2 u2 R'  @ 0000000010110 nodes with 0000005671823 4-TFS probes
  Solution [193] =  L2 U' F' f' R2 B' U2 d2 D  R2 d  [inside 4-TFS] ---> d' R2 u2 R'  @ 0000000010111 nodes with 0000005671824 4-TFS probes
  Solution [194] =  L2 U' F' f' R2 B' U2 d2 D  R2 d' [inside 4-TFS] ---> d  R2 u2 R'  @ 0000000010112 nodes with 0000005671825 4-TFS probes
  Solution [195] =  L2 U' F' f' R2 B' U2 d2 D  R2 d2 [inside 4-TFS] ---> d2 R2 u2 R'  @ 0000000010113 nodes with 0000005671826 4-TFS probes
  Solution [196] =  L2 U' F' f' R2 B' U2 d2 D  R2 r  [inside 4-TFS] ---> r' R2 u2 R'  @ 0000000010117 nodes with 0000005671827 4-TFS probes
  Solution [197] =  L2 U' F' f' R2 B' U2 d2 D  R2 r' [inside 4-TFS] ---> r  R2 u2 R'  @ 0000000010118 nodes with 0000005671828 4-TFS probes
  Solution [198] =  L2 U' F' f' R2 B' U2 d2 D  R2 r2 [inside 4-TFS] ---> r2 R2 u2 R'  @ 0000000010119 nodes with 0000005671829 4-TFS probes
  Solution [199] =  L2 U' F' f' R2 B' U2 d2 D  R2 l  [inside 4-TFS] ---> l' R2 u2 R'  @ 0000000010120 nodes with 0000005671830 4-TFS probes
  Solution [200] =  L2 U' F' f' R2 B' U2 d2 D  R2 l' [inside 4-TFS] ---> l  R2 u2 R'  @ 0000000010121 nodes with 0000005671832 4-TFS probes
  Solution [201] =  L2 U' F' f' R2 B' U2 d2 D  R2 l2 [inside 4-TFS] ---> l2 R2 u2 R'  @ 0000000010122 nodes with 0000005671833 4-TFS probes
  Solution [202] =  L2 U' F' f' R2 B' U2 d2 D  R2 L  [inside 4-TFS] ---> L' R2 u2 R'  @ 0000000010123 nodes with 0000005671834 4-TFS probes
  Solution [203] =  L2 U' F' f' R2 B' U2 d2 D  R2 L' [inside 4-TFS] ---> L  R2 u2 R'  @ 0000000010124 nodes with 0000005671835 4-TFS probes
  Solution [204] =  L2 U' F' f' R2 B' U2 d2 D  R2 L2 [inside 4-TFS] ---> L2 R2 u2 R'  @ 0000000010125 nodes with 0000005671836 4-TFS probes
  Solution [205] =  L2 U' F' f' R2 B' U2 d2 D  R2 F  [inside 4-TFS] ---> F' R2 u2 R'  @ 0000000010126 nodes with 0000005671837 4-TFS probes
  Solution [206] =  L2 U' F' f' R2 B' U2 d2 D  R2 F' [inside 4-TFS] ---> F  R2 u2 R'  @ 0000000010127 nodes with 0000005671840 4-TFS probes
  Solution [207] =  L2 U' F' f' R2 B' U2 d2 D  R2 F2 [inside 4-TFS] ---> F2 R2 u2 R'  @ 0000000010128 nodes with 0000005671841 4-TFS probes
  Solution [208] =  L2 U' F' f' R2 B' U2 d2 D  R2 f  [inside 4-TFS] ---> f' R2 u2 R'  @ 0000000010129 nodes with 0000005671842 4-TFS probes
  Solution [209] =  L2 U' F' f' R2 B' U2 d2 D  R2 f' [inside 4-TFS] ---> f  R2 u2 R'  @ 0000000010130 nodes with 0000005671843 4-TFS probes
  Solution [210] =  L2 U' F' f' R2 B' U2 d2 D  R2 b  [inside 4-TFS] ---> b' R2 u2 R'  @ 0000000010132 nodes with 0000005671844 4-TFS probes
  Solution [211] =  L2 U' F' f' R2 B' U2 d2 D  R2 b' [inside 4-TFS] ---> b  R2 u2 R'  @ 0000000010133 nodes with 0000005671845 4-TFS probes
  Solution [212] =  L2 U' F' f' R2 B' U2 d2 D  R2 B  [inside 4-TFS] ---> B' R2 u2 R'  @ 0000000010135 nodes with 0000005671846 4-TFS probes
  Solution [213] =  L2 U' F' f' R2 B' U2 d2 D  R2 B' [inside 4-TFS] ---> B  R2 u2 R'  @ 0000000010136 nodes with 0000005671847 4-TFS probes
  Solution [214] =  L2 U' F' f' R2 B' U2 d2 D  R2 B2 [inside 4-TFS] ---> B2 R2 u2 R'  @ 0000000010137 nodes with 0000005671848 4-TFS probes
  Solution [215] =  L2 U' F' f' R2 B' u2 d2 D  R' U  [inside 4-TFS] ---> U' R  U2 R'  @ 0000000010252 nodes with 0000005671876 4-TFS probes
  Solution [216] =  L2 U' F' f' R2 B' u2 d2 D  R' U' [inside 4-TFS] ---> U  R  U2 R'  @ 0000000010253 nodes with 0000005671877 4-TFS probes
  Solution [217] =  L2 U' F' f' R2 B' u2 d2 D  R' U2 [inside 4-TFS] ---> U2 R  U2 R'  @ 0000000010254 nodes with 0000005671878 4-TFS probes
  Solution [218] =  L2 U' F' f' R2 B' u2 d2 D  R' u  [inside 4-TFS] ---> u' R  U2 R'  @ 0000000010255 nodes with 0000005671879 4-TFS probes
  Solution [219] =  L2 U' F' f' R2 B' u2 d2 D  R' u' [inside 4-TFS] ---> u  R  U2 R'  @ 0000000010256 nodes with 0000005671880 4-TFS probes
  Solution [220] =  L2 U' F' f' R2 B' u2 d2 D  R' u2 [inside 4-TFS] ---> u2 R  U2 R'  @ 0000000010257 nodes with 0000005671881 4-TFS probes
  Solution [221] =  L2 U' F' f' R2 B' u2 d2 D  R' d  [inside 4-TFS] ---> d' R  U2 R'  @ 0000000010258 nodes with 0000005671882 4-TFS probes
  Solution [222] =  L2 U' F' f' R2 B' u2 d2 D  R' d' [inside 4-TFS] ---> d  R  U2 R'  @ 0000000010259 nodes with 0000005671883 4-TFS probes
  Solution [223] =  L2 U' F' f' R2 B' u2 d2 D  R' d2 [inside 4-TFS] ---> d2 R  U2 R'  @ 0000000010260 nodes with 0000005671884 4-TFS probes
  Solution [224] =  L2 U' F' f' R2 B' u2 d2 D  R' D  [inside 4-TFS] ---> D' R  U2 R'  @ 0000000010261 nodes with 0000005671885 4-TFS probes
  Solution [225] =  L2 U' F' f' R2 B' u2 d2 D  R' D' [inside 4-TFS] ---> D  R  U2 R'  @ 0000000010262 nodes with 0000005671886 4-TFS probes
  Solution [226] =  L2 U' F' f' R2 B' u2 d2 D  R' D2 [inside 4-TFS] ---> D2 R  U2 R'  @ 0000000010263 nodes with 0000005671887 4-TFS probes
  Solution [227] =  L2 U' F' f' R2 B' u2 d2 D  R' r  [inside 4-TFS] ---> r' R  U2 R'  @ 0000000010264 nodes with 0000005671888 4-TFS probes
  Solution [228] =  L2 U' F' f' R2 B' u2 d2 D  R' r' [inside 4-TFS] ---> r  R  U2 R'  @ 0000000010265 nodes with 0000005671889 4-TFS probes
  Solution [229] =  L2 U' F' f' R2 B' u2 d2 D  R' r2 [inside 4-TFS] ---> r2 R  U2 R'  @ 0000000010266 nodes with 0000005671890 4-TFS probes
  Solution [230] =  L2 U' F' f' R2 B' u2 d2 D  R' l  [inside 4-TFS] ---> l' R  U2 R'  @ 0000000010267 nodes with 0000005671891 4-TFS probes
  Solution [231] =  L2 U' F' f' R2 B' u2 d2 D  R' l' [inside 4-TFS] ---> l  R  U2 R'  @ 0000000010268 nodes with 0000005671892 4-TFS probes
  Solution [232] =  L2 U' F' f' R2 B' u2 d2 D  R' l2 [inside 4-TFS] ---> l2 R  U2 R'  @ 0000000010269 nodes with 0000005671893 4-TFS probes
  Solution [233] =  L2 U' F' f' R2 B' u2 d2 D  R' L  [inside 4-TFS] ---> L' R  U2 R'  @ 0000000010270 nodes with 0000005671894 4-TFS probes
  Solution [234] =  L2 U' F' f' R2 B' u2 d2 D  R' L' [inside 4-TFS] ---> L  R  U2 R'  @ 0000000010271 nodes with 0000005671895 4-TFS probes
  Solution [235] =  L2 U' F' f' R2 B' u2 d2 D  R' L2 [inside 4-TFS] ---> L2 R  U2 R'  @ 0000000010272 nodes with 0000005671896 4-TFS probes
  Solution [236] =  L2 U' F' f' R2 B' u2 d2 D  R' F  [inside 4-TFS] ---> F' R  U2 R'  @ 0000000010273 nodes with 0000005671897 4-TFS probes
  Solution [237] =  L2 U' F' f' R2 B' u2 d2 D  R' F' [inside 4-TFS] ---> F  R  U2 R'  @ 0000000010274 nodes with 0000005671898 4-TFS probes
  Solution [238] =  L2 U' F' f' R2 B' u2 d2 D  R' F2 [inside 4-TFS] ---> F2 R  U2 R'  @ 0000000010275 nodes with 0000005671899 4-TFS probes
  Solution [239] =  L2 U' F' f' R2 B' u2 d2 D  R' f  [inside 4-TFS] ---> f' R  U2 R'  @ 0000000010276 nodes with 0000005671900 4-TFS probes
  Solution [240] =  L2 U' F' f' R2 B' u2 d2 D  R' f' [inside 4-TFS] ---> f  R  U2 R'  @ 0000000010277 nodes with 0000005671901 4-TFS probes
  Solution [241] =  L2 U' F' f' R2 B' u2 d2 D  R' f2 [inside 4-TFS] ---> f2 R  U2 R'  @ 0000000010278 nodes with 0000005671902 4-TFS probes
  Solution [242] =  L2 U' F' f' R2 B' u2 d2 D  R' b  [inside 4-TFS] ---> b' R  U2 R'  @ 0000000010279 nodes with 0000005671903 4-TFS probes
  Solution [243] =  L2 U' F' f' R2 B' u2 d2 D  R' b' [inside 4-TFS] ---> b  R  U2 R'  @ 0000000010280 nodes with 0000005671904 4-TFS probes
  Solution [244] =  L2 U' F' f' R2 B' u2 d2 D  R' b2 [inside 4-TFS] ---> b2 R  U2 R'  @ 0000000010281 nodes with 0000005671905 4-TFS probes
  Solution [245] =  L2 U' F' f' R2 B' u2 d2 D  R' B  [inside 4-TFS] ---> B' R  U2 R'  @ 0000000010282 nodes with 0000005671906 4-TFS probes
  Solution [246] =  L2 U' F' f' R2 B' u2 d2 D  R' B' [inside 4-TFS] ---> B  R  U2 R'  @ 0000000010283 nodes with 0000005671907 4-TFS probes
  Solution [247] =  L2 U' F' f' R2 B' u2 d2 D  R' B2 [inside 4-TFS] ---> B2 R  U2 R'  @ 0000000010284 nodes with 0000005671908 4-TFS probes
 ?Solution [248] =  L2 U' b' B' U2 u2 d2 f  b' B' U' [inside 3-TFS] ---> D' U  R'  @ 0000000014777 nodes with 0000000223923 3-TFS probes          tive!
  Solution [249] =  L2 U' b' B' U2 u2 d2 f  b' B' U2 [inside 3-TFS] ---> D' U2 R'  @ 0000000014778 nodes with 0000000223924 3-TFS probes
  Solution [250] =  L2 U' b' B' U2 u2 d2 f  b' B' u  [inside 3-TFS] ---> D' u' R'  @ 0000000014779 nodes with 0000000223925 3-TFS probes
  Solution [251] =  L2 U' b' B' U2 u2 d2 f  b' B' u' [inside 3-TFS] ---> D' u  R'  @ 0000000014780 nodes with 0000000223926 3-TFS probes
  Solution [252] =  L2 U' b' B' U2 u2 d2 f  b' B' u2 [inside 3-TFS] ---> D' u2 R'  @ 0000000014781 nodes with 0000000223927 3-TFS probes
  Solution [253] =  L2 U' b' B' U2 u2 d2 f  b' B' d  [inside 3-TFS] ---> D' d' R'  @ 0000000014782 nodes with 0000000223928 3-TFS probes
  Solution [254] =  L2 U' b' B' U2 u2 d2 f  b' B' d' [inside 3-TFS] ---> D' d  R'  @ 0000000014783 nodes with 0000000223929 3-TFS probes
  Solution [255] =  L2 U' b' B' U2 u2 d2 f  b' B' d2 [inside 3-TFS] ---> D' d2 R'  @ 0000000014784 nodes with 0000000223930 3-TFS probes
  Completed searching 0000000000024909  nodes through DEPTHS 11-16:     LEAF NODES: 0000000009239511 cut BRANCHES: 0000029679219459 pruned
  TFS Database probes 0000000105173517: 1-TFS probes 0000000000000253: 2-TFS probes 0000000000007842: 3-TFS probes 0000000000224040
  TFS Database misses 0000000121724548: 4-TFS probes 0000000005675374: 5-TFS probes 0000000099266008: 6-TFS probes 0000000000000000


  ****

  ===========================================================================================================================================

  Search completed.
```




In summary, I would consider it a bug that the move generator is using rules that assume the orientation of the cube doesn't matter, but the program still considers the orientation of the cube to matter for determining whether or not the cube is solved. So in addition to not finding the real optimal solution, it has to search extra deep to find the optimal "original cube orientation" solution. In fact, it might be a little bit of luck involved in this case that it even finds a solution that cancels down to what I'm presuming to be the optimal "original cube orientation" solution.

I was wondering if anyone has looked for corner swap solutions. In addition to the traditional case:

F2 U' F2 D R2 B2 U B2 D' R2 U r2 U2 r2 U2 u2 r2 u2

there are essentially four other cases, it appears to me:

R2 D' R F2 U' F2 D R2 B2 U B2 D' R2 U r2 U2 r2 U2 u2 r2 u2 R' D R2

L2 U L2 F2 U' F2 D R2 B2 U B2 D' R2 U r2 U2 r2 U2 u2 r2 u2 L2 U' L2

R' F2 U' F2 D R2 B2 U B2 D' R2 U r2 U2 r2 U2 u2 r2 u2 R

R2 F2 U' F2 D R2 B2 U B2 D' R2 U r2 U2 r2 U2 u2 r2 u2 R2

These can take good advantage of corners pruning, but the solutions still seem to be a bit deep for my SSTM program.


----------



## unsolved (May 6, 2014)

uberCuber said:


> I know this kind of thing has been discussed before somewhere, but I don't think it ever got as far as trying to assign specific numbers to each move. The problem is that not only does it depend on the person, but it also depends on the cube itself. It is harder to perform slice turns quickly on some cubes, while others might not have as fast outer layers. And depending on tensions, performing a lot of D moves (say, the common <R,U,D> E-perm) may or may not be easy.



It is possibly too subjective. Perhaps the best idea would be to just cluster all of the solves together, stratified by turn metric, and let the cubers decide for themselves.



cuBerBruce said:


> I tried the following scramble on OO4x4x4 version 1.2.3 and 1.2.8:
> 
> L l r' F f b' R r l' F2 f2 b2 L l U u d' R2 r2 l2



Thanks Bruce, this is the kind of feedback I need! Specific scrambles, nice summary of what you think is going on, etc.

OO_4x4x4 presently has a "preferred orientation" but, theoretically, it still should find any solution, even one that might be optimal at another orientation. I have not examined that subset of code in a while, it is clearly time to revisit.

This has me a little concerned:


```
Completed searching 0000000000000000  nodes through DEPTHS 06-11:     LEAF NODES: 0000000000006318 cut BRANCHES: 0000000000000677 pruned
```

Depth 6 filtered out every node! Yet, somehow, only 6318 were leaf nodes (moves pruned after move generation but before sending them onward to the search) and only 677 branches (moves not yet generated because there was no possible way to solve those 677 cube positions in the remaining depth of search). Definitely a move generator bug.

I am in the process now of flattening out a sparsely-populated matrix into a collapsed linear array of moves with no dependency on axis of rotation or move group that will still avoid cycling positions. It's a little more complex than it sounds.

Thanks for an excellent bug report. Stay tuned!



uberCuber said:


> I know this kind of thing has been discussed before somewhere, but I don't think it ever got as far as trying to assign specific numbers to each move. The problem is that not only does it depend on the person, but it also depends on the cube itself. It is harder to perform slice turns quickly on some cubes, while others might not have as fast outer layers. And depending on tensions, performing a lot of D moves (say, the common <R,U,D> E-perm) may or may not be easy.



It is possibly too subjective. Perhaps the best idea would be to just cluster all of the solves together, stratified by turn metric, and let the cubers decide for themselves.



cuBerBruce said:


> I tried the following scramble on OO4x4x4 version 1.2.3 and 1.2.8:
> 
> L l r' F f b' R r l' F2 f2 b2 L l U u d' R2 r2 l2



Thanks Bruce, this is the kind of feedback I need! Specific scrambles, nice summary of what you think is going on, etc.

OO_4x4x4 presently has a "preferred orientation" but, theoretically, it still should find any solution, even one that might be optimal at another orientation. I have not examined that subset of code in a while, it is clearly time to revisit.

This has me a little concerned:


```
Completed searching 0000000000000000  nodes through DEPTHS 06-11:     LEAF NODES: 0000000000006318 cut BRANCHES: 0000000000000677 pruned
```

Depth 6 filtered out every node! Yet, somehow, only 6318 were leaf nodes (moves pruned after move generation but before sending them onward to the search) and only 677 branches (moves not yet generated because there was no possible way to solve those 677 cube positions in the remaining depth of search). Definitely a move generator bug.

I am in the process now of flattening out a sparsely-populated matrix into a collapsed linear array of moves with no dependency on axis of rotation or move group that will still avoid cycling positions. It's a little more complex than it sounds.

Thanks for an excellent bug report. Stay tuned!

*UPDATE*: I spent the last day re-coding the move generator and verifying the uniqueness of positions in the TFS databases. It turns out there were duplicate entries in the TFS as a result of the move generator still producing moves that had functional equivalents earlier in the process, despite the fact that it used rules for axis rotation/move grouping + my parallel rotation pruner.

At depths 1 and 2, all positions were unique. At depth 3, there are only *28812 *unique positions, not 28836 as with the "rotation rules" version of the move generator. At depth 4, there are *806694 *unique positions, not 810648 with my parallel leaf node pruner or 810891 using only the Jakube move generator idea.

I obtained these numbers by using a full-width non-descriminater, generating all 36 possible moves at each depth, computing the "true 4x4x4 index" using that huge formula that enumerates all of the possible positions, and storing that 4x4x4 true index in an ever-growing linked list. For each move generated, I computed the true index, scanned the list, and if there was no match I appended the linked list with the new entry. If an index was already generated and a "cube match" was found, I printed out the turn sequence and the index that matched. Since I also stored every unique cube and its turn sequence and index, I can now check to see that the collision data is correct.

It looks like move generation is a little more complex than I thought, so I'll be implementing a new version of it from scratch. This will not be a rules-based version, it will be a baseline native generator with no duplication and no orientation preferences. The trick is, how to accomplish all of this and still make it fast.


----------



## Christopher Mowla (May 28, 2014)

I just wanted to mention that I used the classic 3x3x3 setup R2 B2 U2 L U2 R' U2 R U2 F2 R F2 L' B2 R2, in Cube Explorer to find single dedge flip algorithms, and I found over a 100 more 23 single slice quarter turn solutions. I only searched through depth 18 (it took my PC 4 days to do that...I did let my PC rest every once in a while though), and thus I suspect that there are more 23q algorithms which can be created using this 3x3x3 setup, let alone with an optimal 4x4x4 solver in the single slice quarter turn metric.

If anyone has searched at a higher depth and has the 3x3x3 solutions, post them in a .txt file, and I will extract more 23qs and look again for any 21qs. Speaking of which, it's interesting to note that I found only 1 21q which was very close to being a single dedge flip algorithm: r' F l' F2 r F r' F2 D F' D l D' F D' l F2 r.

And two of the 23q's I found cancel to 22 block quarter turns
Rw' U2 B r' B' U2 F2 Lw' B2 r' B2 Lw B r F2 B' Rw (22,17)
Rw' U2 B r' B' U2 F2 Rw' U2 r' U2 Rw B r F2 B' Rw (22,17)
Which means that we could have just used the classic setup to find 22q algorithms all along!

Lastly, to Ed and Tom, I have added the (15,9) checkboard algorithm as well as the adjacent 4-cycle cases to the 4x4x4 parity algorithms page in the wiki, I have credited you guys, and I have updated the table which summarizes the move counts of 2-cycle and 4-cycle algorithms in 2 dedges.

For those who see that wiki page, you will notice that I added a lot more single dedge flip algorithms, including a bunch of 23qs, algorithms which just use two faces, and wide turn OLL parity algorithms which just use wide turns (that cannot be converted to single dedge flips simply by changing wide turns into inner slice turns).


----------



## unsolved (May 28, 2014)

cmowla said:


> I just wanted to mention that I used the classic 3x3x3 setup R2 B2 U2 L U2 R' U2 R U2 F2 R F2 L' B2 R2, in Cube Explorer to find single dedge flip algorithms, and I found over a 100 more 23 single slice quarter turn solutions. I only searched through depth 18 (it took my PC 4 days to do that...I did let my PC rest every once in a while though), and thus I suspect that there are more 23q algorithms which can be created using this 3x3x3 setup, let alone with an optimal 4x4x4 solver in the single slice quarter turn metric.
> 
> If anyone has searched at a higher depth and has the 3x3x3 solutions, post them in a .txt file, and I will extract more 23qs and look again for any 21qs. Speaking of which, it's interesting to note that I found only 1 21q which was very close to being a single dedge flip algorithm: r' F l' F2 r F r' F2 D F' D l D' F D' l F2 r.
> 
> ...



Thanks Chris. My program is currently in a state of disarray as I try to come up with a way to deal with the need for two separate move generators; one for the turns-from-solved database and the other for doing the regular solving. Once I work it out I'll repost a new version.


----------



## unsolved (Jun 1, 2014)

cmowla said:


> I just wanted to mention that I used the classic 3x3x3 setup R2 B2 U2 L U2 R' U2 R U2 F2 R F2 L' B2 R2, in Cube Explorer to find single dedge flip algorithms, and I found over a 100 more 23 single slice quarter turn solutions. I only searched through depth 18....



I loaded up the most stable version of the program with the 6-TFS and let it run through depth 15 and it came up with 39 solutions. Recall this is also the version of the program that has one orientation problem corrected but introduced a move generator issue that Bruce identified. Here are the 39 solutions it has for the single dedge flip:


```
Solutions To Scramble = U2 l2 U2 F2 l F2 l' F2 l2 U2 r U2 r' F2 l 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U2 l2 U2 F2 l  F2 l' F2 l2 [inside 6-TFS] ---> U2 r  U2 r' F2 l   @ 0000300337566 nodes with 0005968964715 6-TFS probes          
Solution [002] =  D2 r2 F2 r  F2 r' F2 D2 r2 [inside 6-TFS] ---> D2 r' F2 l  D2 l'  @ 0001381196532 nodes with 0010588162793 6-TFS probes          
Solution [003] =  D2 l2 F2 l' F2 l  F2 D2 l2 [inside 6-TFS] ---> D2 l  F2 r' D2 r   @ 0001396652763 nodes with 0010654223745 6-TFS probes          
Solution [004] =  r  F2 r' F2 l  B2 r2 B2 D2 [inside 6-TFS] ---> l  B2 r' B2 l2 D2  @ 0001839230742 nodes with 0012545741289 6-TFS probes          
Solution [005] =  r  F2 l' U2 l  U2 r2 F2 r' [inside 6-TFS] ---> F2 r  F2 U2 r2 U2  @ 0001840185623 nodes with 0012549819208 6-TFS probes          
Solution [006] =  r  B2 r' U2 r  U2 l2 B2 r' [inside 6-TFS] ---> U2 l  U2 F2 l2 F2  @ 0001896342278 nodes with 0012789865309 6-TFS probes          
Solution [007] =  r  B2 l' B2 l  D2 l2 D2 B2 [inside 6-TFS] ---> r  D2 l' D2 r2 B2  @ 0001897764723 nodes with 0012795938608 6-TFS probes          
Solution [008] =  r' U2 r  U2 l' D2 r2 D2 B2 [inside 6-TFS] ---> l' D2 r  D2 l2 B2  @ 0001908685542 nodes with 0012842528039 6-TFS probes          
Solution [009] =  r' U2 l  F2 l' F2 r2 U2 r  [inside 6-TFS] ---> U2 r' U2 F2 r2 F2  @ 0001910308522 nodes with 0012849452455 6-TFS probes          
Solution [010] =  r' D2 r  F2 r' F2 l2 D2 r  [inside 6-TFS] ---> F2 l' F2 U2 l2 U2  @ 0001965639928 nodes with 0013085921084 6-TFS probes          
Solution [011] =  r' D2 l  D2 l' B2 l2 B2 D2 [inside 6-TFS] ---> r' B2 l  B2 r2 D2  @ 0001966585410 nodes with 0013089963744 6-TFS probes          
Solution [012] =  r2 U2 l  B2 l' B2 U2 l' U2 [inside 6-TFS] ---> r  B2 r' B2 U2 r2  @ 0002081378673 nodes with 0013580493163 6-TFS probes          
Solution [013] =  r2 U2 B2 r  B2 r' U2 l  U2 [inside 6-TFS] ---> B2 l  B2 l' U2 r2  @ 0002084039376 nodes with 0013591842724 6-TFS probes          
Solution [014] =  r2 D2 r' F2 r  F2 D2 r  D2 [inside 6-TFS] ---> l' F2 l  F2 D2 r2  @ 0002140408584 nodes with 0013832785446 6-TFS probes          
Solution [015] =  r2 D2 F2 l' F2 l  D2 r' D2 [inside 6-TFS] ---> F2 r' F2 r  D2 r2  @ 0002142488895 nodes with 0013841691582 6-TFS probes          
Solution [016] =  r2 F2 D2 r' D2 r  F2 l' F2 [inside 6-TFS] ---> D2 l' D2 l  F2 r2  @ 0002183460633 nodes with 0014016821256 6-TFS probes          
Solution [017] =  r2 F2 l' D2 l  D2 F2 l  F2 [inside 6-TFS] ---> r' D2 r  D2 F2 r2  @ 0002185835670 nodes with 0014026986531 6-TFS probes          
Solution [018] =  r2 B2 U2 l  U2 l' B2 r  B2 [inside 6-TFS] ---> U2 r  U2 r' B2 r2  @ 0002243572338 nodes with 0014273797377 6-TFS probes          
Solution [019] =  r2 B2 r  U2 r' U2 B2 r' B2 [inside 6-TFS] ---> l  U2 l' U2 B2 r2  @ 0002245309134 nodes with 0014281224987 6-TFS probes          
Solution [020] =  l  U2 r' F2 r  F2 l2 U2 l' [inside 6-TFS] ---> U2 l  U2 F2 l2 F2  @ 0002258402849 nodes with 0014337236730 6-TFS probes          
Solution [021] =  l  U2 l' U2 r  D2 l2 D2 B2 [inside 6-TFS] ---> r  D2 l' D2 r2 B2  @ 0002259333204 nodes with 0014341219561 6-TFS probes          
Solution [022] =  l  D2 r' D2 r  B2 r2 B2 D2 [inside 6-TFS] ---> l  B2 r' B2 l2 D2  @ 0002314069113 nodes with 0014575266774 6-TFS probes          
Solution [023] =  l  D2 l' F2 l  F2 r2 D2 l' [inside 6-TFS] ---> F2 r  F2 U2 r2 U2  @ 0002315242901 nodes with 0014580270190 6-TFS probes          
Solution [024] =  l' F2 r  U2 r' U2 l2 F2 l  [inside 6-TFS] ---> F2 l' F2 U2 l2 U2  @ 0002483211373 nodes with 0015298088015 6-TFS probes          
Solution [025] =  l' F2 l  F2 r' B2 l2 B2 D2 [inside 6-TFS] ---> r' B2 l  B2 r2 D2  @ 0002484471975 nodes with 0015303475169 6-TFS probes          
Solution [026] =  l' B2 r  B2 r' D2 r2 D2 B2 [inside 6-TFS] ---> l' D2 r  D2 l2 B2  @ 0002540144091 nodes with 0015541563808 6-TFS probes          
Solution [027] =  l' B2 l  U2 l' U2 r2 B2 l  [inside 6-TFS] ---> U2 r' U2 F2 r2 F2  @ 0002540943667 nodes with 0015544985276 6-TFS probes          
Solution [028] =  l2 U2 r' B2 r  B2 U2 r  U2 [inside 6-TFS] ---> l' B2 l  B2 U2 l2  @ 0002553295386 nodes with 0015597776118 6-TFS probes          
Solution [029] =  l2 U2 B2 l' B2 l  U2 r' U2 [inside 6-TFS] ---> B2 r' B2 r  U2 l2  @ 0002557330677 nodes with 0015615035891 6-TFS probes          
Solution [030] =  l2 D2 l  F2 l' F2 D2 l' D2 [inside 6-TFS] ---> r  F2 r' F2 D2 l2  @ 0002613328218 nodes with 0015854387055 6-TFS probes          
Solution [031] =  l2 D2 F2 r  F2 r' D2 l  D2 [inside 6-TFS] ---> F2 l  F2 l' D2 l2  @ 0002614558842 nodes with 0015859639704 6-TFS probes          
Solution [032] =  l2 F2 D2 l  D2 l' F2 r  F2 [inside 6-TFS] ---> D2 r  D2 r' F2 l2  @ 0002636231427 nodes with 0015952253373 6-TFS probes          
Solution [033] =  l2 F2 r  D2 r' D2 F2 r' F2 [inside 6-TFS] ---> l  D2 l' D2 F2 l2  @ 0002636591499 nodes with 0015953789571 6-TFS probes          
Solution [034] =  l2 B2 U2 r' U2 r  B2 l' B2 [inside 6-TFS] ---> U2 l' U2 l  B2 l2  @ 0002695098936 nodes with 0016203809119 6-TFS probes          
Solution [035] =  l2 B2 l' U2 l  U2 B2 l  B2 [inside 6-TFS] ---> r' U2 r  U2 B2 l2  @ 0002698233768 nodes with 0016217207196 6-TFS probes          
Solution [036] =  F2 r2 F2 U2 r  U2 r' U2 r2 [inside 6-TFS] ---> F2 l  F2 l' U2 r   @ 0003181802361 nodes with 0018284366998 6-TFS probes          
Solution [037] =  F2 l2 F2 U2 l' U2 l  U2 l2 [inside 6-TFS] ---> F2 r' F2 r  U2 l'  @ 0003201044637 nodes with 0018366592387 6-TFS probes          
Solution [038] =  B2 r2 U2 r' U2 r  U2 B2 r2 [inside 6-TFS] ---> B2 r  U2 l' B2 l   @ 0004299467040 nodes with 0023062332164 6-TFS probes          
Solution [039] =  B2 l2 U2 l  U2 l' U2 B2 l2 [inside 6-TFS] ---> B2 l' U2 r  B2 r'  @ 0004315638906 nodes with 0023131455903 6-TFS probes
```


----------



## Christopher Mowla (Jun 3, 2014)

unsolved said:


> I loaded up the most stable version of the program with the 6-TFS and let it run through depth 15 and it came up with 39 solutions. Recall this is also the version of the program that has one orientation problem corrected but introduced a move generator issue that Bruce identified. Here are the 39 solutions it has for the single dedge flip:


You are missing 209 algorithms.


Spoiler: Notes



There are 31 unique single dedge flip algorithms which begin with the move r, r', or r2, flip the UF dedge, and rotate the top center 180 degrees on the 4x4x4 supercube (inverses are also excluded).

I argue that there are actually 26, since the algs which end with B2 can be conjugated with B2 to create another 5 algs to have 26 + 5 = 31, where as these and the other 26 can be rotated, mirrored, inverted, to create duplicate solutions.

Similarly, when I mentioned that I found over 100 more 23q algorithms, they are unique in the same sense that the 26 algs of length (25,15) are unique, and I eliminated all algorithms which were equivalent to other algorithms when the wide turns that I put in them made them equal without performing a transformation


Your solver only found algs that were listed in the wiki (the 26), but the problem is, it only found 7 out of the 26.

I label them as they are in the wiki as well as how many copies of each your solver outputted, so that you can see which of the base algorithms you are missing.


Spoiler



Alg1(v1)(7)
r' U2 l F2 l' F2 r2 U2 r U2 r' U2 F2 r2 F2

Alg1(v4)(4)
r B2 r' U2 r U2 l2 B2 r' U2 l U2 F2 l2 F2

Alg2(v1)(4)
r B2 r' U2 l B2 l2 B2 U2 l U2 l' U2 l2 B2

Alg2(v4)(4)
r B2 l' B2 l D2 l2 D2 B2 r D2 l' D2 r2 B2

Alg2(v5)(4)
r' U2 r U2 l' D2 r2 D2 B2 l' D2 r D2 l2 B2

Alg3(v2)(8)
Rw2 B2 r U2 r' U2 B2 r' B2 l U2 l' U2 B2 Rw2

Alg3(v3)(8)
Rw2 F2 D2 r' D2 r F2 l' F2 D2 l' D2 l F2 Rw2


Clearly you have an algorithm for at least one transformation in Alg1, Alg2, and Alg3, but you have none for Alg4. Therefore your solver is not finding any algorithms in one of the 4 unique (25,15) paths.

Lastly, since your solver should find all possible optimal solutions, we should consider that your solver only found 7 out of 31 optimal algorithms, at least. (If you wish to find all "possible" solutions which flip the UF dedge on the 4x4x4 6-color cube, then we have (26+5)(8) = 248 algorithms your solver should find, not just 39 as you have).

For example, if I was to also include the other 5 algs, let's label them as:
r2 U2 r' U2 r U2 B2 r2 B2 r U2 l' B2 l B2 Alg.5(v1)
r2 D2 r F2 l' F2 U2 r2 D2 r' U2 r B2 r' B2 Alg.5(v2)
r2 U2 l' B2 r B2 D2 r2 D2 l U2 l' B2 l B2 Alg.5(v3)
r2 D2 l D2 r' B2 D2 l2 D2 l' B2 l B2 r' B2 Alg.5(v4)
r2 D2 l D2 r' B2 D2 l2 D2 r' U2 l U2 l' B2 Alg.5(v5)

I wrote a program to generate all of these algs from the 5 here (the "Alg.5" set above) in addition to the 26 in the wiki.

To be safe, I did all of the variations of the following (every possible permutation of compositions of Mirror[], Inverse[], and Rotation[]), and I deleted duplicates also with my program using a 2-dimensional list to store the algorithm as one argument and the relationship as another argument. Half of the relationships listed in this spoiler were deleted by the program along with their corresponding duplicate algorithm, as you will see in the code block below.


Spoiler



alg

MirrorTwizzle linkInverse[alg]
Rotation[alg]

Mirror[Inverse[alg]]
Mirror[Rotation[alg]]

Inverse[Rotation[alg]]
Inverse[Mirror[alg]]

Rotation[Mirror[alg]]
Rotation[Inverse[alg]]

Mirror[Inverse[Rotation[alg]]]
Mirror[Rotation[Inverse[alg]]]

Inverse[Mirror[Rotation[alg]]]
Inverse[Rotation[Mirror[alg]]]

Rotation[Mirror[Inverse[alg]]]
Rotation[Inverse[Mirror[alg]]][/spoiler]Therefore, if you intend your solver to generate all possible optimal solutions in the single slice half turn metric for any given case, then your program should output all of the following (no more, no less, and no duplicates) for the UF single dedge flip case (most likely your program would output them in a different order, but any 15 slice half turn algorithm your solver finds should be in this list).


Here are all [B]248[/B] possible (25,15) solutions for the single dedge flip in UF.  (I've seen two people attempt to make a complete list, but neither of them got the number right, nor have I ever seen these algorithms organized like this.  Again, all of the following was generated with code, and the v1,v2, etc. stand for "versions"/transformations.  I proved all of these transformations in [URL="http://www.speedsolving.com/forum/showthread.php?22969-Methods-for-Forming-2-Cycle-Odd-Parity-Algorithms-for-Big-Cubes&p=774938&viewfull=1#post774938"]this post[/URL].)
[Code]r' U2 l F2 l' F2 r2 U2 r U2 r' U2 F2 r2 F2    Alg.1(v1)
l U2 r' F2 r F2 l2 U2 l' U2 l U2 F2 l2 F2    Mirror[Alg.1(v1)]
F2 r2 F2 U2 r U2 r' U2 r2 F2 l F2 l' U2 r    Inverse[Alg.1(v1)]
l' F2 r U2 r' U2 l2 F2 l F2 l' F2 U2 l2 U2    Rotation[Alg.1(v1)]
F2 l2 F2 U2 l' U2 l U2 l2 F2 r' F2 r U2 l'    Mirror[Inverse[Alg.1(v1)]]
r F2 l' U2 l U2 r2 F2 r' F2 r F2 U2 r2 U2    Mirror[Rotation[Alg.1(v1)]]
U2 l2 U2 F2 l F2 l' F2 l2 U2 r U2 r' F2 l    Inverse[Rotation[Alg.1(v1)]]
U2 r2 U2 F2 r' F2 r F2 r2 U2 l' U2 l F2 r'    Mirror[Inverse[Rotation[Alg.1(v1)]]]
 
r' U2 r U2 l' U2 l2 F2 r F2 l' U2 F2 r2 F2    Alg.1(v2)
l U2 l' U2 r U2 r2 F2 l' F2 r U2 F2 l2 F2    Mirror[Alg.1(v2)]
F2 r2 F2 U2 l F2 r' F2 l2 U2 l U2 r' U2 r    Inverse[Alg.1(v2)]
l' F2 l F2 r' F2 r2 U2 l U2 r' F2 U2 l2 U2    Rotation[Alg.1(v2)]
F2 l2 F2 U2 r' F2 l F2 r2 U2 r' U2 l U2 l'    Mirror[Inverse[Alg.1(v2)]]
r F2 r' F2 l F2 l2 U2 r' U2 l F2 U2 r2 U2    Mirror[Rotation[Alg.1(v2)]]
U2 l2 U2 F2 r U2 l' U2 r2 F2 r F2 l' F2 l    Inverse[Rotation[Alg.1(v2)]]
U2 r2 U2 F2 l' U2 r U2 l2 F2 l' F2 r F2 r'    Mirror[Inverse[Rotation[Alg.1(v2)]]]
 
r B2 r' U2 r U2 r2 F2 r' D2 l D2 B2 r2 F2    Alg.1(v3)
l' B2 l U2 l' U2 l2 F2 l D2 r' D2 B2 l2 F2    Mirror[Alg.1(v3)]
F2 r2 B2 D2 l' D2 r F2 r2 U2 r' U2 r B2 r'    Inverse[Alg.1(v3)]
l D2 l' F2 l F2 l2 U2 l' B2 r B2 D2 l2 U2    Rotation[Alg.1(v3)]
F2 l2 B2 D2 r D2 l' F2 l2 U2 l U2 l' B2 l    Mirror[Inverse[Alg.1(v3)]]
r' D2 r F2 r' F2 r2 U2 r B2 l' B2 D2 r2 U2    Mirror[Rotation[Alg.1(v3)]]
U2 l2 D2 B2 r' B2 l U2 l2 F2 l' F2 l D2 l'    Inverse[Rotation[Alg.1(v3)]]
U2 r2 D2 B2 l B2 r' U2 r2 F2 r F2 r' D2 r    Mirror[Inverse[Rotation[Alg.1(v3)]]]
 
r B2 r' U2 r U2 l2 B2 r' U2 l U2 F2 l2 F2    Alg.1(v4)
l' B2 l U2 l' U2 r2 B2 l U2 r' U2 F2 r2 F2    Mirror[Alg.1(v4)]
F2 l2 F2 U2 l' U2 r B2 l2 U2 r' U2 r B2 r'    Inverse[Alg.1(v4)]
l D2 l' F2 l F2 r2 D2 l' F2 r F2 U2 r2 U2    Rotation[Alg.1(v4)]
F2 r2 F2 U2 r U2 l' B2 r2 U2 l U2 l' B2 l    Mirror[Inverse[Alg.1(v4)]]
r' D2 r F2 r' F2 l2 D2 r F2 l' F2 U2 l2 U2    Mirror[Rotation[Alg.1(v4)]]
U2 r2 U2 F2 r' F2 l D2 r2 F2 l' F2 l D2 l'    Inverse[Rotation[Alg.1(v4)]]
U2 l2 U2 F2 l F2 r' D2 l2 F2 r F2 r' D2 r    Mirror[Inverse[Rotation[Alg.1(v4)]]]
 
r B2 l' B2 l U2 r2 F2 l' F2 r U2 F2 l2 F2    Alg.1(v5)
l' B2 r B2 r' U2 l2 F2 r F2 l' U2 F2 r2 F2    Mirror[Alg.1(v5)]
F2 l2 F2 U2 r' F2 l F2 r2 U2 l' B2 l B2 r'    Inverse[Alg.1(v5)]
l D2 r' D2 r F2 l2 U2 r' U2 l F2 U2 r2 U2    Rotation[Alg.1(v5)]
F2 r2 F2 U2 l F2 r' F2 l2 U2 r B2 r' B2 l    Mirror[Inverse[Alg.1(v5)]]
r' D2 l D2 l' F2 r2 U2 l U2 r' F2 U2 l2 U2    Mirror[Rotation[Alg.1(v5)]]
U2 r2 U2 F2 l' U2 r U2 l2 F2 r' D2 r D2 l'    Inverse[Rotation[Alg.1(v5)]]
U2 l2 U2 F2 r U2 l' U2 r2 F2 l D2 l' D2 r    Mirror[Inverse[Rotation[Alg.1(v5)]]]
 
r B2 r' U2 l B2 l2 B2 U2 l U2 l' U2 l2 B2    Alg.2(v1)
l' B2 l U2 r' B2 r2 B2 U2 r' U2 r U2 r2 B2    Mirror[Alg.2(v1)]
B2 l2 U2 l U2 l' U2 B2 l2 B2 l' U2 r B2 r'    Inverse[Alg.2(v1)]
l D2 l' F2 r D2 r2 D2 F2 r F2 r' F2 r2 D2    Rotation[Alg.2(v1)]
B2 r2 U2 r' U2 r U2 B2 r2 B2 r U2 l' B2 l    Mirror[Inverse[Alg.2(v1)]]
r' D2 r F2 l' D2 l2 D2 F2 l' F2 l F2 l2 D2    Mirror[Rotation[Alg.2(v1)]]
D2 r2 F2 r F2 r' F2 D2 r2 D2 r' F2 l D2 l'    Inverse[Rotation[Alg.2(v1)]]
D2 l2 F2 l' F2 l F2 D2 l2 D2 l F2 r' D2 r    Mirror[Inverse[Rotation[Alg.2(v1)]]]
 
r B2 r' U2 r D2 r2 U2 F2 l F2 r' D2 r2 B2    Alg.2(v2)
l' B2 l U2 l' D2 l2 U2 F2 r' F2 l D2 l2 B2    Mirror[Alg.2(v2)]
B2 r2 D2 r F2 l' F2 U2 r2 D2 r' U2 r B2 r'    Inverse[Alg.2(v2)]
l D2 l' F2 l B2 l2 F2 U2 r U2 l' B2 l2 D2    Rotation[Alg.2(v2)]
B2 l2 D2 l' F2 r F2 U2 l2 D2 l U2 l' B2 l    Mirror[Inverse[Alg.2(v2)]]
r' D2 r F2 r' B2 r2 F2 U2 l' U2 r B2 r2 D2    Mirror[Rotation[Alg.2(v2)]]
D2 l2 B2 l U2 r' U2 F2 l2 B2 l' F2 l D2 l'    Inverse[Rotation[Alg.2(v2)]]
D2 r2 B2 r' U2 l U2 F2 r2 B2 r F2 r' D2 r    Mirror[Inverse[Rotation[Alg.2(v2)]]]
 
r B2 r' U2 r D2 l2 D2 B2 l B2 r' U2 l2 B2    Alg.2(v3)
l' B2 l U2 l' D2 r2 D2 B2 r' B2 l U2 r2 B2    Mirror[Alg.2(v3)]
B2 l2 U2 r B2 l' B2 D2 l2 D2 r' U2 r B2 r'    Inverse[Alg.2(v3)]
l D2 l' F2 l B2 r2 B2 D2 r D2 l' F2 r2 D2    Rotation[Alg.2(v3)]
B2 r2 U2 l' B2 r B2 D2 r2 D2 l U2 l' B2 l    Mirror[Inverse[Alg.2(v3)]]
r' D2 r F2 r' B2 l2 B2 D2 l' D2 r F2 l2 D2    Mirror[Rotation[Alg.2(v3)]]
D2 r2 F2 l D2 r' D2 B2 r2 B2 l' F2 l D2 l'    Inverse[Rotation[Alg.2(v3)]]
D2 l2 F2 r' D2 l D2 B2 l2 B2 r F2 r' D2 r    Mirror[Inverse[Rotation[Alg.2(v3)]]]
 
r B2 l' B2 l D2 l2 D2 B2 r D2 l' D2 r2 B2    Alg.2(v4)
l' B2 r B2 r' D2 r2 D2 B2 l' D2 r D2 l2 B2    Mirror[Alg.2(v4)]
B2 r2 D2 l D2 r' B2 D2 l2 D2 l' B2 l B2 r'    Inverse[Alg.2(v4)]
l D2 r' D2 r B2 r2 B2 D2 l B2 r' B2 l2 D2    Rotation[Alg.2(v4)]
B2 l2 D2 r' D2 l B2 D2 r2 D2 r B2 r' B2 l    Mirror[Inverse[Alg.2(v4)]]
r' D2 l D2 l' B2 l2 B2 D2 r' B2 l B2 r2 D2    Mirror[Rotation[Alg.2(v4)]]
D2 l2 B2 r B2 l' D2 B2 r2 B2 r' D2 r D2 l'    Inverse[Rotation[Alg.2(v4)]]
D2 r2 B2 l' B2 r D2 B2 l2 B2 l D2 l' D2 r    Mirror[Inverse[Rotation[Alg.2(v4)]]]
 
r' U2 r U2 l' D2 r2 D2 B2 l' D2 r D2 l2 B2    Alg.2(v5)
l U2 l' U2 r D2 l2 D2 B2 r D2 l' D2 r2 B2    Mirror[Alg.2(v5)]
B2 l2 D2 r' D2 l B2 D2 r2 D2 l U2 r' U2 r    Inverse[Alg.2(v5)]
l' F2 l F2 r' B2 l2 B2 D2 r' B2 l B2 r2 D2    Rotation[Alg.2(v5)]
B2 r2 D2 l D2 r' B2 D2 l2 D2 r' U2 l U2 l'    Mirror[Inverse[Alg.2(v5)]]
r F2 r' F2 l B2 r2 B2 D2 l B2 r' B2 l2 D2    Mirror[Rotation[Alg.2(v5)]]
D2 r2 B2 l' B2 r D2 B2 l2 B2 r F2 l' F2 l    Inverse[Rotation[Alg.2(v5)]]
D2 l2 B2 r B2 l' D2 B2 r2 B2 l' F2 r F2 r'    Mirror[Inverse[Rotation[Alg.2(v5)]]]
 
r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 r2    Alg.3(v1)
l2 B2 U2 r' U2 l U2 l' U2 F2 l' F2 r B2 l2    Mirror[Alg.3(v1)]
r2 B2 l F2 r' F2 U2 r' U2 r U2 l' U2 B2 r2    Inverse[Alg.3(v1)]
l2 D2 F2 r F2 l' F2 l F2 U2 l U2 r' D2 l2    Rotation[Alg.3(v1)]
l2 B2 r' F2 l F2 U2 l U2 l' U2 r U2 B2 l2    Mirror[Inverse[Alg.3(v1)]]
r2 D2 F2 l' F2 r F2 r' F2 U2 r' U2 l D2 r2    Mirror[Rotation[Alg.3(v1)]]
l2 D2 r U2 l' U2 F2 l' F2 l F2 r' F2 D2 l2    Inverse[Rotation[Alg.3(v1)]]
r2 D2 l' U2 r U2 F2 r F2 r' F2 l F2 D2 r2    Mirror[Inverse[Rotation[Alg.3(v1)]]]
 
r2 B2 U2 l U2 l' B2 r B2 U2 r U2 r' B2 r2    Alg.3(v2)
l2 B2 U2 r' U2 r B2 l' B2 U2 l' U2 l B2 l2    Mirror[Alg.3(v2)]
r2 B2 r U2 r' U2 B2 r' B2 l U2 l' U2 B2 r2    Inverse[Alg.3(v2)]
l2 D2 F2 r F2 r' D2 l D2 F2 l F2 l' D2 l2    Rotation[Alg.3(v2)]
l2 B2 l' U2 l U2 B2 l B2 r' U2 r U2 B2 l2    Mirror[Inverse[Alg.3(v2)]]
r2 D2 F2 l' F2 l D2 r' D2 F2 r' F2 r D2 r2    Mirror[Rotation[Alg.3(v2)]]
l2 D2 l F2 l' F2 D2 l' D2 r F2 r' F2 D2 l2    Inverse[Rotation[Alg.3(v2)]]
r2 D2 r' F2 r F2 D2 r D2 l' F2 l F2 D2 r2    Mirror[Inverse[Rotation[Alg.3(v2)]]]
 
r2 F2 D2 r' D2 r F2 l' F2 D2 l' D2 l F2 r2    Alg.3(v3)
l2 F2 D2 l D2 l' F2 r F2 D2 r D2 r' F2 l2    Mirror[Alg.3(v3)]
r2 F2 l' D2 l D2 F2 l F2 r' D2 r D2 F2 r2    Inverse[Alg.3(v3)]
l2 U2 B2 l' B2 l U2 r' U2 B2 r' B2 r U2 l2    Rotation[Alg.3(v3)]
l2 F2 r D2 r' D2 F2 r' F2 l D2 l' D2 F2 l2    Mirror[Inverse[Alg.3(v3)]]
r2 U2 B2 r B2 r' U2 l U2 B2 l B2 l' U2 r2    Mirror[Rotation[Alg.3(v3)]]
l2 U2 r' B2 r B2 U2 r U2 l' B2 l B2 U2 l2    Inverse[Rotation[Alg.3(v3)]]
r2 U2 l B2 l' B2 U2 l' U2 r B2 r' B2 U2 r2    Mirror[Inverse[Rotation[Alg.3(v3)]]]
 
r2 F2 D2 r' D2 l D2 l' D2 B2 l' B2 r F2 r2    Alg.3(v4)
l2 F2 D2 l D2 r' D2 r D2 B2 r B2 l' F2 l2    Mirror[Alg.3(v4)]
r2 F2 r' B2 l B2 D2 l D2 l' D2 r D2 F2 r2    Inverse[Alg.3(v4)]
l2 U2 B2 l' B2 r B2 r' B2 D2 r' D2 l U2 l2    Rotation[Alg.3(v4)]
l2 F2 l B2 r' B2 D2 r' D2 r D2 l' D2 F2 l2    Mirror[Inverse[Alg.3(v4)]]
r2 U2 B2 r B2 l' B2 l B2 D2 l D2 r' U2 r2    Mirror[Rotation[Alg.3(v4)]]
l2 U2 l' D2 r D2 B2 r B2 r' B2 l B2 U2 l2    Inverse[Rotation[Alg.3(v4)]]
r2 U2 r D2 l' D2 B2 l' B2 l B2 r' B2 U2 r2    Mirror[Inverse[Rotation[Alg.3(v4)]]]
 
r2 B2 U2 r B2 r' B2 l U2 F2 r F2 l' B2 r2    Alg.3(v5)
l2 B2 U2 l' B2 l B2 r' U2 F2 l' F2 r B2 l2    Mirror[Alg.3(v5)]
r2 B2 l F2 r' F2 U2 l' B2 r B2 r' U2 B2 r2    Inverse[Alg.3(v5)]
l2 D2 F2 l D2 l' D2 r F2 U2 l U2 r' D2 l2    Rotation[Alg.3(v5)]
l2 B2 r' F2 l F2 U2 r B2 l' B2 l U2 B2 l2    Mirror[Inverse[Alg.3(v5)]]
r2 D2 F2 r' D2 r D2 l' F2 U2 r' U2 l D2 r2    Mirror[Rotation[Alg.3(v5)]]
l2 D2 r U2 l' U2 F2 r' D2 l D2 l' F2 D2 l2    Inverse[Rotation[Alg.3(v5)]]
r2 D2 l' U2 r U2 F2 l D2 r' D2 r F2 D2 r2    Mirror[Inverse[Rotation[Alg.3(v5)]]]
 
r2 F2 D2 l' F2 l F2 r' D2 B2 l' B2 r F2 r2    Alg.3(v6)
l2 F2 D2 r F2 r' F2 l D2 B2 r B2 l' F2 l2    Mirror[Alg.3(v6)]
r2 F2 r' B2 l B2 D2 r F2 l' F2 l D2 F2 r2    Inverse[Alg.3(v6)]
l2 U2 B2 r' U2 r U2 l' B2 D2 r' D2 l U2 l2    Rotation[Alg.3(v6)]
l2 F2 l B2 r' B2 D2 l' F2 r F2 r' D2 F2 l2    Mirror[Inverse[Alg.3(v6)]]
r2 U2 B2 l U2 l' U2 r B2 D2 l D2 r' U2 r2    Mirror[Rotation[Alg.3(v6)]]
l2 U2 l' D2 r D2 B2 l U2 r' U2 r B2 U2 l2    Inverse[Rotation[Alg.3(v6)]]
r2 U2 r D2 l' D2 B2 r' U2 l U2 l' B2 U2 r2    Mirror[Inverse[Rotation[Alg.3(v6)]]]
 
r2 B2 U2 r B2 l' D2 r D2 B2 l U2 r' B2 r2    Alg.3(v7)
l2 B2 U2 l' B2 r D2 l' D2 B2 r' U2 l B2 l2    Mirror[Alg.3(v7)]
r2 B2 r U2 l' B2 D2 r' D2 l B2 r' U2 B2 r2    Inverse[Alg.3(v7)]
l2 D2 F2 l D2 r' B2 l B2 D2 r F2 l' D2 l2    Rotation[Alg.3(v7)]
l2 B2 l' U2 r B2 D2 l D2 r' B2 l U2 B2 l2    Mirror[Inverse[Alg.3(v7)]]
r2 D2 F2 r' D2 l B2 r' B2 D2 l' F2 r D2 r2    Mirror[Rotation[Alg.3(v7)]]
l2 D2 l F2 r' D2 B2 l' B2 r D2 l' F2 D2 l2    Inverse[Rotation[Alg.3(v7)]]
r2 D2 r' F2 l D2 B2 r B2 l' D2 r F2 D2 r2    Mirror[Inverse[Rotation[Alg.3(v7)]]]
 
r2 F2 D2 l' F2 r U2 l' U2 F2 r' D2 l F2 r2    Alg.3(v8)
l2 F2 D2 r F2 l' U2 r U2 F2 l D2 r' F2 l2    Mirror[Alg.3(v8)]
r2 F2 l' D2 r F2 U2 l U2 r' F2 l D2 F2 r2    Inverse[Alg.3(v8)]
l2 U2 B2 r' U2 l F2 r' F2 U2 l' B2 r U2 l2    Rotation[Alg.3(v8)]
l2 F2 r D2 l' F2 U2 r' U2 l F2 r' D2 F2 l2    Mirror[Inverse[Alg.3(v8)]]
r2 U2 B2 l U2 r' F2 l F2 U2 r B2 l' U2 r2    Mirror[Rotation[Alg.3(v8)]]
l2 U2 r' B2 l U2 F2 r F2 l' U2 r B2 U2 l2    Inverse[Rotation[Alg.3(v8)]]
r2 U2 l B2 r' U2 F2 l' F2 r U2 l' B2 U2 r2    Mirror[Inverse[Rotation[Alg.3(v8)]]]
 
r2 B2 U2 l' U2 r U2 r' U2 B2 r' B2 l B2 r2    Alg.4(v1)
l2 B2 U2 r U2 l' U2 l U2 B2 l B2 r' B2 l2    Mirror[Alg.4(v1)]
r2 B2 l' B2 r B2 U2 r U2 r' U2 l U2 B2 r2    Inverse[Alg.4(v1)]
l2 D2 F2 r' F2 l F2 l' F2 D2 l' D2 r D2 l2    Rotation[Alg.4(v1)]
l2 B2 r B2 l' B2 U2 l' U2 l U2 r' U2 B2 l2    Mirror[Inverse[Alg.4(v1)]]
r2 D2 F2 l F2 r' F2 r F2 D2 r D2 l' D2 r2    Mirror[Rotation[Alg.4(v1)]]
l2 D2 r' D2 l D2 F2 l F2 l' F2 r F2 D2 l2    Inverse[Rotation[Alg.4(v1)]]
r2 D2 l D2 r' D2 F2 r' F2 r F2 l' F2 D2 r2    Mirror[Inverse[Rotation[Alg.4(v1)]]]
 
r2 B2 U2 l' U2 l F2 r' F2 U2 r' U2 r B2 r2    Alg.4(v2)
l2 B2 U2 r U2 r' F2 l F2 U2 l U2 l' B2 l2    Mirror[Alg.4(v2)]
r2 B2 r' U2 r U2 F2 r F2 l' U2 l U2 B2 r2    Inverse[Alg.4(v2)]
l2 D2 F2 r' F2 r U2 l' U2 F2 l' F2 l D2 l2    Rotation[Alg.4(v2)]
l2 B2 l U2 l' U2 F2 l' F2 r U2 r' U2 B2 l2    Mirror[Inverse[Alg.4(v2)]]
r2 D2 F2 l F2 l' U2 r U2 F2 r F2 r' D2 r2    Mirror[Rotation[Alg.4(v2)]]
l2 D2 l' F2 l F2 U2 l U2 r' F2 r F2 D2 l2    Inverse[Rotation[Alg.4(v2)]]
r2 D2 r F2 r' F2 U2 r' U2 l F2 l' F2 D2 r2    Mirror[Inverse[Rotation[Alg.4(v2)]]]
 
r2 F2 D2 r D2 r' B2 l B2 D2 l D2 l' F2 r2    Alg.4(v3)
l2 F2 D2 l' D2 l B2 r' B2 D2 r' D2 r F2 l2    Mirror[Alg.4(v3)]
r2 F2 l D2 l' D2 B2 l' B2 r D2 r' D2 F2 r2    Inverse[Alg.4(v3)]
l2 U2 B2 l B2 l' D2 r D2 B2 r B2 r' U2 l2    Rotation[Alg.4(v3)]
l2 F2 r' D2 r D2 B2 r B2 l' D2 l D2 F2 l2    Mirror[Inverse[Alg.4(v3)]]
r2 U2 B2 r' B2 r D2 l' D2 B2 l' B2 l U2 r2    Mirror[Rotation[Alg.4(v3)]]
l2 U2 r B2 r' B2 D2 r' D2 l B2 l' B2 U2 l2    Inverse[Rotation[Alg.4(v3)]]
r2 U2 l' B2 l B2 D2 l D2 r' B2 r B2 U2 r2    Mirror[Inverse[Rotation[Alg.4(v3)]]]
 
r2 F2 D2 r D2 l' D2 l D2 F2 l F2 r' F2 r2    Alg.4(v4)
l2 F2 D2 l' D2 r D2 r' D2 F2 r' F2 l F2 l2    Mirror[Alg.4(v4)]
r2 F2 r F2 l' F2 D2 l' D2 l D2 r' D2 F2 r2    Inverse[Alg.4(v4)]
l2 U2 B2 l B2 r' B2 r B2 U2 r U2 l' U2 l2    Rotation[Alg.4(v4)]
l2 F2 l' F2 r F2 D2 r D2 r' D2 l D2 F2 l2    Mirror[Inverse[Alg.4(v4)]]
r2 U2 B2 r' B2 l B2 l' B2 U2 l' U2 r U2 r2    Mirror[Rotation[Alg.4(v4)]]
l2 U2 l U2 r' U2 B2 r' B2 r B2 l' B2 U2 l2    Inverse[Rotation[Alg.4(v4)]]
r2 U2 r' U2 l U2 B2 l B2 l' B2 r B2 U2 r2    Mirror[Inverse[Rotation[Alg.4(v4)]]]
 
r2 B2 U2 r' F2 r F2 l' U2 B2 r' B2 l B2 r2    Alg.4(v5)
l2 B2 U2 l F2 l' F2 r U2 B2 l B2 r' B2 l2    Mirror[Alg.4(v5)]
r2 B2 l' B2 r B2 U2 l F2 r' F2 r U2 B2 r2    Inverse[Alg.4(v5)]
l2 D2 F2 l' U2 l U2 r' F2 D2 l' D2 r D2 l2    Rotation[Alg.4(v5)]
l2 B2 r B2 l' B2 U2 r' F2 l F2 l' U2 B2 l2    Mirror[Inverse[Alg.4(v5)]]
r2 D2 F2 r U2 r' U2 l F2 D2 r D2 l' D2 r2    Mirror[Rotation[Alg.4(v5)]]
l2 D2 r' D2 l D2 F2 r U2 l' U2 l F2 D2 l2    Inverse[Rotation[Alg.4(v5)]]
r2 D2 l D2 r' D2 F2 l' U2 r U2 r' F2 D2 r2    Mirror[Inverse[Rotation[Alg.4(v5)]]]
 
r2 B2 U2 r' F2 l D2 r' D2 F2 l' U2 r B2 r2    Alg.4(v6)
l2 B2 U2 l F2 r' D2 l D2 F2 r U2 l' B2 l2    Mirror[Alg.4(v6)]
r2 B2 r' U2 l F2 D2 r D2 l' F2 r U2 B2 r2    Inverse[Alg.4(v6)]
l2 D2 F2 l' U2 r B2 l' B2 U2 r' F2 l D2 l2    Rotation[Alg.4(v6)]
l2 B2 l U2 r' F2 D2 l' D2 r F2 l' U2 B2 l2    Mirror[Inverse[Alg.4(v6)]]
r2 D2 F2 r U2 l' B2 r B2 U2 l F2 r' D2 r2    Mirror[Rotation[Alg.4(v6)]]
l2 D2 l' F2 r U2 B2 l B2 r' U2 l F2 D2 l2    Inverse[Rotation[Alg.4(v6)]]
r2 D2 r F2 l' U2 B2 r' B2 l U2 r' F2 D2 r2    Mirror[Inverse[Rotation[Alg.4(v6)]]]
 
r2 F2 D2 l B2 r' U2 l U2 B2 r D2 l' F2 r2    Alg.4(v7)
l2 F2 D2 r' B2 l U2 r' U2 B2 l' D2 r F2 l2    Mirror[Alg.4(v7)]
r2 F2 l D2 r' B2 U2 l' U2 r B2 l' D2 F2 r2    Inverse[Alg.4(v7)]
l2 U2 B2 r D2 l' F2 r F2 D2 l B2 r' U2 l2    Rotation[Alg.4(v7)]
l2 F2 r' D2 l B2 U2 r U2 l' B2 r D2 F2 l2    Mirror[Inverse[Alg.4(v7)]]
r2 U2 B2 l' D2 r F2 l' F2 D2 r' B2 l U2 r2    Mirror[Rotation[Alg.4(v7)]]
l2 U2 r B2 l' D2 F2 r' F2 l D2 r' B2 U2 l2    Inverse[Rotation[Alg.4(v7)]]
r2 U2 l' B2 r D2 F2 l F2 r' D2 l B2 U2 r2    Mirror[Inverse[Rotation[Alg.4(v7)]]]
 
r2 F2 D2 l B2 l' B2 r D2 F2 l F2 r' F2 r2    Alg.4(v8)
l2 F2 D2 r' B2 r B2 l' D2 F2 r' F2 l F2 l2    Mirror[Alg.4(v8)]
r2 F2 r F2 l' F2 D2 r' B2 l B2 l' D2 F2 r2    Inverse[Alg.4(v8)]
l2 U2 B2 r D2 r' D2 l B2 U2 r U2 l' U2 l2    Rotation[Alg.4(v8)]
l2 F2 l' F2 r F2 D2 l B2 r' B2 r D2 F2 l2    Mirror[Inverse[Alg.4(v8)]]
r2 U2 B2 l' D2 l D2 r' B2 U2 l' U2 r U2 r2    Mirror[Rotation[Alg.4(v8)]]
l2 U2 l U2 r' U2 B2 l' D2 r D2 r' B2 U2 l2    Inverse[Rotation[Alg.4(v8)]]
r2 U2 r' U2 l U2 B2 r D2 l' D2 l B2 U2 r2    Mirror[Inverse[Rotation[Alg.4(v8)]]]
 
r2 U2 r' U2 r U2 B2 r2 B2 r U2 l' B2 l B2    Alg.5(v1)
l2 U2 l U2 l' U2 B2 l2 B2 l' U2 r B2 r' B2    Mirror[Alg.5(v1)]
B2 l' B2 l U2 r' B2 r2 B2 U2 r' U2 r U2 r2    Inverse[Alg.5(v1)]
l2 F2 l' F2 l F2 D2 l2 D2 l F2 r' D2 r D2    Rotation[Alg.5(v1)]
B2 r B2 r' U2 l B2 l2 B2 U2 l U2 l' U2 l2    Mirror[Inverse[Alg.5(v1)]]
r2 F2 r F2 r' F2 D2 r2 D2 r' F2 l D2 l' D2    Mirror[Rotation[Alg.5(v1)]]
D2 r' D2 r F2 l' D2 l2 D2 F2 l' F2 l F2 l2    Inverse[Rotation[Alg.5(v1)]]
D2 l D2 l' F2 r D2 r2 D2 F2 r F2 r' F2 r2    Mirror[Inverse[Rotation[Alg.5(v1)]]]
 
r2 D2 r F2 l' F2 U2 r2 D2 r' U2 r B2 r' B2    Alg.5(v2)
l2 D2 l' F2 r F2 U2 l2 D2 l U2 l' B2 l B2    Mirror[Alg.5(v2)]
B2 r B2 r' U2 r D2 r2 U2 F2 l F2 r' D2 r2    Inverse[Alg.5(v2)]
l2 B2 l U2 r' U2 F2 l2 B2 l' F2 l D2 l' D2    Rotation[Alg.5(v2)]
B2 l' B2 l U2 l' D2 l2 U2 F2 r' F2 l D2 l2    Mirror[Inverse[Alg.5(v2)]]
r2 B2 r' U2 l U2 F2 r2 B2 r F2 r' D2 r D2    Mirror[Rotation[Alg.5(v2)]]
D2 l D2 l' F2 l B2 l2 F2 U2 r U2 l' B2 l2    Inverse[Rotation[Alg.5(v2)]]
D2 r' D2 r F2 r' B2 r2 F2 U2 l' U2 r B2 r2    Mirror[Inverse[Rotation[Alg.5(v2)]]]
 
r2 U2 l' B2 r B2 D2 r2 D2 l U2 l' B2 l B2    Alg.5(v3)
l2 U2 r B2 l' B2 D2 l2 D2 r' U2 r B2 r' B2    Mirror[Alg.5(v3)]
B2 l' B2 l U2 l' D2 r2 D2 B2 r' B2 l U2 r2    Inverse[Alg.5(v3)]
l2 F2 r' D2 l D2 B2 l2 B2 r F2 r' D2 r D2    Rotation[Alg.5(v3)]
B2 r B2 r' U2 r D2 l2 D2 B2 l B2 r' U2 l2    Mirror[Inverse[Alg.5(v3)]]
r2 F2 l D2 r' D2 B2 r2 B2 l' F2 l D2 l' D2    Mirror[Rotation[Alg.5(v3)]]
D2 r' D2 r F2 r' B2 l2 B2 D2 l' D2 r F2 l2    Inverse[Rotation[Alg.5(v3)]]
D2 l D2 l' F2 l B2 r2 B2 D2 r D2 l' F2 r2    Mirror[Inverse[Rotation[Alg.5(v3)]]]
 
r2 D2 l D2 r' B2 D2 l2 D2 l' B2 l B2 r' B2    Alg.5(v4)
l2 D2 r' D2 l B2 D2 r2 D2 r B2 r' B2 l B2    Mirror[Alg.5(v4)]
B2 r B2 l' B2 l D2 l2 D2 B2 r D2 l' D2 r2    Inverse[Alg.5(v4)]
l2 B2 r B2 l' D2 B2 r2 B2 r' D2 r D2 l' D2    Rotation[Alg.5(v4)]
B2 l' B2 r B2 r' D2 r2 D2 B2 l' D2 r D2 l2    Mirror[Inverse[Alg.5(v4)]]
r2 B2 l' B2 r D2 B2 l2 B2 l D2 l' D2 r D2    Mirror[Rotation[Alg.5(v4)]]
D2 l D2 r' D2 r B2 r2 B2 D2 l B2 r' B2 l2    Inverse[Rotation[Alg.5(v4)]]
D2 r' D2 l D2 l' B2 l2 B2 D2 r' B2 l B2 r2    Mirror[Inverse[Rotation[Alg.5(v4)]]]
 
r2 D2 l D2 r' B2 D2 l2 D2 r' U2 l U2 l' B2    Alg.5(v5)
l2 D2 r' D2 l B2 D2 r2 D2 l U2 r' U2 r B2    Mirror[Alg.5(v5)]
B2 l U2 l' U2 r D2 l2 D2 B2 r D2 l' D2 r2    Inverse[Alg.5(v5)]
l2 B2 r B2 l' D2 B2 r2 B2 l' F2 r F2 r' D2    Rotation[Alg.5(v5)]
B2 r' U2 r U2 l' D2 r2 D2 B2 l' D2 r D2 l2    Mirror[Inverse[Alg.5(v5)]]
r2 B2 l' B2 r D2 B2 l2 B2 r F2 l' F2 l D2    Mirror[Rotation[Alg.5(v5)]]
D2 r F2 r' F2 l B2 r2 B2 D2 l B2 r' B2 l2    Inverse[Rotation[Alg.5(v5)]]
D2 l' F2 l F2 r' B2 l2 B2 D2 r' B2 l B2 r2    Mirror[Inverse[Rotation[Alg.5(v5)]]]
[/Code]Lastly, to save anyone time who might want to actually check that all of these algs work, I wrote another program which checks that, and it said all algorithms work.


----------



## imvelox (Jul 22, 2014)

32 bit application pls


----------



## unsolved (Aug 2, 2014)

imvelox said:


> 32 bit application pls



My code uses a 64-bit move generator to execute matrix rotations at the bit-level much more expediently, so I am sorry to say there will not be a 32-bit version.


----------



## unsolved (Nov 30, 2014)

Version 2.0.2 is available now.







Features:


Very fast 64-bit move generator. Over 44,000,000 nodes/second on a 3.1 GHz computer
Slightly more intelligent move ordering than 2.0.0 will reduce the number of nodes examined
2 fast pruning heuristics reduce the size of the tree
Now fully supports cube rotations in the scramble (x,y,z, x',y',z',x2,y2,z2)
Recognizes solutions leading to any rotated cube state, fixing a major flaw in older versions

There is still no *Turns From Solved* databases in this release.

http://lightningcloudcomputing.com/OO_4x4x4_bitboard.zip


----------



## Jakube (Nov 30, 2014)

Which pruning heuristics are you using? I guess, you could improve those quite a lot. I just tested a 8 move scramble , your programm visited about 3.5 *10^9 nodes, cubebruce's program only 2.3 * 10^7. That's a factor of 150!


----------



## unsolved (Nov 30, 2014)

Jakube said:


> Which pruning heuristics are you using? I guess, you could improve those quite a lot. I just tested a 8 move scramble , your programm visited about 3.5 *10^9 nodes, cubebruce's program only 2.3 * 10^7. That's a factor of 150!



You are correct regarding the potential for improvement. This is a complete rewrite of the program. Recall the earlier versions would not be able to tell that a scramble such as U u d' D' was a cube already solved. It would actually have to rotate it back to solve it. Even worse, U u d' D' was a "4 turns-from-solved" database entry! 

I only have two pruning heuristics in place.

1. If there is 1-turn left in your current search, such as you generated 4 of the 5 moves for depth 5, you must have 2 opposite sides of the cube solved if you hope to solve the cube in 1 more move. The bitboard version of my program makes it very easy to test this faster than a move can be generated, so this is a pruning condition.

2. If there are 2-turns left in your current search, if any side of the cube has 4 different colored centers, the cube can't be solved. So that is pruned away.

The major speed advance was creating a move generator that can make any move using only 6 lines of C code. Here is the code for making the move F'


```
BITBOARD_4x4x4_CUBE F_MINUS(BITBOARD_4x4x4_CUBE original_4x4x4_cube)
{
		BITBOARD_4x4x4_CUBE new_cube;

		/**************************************************************************/
		/* Rotating the front will change something on every face except the back */
		/**************************************************************************/
		new_cube._4x4x4_back = original_4x4x4_cube._4x4x4_back;

		/******************************************************************************************/
		/* Entire row of cubes moves from top -----> left -----> bottom -----> right -----> top   */
		/* new left = old top; new bottom = old left; new right = old bottom; new top = old right */ 
		/******************************************************************************************/
new_cube._4x4x4_left   = (original_4x4x4_cube._4x4x4_left & BITMASK_CUBE_FACE_NOT_COL_04)   | ((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_13) >> 12) | ((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_14) << 8) | ((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_15) << 28) | ((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_16) << 48);

new_cube._4x4x4_bottom = (original_4x4x4_cube._4x4x4_bottom & BITMASK_CUBE_FACE_NOT_ROW_01) | ((original_4x4x4_cube._4x4x4_left & BITMASK_CUBE_FACE_SQUARE_04) << 12) | ((original_4x4x4_cube._4x4x4_left & BITMASK_CUBE_FACE_SQUARE_08) << 24) | ((original_4x4x4_cube._4x4x4_left & BITMASK_CUBE_FACE_SQUARE_12) << 36) | ((original_4x4x4_cube._4x4x4_left & BITMASK_CUBE_FACE_SQUARE_16) << 48);

new_cube._4x4x4_right  = (original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_NOT_COL_01)  | ((original_4x4x4_cube._4x4x4_bottom  & BITMASK_CUBE_FACE_SQUARE_01) >> 48) | ((original_4x4x4_cube._4x4x4_bottom  & BITMASK_CUBE_FACE_SQUARE_02) >> 28) | ((original_4x4x4_cube._4x4x4_bottom  & BITMASK_CUBE_FACE_SQUARE_03) >> 8) | ((original_4x4x4_cube._4x4x4_bottom  & BITMASK_CUBE_FACE_SQUARE_04) << 12);

new_cube._4x4x4_top    = (original_4x4x4_cube._4x4x4_top  & BITMASK_CUBE_FACE_NOT_ROW_04)   | ((original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_SQUARE_01) >> 48) | ((original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_SQUARE_05) >> 36) | ((original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_SQUARE_09) >> 24) | ((original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_SQUARE_13) >> 12);

		/*********************************************************************************/
		/*                                                                               */
		/* THESE CUBE LOCATIONS BECOME....              THESE CUBE LOCATIONS             */
		/*                                                                               */
		/*                                                                               */
		/*********************************/             /*********************************/
		/*  01   *  02   *  03   *   04  */             /*  04   *  08   *  12   *   16  */
		/*********************************/             /*********************************/
		/*  05   *  06   *  07   *   08  */             /*  03   *  07   *  11   *   15  */
		/*********************************/             /*********************************/
		/*  09   *  10   *  11   *   12  */             /*  02   *  06   *  10   *   14  */
		/*********************************/             /*********************************/
		/*  13   *  14   *  15   *   16  */             /*  01   *  05   *  09   *   13  */
		/*********************************/             /*********************************/
		/*                                                                               */
		/*                                                                               */
		/*********************************************************************************/

		new_cube._4x4x4_front = ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_04) << 12)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_08) << 24)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_12) << 36)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_16) << 48)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_03) >> 8)   | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_07) << 4)   | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_11) << 16)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_15) << 28)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_02) >> 28)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_06) >> 16)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_10) >> 4)   | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_14) << 8)   | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_01) >> 48)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_05) >> 36)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_09) >> 24)  | \
							    ((original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_SQUARE_13) >> 12);

		return new_cube;
}
```



*EDIT:*

Currently debugging my *TFS-03* implementation. Somehow my new bitboards are occasionally not found after probing the database and reporting a positive find. In each case the cube in question is in there. Once I get this worked out, I'll release a version with all 24 rotated states in RAM for up to 3 turns. It is under 35 MB and shouldn't tax anyone's computer resources.


----------



## Jakube (Dec 1, 2014)

unsolved said:


> I only have two pruning heuristics in place.
> 
> 1. If there is 1-turn left in your current search, such as you generated 4 of the 5 moves for depth 5, you must have 2 opposite sides of the cube solved if you hope to solve the cube in 1 more move. The bitboard version of my program makes it very easy to test this faster than a move can be generated, so this is a pruning condition.
> 
> 2. If there are 2-turns left in your current search, if any side of the cube has 4 different colored centers, the cube can't be solved. So that is pruned away.




That's a nice start. I did something similar, when I programmed my first cube solver (a 2x2x2 solver in 2012). 

What you can do, to improve pruning is the following. You can pick one center and map containing all 6^4 different pattern and their number, which is necessary to solve this pattern. Now at each node you can check, if #moves_left >= #moves_nessasary_for_this_center. I'm not sure, how many moves you will save on average, but definitely more that 1-2, like you currently save. But you can easily improve this afterwards by taking the maximum of all 6 centers prune values, create a list of 2 adjacent centers, create a list for all corner positions, ... 

The pruning approach is way more powerful than a fast move generator, because the branching factor is so big. For each move you save, your program will be a factor of ~16 faster.


----------



## unsolved (Dec 1, 2014)

Jakube said:


> That's a nice start. I did something similar, when I programmed my first cube solver (a 2x2x2 solver in 2012).
> 
> What you can do, to improve pruning is the following. You can pick one center and map containing all 6^4 different pattern and their number, which is necessary to solve this pattern. Now at each node you can check, if #moves_left >= #moves_nessasary_for_this_center. I'm not sure, how many moves you will save on average, but definitely more that 1-2, like you currently save. But you can easily improve this afterwards by taking the maximum of all 6 centers prune values, create a list of 2 adjacent centers, create a list for all corner positions, ...
> 
> The pruning approach is way more powerful than a fast move generator, because the branching factor is so big. For each move you save, your program will be a factor of ~16 faster.



Yes, but as a former chess programmer, I am addicted to increasing move generator speed  I also wrote a checkers program with the least lines of code using 64-bit Magic Ghost squares. The move generator was only 37 lines of code total.

I understand the concept of pruning after Bruce enlightened me. That does not mean I can implement all that I have the grasp on: I have struggled getting the corner database to work flawlessly, but I will have that perfected now that I have a reference-less solved cube state analyzer. And, with my bitboard I can analyze data from all 24 centers with one line of code, so I can code some pretty complex relationships that take practically no time to evaluate.

The problem with using centers as a pruning basis is that you can have 4 different colored centers get solved with only 3 turns. *u' r+ u2* from a solved cube creates a mottled center pattern on the front and back faces. So looking up any such solution is saving 3-ply worth of solving at best, not nearly the huge payoff you see with corner pruning.

I also solved every 1 center vs. 1 center, 2 vs. 2, and 3 vs. 3 position (sample below)


```
Solutions To center scenario U1:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  u' R' [inside 6-TFS] ---> u  l  u' R  u  l'  @ 0000000000137 nodes with 0000000001754 6-TFS probes   
Solution [002] =  u' b' [inside 6-TFS] ---> u  F  u' b  u  F'  @ 0000000000155 nodes with 0000000001963 6-TFS probes   
Solution [003] =  d' b  [inside 6-TFS] ---> d  F' d' b' d  F   @ 0000000000238 nodes with 0000000002727 6-TFS probes   
Solution [004] =  r  u2 [inside 6-TFS] ---> r' U2 r  u2 r' U2  @ 0000000000447 nodes with 0000000004809 6-TFS probes   
Solution [005] =  r' b2 [inside 6-TFS] ---> r  F2 r' b2 r  F2  @ 0000000000498 nodes with 0000000005542 6-TFS probes   
Solution [006] =  l  F  [inside 6-TFS] ---> r' F' l' F  r  F'  @ 0000000000547 nodes with 0000000006177 6-TFS probes   
Solution [007] =  l' U  [inside 6-TFS] ---> r  U' l  U  r' U'  @ 0000000000559 nodes with 0000000006208 6-TFS probes   
Solution [008] =  f  u' [inside 6-TFS] ---> f' U' f  u  f' U   @ 0000000000788 nodes with 0000000008796 6-TFS probes   
Solution [009] =  b  u  [inside 6-TFS] ---> b' U  b  u' b' U'  @ 0000000000877 nodes with 0000000009978 6-TFS probes   
Solution [010] =  b  L' [inside 6-TFS] ---> b' l' b  L  b' l   @ 0000000000896 nodes with 0000000010165 6-TFS probes   
Solution [011] =  b' R' [inside 6-TFS] ---> b  l' b' R  b  l   @ 0000000000914 nodes with 0000000010364 6-TFS probes   



Solutions To center scenario U1:F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  b' [inside 6-TFS] ---> u' b  U' b' u  b   @ 0000000000029 nodes with 0000000000791 6-TFS probes   
Solution [002] =  U' b' [inside 6-TFS] ---> u' b  U  b' u  b   @ 0000000000062 nodes with 0000000001182 6-TFS probes   
Solution [003] =  U2 b' [inside 6-TFS] ---> u' b  U2 b' u  b   @ 0000000000095 nodes with 0000000001405 6-TFS probes   
Solution [004] =  d' b  [inside 6-TFS] ---> d  F2 d' b' d  F2  @ 0000000000238 nodes with 0000000002988 6-TFS probes   
Solution [005] =  r  b  [inside 6-TFS] ---> L  b' r' b  L' b'  @ 0000000000466 nodes with 0000000005343 6-TFS probes   
Solution [006] =  r  b' [inside 6-TFS] ---> R  b  r' b' R' b   @ 0000000000467 nodes with 0000000005359 6-TFS probes   
Solution [007] =  r' b2 [inside 6-TFS] ---> r  F  r' b2 r  F'  @ 0000000000498 nodes with 0000000005627 6-TFS probes   
Solution [008] =  l  u  [inside 6-TFS] ---> L' u' l' u  L  u'  @ 0000000000535 nodes with 0000000006063 6-TFS probes   
Solution [009] =  l  u' [inside 6-TFS] ---> R' u  l' u' R  u   @ 0000000000536 nodes with 0000000006064 6-TFS probes   
Solution [010] =  l' u2 [inside 6-TFS] ---> l  U' l' u2 l  U   @ 0000000000564 nodes with 0000000006387 6-TFS probes   
Solution [011] =  F  u' [inside 6-TFS] ---> b' u  F' u' b  u   @ 0000000000689 nodes with 0000000008019 6-TFS probes   
Solution [012] =  F' u' [inside 6-TFS] ---> b' u  F  u' b  u   @ 0000000000722 nodes with 0000000008326 6-TFS probes   
Solution [013] =  F' l  [inside 6-TFS] ---> F  r' F' l' F  r   @ 0000000000736 nodes with 0000000008377 6-TFS probes   
Solution [014] =  F2 u' [inside 6-TFS] ---> b' u  F2 u' b  u   @ 0000000000755 nodes with 0000000008585 6-TFS probes   
Solution [015] =  f' u  [inside 6-TFS] ---> f  U2 f' u' f  U2  @ 0000000000817 nodes with 0000000009323 6-TFS probes   



Solutions To center scenario U1:F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U' b  [inside 6-TFS] ---> d' b' U  b  d  b'  @ 0000000000061 nodes with 0000000001245 6-TFS probes   
Solution [002] =  U2 b  [inside 6-TFS] ---> d' b' U2 b  d  b'  @ 0000000000094 nodes with 0000000001686 6-TFS probes   
Solution [003] =  u' b' [inside 6-TFS] ---> u  F2 u' b  u  F2  @ 0000000000155 nodes with 0000000002183 6-TFS probes   
Solution [004] =  r  d2 [inside 6-TFS] ---> r' U  r  d2 r' U'  @ 0000000000450 nodes with 0000000005161 6-TFS probes   
Solution [005] =  r' b2 [inside 6-TFS] ---> r  F' r' b2 r  F   @ 0000000000498 nodes with 0000000005778 6-TFS probes   
Solution [006] =  F  d' [inside 6-TFS] ---> b  d  F' d' b' d   @ 0000000000692 nodes with 0000000007930 6-TFS probes   
Solution [007] =  F' d' [inside 6-TFS] ---> b  d  F  d' b' d   @ 0000000000725 nodes with 0000000008170 6-TFS probes   
Solution [008] =  F2 d' [inside 6-TFS] ---> b  d  F2 d' b' d   @ 0000000000758 nodes with 0000000008544 6-TFS probes   
Solution [009] =  f  d  [inside 6-TFS] ---> f' U2 f  d' f' U2  @ 0000000000790 nodes with 0000000008775 6-TFS probes   



Solutions To center scenario U1:F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U' l' [inside 6-TFS] ---> d2 l  U  l' d2 l   @ 0000000000050 nodes with 0000000001003 6-TFS probes   
Solution [002] =  U2 l' [inside 6-TFS] ---> d2 l  U2 l' d2 l   @ 0000000000083 nodes with 0000000001241 6-TFS probes   
Solution [003] =  u' b' [inside 6-TFS] ---> u  F' u' b  u  F   @ 0000000000155 nodes with 0000000002406 6-TFS probes   
Solution [004] =  d' b  [inside 6-TFS] ---> d  F  d' b' d  F'  @ 0000000000238 nodes with 0000000003195 6-TFS probes   
Solution [005] =  F  r' [inside 6-TFS] ---> b2 r  F' r' b2 r   @ 0000000000701 nodes with 0000000008078 6-TFS probes   
Solution [006] =  F' r' [inside 6-TFS] ---> b2 r  F  r' b2 r   @ 0000000000734 nodes with 0000000008558 6-TFS probes   
Solution [007] =  F2 r' [inside 6-TFS] ---> b2 r  F2 r' b2 r   @ 0000000000767 nodes with 0000000008962 6-TFS probes   
Solution [008] =  f' d' [inside 6-TFS] ---> f  U' f' d  f  U   @ 0000000000821 nodes with 0000000009723 6-TFS probes   
Solution [009] =  b' d  [inside 6-TFS] ---> b  U  b' d' b  U'  @ 0000000000907 nodes with 0000000010726 6-TFS probes   



Solutions To center scenario U2:F1 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U' l' [inside 6-TFS] ---> U  r  U' l  U  r'  @ 0000000000050 nodes with 0000000000855 6-TFS probes   
Solution [002] =  U' b  [inside 6-TFS] ---> u  b' U  b  u' b'  @ 0000000000061 nodes with 0000000000878 6-TFS probes   
Solution [003] =  U2 b  [inside 6-TFS] ---> u  b' U2 b  u' b'  @ 0000000000094 nodes with 0000000001324 6-TFS probes   
Solution [004] =  d  b' [inside 6-TFS] ---> d' F2 d  b  d' F2  @ 0000000000212 nodes with 0000000002686 6-TFS probes   
Solution [005] =  r  u2 [inside 6-TFS] ---> r' U  r  u2 r' U'  @ 0000000000447 nodes with 0000000004719 6-TFS probes   
Solution [006] =  r' u  [inside 6-TFS] ---> L  u' r  u  L' u'  @ 0000000000475 nodes with 0000000004972 6-TFS probes   
Solution [007] =  r' u' [inside 6-TFS] ---> R  u  r  u' R' u   @ 0000000000476 nodes with 0000000004973 6-TFS probes   
Solution [008] =  l  b2 [inside 6-TFS] ---> l' F' l  b2 l' F   @ 0000000000555 nodes with 0000000006223 6-TFS probes   
Solution [009] =  l' b  [inside 6-TFS] ---> L' b' l  b  L  b'  @ 0000000000580 nodes with 0000000006346 6-TFS probes   
Solution [010] =  l' b' [inside 6-TFS] ---> R' b  l  b' R  b   @ 0000000000581 nodes with 0000000006348 6-TFS probes   
Solution [011] =  F  u  [inside 6-TFS] ---> b  u' F' u  b' u'  @ 0000000000688 nodes with 0000000007781 6-TFS probes   
Solution [012] =  F  r' [inside 6-TFS] ---> F' l  F  r  F' l'  @ 0000000000701 nodes with 0000000007875 6-TFS probes   
Solution [013] =  F' u  [inside 6-TFS] ---> b  u' F  u  b' u'  @ 0000000000721 nodes with 0000000007999 6-TFS probes   
Solution [014] =  F2 u  [inside 6-TFS] ---> b  u' F2 u  b' u'  @ 0000000000754 nodes with 0000000008360 6-TFS probes   
Solution [015] =  f  u' [inside 6-TFS] ---> f' U2 f  u  f' U2  @ 0000000000788 nodes with 0000000008564 6-TFS probes   


Solutions To center scenario U1,U2 vs. F1,F2 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U2 l  f2 [inside 6-TFS] ---> l' r  f2 r' U2 r'  @ 0000000350607 nodes with 0000004186385 6-TFS probes   
Solution [002] =  r' F2 r' d2 [inside 6-TFS] ---> l' r  d2 l  F2 r   @ 0000000388110 nodes with 0000004593014 6-TFS probes   
Solution [003] =  r' F2 l' d2 [inside 6-TFS] ---> l  r' d2 r  F2 r   @ 0000000388197 nodes with 0000004594245 6-TFS probes   
Solution [004] =  l  F2 r  d2 [inside 6-TFS] ---> l  r' d2 l' F2 l'  @ 0000000432900 nodes with 0000005080754 6-TFS probes   
Solution [005] =  l  F2 l  d2 [inside 6-TFS] ---> l' r  d2 r' F2 l'  @ 0000000432990 nodes with 0000005081694 6-TFS probes   
Solution [006] =  l' U2 r' f2 [inside 6-TFS] ---> l' r  f2 l  U2 l   @ 0000000442458 nodes with 0000005188763 6-TFS probes   
Solution [007] =  l' U2 l' f2 [inside 6-TFS] ---> l  r' f2 r  U2 l   @ 0000000442542 nodes with 0000005189630 6-TFS probes   



Solutions To center scenario U1,U2 vs. F1,F3 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  U  B2 D2 [inside 6-TFS] ---> r' D2 B2 U2 l' U   @ 0000000000915 nodes with 0000000021788 6-TFS probes   



Solutions To center scenario U1,U2 vs. F1,F4 

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r' F2 r' b2 r  [inside 6-TFS] ---> F  l' b2 l  F  r   @ 0000010912588 nodes with 0000129027917 6-TFS probes   
Solution [002] =  r2 U2 B  r' u2 [inside 6-TFS] ---> r2 u2 r' B' U2 r2  @ 0000011193273 nodes with 0000132120602 6-TFS probes   
Solution [003] =  r2 D2 F  l' u2 [inside 6-TFS] ---> l2 u2 l' F' D2 r2  @ 0000011377932 nodes with 0000134158698 6-TFS probes   
Solution [004] =  r2 F  D2 l' u2 [inside 6-TFS] ---> l2 u2 l' D2 F' r2  @ 0000011517630 nodes with 0000135698665 6-TFS probes   
Solution [005] =  r2 B  U2 r' u2 [inside 6-TFS] ---> r2 u2 r' U2 B' r2  @ 0000011723256 nodes with 0000137952338 6-TFS probes   
Solution [006] =  l' U' l' d2 l  [inside 6-TFS] ---> U' r' d2 r  U2 l   @ 0000012415933 nodes with 0000145594847 6-TFS probes   
Solution [007] =  l' U2 r' d2 r  [inside 6-TFS] ---> U  l' d2 l  U  l   @ 0000012439528 nodes with 0000145859045 6-TFS probes   
Solution [008] =  l2 U2 B  l' d2 [inside 6-TFS] ---> l2 d2 l' B' U2 l2  @ 0000013051503 nodes with 0000152569832 6-TFS probes   
Solution [009] =  l2 D2 F  r' d2 [inside 6-TFS] ---> r2 d2 r' F' D2 l2  @ 0000013235988 nodes with 0000154600406 6-TFS probes   
Solution [010] =  l2 F  D2 r' d2 [inside 6-TFS] ---> r2 d2 r' D2 F' l2  @ 0000013311858 nodes with 0000155433022 6-TFS probes   
Solution [011] =  l2 B  U2 l' d2 [inside 6-TFS] ---> l2 d2 l' U2 B' l2  @ 0000013517658 nodes with 0000157693431 6-TFS probes   

Solutions To center scenario U1,U2,U4 vs. F1,F3,F4

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U  r  u2 d2 r' U  [inside 6-TFS] ---> l  d2 u2 l' U2 r'  @ 0007748320882 nodes with 0092433507512 6-TFS probes   
Solution [002] =  r  U  l  U2 D2 r' U  [inside 6-TFS] ---> l  D2 U2 r' U2 r'  @ 0007750238098 nodes with 0092454645263 6-TFS probes   
Solution [003] =  r  U  l  u2 d2 l' U  [inside 6-TFS] ---> r  d2 u2 r' U2 r'  @ 0007750306765 nodes with 0092455403602 6-TFS probes   
Solution [004] =  r' D' B2 U2 r' U2 B2 [inside 6-TFS] ---> D  r' D  l' D' r2  @ 0008461746369 nodes with 0100272867872 6-TFS probes   
Solution [005] =  r2 d2 r' U2 r  u2 r' [inside 6-TFS] ---> l  d2 u2 l' U2 r'  @ 0008942772851 nodes with 0105558169573 6-TFS probes   
Solution [006] =  r2 d2 r' U2 r  u2 l  [inside 6-TFS] ---> r' d2 u2 l' U2 r'  @ 0008942772853 nodes with 0105558169576 6-TFS probes   
Solution [007] =  r2 d2 r' U2 l  u2 d2 [inside 6-TFS] ---> l' r  u2 r' U2 r'  @ 0008942775354 nodes with 0105558196986 6-TFS probes   
Solution [008] =  r2 f2 r  F2 r' f2 b2 [inside 6-TFS] ---> l' r  b2 l  F2 r   @ 0009205862415 nodes with 0108449443029 6-TFS probes   
Solution [009] =  r2 f2 r  F2 l' b2 r' [inside 6-TFS] ---> l  b2 f2 r  F2 r   @ 0009205864838 nodes with 0108449469630 6-TFS probes   
Solution [010] =  r2 f2 r  F2 l' b2 l  [inside 6-TFS] ---> r' b2 f2 r  F2 r   @ 0009205864840 nodes with 0108449469647 6-TFS probes   
Solution [011] =  l  F  r  F2 B2 l' F  [inside 6-TFS] ---> r  B2 F2 l' F2 l'  @ 0009579688126 nodes with 0112556889349 6-TFS probes   
Solution [012] =  l  F  r  f2 b2 r' F  [inside 6-TFS] ---> l  b2 f2 l' F2 l'  @ 0009579756550 nodes with 0112557647153 6-TFS probes   
Solution [013] =  l  F  l  F2 B2 r' F  [inside 6-TFS] ---> l  B2 F2 r' F2 l'  @ 0009581610010 nodes with 0112578041353 6-TFS probes   
Solution [014] =  l  F  l  f2 b2 l' F  [inside 6-TFS] ---> r  b2 f2 r' F2 l'  @ 0009581678602 nodes with 0112578792734 6-TFS probes   
Solution [015] =  l' B' D2 F2 l' F2 D2 [inside 6-TFS] ---> B  l' B  r' B' l2  @ 0010232788488 nodes with 0119732515519 6-TFS probes   
Solution [016] =  l2 u2 l  U2 r' d2 r  [inside 6-TFS] ---> l' d2 u2 l  U2 l   @ 0010362393376 nodes with 0121156572968 6-TFS probes   
Solution [017] =  l2 u2 l  U2 r' d2 l' [inside 6-TFS] ---> r  d2 u2 l  U2 l   @ 0010362393380 nodes with 0121156572984 6-TFS probes   
Solution [018] =  l2 u2 l  U2 l' u2 d2 [inside 6-TFS] ---> l  r' d2 r  U2 l   @ 0010362395718 nodes with 0121156598200 6-TFS probes   
Solution [019] =  l2 b2 l' F2 r  f2 b2 [inside 6-TFS] ---> l  r' f2 l' F2 l'  @ 0010678918506 nodes with 0124634137741 6-TFS probes   
Solution [020] =  l2 b2 l' F2 l  f2 r  [inside 6-TFS] ---> l' b2 f2 r' F2 l'  @ 0010678920925 nodes with 0124634164709 6-TFS probes   
Solution [021] =  l2 b2 l' F2 l  f2 l' [inside 6-TFS] ---> r  b2 f2 r' F2 l'  @ 0010678920929 nodes with 0124634164772 6-TFS probes   



Solutions To center scenario U1,U2,U4 vs. F2,F3,F4

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|OOOO|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U2 l  U2 D2 r' U' [inside 6-TFS] ---> l  D2 U2 r' U' r'  @ 0007791392579 nodes with 0092906774080 6-TFS probes   
Solution [002] =  r  U2 l  u2 d2 l' U' [inside 6-TFS] ---> r  d2 u2 r' U' r'  @ 0007791461246 nodes with 0092907524073 6-TFS probes   
Solution [003] =  r' F2 l' F2 B2 r  F  [inside 6-TFS] ---> l' B2 F2 r  F  r   @ 0008627385268 nodes with 0102091592643 6-TFS probes   
Solution [004] =  r' F2 l' f2 b2 l  F  [inside 6-TFS] ---> r' b2 f2 r  F  r   @ 0008627453863 nodes with 0102092347556 6-TFS probes   
Solution [005] =  l  F2 l  F2 B2 r' F' [inside 6-TFS] ---> l  B2 F2 r' F' l'  @ 0009622764491 nodes with 0113028715803 6-TFS probes   
Solution [006] =  l  F2 l  f2 b2 l' F' [inside 6-TFS] ---> r  b2 f2 r' F' l'  @ 0009622833083 nodes with 0113029470363 6-TFS probes   
Solution [007] =  l' U2 l' U2 D2 r  U  [inside 6-TFS] ---> l' D2 U2 r  U  l   @ 0009834392044 nodes with 0115353500633 6-TFS probes   
Solution [008] =  l' U2 l' u2 d2 l  U  [inside 6-TFS] ---> r' d2 u2 r  U  l   @ 0009834460714 nodes with 0115354246542 6-TFS probes   



Solutions To center scenario U1,U3,U4 vs. F1,F2,F3

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|####|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U2 r  u2 d2 r' U  [inside 6-TFS] ---> l  d2 u2 l' U  r'  @ 0007789475362 nodes with 0092884032655 6-TFS probes   
Solution [002] =  r' F2 r' F2 B2 l  F' [inside 6-TFS] ---> r' B2 F2 l  F' r   @ 0008625527216 nodes with 0102070935901 6-TFS probes   
Solution [003] =  r' F2 r' f2 b2 r  F' [inside 6-TFS] ---> l' b2 f2 l  F' r   @ 0008625595637 nodes with 0102071690459 6-TFS probes   
Solution [004] =  l  F2 r  F2 B2 l' F  [inside 6-TFS] ---> r  B2 F2 l' F  l'  @ 0009620842606 nodes with 0113006284791 6-TFS probes   
Solution [005] =  l  F2 r  f2 b2 r' F  [inside 6-TFS] ---> l  b2 f2 l' F  l'  @ 0009620911030 nodes with 0113007039053 6-TFS probes   
Solution [006] =  l' U2 r' U2 D2 l  U' [inside 6-TFS] ---> r' D2 U2 l  U' l   @ 0009832470167 nodes with 0115331787797 6-TFS probes   
Solution [007] =  l' U2 r' u2 d2 r  U' [inside 6-TFS] ---> l' d2 u2 l  U' l   @ 0009832538657 nodes with 0115332533174 6-TFS probes   



Solutions To center scenario U1,U3,U4 vs. F1,F2,F4

TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r' F  r' F2 B2 l  F  [inside 6-TFS] ---> r' B2 F2 l  F2 r   @ 0008584372735 nodes with 0101618757955 6-TFS probes   
Solution [002] =  r' F  r' f2 b2 r  F  [inside 6-TFS] ---> l' b2 f2 l  F2 r   @ 0008584441156 nodes with 0101619506595 6-TFS probes   
Solution [003] =  r' F  l' F2 B2 r  F  [inside 6-TFS] ---> l' B2 F2 r  F2 r   @ 0008586230788 nodes with 0101639179490 6-TFS probes   
Solution [004] =  r' F  l' f2 b2 l  F  [inside 6-TFS] ---> r' b2 f2 r  F2 r   @ 0008586299383 nodes with 0101639934276 6-TFS probes   
Solution [005] =  r2 d2 r' U2 r  u2 d2 [inside 6-TFS] ---> l  r' u2 l' U2 r'  @ 0008942772843 nodes with 0105556944118 6-TFS probes   
Solution [006] =  r2 d2 r' U2 l  u2 r  [inside 6-TFS] ---> l' d2 u2 r' U2 r'  @ 0008942775361 nodes with 0105556971400 6-TFS probes   
Solution [007] =  r2 d2 r' U2 l  u2 l' [inside 6-TFS] ---> r  d2 u2 r' U2 r'  @ 0008942775365 nodes with 0105556971415 6-TFS probes   
Solution [008] =  r2 f2 r  F2 r' b2 r  [inside 6-TFS] ---> l' b2 f2 l  F2 r   @ 0009205862488 nodes with 0108447356789 6-TFS probes   
Solution [009] =  r2 f2 r  F2 r' b2 l' [inside 6-TFS] ---> r  b2 f2 l  F2 r   @ 0009205862492 nodes with 0108447356806 6-TFS probes   
Solution [010] =  r2 f2 r  F2 l' f2 b2 [inside 6-TFS] ---> l  r' b2 r  F2 r   @ 0009205864764 nodes with 0108447381423 6-TFS probes   
Solution [011] =  l  D' B2 U2 l  U2 B2 [inside 6-TFS] ---> D  l  D  r  D' l2  @ 0009508172139 nodes with 0111768760110 6-TFS probes   
Solution [012] =  l' U  r' U2 D2 l  U  [inside 6-TFS] ---> r' D2 U2 l  U2 l   @ 0009791315686 nodes with 0114879974891 6-TFS probes   
Solution [013] =  l' U  r' u2 d2 r  U  [inside 6-TFS] ---> l' d2 u2 l  U2 l   @ 0009791384176 nodes with 0114880727942 6-TFS probes   
Solution [014] =  l' U  l' U2 D2 r  U  [inside 6-TFS] ---> l' D2 U2 r  U2 l   @ 0009793237564 nodes with 0114901055904 6-TFS probes   
Solution [015] =  l' U  l' u2 d2 l  U  [inside 6-TFS] ---> r' d2 u2 r  U2 l   @ 0009793306234 nodes with 0114901813611 6-TFS probes   
Solution [016] =  l2 u2 l  U2 r' u2 d2 [inside 6-TFS] ---> l' r  d2 l  U2 l   @ 0010362393288 nodes with 0121154498648 6-TFS probes   
Solution [017] =  l2 u2 l  U2 l' d2 r' [inside 6-TFS] ---> l  d2 u2 r  U2 l   @ 0010362395807 nodes with 0121154525043 6-TFS probes   
Solution [018] =  l2 u2 l  U2 l' d2 l  [inside 6-TFS] ---> r' d2 u2 r  U2 l   @ 0010362395809 nodes with 0121154525044 6-TFS probes   
Solution [019] =  l2 b2 l' F2 r  f2 r' [inside 6-TFS] ---> l  b2 f2 l' F2 l'  @ 0010678918496 nodes with 0124632168079 6-TFS probes   
Solution [020] =  l2 b2 l' F2 r  f2 l  [inside 6-TFS] ---> r' b2 f2 l' F2 l'  @ 0010678918498 nodes with 0124632168081 6-TFS probes   
Solution [021] =  l2 b2 l' F2 l  f2 b2 [inside 6-TFS] ---> l' r  f2 r' F2 l'  @ 0010678920936 nodes with 0124632195186 6-TFS probes
```


----------



## qqwref (Dec 1, 2014)

unsolved said:


> Yes, but as a former chess programmer, I am addicted to increasing move generator speed


That's certainly useful to do, but don't forget, the number of states that must be considered in a 4x4x4 solver is much higher than the number of states a chess or checkers program would ever need to look at  I bet chess and checkers solvers use their own kind of pruning too, although of course algorithms like alpha-beta pruning won't work on a single-player permutation 'game' like this.


There are a lot of interesting sequences in the output dump there. I don't have time to look at them all, but going through some of the 2-center cases I notice some do a similar thing - I wonder how many really unique optimal ways there are to do these things.


----------



## unsolved (Dec 3, 2014)

qqwref said:


> That's certainly useful to do, but don't forget, the number of states that must be considered in a 4x4x4 solver is much higher than the number of states a chess or checkers program would ever need to look at  I bet chess and checkers solvers use their own kind of pruning too, although of course algorithms like alpha-beta pruning won't work on a single-player permutation 'game' like this.
> 
> 
> There are a lot of interesting sequences in the output dump there. I don't have time to look at them all, but going through some of the 2-center cases I notice some do a similar thing - I wonder how many really unique optimal ways there are to do these things.



Bear in mind that the output is from the much older, and partially defective program. While the solutions are good, they are far from a complete set. Recall that version of the program "sat still"and wanted to be solved in its original position. So there are many 6-turn solutions that could not even be probed, because they were missing from the database. I am in the process of correcting this now. I am loading all 24 possible cube starting positions into RAM, and then solving them, 1 turn at a time, verifying explicitly that none are duplicates. This is harder than it sounds and a few obstacles are still impeding my latest attempts to make this work as efficiently as possible.

I should have a 2-turn or 3-turn implementation available in a day or two.


----------



## Christopher Mowla (Dec 3, 2014)

unsolved said:


> Bear in mind that the output is from the much older, and partially defective program. While the solutions are good, they are far from a complete set.


I wrote a permutation solver/generator, and I used a random number generator to find solutions, as computing all possible permutations would require dozens of gigabytes of RAM. Out of curiosity, did you use a random number generator for any portion of your chess programs?


----------



## unsolved (Dec 3, 2014)

cmowla said:


> I wrote a permutation solver/generator, and I used a random number generator to find solutions, as computing all possible permutations would require dozens of gigabytes of RAM. Out of curiosity, did you use a random number generator for any portion of your chess programs?



*EDIT: My TFS-03 database is now confirmed for all 24 rotated states as requiring a total of 34.84 Megabytes of RAM. Yes, MB and not GB, but it is only for 3-moves into the future. The good news is, I can chop 3-ply off of the tree at any level in the search. Testing it now...*

Well my program played on an 80-square board with 2 new types of chess pieces, and looked like this:






So it wasn't pure chess. Large random numbers were used in a static fashion for hash table lookups. It's strange how better randomness can improve the rate at which you can find things in large tables.

Download Link


----------



## unsolved (Dec 4, 2014)

cuBerBruce said:


> EDIT (appending):
> I tried the following scramble on OO4x4x4 version 1.2.3 and 1.2.8:
> 
> L l r' F f b' R r l' F2 f2 b2 L l U u d' R2 r2 l2
> ...



I have to thank you for coming up with a clear case to document what was wrong with my old solver. The current version of my program, 2.0.4, handles this without any strain. In fact, it "over-handles" it.

http://lightningcloudcomputing.com/OO_4x4x4_204.zip






I have no corner pruning yet, but I do use the 1-, 2-, and 3-Turn-From-Solved database in 2 separate ways (which might be causing some of the "over-solves" in solutions 0001-0027, 0029-0043, and 0045 and 0046 (there are more even). The optimal solution is 8-plies, so I would expect *OO_4x4x4* to hit it at ply 5 with the 3-TFS database. It didn't. Yet at ply 8 we see a flurry of TFS activity, all 3 databases showcasing solutions, and a "native" depth 8 solution first appearing in solution 0028.

My current thinking is that the following logic is flawed:

A. If there are 3 ply remaining in the search, if a database probe of 3-TFS misses, and 2-TFS misses, and 1-TFS misses, the cube cannot be solved in 3 more moves, so prune it.
B. If there are 2 ply remaining in the search, if a database probe of 2-TFS misses, and 1-TFS misses, the cube cannot be solved in 2 more moves, so prune it.
C. If there is 1 ply remaining in the search, if a database probe of 1-TFS misses, the cube cannot be solved in 1 more move, so prune it.

This is the only set of pruning being carried out by the program before engaging the move generator.

After engaging the move generator, if depth == 0, I check to see if the cube is solved, or in 1-TFS, 2-TFS, and 3-TFS. That is what is being displayed when you see *[inside TFS]*.

So if A,B, and C, are correct above, could that mean the Jakube Move Generator is self-auditing moves that should be sent forth? I am really scratching my head over this one.


----------



## qqwref (Dec 5, 2014)

unsolved said:


> My current thinking is that the following logic is flawed:
> 
> A. If there are 3 ply remaining in the search, if a database probe of 3-TFS misses, and 2-TFS misses, and 1-TFS misses, the cube cannot be solved in 3 more moves, so prune it.
> B. If there are 2 ply remaining in the search, if a database probe of 2-TFS misses, and 1-TFS misses, the cube cannot be solved in 2 more moves, so prune it.
> C. If there is 1 ply remaining in the search, if a database probe of 1-TFS misses, the cube cannot be solved in 1 more move, so prune it.


What does it mean to have "3 ply remaining"? You don't know how long the solution is. I hope you are not reasoning as follows:
- Suppose current searching depth is 5.
- We have done 2 moves. 3 moves are thus "remaining". This position of course cannot be solved in 3 more moves, so prune it.

If that is indeed what you meant by A, B, and C above, then I see the problem. That reasoning is only correct if your current depth is (at least) the length of the optimal solution. A 2-move solution is only in the 3-TFS database if there is a 5-move optimal solution, but you are not looking for a 5-move solution, you are looking for a (5+3)-move solution - the position shouldn't even show up in your databases until you get 5 moves deep. So instead of finding those (5+3)-move solutions, your program prunes everything until it gets to a searching depth of 8, the same as the optimal solution. Then and only then will it let itself find solutions - and it finds everything from 8+0 to 8+3 moves, as you see above.


And, if that is indeed what you are doing, I suggest the following change in the searching algorithm, in pseudocode:

```
OLD:
let database_depth = 3
loop on search_depth = 1, 2, 3, ... until we find a solution
 loop through tree of positions of length up to search_depth
  if search_depth - position_depth is 3 and position not in 3-TFS, 2-TFS, 1-TFS: prune
  if search_depth - position_depth is 2 and position not in 2-TFS, 1-TFS: prune
  if search_depth - position_depth is 1 and position not in 1-TFS: prune
  if search_depth = position_depth and position in 3-TFS, 2-TFS, 1-TFS, 0-TFS: print solution

NEW:
let database_depth = 3
loop on search_depth = 1, 2, 3, ... until we find a solution
 loop through tree of positions of length up to (search_depth - database_depth)
  [add new pruning which is not based on TFS databases here]
  if search_depth - database_depth = position_depth and position in 3-TFS, 2-TFS, 1-TFS, 0-TFS: print solution
                                                                    // solution will almost always be found in the 3-TFS
```


----------



## unsolved (Dec 5, 2014)

qqwref said:


> What does it mean to have "3 ply remaining"? You don't know how long the solution is. I hope you are not reasoning as follows...
> 
> If that is indeed what you meant by A, B, and C above, then I see the problem.



I see the problem too. I am an idiot 

And, although I like the search depth, my guess is that my corner pruning database is not working.






*EDIT: On second thought, I think I will keep this mistake hanging around for a while.*


----------



## unsolved (Dec 5, 2014)

qqwref said:


> What does it mean to have "3 ply remaining"? You don't know how long the solution is. I hope you are not reasoning as follows...
> 
> If that is indeed what you meant by A, B, and C above, then I see the problem.



By the way, thanks for shedding light on the subject. That is pretty much exactly what I was doing. It explains the "race to the front door," then the preponderance of solutions all at once. I have implemented your suggestion, which amounts to back-end pruning. Bruce's corner database is for forward pruning. I have disabled all of the forward pruning sections in my code, and now I get this humble, ordinary (but correct) version of a brute force solver:






I got this position from the old "stationary" 6-TFS database run where I solved all permutations of centers. Although clearly faulty, it produced this set of data in seconds:


```
TOP                     FRONT                   RIGHT
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|OOOO|OOOO|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|####|####|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------
|####|####|####|####|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|
---------------------   ---------------------   ---------------------


BOTTOM                  BACK                    LEFT
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------
|~~~~|~~~~|~~~~|~~~~|   |&&&&|&&&&|&&&&|&&&&|   |^^^^|^^^^|^^^^|^^^^|
---------------------   ---------------------   ---------------------



Solution [001] =  r  U  l  d2 [inside 6-TFS] ---> l' r  d2 r' U' r'  @ 0000000348741 nodes with 0000004171213 6-TFS probes   
Solution [002] =  r' F' r' b2 [inside 6-TFS] ---> l' r  b2 l  F  r   @ 0000000387201 nodes with 0000004592087 6-TFS probes   
Solution [003] =  r' F' l' b2 [inside 6-TFS] ---> l  r' b2 r  F  r   @ 0000000387285 nodes with 0000004592754 6-TFS probes   
Solution [004] =  l  F  r  b2 [inside 6-TFS] ---> l  r' b2 l' F' l'  @ 0000000431064 nodes with 0000005075019 6-TFS probes   
Solution [005] =  l  F  l  b2 [inside 6-TFS] ---> l' r  b2 r' F' l'  @ 0000000431151 nodes with 0000005075484 6-TFS probes   
Solution [006] =  l' U' r' d2 [inside 6-TFS] ---> l' r  d2 l  U  l   @ 0000000441516 nodes with 0000005190336 6-TFS probes   
Solution [007] =  l' U' l' d2 [inside 6-TFS] ---> l  r' d2 r  U  l   @ 0000000441603 nodes with 0000005191422 6-TFS probes
```

It has missed some solutions due to the 6-TFS not being correct, having generated moves from its locked starting arrangement, as if glued to the desk.

I seem to be suffering from the ignominy of having defective versions of my program vastly outperforming the solid, reliable version of it.

If somebody could verify that there are only 16 solutions to the 2-center position above, I would appreciate it. Since it took over half an hour to sluggishly get to less than 1/3rd of the moves at that depth, I am not going to wait around and see if any more pop up.


----------



## unsolved (Dec 5, 2014)

I released 3 different "flavors" of version 2.0.5 today: Heavy Pruning, Light Pruning, No Pruning. They are all available from the same download. Just launch whichever app you want to play with

http://lightningcloudcomputing.com/OO_4x4x4_205.zip

*Version 2.0.5 Heavy Pruning*
Uses a forward pruning technique heavily borrowed from the concept of the History Heuristic in chess. Each move accumulates a "history score" that increases if there are more cubes per side in the current ply as a result of the move having been made. There is a "period of observation" where the totals are computed, then a "period of action" when pruning takes place. If moves continue to have decreasing history scores they are pruned aggressively. The result is shown below: A single solution is found in a relatively short period of time. The nodes/second is low because the program does not reach terminal nodes nearly as often (so they are not counted).






*Version 2.0.5 Light Pruning*

Uses the same forward pruning technique but with a much longer "period of observation" and a much less aggressive criteria for pruning during the "period of action" when pruning takes place. It will generally find at least half of all available solutions, in about 1/10th the time of the "No Pruning" version.





*Version 2.0.5 No Pruning*
If you want every possible solution, and are prepared to wait, this is the version for you. It won't miss a single solution, but the time-to-depth is agonizing.


----------



## Carrot (Dec 7, 2014)

If the heavy pruning is supposed to find at least one optimal solution, then it doesn't work 


Spoiler



http://i.imgur.com/kjnISye.png


----------



## unsolved (Dec 7, 2014)

Carrot said:


> If the heavy pruning is supposed to find at least one optimal solution, then it doesn't work



It looks like the TFS database at the end is just "undoing" the last 3 moves made. So... it does and it doesn't. This "overshoot problem" is a known issue. Somehow the TFS is finding the solve at a greater depth to give a solution = to the nominal search depth. So a 23-ply search, with the last 3 plies in the database undoing the last 3 moves made, gives you a 20-ply solution. I know, crazy, right? It's supposed to be the other way around, finding a 20-ply solution after 17 plies of search.


----------



## cuBerBruce (Dec 7, 2014)

A solver that guarantees optimality of solutions always uses admissible heuristics for pruning. Since you choose not to use admissible heuristics, you should not be surprised that optimal solutions are missed.


----------



## Carrot (Dec 7, 2014)

unsolved said:


> It looks like the TFS database at the end is just "undoing" the last 3 moves made. So... it does and it doesn't. This "overshoot problem" is a known issue. Somehow the TFS is finding the solve at a greater depth to give a solution = to the nominal search depth. So a 23-ply search, with the last 3 plies in the database undoing the last 3 moves made, gives you a 20-ply solution. I know, crazy, right? It's supposed to be the other way around, finding a 20-ply solution after 17 plies of search.
> 
> http://i.imgur.com/kjnISye.png



the last 3 moves are not canceling.

however, R' r' l could just have been written as L'


----------



## qqwref (Dec 7, 2014)

Yeah, it's not undoing the moves, those last 7 or so moves are just a PLL parity algorithm. But as Bruce said, you are pruning positions that could be part of optimal solutions. So sometimes you will find the optimal solutions, but sometimes you will not see them.

Pruning too many positions can be a really strong technique for suboptimal solvers - I have used it for a puzzle game solver I made, where I took the 'best' N positions from each depth so as to get very deep without running out of memory. But for optimal solving you need an admissible heuristic, which means you only throw out positions when you can guarantee they will not lead to a solution of the given length.


----------



## unsolved (Dec 7, 2014)

Carrot said:


> the last 3 moves are not canceling.



Ah, you are correct. I spoke too soon. I was so used to seeing moves being undone in some of my own testing.



cuBerBruce said:


> A solver that guarantees optimality of solutions always uses admissible heuristics for pruning. Since you choose not to use admissible heuristics, you should not be surprised that optimal solutions are missed.



It's called _experimenting _Bruce. Sometimes you have to try new things to see how they work out.

The algorithm shows great promise. With a deeper understanding and some fine tuning, it could be perfected.



qqwref said:


> But for optimal solving you need an admissible heuristic, which means you only throw out positions when you can guarantee they will not lead to a solution of the given length.



Indeed  Let's just say I am working on trying to make this one admissible then.


----------



## cuBerBruce (Dec 8, 2014)

unsolved said:


> It's called _experimenting _Bruce. Sometimes you have to try new things to see how they work out.



You generally do not get an admissable heuristic through "experimenting" or ad hoc trial and error techniques. You get an admissible heuristic through using techniques that provably give you admissible heuristics. One of the most common ways is using a subset of pieces, and building a table of how many moves are required to solve each of the various arrangements of those pieces.

I'm not saying that it's necessarily bad to experiment with non-admissible heuristics. If you can create a solver that will solve "random" positions in under 40 moves fairly quickly, even if the solutions are not necessarily optimal, that would probably be considered very useful. As qqwref mentioned, you might be able to find solutions for deep positions faster with non-admmissible pruining, you just can't expect to necessarily get the optimal solutions.


----------



## unsolved (Dec 8, 2014)

cuBerBruce said:


> You generally do not get an admissable heuristic through "experimenting" or ad hoc trial and error techniques.



A PV that leads to a solution must start to converge at one point in time. I can guarantee, if you are 1 move away from a solution, you must have at least 2 opposite sides of the cube solved. It's very easy to test for, and if depth == 1 and that condition is absent, there is no move, real or imagined, that will solve the cube.

If you are 2 moves away, and any one of your 6 sides has 4 different colors for centers, you'll never solve it in 2 moves.

These are the types of heuristics I am discovering through Karnaugh Map reductions of the entire n-move domain.

Sometimes I am not implementing them properly, and I prune a node that would converge on a solution. Or sometimes the heuristic is "off by 1" in the depth at which it is applied, then I have to reconfirm it (takes over a hundred hours for some of the more complex ones).

Once I get all the kinks out, these will be what you call admissible.

You have to admit, finding a few 22-ply solves in under a minute is pretty cool.


----------



## qqwref (Dec 9, 2014)

Yeah, that's definitely a cool application. I don't know if they're optimal, but 14 btm is pretty cool.


----------



## Christopher Mowla (Dec 9, 2014)

qqwref said:


> I don't know if they're optimal, but 14 btm is pretty cool.


Not in btm, but close. y f' 2L' f r2 f' 2L f' 2D' f2 r2 u 2R2 u' (but in single slice turns, his algs are optimal, and therefore his solver "did its job").

@unsolved, I just grabbed these from one of my old (long) posts which might be of interest to you.


Spoiler: algs



_I believe these are all possible 8 BQTM 1x2x2 block 3-cycle algorithms._ _The algorithm I used to create the 13 btm solution above is 10 BQTM, but 8 btm: _Rw2 Uw' l' Uw Rw2 Uw' l Uw_._

Case 1
Alg 1.
Rw' Fw' Rw b' Rw' Fw Rw b
Wide Turn Equivalences (3)
Rw' Bw' Dw b' Dw' Bw Rw b
Lw' Uw' Lw b' Lw' Uw Lw b
Lw' Dw' Bw r' Bw' Dw Lw b
Alg 2.
b Lw Fw' Lw' b' Lw Fw Lw'
Wide Turn Equivalences (3)
b Lw Bw' Uw' b' Uw Bw Lw'
b Rw Uw' Rw' b' Rw Uw Rw'
b Rw Dw' Fw' r' Fw Dw Rw'

Case 2
Lw' b Lw Fw' Lw' b' Lw Fw
Wide Turn Equivalences (3)
Lw' b Lw Bw' Uw' b' Uw Bw
Rw' u Rw Fw' Rw' u' Rw Fw
Rw' u Rw Bw' Dw' r' Dw Bw

Case 3
r' Dw r Uw r' Dw' r Uw'
Wide Turn Equivalences (3)
r' Uw f Uw f' Uw' r Uw'
r' Dw r Dw b' Dw' b Dw'
r' Uw f Dw r' Uw' b Dw'

Case 4
Uw' Rw d' Rw' Uw Rw d Rw'
Wide Turn Equivalences (3)
Dw' Fw d' Fw' Dw Rw d Rw'
Uw' Lw b' Lw' Uw Lw b Lw'
Dw' Bw r' Bw' Dw Lw b Lw' 

Case 5
Alg 1.
Rw' Fw' Rw b Rw' Fw Rw b'
Wide Turn Equivalences (3)
Rw' Bw' Dw b Dw' Bw Rw b'
Lw' Uw' Lw b Lw' Uw Lw b'
Lw' Dw' Bw r Bw' Dw Lw b'
Alg 2.
Uw' Rw d Rw' Uw Rw d' Rw'
Wide Turn Equivalences (3)
Dw' Fw d Fw' Dw Rw d' Rw'
Uw' Lw b Lw' Uw Lw b' Lw'
Dw' Bw r Bw' Dw Lw b' Lw'

Case 6
Alg 1.
Fw d Fw' Uw Fw d' Fw' Uw'
Wide Turn Equivalences (3)
Fw d Fw' Dw Rw d' Rw' Dw'
Bw r Bw' Uw Bw r' Bw' Uw'
Bw r Bw' Dw Lw b' Lw' Dw'
Alg 2.
Uw' b' Dw b Uw b' Dw' b
Wide Turn Equivalences (3)
Dw' r' Dw r Dw b' Dw' b
Uw' b' Uw r Uw r' Uw' b
Dw' r' Uw f Dw r' Uw' b

Case 7
Uw Lw' Uw' r' Uw Lw Uw' r
Wide Turn Equivalences (3)
Uw Rw' Fw' r' Fw Rw Uw' r
Dw Fw' Dw' r' Dw Fw Dw' r
Dw Bw' Lw' d' Lw Bw Dw' r


_I found all of those with the hope of finding a shorter single dedge flip algorithm (in BQTM) than 19, but I didn't su__cceed_.

Here's a 19 btm single dedge flip algorithm from your first solution. 
r' U' 2B u2 f2 2D f2 2D' f2 2U f2 2U' r2 2D r2 u2 2B' U r


----------



## unsolved (Dec 9, 2014)

cmowla said:


> Not in btm, but close. y f' 2L' f r2 f' 2L f' 2D' f2 r2 u 2R2 u' (but in single slice turns, his algs are optimal, and therefore his solver "did its job").
> 
> @unsolved, I just grabbed these from one of my old (long) posts which might be of interest to you.
> 
> ...



Yes, that is like my favorite alg for the single dedge flip! I guess if this version of OO_4x4x4 proves to be stable, it will be time to start working on a Block Turn version. As for the latest developments:


I am hopeful now. Every time Bruce gives me a kick in the pants, I end up staying awake all night and retasking about 30 CPUs to bang on stuff 

So here is what I did:

1. I eliminated EVERY heuristic in the *Inexact Pattern Singular Distance Heuristic Database* that did not have a 100% tautology table matchup in the Karnaugh Map Database. That is a real shame, because some were at 88% to 95% and would prune like a hot knife through butter. But, the ones that remain are what Bruce would have to call admissible. The beauty of a Bitmap Move Generator is you can perform bit-ANDs across every cube from every possible position in a given depth, and the resulting pattern masks are those that did not occur. Pass these patterns into a Karnaugh Map analyzer, and you get a "logical expression" that precipitates out. So one line of code has the power to determine what cubes can't possibly be in a solution set bounded by a certain range of depths. I am keeping my fingers crossed that version 2.0.7 is working properly.

2. I stratified my databases by function. There are 3 types: *Exact Pattern Complete Solution Database*, which is what I used to call the *Turns From Solved* databases. Match a pattern in here, and not only do you _not _have to search, you get the solution returned. A *Partial Pattern Minimal Distance Database* is one that is populated with "Ghost Squares," or what are called "Don't Care" conditions in Karnaugh Maps. As long as the unghosted squares match, then the minimum distance for a solution is known with 100% certainty. If you are 3 plies away and in a Minimal Distance of 4 or more to solve the cube, you can prune the branch, not just the node. Lastly, the *Inexact Pattern Singular Minimal Distance* database, which contains the opposite kind of information. It pulls data from a corner-pruner and center-pruner, so there is some "inexactness" here. In such a position, you know there is a solution either in the next *n - m bounded* moves, or there can't be a solution before n moves. So you take a "wait and see" approach. The cutoff becomes conditional.

3. Lastly, I built a 1 GB + massive Solution Transposition Filter mechanism. Beyond two pairs of transposing opposite face moves appearing in conjunction in a solution, all rotated and flipped versions are pruned. This means you will need about 2 GB of RAM to use version 2.0.7 or later. The results of this seem to be good so far. It can still crank out many solutions, as shown below:


```
Omnia Obtorquebantur 4x4x4 Version 2.0.7 [with Partial Pattern Minimal Distance Pruning] compiled on December 07, 2014.



                          TOP
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|^^^^|^^^^|&&&&|   |OOOO|&&&&|&&&&|OOOO|   |XXXX|OOOO|OOOO|XXXX|   |^^^^|XXXX|XXXX|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|   |^^^^|^^^^|^^^^|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|   |^^^^|^^^^|^^^^|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |OOOO|OOOO|OOOO|OOOO|   |XXXX|XXXX|XXXX|XXXX|   |^^^^|^^^^|^^^^|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------


 
  Solutions To Scramble = u2 b2 l2 D f2 D2 r2 D' r2 D2 b2 l2 u2 
 
  Solution [0001] =  u2 l2 b2 U  l2 D2 f2 U' f2 U2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031166759 nodes [time = 01:25]
  Solution [0002] =  u2 l2 b2 U  l2 D2 f2 U' f2 D2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031166768 nodes [time = 01:25]
  Solution [0003] =  u2 l2 b2 U' b2 U2 l2 U  b2 U2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031298258 nodes [time = 01:25]
  Solution [0004] =  u2 l2 b2 U' b2 U2 l2 U  b2 D2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031298267 nodes [time = 01:25]
  Solution [0005] =  u2 l2 b2 U' b2 D2 r2 U  f2 U2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031300909 nodes [time = 01:25]
  Solution [0006] =  u2 l2 b2 U' b2 D2 r2 U  f2 D2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031300918 nodes [time = 01:25]
  Solution [0007] =  u2 l2 b2 U2 l2 U  b2 U2 l2 U'  [inside 3-TFS] --->  l2 b2 u2  @ 000000031322138 nodes [time = 01:25]
  Solution [0008] =  u2 l2 b2 U2 l2 U  b2 D2 r2 U'  [inside 3-TFS] --->  r2 f2 d2  @ 000000031323644 nodes [time = 01:25]
  Solution [0009] =  u2 l2 b2 U2 l2 U' l2 U2 b2 U   [inside 3-TFS] --->  l2 b2 u2  @ 000000031323908 nodes [time = 01:25]
  Solution [0010] =  u2 l2 b2 U2 l2 U' l2 D2 f2 U   [inside 3-TFS] --->  r2 f2 d2  @ 000000031323964 nodes [time = 01:25]
  Solution [0011] =  u2 l2 b2 U2 l2 D' b2 U2 r2 D   [inside 3-TFS] --->  l2 b2 u2  @ 000000031359641 nodes [time = 01:25]
  Solution [0012] =  u2 l2 b2 U2 l2 D' b2 D2 l2 D   [inside 3-TFS] --->  r2 f2 d2  @ 000000031359801 nodes [time = 01:25]
  Solution [0013] =  u2 l2 b2 U2 l2 D  l2 U2 f2 D'  [inside 3-TFS] --->  l2 b2 u2  @ 000000031361702 nodes [time = 01:25]
  Solution [0014] =  u2 l2 b2 U2 l2 D  l2 D2 b2 D'  [inside 3-TFS] --->  r2 f2 d2  @ 000000031362974 nodes [time = 01:25]
  Solution [0015] =  u2 l2 b2 D' r2 D2 f2 D  f2 U2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031525567 nodes [time = 01:25]
  Solution [0016] =  u2 l2 b2 D' r2 D2 f2 D  f2 D2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031525576 nodes [time = 01:25]
  Solution [0017] =  u2 l2 b2 D  f2 U2 l2 D' b2 U2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031548275 nodes [time = 01:25]
  Solution [0018] =  u2 l2 b2 D  f2 U2 l2 D' b2 D2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031548284 nodes [time = 01:25]
  Solution [0019] =  u2 l2 b2 D  f2 D2 r2 D' f2 U2  [inside 3-TFS] --->  r2 f2 d2  @ 000000031550333 nodes [time = 01:25]
  Solution [0020] =  u2 l2 b2 D  f2 D2 r2 D' f2 D2  [inside 3-TFS] --->  l2 b2 u2  @ 000000031550342 nodes [time = 01:25]
  Solution [0021] =  u2 l2 b2 D2 r2 U  f2 U2 r2 U'  [inside 3-TFS] --->  r2 f2 d2  @ 000000031590045 nodes [time = 01:26]
  Solution [0022] =  u2 l2 b2 D2 r2 U  f2 D2 l2 U'  [inside 3-TFS] --->  l2 b2 u2  @ 000000031591614 nodes [time = 01:26]
  Solution [0023] =  u2 l2 b2 D2 r2 U' r2 U2 f2 U   [inside 3-TFS] --->  r2 f2 d2  @ 000000031592048 nodes [time = 01:26]
  Solution [0024] =  u2 l2 b2 D2 r2 U' r2 D2 b2 U   [inside 3-TFS] --->  l2 b2 u2  @ 000000031592168 nodes [time = 01:26]
  Solution [0025] =  u2 l2 b2 D2 r2 D' f2 U2 l2 D   [inside 3-TFS] --->  r2 f2 d2  @ 000000031606094 nodes [time = 01:26]
  Solution [0026] =  u2 l2 b2 D2 r2 D' f2 D2 r2 D   [inside 3-TFS] --->  l2 b2 u2  @ 000000031606269 nodes [time = 01:26]
  Solution [0027] =  u2 l2 b2 D2 r2 D  r2 U2 b2 D'  [inside 3-TFS] --->  r2 f2 d2  @ 000000031612317 nodes [time = 01:26]
  Solution [0028] =  u2 l2 b2 D2 r2 D  r2 D2 f2 D'  [inside 3-TFS] --->  l2 b2 u2  @ 000000031615566 nodes [time = 01:26]
  Solution [0029] =  d2 l2 b2 U  l2 U2 b2 U' b2 U2  [inside 3-TFS] --->  l2 b2 d2  @ 000000039898690 nodes [time = 01:44]
  Solution [0030] =  d2 l2 b2 U  l2 U2 b2 U' b2 D2  [inside 3-TFS] --->  r2 f2 u2  @ 000000039898699 nodes [time = 01:44]
  Solution [0031] =  d2 l2 b2 U' b2 U2 l2 U  b2 U2  [inside 3-TFS] --->  l2 b2 d2  @ 000000040032252 nodes [time = 01:45]
  Solution [0032] =  d2 l2 b2 U' b2 U2 l2 U  b2 D2  [inside 3-TFS] --->  r2 f2 u2  @ 000000040032261 nodes [time = 01:45]
  Solution [0033] =  d2 l2 b2 U' b2 D2 r2 U  f2 U2  [inside 3-TFS] --->  r2 f2 u2  @ 000000040034539 nodes [time = 01:45]
  Solution [0034] =  d2 l2 b2 U' b2 D2 r2 U  f2 D2  [inside 3-TFS] --->  l2 b2 d2  @ 000000040034548 nodes [time = 01:45]
  Solution [0035] =  d2 l2 b2 U2 l2 U  b2 U2 l2 U'  [inside 3-TFS] --->  l2 b2 d2  @ 000000040079858 nodes [time = 01:45]
  Solution [0036] =  d2 l2 b2 U2 l2 U  b2 D2 r2 U'  [inside 3-TFS] --->  r2 f2 u2  @ 000000040081408 nodes [time = 01:45]
  Solution [0037] =  d2 l2 b2 U2 l2 U' l2 U2 b2 U   [inside 3-TFS] --->  l2 b2 d2  @ 000000040081739 nodes [time = 01:45]
  Solution [0038] =  d2 l2 b2 U2 l2 U' l2 D2 f2 U   [inside 3-TFS] --->  r2 f2 u2  @ 000000040081848 nodes [time = 01:45]
  Solution [0039] =  d2 l2 b2 U2 l2 D' b2 U2 r2 D   [inside 3-TFS] --->  l2 b2 d2  @ 000000040095844 nodes [time = 01:45]
  Solution [0040] =  d2 l2 b2 U2 l2 D' b2 D2 l2 D   [inside 3-TFS] --->  r2 f2 u2  @ 000000040096032 nodes [time = 01:45]
  Solution [0041] =  d2 l2 b2 U2 l2 D  l2 U2 f2 D'  [inside 3-TFS] --->  l2 b2 d2  @ 000000040102735 nodes [time = 01:45]
  Solution [0042] =  d2 l2 b2 U2 l2 D  l2 D2 b2 D'  [inside 3-TFS] --->  r2 f2 u2  @ 000000040106130 nodes [time = 01:45]
  Solution [0043] =  d2 l2 b2 D' r2 U2 b2 D  b2 U2  [inside 3-TFS] --->  l2 b2 d2  @ 000000040321939 nodes [time = 01:46]
  Solution [0044] =  d2 l2 b2 D' r2 U2 b2 D  b2 D2  [inside 3-TFS] --->  r2 f2 u2  @ 000000040321948 nodes [time = 01:46]
  Solution [0045] =  d2 l2 b2 D  f2 U2 l2 D' b2 U2  [inside 3-TFS] --->  l2 b2 d2  @ 000000040333910 nodes [time = 01:46]
  Solution [0046] =  d2 l2 b2 D  f2 U2 l2 D' b2 D2  [inside 3-TFS] --->  r2 f2 u2  @ 000000040333919 nodes [time = 01:46]
  Solution [0047] =  d2 l2 b2 D  f2 D2 r2 D' f2 U2  [inside 3-TFS] --->  r2 f2 u2  @ 000000040336240 nodes [time = 01:46]
  Solution [0048] =  d2 l2 b2 D  f2 D2 r2 D' f2 D2  [inside 3-TFS] --->  l2 b2 d2  @ 000000040336249 nodes [time = 01:46]
  Solution [0049] =  d2 l2 b2 D2 r2 U  f2 U2 r2 U'  [inside 3-TFS] --->  r2 f2 u2  @ 000000040351316 nodes [time = 01:46]
  Solution [0050] =  d2 l2 b2 D2 r2 U  f2 D2 l2 U'  [inside 3-TFS] --->  l2 b2 d2  @ 000000040352865 nodes [time = 01:46]
  Solution [0051] =  d2 l2 b2 D2 r2 U' r2 U2 f2 U   [inside 3-TFS] --->  r2 f2 u2  @ 000000040353284 nodes [time = 01:46]
  Solution [0052] =  d2 l2 b2 D2 r2 U' r2 D2 b2 U   [inside 3-TFS] --->  l2 b2 d2  @ 000000040353350 nodes [time = 01:46]
  Solution [0053] =  d2 l2 b2 D2 r2 D' f2 U2 l2 D   [inside 3-TFS] --->  r2 f2 u2  @ 000000040389180 nodes [time = 01:46]
  Solution [0054] =  d2 l2 b2 D2 r2 D' f2 D2 r2 D   [inside 3-TFS] --->  l2 b2 d2  @ 000000040389328 nodes [time = 01:46]
  Solution [0055] =  d2 l2 b2 D2 r2 D  r2 U2 b2 D'  [inside 3-TFS] --->  r2 f2 u2  @ 000000040391295 nodes [time = 01:46]
  Solution [0056] =  d2 l2 b2 D2 r2 D  r2 D2 f2 D'  [inside 3-TFS] --->  l2 b2 d2  @ 000000040392453 nodes [time = 01:46]
```






But on a side note, the 22-move "snake" positions are now effectively out of range. Those heavy pruning algos that were not 100% admissible are now out of version 2.0.7, so it looks like 15-plies is a functional limit of what it can do in a about 2-3 minutes.


----------



## Christopher Mowla (Dec 9, 2014)

15 move solutions in 2-3 minutes? Wow, that's impressive! These solutions are impressive as well (as are all solutions you have found with your solver so far!).


----------



## unsolved (Dec 9, 2014)

cmowla said:


> 15 move solutions in 2-3 minutes? Wow, that's impressive! These solutions are impressive as well (as are all solutions you have found with your solver so far!).



Thanks.

But it's a 33 MB download now, compressed. Also requires 2.1 GB of RAM to run.

http://lightningcloudcomputing.com/OO_4x4x4_207.zip


----------



## cuBerBruce (Dec 9, 2014)

I tried the UF dedge flip position, and it clearly is not generating all optimal solutions. It only generates three solutions. All of them start with r2. None of them start with l2. Also, none start with r2 U2 B2 (although all 3 solutions found end with B2 U2 r2). Also, none started with r2 D2 F2.

It spent several minutes searching for solutions starting with r2. It spent little or no time searching for solutions starting with l2.

What's worse, I tried the scramble: r2 B2 U2 l U2 r' U2 r U2 F2 r F2 l' B2 D2 F2 which can be solved in 12 moves. It is 3 moves away from the UF dedge flip position. Version 2.0.7 didn't even solve this in its "depth 12-15" search. (I tried this based upon the lack of solutions starting with r2 D2 F2 for the dedge flip.)

Clearly there is still over-aggressive pruning going on (at least if you're expecting to get optimal solutions).


----------



## unsolved (Dec 9, 2014)

cuBerBruce said:


> I tried the UF dedge flip position, and it clearly is not generating all optimal solutions. It only generates three solutions. All of them start with r2. None of them start with l2. Also, none start with r2 U2 B2 (although all 3 solutions found end with B2 U2 r2). Also, none started with r2 D2 F2.
> 
> It spent several minutes searching for solutions starting with r2. It spent little or no time searching for solutions starting with l2.
> 
> ...



Well I am going to have to write the most detailed chronicling tool ever to debug this one. I highly suspect the transposition code based on what you said. I wanted to avoid the "large dump" of solutions that some scrambles produce, such as:

*l2 R2 [ROTATE z'] l2 R2 [ROTATE x'] [ROTATE z'] [ROTATE x] l2 R2 [ROTATE y] [ROTATE x] l2 R2 [ROTATE y]* and *u2 l2 b2 U l2 D2 f2 U' f2 U2* There are so many mirrors/rotations that the complete set of solutions borders on ridiculous. So I started hashing cubes already generated during the searching process, rotated each of them to the other 23 states, and hashed them as well. Should they ever arise again during the search, I pruned them. But as the hash table fills up, I used an aging mechanism to determine which entries to overwrite. Oldest entries are overwritten first. I suspect therein lies the culprit, so I'll start there.

Good detective work Bruce.


----------



## qqwref (Dec 10, 2014)

Ah, but wouldn't the pruning cubes you have already seen make it pretty much impossible to generate all optimal solutions? All you can really be sure of is that solutions won't have rotations in them. That said, you can certainly prune an already-known state if you know it can be reached in fewer moves than what you just did.


----------



## unsolved (Dec 10, 2014)

qqwref said:


> Ah, but wouldn't the pruning cubes you have already seen make it pretty much impossible to generate all optimal solutions? All you can really be sure of is that solutions won't have rotations in them. That said, you can certainly prune an already-known state if you know it can be reached in fewer moves than what you just did.



I wanted to avoid output like this:


```
Omnia Obtorquebantur 4x4x4 Version 2.0.5 compiled on December 05, 2014. Copyright (c) 2014 by Ed Trice.



                          TOP
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |~~~~|####|~~~~|####|   |XXXX|XXXX|XXXX|XXXX|   |####|~~~~|####|~~~~|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |####|~~~~|####|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |~~~~|####|~~~~|####|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |~~~~|####|~~~~|####|   |XXXX|XXXX|XXXX|XXXX|   |####|~~~~|####|~~~~|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |####|~~~~|####|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |~~~~|####|~~~~|####|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------


 
  Solutions To Scramble = l2 R2 [ROTATE z'] l2 R2 [ROTATE x'] [ROTATE z'] [ROTATE x] l2 R2 [ROTATE y] [ROTATE x] l2 R2 [ROTATE y] 
 
  Solution [0001] =  R2 l2 U2 d2 F2  [inside 3-TFS] --->  b2 d2 U2  @ 000000002423835 nodes [time = 00:01]
  Solution [0002] =  R2 l2 U2 d2 f2  [inside 3-TFS] --->  B2 d2 U2  @ 000000002423838 nodes [time = 00:01]
  Solution [0003] =  R2 l2 U2 d2 b2  [inside 3-TFS] --->  F2 d2 U2  @ 000000002423841 nodes [time = 00:01]
  Solution [0004] =  R2 l2 U2 d2 B2  [inside 3-TFS] --->  f2 d2 U2  @ 000000002423844 nodes [time = 00:01]
  Solution [0005] =  R2 l2 u2 D2 F2  [inside 3-TFS] --->  b2 D2 u2  @ 000000002426418 nodes [time = 00:01]
  Solution [0006] =  R2 l2 u2 D2 f2  [inside 3-TFS] --->  B2 D2 u2  @ 000000002426421 nodes [time = 00:01]
  Solution [0007] =  R2 l2 u2 D2 b2  [inside 3-TFS] --->  F2 D2 u2  @ 000000002426424 nodes [time = 00:01]
  Solution [0008] =  R2 l2 u2 D2 B2  [inside 3-TFS] --->  f2 D2 u2  @ 000000002426427 nodes [time = 00:01]
  Solution [0009] =  R2 l2 F2 b2 U2  [inside 3-TFS] --->  d2 b2 F2  @ 000000002433786 nodes [time = 00:01]
  Solution [0010] =  R2 l2 F2 b2 u2  [inside 3-TFS] --->  D2 b2 F2  @ 000000002433789 nodes [time = 00:01]
  Solution [0011] =  R2 l2 F2 b2 d2  [inside 3-TFS] --->  U2 b2 F2  @ 000000002433792 nodes [time = 00:01]
  Solution [0012] =  R2 l2 F2 b2 D2  [inside 3-TFS] --->  u2 b2 F2  @ 000000002433795 nodes [time = 00:01]
  Solution [0013] =  R2 l2 f2 B2 U2  [inside 3-TFS] --->  d2 B2 f2  @ 000000002436372 nodes [time = 00:01]
  Solution [0014] =  R2 l2 f2 B2 u2  [inside 3-TFS] --->  D2 B2 f2  @ 000000002436375 nodes [time = 00:01]
  Solution [0015] =  R2 l2 f2 B2 d2  [inside 3-TFS] --->  U2 B2 f2  @ 000000002436378 nodes [time = 00:01]
  Solution [0016] =  R2 l2 f2 B2 D2  [inside 3-TFS] --->  u2 B2 f2  @ 000000002436381 nodes [time = 00:01]
  Solution [0017] =  R2 U2 d2 F2 b2  [inside 3-TFS] --->  d2 U2 l2  @ 000000002564628 nodes [time = 00:01]
  Solution [0018] =  R2 U2 d2 f2 B2  [inside 3-TFS] --->  d2 U2 l2  @ 000000002564721 nodes [time = 00:01]
  Solution [0019] =  R2 u2 D2 F2 b2  [inside 3-TFS] --->  D2 u2 l2  @ 000000002637312 nodes [time = 00:01]
  Solution [0020] =  R2 u2 D2 f2 B2  [inside 3-TFS] --->  D2 u2 l2  @ 000000002637405 nodes [time = 00:01]
  Solution [0021] =  R2 F2 b2 U2 d2  [inside 3-TFS] --->  b2 F2 l2  @ 000000002844453 nodes [time = 00:01]
  Solution [0022] =  R2 F2 b2 u2 D2  [inside 3-TFS] --->  b2 F2 l2  @ 000000002844546 nodes [time = 00:01]
  Solution [0023] =  R2 f2 B2 U2 d2  [inside 3-TFS] --->  B2 f2 l2  @ 000000002917209 nodes [time = 00:01]
  Solution [0024] =  R2 f2 B2 u2 D2  [inside 3-TFS] --->  B2 f2 l2  @ 000000002917302 nodes [time = 00:01]
  Solution [0025] =  r2 L2 U2 d2 F2  [inside 3-TFS] --->  b2 d2 U2  @ 000000004467789 nodes [time = 00:02]
  Solution [0026] =  r2 L2 U2 d2 f2  [inside 3-TFS] --->  B2 d2 U2  @ 000000004467792 nodes [time = 00:02]
  Solution [0027] =  r2 L2 U2 d2 b2  [inside 3-TFS] --->  F2 d2 U2  @ 000000004467795 nodes [time = 00:02]
  Solution [0028] =  r2 L2 U2 d2 B2  [inside 3-TFS] --->  f2 d2 U2  @ 000000004467798 nodes [time = 00:02]
  Solution [0029] =  r2 L2 u2 D2 F2  [inside 3-TFS] --->  b2 D2 u2  @ 000000004470372 nodes [time = 00:02]
  Solution [0030] =  r2 L2 u2 D2 f2  [inside 3-TFS] --->  B2 D2 u2  @ 000000004470375 nodes [time = 00:02]
  Solution [0031] =  r2 L2 u2 D2 b2  [inside 3-TFS] --->  F2 D2 u2  @ 000000004470378 nodes [time = 00:02]
  Solution [0032] =  r2 L2 u2 D2 B2  [inside 3-TFS] --->  f2 D2 u2  @ 000000004470381 nodes [time = 00:02]
  Solution [0033] =  r2 L2 F2 b2 U2  [inside 3-TFS] --->  d2 b2 F2  @ 000000004477740 nodes [time = 00:02]
  Solution [0034] =  r2 L2 F2 b2 u2  [inside 3-TFS] --->  D2 b2 F2  @ 000000004477743 nodes [time = 00:02]
  Solution [0035] =  r2 L2 F2 b2 d2  [inside 3-TFS] --->  U2 b2 F2  @ 000000004477746 nodes [time = 00:02]
  Solution [0036] =  r2 L2 F2 b2 D2  [inside 3-TFS] --->  u2 b2 F2  @ 000000004477749 nodes [time = 00:02]
  Solution [0037] =  r2 L2 f2 B2 U2  [inside 3-TFS] --->  d2 B2 f2  @ 000000004480326 nodes [time = 00:02]
  Solution [0038] =  r2 L2 f2 B2 u2  [inside 3-TFS] --->  D2 B2 f2  @ 000000004480329 nodes [time = 00:02]
  Solution [0039] =  r2 L2 f2 B2 d2  [inside 3-TFS] --->  U2 B2 f2  @ 000000004480332 nodes [time = 00:02]
  Solution [0040] =  r2 L2 f2 B2 D2  [inside 3-TFS] --->  u2 B2 f2  @ 000000004480335 nodes [time = 00:02]
  Solution [0041] =  r2 U2 d2 F2 b2  [inside 3-TFS] --->  d2 U2 L2  @ 000000004550910 nodes [time = 00:02]
  Solution [0042] =  r2 U2 d2 f2 B2  [inside 3-TFS] --->  d2 U2 L2  @ 000000004551003 nodes [time = 00:02]
  Solution [0043] =  r2 u2 D2 F2 b2  [inside 3-TFS] --->  D2 u2 L2  @ 000000004623594 nodes [time = 00:02]
  Solution [0044] =  r2 u2 D2 f2 B2  [inside 3-TFS] --->  D2 u2 L2  @ 000000004623687 nodes [time = 00:02]
  Solution [0045] =  r2 F2 b2 U2 d2  [inside 3-TFS] --->  b2 F2 L2  @ 000000004830735 nodes [time = 00:02]
  Solution [0046] =  r2 F2 b2 u2 D2  [inside 3-TFS] --->  b2 F2 L2  @ 000000004830828 nodes [time = 00:02]
  Solution [0047] =  r2 f2 B2 U2 d2  [inside 3-TFS] --->  B2 f2 L2  @ 000000004903491 nodes [time = 00:02]
  Solution [0048] =  r2 f2 B2 u2 D2  [inside 3-TFS] --->  B2 f2 L2  @ 000000004903584 nodes [time = 00:02]
  Solution [0049] =  l2 U2 d2 F2 b2  [inside 3-TFS] --->  d2 U2 R2  @ 000000006345708 nodes [time = 00:03]
  Solution [0050] =  l2 U2 d2 f2 B2  [inside 3-TFS] --->  d2 U2 R2  @ 000000006345801 nodes [time = 00:03]
  Solution [0051] =  l2 u2 D2 F2 b2  [inside 3-TFS] --->  D2 u2 R2  @ 000000006418392 nodes [time = 00:03]
  Solution [0052] =  l2 u2 D2 f2 B2  [inside 3-TFS] --->  D2 u2 R2  @ 000000006418485 nodes [time = 00:03]
  Solution [0053] =  l2 F2 b2 U2 d2  [inside 3-TFS] --->  b2 F2 R2  @ 000000006625533 nodes [time = 00:03]
  Solution [0054] =  l2 F2 b2 u2 D2  [inside 3-TFS] --->  b2 F2 R2  @ 000000006625626 nodes [time = 00:03]
  Solution [0055] =  l2 f2 B2 U2 d2  [inside 3-TFS] --->  B2 f2 R2  @ 000000006698289 nodes [time = 00:03]
  Solution [0056] =  l2 f2 B2 u2 D2  [inside 3-TFS] --->  B2 f2 R2  @ 000000006698382 nodes [time = 00:03]
  Solution [0057] =  L2 U2 d2 F2 b2  [inside 3-TFS] --->  d2 U2 r2  @ 000000007967490 nodes [time = 00:03]
  Solution [0058] =  L2 U2 d2 f2 B2  [inside 3-TFS] --->  d2 U2 r2  @ 000000007967583 nodes [time = 00:03]
  Solution [0059] =  L2 u2 D2 F2 b2  [inside 3-TFS] --->  D2 u2 r2  @ 000000008040174 nodes [time = 00:03]
  Solution [0060] =  L2 u2 D2 f2 B2  [inside 3-TFS] --->  D2 u2 r2  @ 000000008040267 nodes [time = 00:03]
  Solution [0061] =  L2 F2 b2 U2 d2  [inside 3-TFS] --->  b2 F2 r2  @ 000000008247315 nodes [time = 00:03]
  Solution [0062] =  L2 F2 b2 u2 D2  [inside 3-TFS] --->  b2 F2 r2  @ 000000008247408 nodes [time = 00:03]
  Solution [0063] =  L2 f2 B2 U2 d2  [inside 3-TFS] --->  B2 f2 r2  @ 000000008320071 nodes [time = 00:03]
  Solution [0064] =  L2 f2 B2 u2 D2  [inside 3-TFS] --->  B2 f2 r2  @ 000000008320164 nodes [time = 00:03]
  Solution [0065] =  U2 d2 F2 b2 U2  [inside 3-TFS] --->  d2 l2 R2  @ 000000010305123 nodes [time = 00:04]
  Solution [0066] =  U2 d2 F2 b2 u2  [inside 3-TFS] --->  D2 L2 r2  @ 000000010305126 nodes [time = 00:04]
  Solution [0067] =  U2 d2 F2 b2 d2  [inside 3-TFS] --->  U2 l2 R2  @ 000000010305129 nodes [time = 00:04]
  Solution [0068] =  U2 d2 F2 b2 D2  [inside 3-TFS] --->  u2 L2 r2  @ 000000010305132 nodes [time = 00:04]
  Solution [0069] =  U2 d2 f2 B2 U2  [inside 3-TFS] --->  d2 L2 r2  @ 000000010307709 nodes [time = 00:04]
  Solution [0070] =  U2 d2 f2 B2 u2  [inside 3-TFS] --->  D2 l2 R2  @ 000000010307712 nodes [time = 00:04]
  Solution [0071] =  U2 d2 f2 B2 d2  [inside 3-TFS] --->  U2 L2 r2  @ 000000010307715 nodes [time = 00:04]
  Solution [0072] =  U2 d2 f2 B2 D2  [inside 3-TFS] --->  u2 l2 R2  @ 000000010307718 nodes [time = 00:04]
  Solution [0073] =  u2 D2 F2 b2 U2  [inside 3-TFS] --->  d2 l2 R2  @ 000000012349077 nodes [time = 00:05]
  Solution [0074] =  u2 D2 F2 b2 u2  [inside 3-TFS] --->  D2 L2 r2  @ 000000012349080 nodes [time = 00:05]
  Solution [0075] =  u2 D2 F2 b2 d2  [inside 3-TFS] --->  U2 l2 R2  @ 000000012349083 nodes [time = 00:05]
  Solution [0076] =  u2 D2 F2 b2 D2  [inside 3-TFS] --->  u2 L2 r2  @ 000000012349086 nodes [time = 00:05]
  Solution [0077] =  u2 D2 f2 B2 U2  [inside 3-TFS] --->  d2 L2 r2  @ 000000012351663 nodes [time = 00:05]
  Solution [0078] =  u2 D2 f2 B2 u2  [inside 3-TFS] --->  D2 l2 R2  @ 000000012351666 nodes [time = 00:05]
  Solution [0079] =  u2 D2 f2 B2 d2  [inside 3-TFS] --->  U2 L2 r2  @ 000000012351669 nodes [time = 00:05]
  Solution [0080] =  u2 D2 f2 B2 D2  [inside 3-TFS] --->  u2 l2 R2  @ 000000012351672 nodes [time = 00:05]
  Solution [0081] =  F2 b2 U2 d2 F2  [inside 3-TFS] --->  b2 l2 R2  @ 000000018174069 nodes [time = 00:08]
  Solution [0082] =  F2 b2 U2 d2 f2  [inside 3-TFS] --->  B2 l2 R2  @ 000000018174072 nodes [time = 00:08]
  Solution [0083] =  F2 b2 U2 d2 b2  [inside 3-TFS] --->  F2 l2 R2  @ 000000018174075 nodes [time = 00:08]
  Solution [0084] =  F2 b2 U2 d2 B2  [inside 3-TFS] --->  f2 l2 R2  @ 000000018174078 nodes [time = 00:08]
  Solution [0085] =  F2 b2 u2 D2 F2  [inside 3-TFS] --->  b2 L2 r2  @ 000000018176652 nodes [time = 00:08]
  Solution [0086] =  F2 b2 u2 D2 f2  [inside 3-TFS] --->  B2 L2 r2  @ 000000018176655 nodes [time = 00:08]
  Solution [0087] =  F2 b2 u2 D2 b2  [inside 3-TFS] --->  F2 L2 r2  @ 000000018176658 nodes [time = 00:08]
  Solution [0088] =  F2 b2 u2 D2 B2  [inside 3-TFS] --->  f2 L2 r2  @ 000000018176661 nodes [time = 00:08]
  Solution [0089] =  f2 B2 U2 d2 F2  [inside 3-TFS] --->  b2 L2 r2  @ 000000020220075 nodes [time = 00:09]
  Solution [0090] =  f2 B2 U2 d2 f2  [inside 3-TFS] --->  B2 L2 r2  @ 000000020220078 nodes [time = 00:09]
  Solution [0091] =  f2 B2 U2 d2 b2  [inside 3-TFS] --->  F2 L2 r2  @ 000000020220081 nodes [time = 00:09]
  Solution [0092] =  f2 B2 U2 d2 B2  [inside 3-TFS] --->  f2 L2 r2  @ 000000020220084 nodes [time = 00:09]
  Solution [0093] =  f2 B2 u2 D2 F2  [inside 3-TFS] --->  b2 l2 R2  @ 000000020222658 nodes [time = 00:09]
  Solution [0094] =  f2 B2 u2 D2 f2  [inside 3-TFS] --->  B2 l2 R2  @ 000000020222661 nodes [time = 00:09]
  Solution [0095] =  f2 B2 u2 D2 b2  [inside 3-TFS] --->  F2 l2 R2  @ 000000020222664 nodes [time = 00:09]
  Solution [0096] =  f2 B2 u2 D2 B2  [inside 3-TFS] --->  f2 l2 R2  @ 000000020222667 nodes [time = 00:09]
```

but I thought this was an appropriate level of pruning:


```
Omnia Obtorquebantur 4x4x4 Version 2.0.7 [with Partial Pattern Minimal Distance Pruning] compiled on December 07, 2014.



                          TOP
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |~~~~|####|~~~~|####|   |XXXX|XXXX|XXXX|XXXX|   |####|~~~~|####|~~~~|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |####|~~~~|####|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |~~~~|####|~~~~|####|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |~~~~|####|~~~~|####|   |XXXX|XXXX|XXXX|XXXX|   |####|~~~~|####|~~~~|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|&&&&|&&&&|&&&&|   |####|~~~~|####|~~~~|   |XXXX|XXXX|XXXX|XXXX|   |~~~~|####|~~~~|####|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------
                          |OOOO|^^^^|OOOO|^^^^|
                          ---------------------
                          |^^^^|OOOO|^^^^|OOOO|
                          ---------------------


 
  Solutions To Scramble = l2 R2 [ROTATE z'] l2 R2 [ROTATE x'] [ROTATE z'] [ROTATE x] l2 R2 [ROTATE y] [ROTATE x] l2 R2 [ROTATE y] 
 
  Solution [0001] =  R2 U2 d2 F2 b2  [inside 3-TFS] --->  d2 U2 l2  @ 000000000450649 nodes [time = 00:04]
  Solution [0002] =  R2 U2 d2 f2 B2  [inside 3-TFS] --->  d2 U2 l2  @ 000000000450684 nodes [time = 00:04]
  Solution [0003] =  R2 u2 D2 F2 b2  [inside 3-TFS] --->  D2 u2 l2  @ 000000000451845 nodes [time = 00:04]
  Solution [0004] =  R2 u2 D2 f2 B2  [inside 3-TFS] --->  D2 u2 l2  @ 000000000451880 nodes [time = 00:04]
  Solution [0005] =  R2 F2 b2 U2 d2  [inside 3-TFS] --->  b2 F2 l2  @ 000000000454484 nodes [time = 00:04]
  Solution [0006] =  R2 F2 b2 u2 D2  [inside 3-TFS] --->  b2 F2 l2  @ 000000000454519 nodes [time = 00:04]
  Solution [0007] =  R2 f2 B2 U2 d2  [inside 3-TFS] --->  B2 f2 l2  @ 000000000455752 nodes [time = 00:04]
  Solution [0008] =  R2 f2 B2 u2 D2  [inside 3-TFS] --->  B2 f2 l2  @ 000000000455787 nodes [time = 00:04]
  Solution [0009] =  U2 d2 F2 b2 U2  [inside 3-TFS] --->  d2 l2 R2  @ 000000000638472 nodes [time = 00:04]
  Solution [0010] =  U2 d2 F2 b2 u2  [inside 3-TFS] --->  D2 L2 r2  @ 000000000638475 nodes [time = 00:04]
  Solution [0011] =  U2 d2 F2 b2 d2  [inside 3-TFS] --->  U2 l2 R2  @ 000000000638478 nodes [time = 00:04]
  Solution [0012] =  U2 d2 F2 b2 D2  [inside 3-TFS] --->  u2 L2 r2  @ 000000000638481 nodes [time = 00:04]
  Solution [0013] =  U2 d2 f2 B2 U2  [inside 3-TFS] --->  d2 L2 r2  @ 000000000638683 nodes [time = 00:05]
  Solution [0014] =  U2 d2 f2 B2 u2  [inside 3-TFS] --->  D2 l2 R2  @ 000000000638686 nodes [time = 00:05]
  Solution [0015] =  U2 d2 f2 B2 d2  [inside 3-TFS] --->  U2 L2 r2  @ 000000000638689 nodes [time = 00:05]
  Solution [0016] =  U2 d2 f2 B2 D2  [inside 3-TFS] --->  u2 l2 R2  @ 000000000638692 nodes [time = 00:05]
  Solution [0017] =  u2 D2 F2 b2 U2  [inside 3-TFS] --->  d2 l2 R2  @ 000000000690182 nodes [time = 00:05]
  Solution [0018] =  u2 D2 F2 b2 u2  [inside 3-TFS] --->  D2 L2 r2  @ 000000000690185 nodes [time = 00:05]
  Solution [0019] =  u2 D2 F2 b2 d2  [inside 3-TFS] --->  U2 l2 R2  @ 000000000690188 nodes [time = 00:05]
  Solution [0020] =  u2 D2 F2 b2 D2  [inside 3-TFS] --->  u2 L2 r2  @ 000000000690191 nodes [time = 00:05]
  Solution [0021] =  u2 D2 f2 B2 U2  [inside 3-TFS] --->  d2 L2 r2  @ 000000000690393 nodes [time = 00:05]
  Solution [0022] =  u2 D2 f2 B2 u2  [inside 3-TFS] --->  D2 l2 R2  @ 000000000690396 nodes [time = 00:05]
  Solution [0023] =  u2 D2 f2 B2 d2  [inside 3-TFS] --->  U2 L2 r2  @ 000000000690399 nodes [time = 00:05]
  Solution [0024] =  u2 D2 f2 B2 D2  [inside 3-TFS] --->  u2 l2 R2  @ 000000000690402 nodes [time = 00:05]
  Solution [0025] =  F2 b2 U2 d2 F2  [inside 3-TFS] --->  b2 l2 R2  @ 000000001097301 nodes [time = 00:05]
  Solution [0026] =  F2 b2 U2 d2 f2  [inside 3-TFS] --->  B2 l2 R2  @ 000000001097304 nodes [time = 00:05]
  Solution [0027] =  F2 b2 U2 d2 b2  [inside 3-TFS] --->  F2 l2 R2  @ 000000001097307 nodes [time = 00:05]
  Solution [0028] =  F2 b2 U2 d2 B2  [inside 3-TFS] --->  f2 l2 R2  @ 000000001097310 nodes [time = 00:05]
  Solution [0029] =  F2 b2 u2 D2 F2  [inside 3-TFS] --->  b2 L2 r2  @ 000000001099884 nodes [time = 00:05]
  Solution [0030] =  F2 b2 u2 D2 f2  [inside 3-TFS] --->  B2 L2 r2  @ 000000001099887 nodes [time = 00:05]
  Solution [0031] =  F2 b2 u2 D2 b2  [inside 3-TFS] --->  F2 L2 r2  @ 000000001099890 nodes [time = 00:05]
  Solution [0032] =  F2 b2 u2 D2 B2  [inside 3-TFS] --->  f2 L2 r2  @ 000000001099893 nodes [time = 00:05]
  Solution [0033] =  f2 B2 U2 d2 F2  [inside 3-TFS] --->  b2 L2 r2  @ 000000001216978 nodes [time = 00:05]
  Solution [0034] =  f2 B2 U2 d2 f2  [inside 3-TFS] --->  B2 L2 r2  @ 000000001216981 nodes [time = 00:05]
  Solution [0035] =  f2 B2 U2 d2 b2  [inside 3-TFS] --->  F2 L2 r2  @ 000000001216984 nodes [time = 00:05]
  Solution [0036] =  f2 B2 U2 d2 B2  [inside 3-TFS] --->  f2 L2 r2  @ 000000001216987 nodes [time = 00:05]
  Solution [0037] =  f2 B2 u2 D2 F2  [inside 3-TFS] --->  b2 l2 R2  @ 000000001219561 nodes [time = 00:05]
  Solution [0038] =  f2 B2 u2 D2 f2  [inside 3-TFS] --->  B2 l2 R2  @ 000000001219564 nodes [time = 00:05]
  Solution [0039] =  f2 B2 u2 D2 b2  [inside 3-TFS] --->  F2 l2 R2  @ 000000001219567 nodes [time = 00:05]
  Solution [0040] =  f2 B2 u2 D2 B2  [inside 3-TFS] --->  f2 l2 R2  @ 000000001219570 nodes [time = 00:05]
```

The difference is, one program can take 15 minutes to finish ply 10, and the other can solve the Single Dedge flip in less time. I thought it was an acceptable tradeoff. But it's not acceptable if the transposition filter removes all of the optimal solutions at the proper depth.


----------



## qqwref (Dec 10, 2014)

I don't know how relevant this is, based on how you did things, but perhaps you could reduce the number of solutions by only considering one way to write each move on a given axis. For instance, R2 l2 and l2 R2 are the same (up to a rotation), as are U u and D d. Then you would at least not be printing 96 solutions.

Actually, with the current setup, you would never print every solution anyway - once you find a position inside your TFS database, you only produce one solution, right? There may be more than one.


----------



## unsolved (Dec 10, 2014)

qqwref said:


> I don't know how relevant this is, based on how you did things, but perhaps you could reduce the number of solutions by only considering one way to write each move on a given axis. For instance, R2 l2 and l2 R2 are the same (up to a rotation), as are U u and D d. Then you would at least not be printing 96 solutions.
> 
> Actually, with the current setup, you would never print every solution anyway - once you find a position inside your TFS database, you only produce one solution, right? There may be more than one.



The attempt was made to reduce the size of the game tree, and the result was the reduction of the solution count in exchange for searching much deeper and much faster. Did you see the 22-ply "snake" solve in under 1 minute?






That was just too incredible to fathom. In scrambles where there are so many symmetrical solutions, pruning away even one set early enough in the move generation phase has tremendous impact on tree reduction. Look at one of the solutions starting out *F2 f2*.... Everyone one of the permutations with *f2 F2* and *r2 R2* that are ignored alone will make the tree 64 times smaller. Now multiply that by each rotation state, and aggregate the node reduction from each early stage of the tree on out to the final depth, and it's like taking a chainsaw to the game tree. 

The problem is, in scrambles where this symmetry reduction happens to factor out even a single node that was necessary to examine en route to an optimal solution will have the potential to miss that solution entirely.


----------



## qqwref (Dec 10, 2014)

I'm not completely sure what you're talking about, as the example you posted doesn't quite do what I mean. You have solutions beginning with both F2 f2 and b2 B2, whereas I'm suggesting that since those positions are the same (up to a rotation) you only allow one of the two sequences.


----------



## unsolved (Dec 11, 2014)

qqwref said:


> I'm not completely sure what you're talking about, as the example you posted doesn't quite do what I mean. You have solutions beginning with both F2 f2 and b2 B2, whereas I'm suggesting that since those positions are the same (up to a rotation) you only allow one of the two sequences.



Well I decided to shelve the forward pruning stuff for a while and see if I could come up with a way to do the TFS in RAM only, like I did before.

Good News: I cranked out up to TFS-05 from all 24 cube orientations in only 4:26 (and that's minutes and seconds).

The Bad News: You need slightly more than 14 GB of RAM to have near collision-free hashtable performance.







The numbers need a little explaining. The Nodes are cumulative, the other numbers are the per-ply totals. Remember, there is 24 times as much of everything, and I used a 36^n move generator. I only tested the position after it was generated. So if the program made U u' U U it quereied the hashtable for uniqueness, obviously seeing that was a duplicate of U' u', so it was not added. It did count as a duplicate for depth 4.

The node count @ depth 1 = 888 - 24 = 864. And that = 864 unique + 0 duplicates. 864/24 = 36.
The node count @ depth 2 = 31992 - 888 = 31104. And that = 23976 unique + 7128 duplicates. 31104/24 = 1296 = 36 * 36. Notice you don't calculate 31992 - 888 - 24 because the 24 is already accumulated in the 888.

So the numbers all add up to their 36^n proper counts.

Also the unique counts divided by 24 match some other published node counts.

23976/24 = 999.
652464/24 = 27186.
17714304/24 = 738096.

EDIT

And now it looks like TFS-05 with all of the forward pruning stripped away is behaving as expected. It found all of the solutions, and I double-checked with Bruce's program.


----------



## cuBerBruce (Dec 12, 2014)

Related to what qqwref was saying, Dan Hoey used the term _syllable_ to refer to different possible combinations of moves among parallel layers that have distinct effects. For the 4x4x4, assuming you consider that the resulting orientation of the cube doesn't matter, there are 63 possible syllables for each axis. Below (in the spoiler), I will list a possible way to generate the 63 syllables for one axis. Converting to a different axis should be straightforward. This is for the single-slice turn metric.



Spoiler



1-move cases (12 total): U U' U2 u u' u2 D D' D2 d d' d2

2-move cases (45 total):
if first move is U, U' or U2:
then second move can be one of: u u' u2 D D' D2 d d' d2

if first move is u:
then second move can be one of: D D2 d d2

if first move is u':
then second move can be one of: D' D2 d' d2

if first move is u2:
then second move can be one of: D D' d d'

if first move is D:
then second move can be one of: d' d2

if first move is D':
then second move can be one of: d d2

if first move is D2:
then second move can be one of: d d'

if first move is d, d', or d2:
then no second move is allowed for this axis.

3-move cases (6 total):
if first 2 moves are U u':
then third move must be: D2

if first 2 moves are U u2:
then third move must be: D

if first 2 moves are U' u:
then third move must be: D2

if first 2 moves are U' u2:
then third move must be: D'

if first 2 moves are U2 u:
then third move must be: D

if first 2 moves are U2 u':
then third move must be: D'

A third move is not used for any other first 2 moves.


----------



## unsolved (Dec 12, 2014)

cuBerBruce said:


> Related to what qqwref was saying, Dan Hoey used the term _syllable_ to refer to different possible combinations of moves among parallel layers that have distinct effects. For the 4x4x4, assuming you consider that the resulting orientation of the cube doesn't matter, there are 63 possible syllables for each axis. Below (in the spoiler), I will list a possible way to generate the 63 syllables for one axis. Converting to a different axis should be straightforward. This is for the single-slice turn metric.



Thanks Bruce. Good information. So is your move generator rule-based? Is all that is needed is a history check backwards for 3 plies, with a table-lookup for the legality of the next move series?

I have been cleaning up code, and placing #define statements strategically throughout, so all I have to do is specify the largest TFS-database the user wants, and it will build automatically and all the code handles the proper distance info returned by the search. It's a little more difficult than it sounds.

Running some more tests now... I may release TFS-4 early, was planning on December 13th. 

Memory requirements for TFS-4 looks like 560 MB minimum for acceptable hashtable lookup speeds.
For TFS-5 it's still large, 14 GB 






EDIT: Holy cow! This thing is cranking out tons of solutions! This is what my older versions were trying to suppress.


```
Omnia Obtorquebantur 4x4x4 Version 2.1.1, December 13, 2014. Copyright 2014 by Ed Trice.

                          TOP
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|   |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|   |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|XXXX|XXXX|XXXX|   |^^^^|^^^^|^^^^|OOOO|   |XXXX|&&&&|&&&&|&&&&|   |OOOO|OOOO|OOOO|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------


 
  Solutions To Scramble = R L F B R L F B R L F B 
 
  Solution [0001] =  R  L  U2 F2 U2 B2 R   [inside 05-TFS] --->  L  F2 D2 B2 D2  @ 000000788411812 nodes [time = 03:41]
  Solution [0002] =  R  L  U2 F2 U2 B2 L   [inside 05-TFS] --->  R  F2 D2 B2 D2  @ 000000788411822 nodes [time = 03:41]
  Solution [0003] =  R  L  U2 B2 U2 F2 R   [inside 05-TFS] --->  L  B2 D2 F2 D2  @ 000000788610523 nodes [time = 03:41]
  Solution [0004] =  R  L  U2 B2 U2 F2 L   [inside 05-TFS] --->  R  B2 D2 F2 D2  @ 000000788610533 nodes [time = 03:41]
  Solution [0005] =  R  L  D2 F2 D2 B2 R   [inside 05-TFS] --->  L  F2 U2 B2 U2  @ 000000793821505 nodes [time = 03:42]
  Solution [0006] =  R  L  D2 F2 D2 B2 L   [inside 05-TFS] --->  R  F2 U2 B2 U2  @ 000000793821515 nodes [time = 03:42]
  Solution [0007] =  R  L  D2 B2 D2 F2 R   [inside 05-TFS] --->  L  B2 U2 F2 U2  @ 000000794020216 nodes [time = 03:42]
  Solution [0008] =  R  L  D2 B2 D2 F2 L   [inside 05-TFS] --->  R  B2 U2 F2 U2  @ 000000794020226 nodes [time = 03:42]
  Solution [0009] =  R  L  F  B  R  L  F   [inside 05-TFS] --->  B  L  R  B  F   @ 000000794714977 nodes [time = 03:43]
  Solution [0010] =  R  L  F  B  R  L  B   [inside 05-TFS] --->  F  L  R  B  F   @ 000000794714987 nodes [time = 03:43]
  Solution [0011] =  R2 U2 L2 F  B  R2 D2  [inside 05-TFS] --->  L2 D2 B  F  U2  @ 000002024251152 nodes [time = 09:28]
  Solution [0012] =  R2 D2 L2 F  B  R2 U2  [inside 05-TFS] --->  L2 U2 B  F  D2  @ 000002181587811 nodes [time = 10:12]
  Solution [0013] =  R2 F2 U  D  F2 L2 F2  [inside 05-TFS] --->  L2 D  U  L2 B2  @ 000002238681087 nodes [time = 10:28]
  Solution [0014] =  R2 B2 U  D  B2 L2 B2  [inside 05-TFS] --->  L2 D  U  L2 F2  @ 000002396024838 nodes [time = 11:11]
  Solution [0015] =  L2 U2 R2 F  B  L2 D2  [inside 05-TFS] --->  R2 D2 B  F  U2  @ 000006291376107 nodes [time = 29:25]
  Solution [0016] =  L2 D2 R2 F  B  L2 U2  [inside 05-TFS] --->  R2 U2 B  F  D2  @ 000006448712766 nodes [time = 30:10]
  Solution [0017] =  L2 F2 U  D  F2 R2 F2  [inside 05-TFS] --->  R2 D  U  R2 B2  @ 000006511208418 nodes [time = 30:27]
  Solution [0018] =  L2 B  R2 f2 U' B2 L   [inside 05-TFS] --->  L2 F  r2 b2 u'  @ 000006647371016 nodes [time = 31:05]
  Solution [0019] =  L2 B2 U  D  B2 R2 B2  [inside 05-TFS] --->  R2 D  U  R2 F2  @ 000006668552169 nodes [time = 31:10]
  Solution [0020] =  U  R' L' D2 F  B  U2  [inside 05-TFS] --->  B' F' L  R  U   @ 000006700358190 nodes [time = 31:19]
  Solution [0021] =  U  R' L' F  B  U2 F'  [inside 05-TFS] --->  B' D2 L  R  U   @ 000006700392026 nodes [time = 31:19]
  Solution [0022] =  U  R' L' F  B  U2 B'  [inside 05-TFS] --->  F' D2 L  R  U   @ 000006700392034 nodes [time = 31:19]
  Solution [0023] =  U  R2 U' D  L2 D2 R2  [inside 05-TFS] --->  F2 D2 B2 L2 D   @ 000006723489291 nodes [time = 31:26]
  Solution [0024] =  U  R2 U' D  L2 D2 L2  [inside 05-TFS] --->  B2 U2 F2 R2 D   @ 000006723489300 nodes [time = 31:26]
  Solution [0025] =  U  R2 u  d' B2 D2 F2  [inside 05-TFS] --->  L2 D2 R2 B2 D   @ 000006724813077 nodes [time = 31:26]
  Solution [0026] =  U  R2 u  d' B2 D2 B2  [inside 05-TFS] --->  R2 U2 L2 F2 D   @ 000006724813086 nodes [time = 31:26]
  Solution [0027] =  U  R2 u  B2 D2 B2 d'  [inside 05-TFS] --->  R2 U2 L2 F2 D   @ 000006725183602 nodes [time = 31:26]
  Solution [0028] =  U  R2 d' B2 D2 B2 u   [inside 05-TFS] --->  R2 U2 L2 F2 D   @ 000006727106053 nodes [time = 31:27]
  Solution [0029] =  U  R2 F  R2 L2 F2 R2  [inside 05-TFS] --->  L2 F' R2 D2 U   @ 000006729983043 nodes [time = 31:27]
  Solution [0030] =  U  R2 F  R2 L2 F2 r2  [inside 05-TFS] --->  l2 B' R2 D  U2  @ 000006729983046 nodes [time = 31:27]
  Solution [0031] =  U  R2 F  R2 L2 F2 l2  [inside 05-TFS] --->  r2 B' R2 D  U2  @ 000006729983049 nodes [time = 31:27]
  Solution [0032] =  U  R2 F  R2 L2 F2 L2  [inside 05-TFS] --->  R2 F' R2 D2 U   @ 000006729983052 nodes [time = 31:27]
  Solution [0033] =  U  R2 F  r2 l2 B2 R2  [inside 05-TFS] --->  L2 B' R2 D  U2  @ 000006730051875 nodes [time = 31:27]
  Solution [0034] =  U  R2 F  r2 l2 B2 r2  [inside 05-TFS] --->  l2 F' R2 D2 U   @ 000006730051878 nodes [time = 31:27]
  Solution [0035] =  U  R2 F  r2 l2 B2 l2  [inside 05-TFS] --->  r2 F' R2 D2 U   @ 000006730051881 nodes [time = 31:27]
  Solution [0036] =  U  R2 F  r2 l2 B2 L2  [inside 05-TFS] --->  R2 B' R2 D  U2  @ 000006730051884 nodes [time = 31:27]
  Solution [0037] =  U  R2 F' R2 L2 F2 R2  [inside 05-TFS] --->  L2 F  R2 D2 U   @ 000006730715769 nodes [time = 31:28]
  Solution [0038] =  U  R2 F' R2 L2 F2 r2  [inside 05-TFS] --->  l2 B  R2 D  U2  @ 000006730715772 nodes [time = 31:28]
  Solution [0039] =  U  R2 F' R2 L2 F2 l2  [inside 05-TFS] --->  r2 B  R2 D  U2  @ 000006730715775 nodes [time = 31:28]
  Solution [0040] =  U  R2 F' R2 L2 F2 L2  [inside 05-TFS] --->  R2 F  R2 D2 U   @ 000006730715778 nodes [time = 31:28]
  Solution [0041] =  U  R2 F' r2 l2 B2 R2  [inside 05-TFS] --->  L2 B  R2 D  U2  @ 000006730784601 nodes [time = 31:28]
  Solution [0042] =  U  R2 F' r2 l2 B2 r2  [inside 05-TFS] --->  l2 F  R2 D2 U   @ 000006730784604 nodes [time = 31:28]
  Solution [0043] =  U  R2 F' r2 l2 B2 l2  [inside 05-TFS] --->  r2 F  R2 D2 U   @ 000006730784607 nodes [time = 31:28]
  Solution [0044] =  U  R2 F' r2 l2 B2 L2  [inside 05-TFS] --->  R2 B  R2 D  U2  @ 000006730784610 nodes [time = 31:28]
  Solution [0045] =  U  R2 B' U2 D2 F2 U2  [inside 05-TFS] --->  D2 B  R2 D2 U   @ 000006736242222 nodes [time = 31:29]
  Solution [0046] =  U  R2 B' U2 D2 F2 u2  [inside 05-TFS] --->  d2 F  L2 D2 U   @ 000006736242225 nodes [time = 31:29]
  Solution [0047] =  U  R2 B' U2 D2 F2 d2  [inside 05-TFS] --->  u2 F  L2 D2 U   @ 000006736242228 nodes [time = 31:29]
  Solution [0048] =  U  R2 B' U2 D2 F2 D2  [inside 05-TFS] --->  U2 B  R2 D2 U   @ 000006736242231 nodes [time = 31:29]
  Solution [0049] =  U  R2 B' u2 d2 B2 U2  [inside 05-TFS] --->  D2 F  L2 D2 U   @ 000006736311054 nodes [time = 31:29]
  Solution [0050] =  U  R2 B' u2 d2 B2 u2  [inside 05-TFS] --->  d2 B  R2 D2 U   @ 000006736311057 nodes [time = 31:29]

...

  Solution [0497] =  U2 D' F2 L' f2 b2 R2  [inside 05-TFS] --->  b2 f2 L  F2 D'  @ 000008163942852 nodes [time = 38:09]
  Solution [0498] =  U2 D' F2 L  F2 B2 L2  [inside 05-TFS] --->  B2 F2 L' F2 D'  @ 000008163959649 nodes [time = 38:09]
  Solution [0499] =  U2 D' F2 L  f2 b2 R2  [inside 05-TFS] --->  b2 f2 L' F2 D'  @ 000008163962076 nodes [time = 38:09]
  Solution [0500] =  U2 D' B2 R  F2 B2 R2  [inside 05-TFS] --->  B2 F2 R' B2 D'  @ 000008169329616 nodes [time = 38:11]
  Solution [0501] =  U2 D' B2 R  f2 b2 L2  [inside 05-TFS] --->  b2 f2 R' B2 D'  @ 000008169332061 nodes [time = 38:11]
  Solution [0502] =  U2 D' B2 R' F2 B2 R2  [inside 05-TFS] --->  B2 F2 R  B2 D'  @ 000008169355671 nodes [time = 38:11]
  Solution [0503] =  U2 D' B2 R' f2 b2 L2  [inside 05-TFS] --->  b2 f2 R  B2 D'  @ 000008169358116 nodes [time = 38:11]
  Solution [0504] =  U2 D' B2 L' U2 D2 R2  [inside 05-TFS] --->  D2 U2 L  B2 D'  @ 000008169525456 nodes [time = 38:11]
  Solution [0505] =  U2 D' B2 L' u2 d2 L2  [inside 05-TFS] --->  d2 u2 L  B2 D'  @ 000008169527901 nodes [time = 38:11]
  Solution [0506] =  U2 D' B2 L  U2 D2 R2  [inside 05-TFS] --->  D2 U2 L' B2 D'  @ 000008169544680 nodes [time = 38:11]
  Solution [0507] =  U2 D' B2 L  u2 d2 L2  [inside 05-TFS] --->  d2 u2 L' B2 D'  @ 000008169547125 nodes [time = 38:11]
  Solution [0508] =  U2 D  R2 F  U2 D2 B2  [inside 05-TFS] --->  D2 U2 F' R2 D   @ 000008171790939 nodes [time = 38:11]
  Solution [0509] =  U2 D  R2 F  u2 d2 F2  [inside 05-TFS] --->  d2 u2 F' R2 D   @ 000008171793369 nodes [time = 38:11]
  Solution [0510] =  U2 D  R2 F' U2 D2 B2  [inside 05-TFS] --->  D2 U2 F  R2 D   @ 000008171816994 nodes [time = 38:11]
  Solution [0511] =  U2 D  R2 F' u2 d2 F2  [inside 05-TFS] --->  d2 u2 F  R2 D   @ 000008171819424 nodes [time = 38:11]
  Solution [0512] =  U2 D  R2 B' R2 L2 B2  [inside 05-TFS] --->  L2 R2 B  R2 D   @ 000008171993610 nodes [time = 38:11]
  Solution [0513] =  U2 D  R2 B' r2 l2 F2  [inside 05-TFS] --->  l2 r2 B  R2 D   @ 000008171996040 nodes [time = 38:11]
  Solution [0514] =  U2 D  R2 B  R2 L2 B2  [inside 05-TFS] --->  L2 R2 B' R2 D   @ 000008172012834 nodes [time = 38:11]
  Solution [0515] =  U2 D  R2 B  r2 l2 F2  [inside 05-TFS] --->  l2 r2 B' R2 D   @ 000008172015264 nodes [time = 38:11]
  Solution [0516] =  U2 D  L2 F  R2 L2 F2  [inside 05-TFS] --->  L2 R2 F' L2 D   @ 000008177183838 nodes [time = 38:13]
  Solution [0517] =  U2 D  L2 F  r2 l2 B2  [inside 05-TFS] --->  l2 r2 F' L2 D   @ 000008177186286 nodes [time = 38:13]
  Solution [0518] =  U2 D  L2 F' R2 L2 F2  [inside 05-TFS] --->  L2 R2 F  L2 D   @ 000008177209893 nodes [time = 38:13]
  Solution [0519] =  U2 D  L2 F' r2 l2 B2  [inside 05-TFS] --->  l2 r2 F  L2 D   @ 000008177212341 nodes [time = 38:13]
  Solution [0520] =  U2 D  L2 B' U2 D2 F2  [inside 05-TFS] --->  D2 U2 B  L2 D   @ 000008177406417 nodes [time = 38:13]
  Solution [0521] =  U2 D  L2 B' u2 d2 B2  [inside 05-TFS] --->  d2 u2 B  L2 D   @ 000008177408865 nodes [time = 38:13]
  Solution [0522] =  U2 D  L2 B  U2 D2 F2  [inside 05-TFS] --->  D2 U2 B' L2 D   @ 000008177425641 nodes [time = 38:13]
  Solution [0523] =  U2 D  L2 B  u2 d2 B2  [inside 05-TFS] --->  d2 u2 B' L2 D   @ 000008177428089 nodes [time = 38:13]
  Solution [0524] =  U2 D  F2 R  U2 D2 L2  [inside 05-TFS] --->  D2 U2 R' F2 D   @ 000008178926757 nodes [time = 38:13]
  Solution [0525] =  U2 D  F2 R  u2 d2 R2  [inside 05-TFS] --->  d2 u2 R' F2 D   @ 000008178929184 nodes [time = 38:13]
  Solution [0526] =  U2 D  F2 R' U2 D2 L2  [inside 05-TFS] --->  D2 U2 R  F2 D   @ 000008178952812 nodes [time = 38:13]
  Solution [0527] =  U2 D  F2 R' u2 d2 R2  [inside 05-TFS] --->  d2 u2 R  F2 D   @ 000008178955239 nodes [time = 38:13]
  Solution [0528] =  U2 D  F2 L' F2 B2 L2  [inside 05-TFS] --->  B2 F2 L  F2 D   @ 000008179142505 nodes [time = 38:13]
  Solution [0529] =  U2 D  F2 L' f2 b2 R2  [inside 05-TFS] --->  b2 f2 L  F2 D   @ 000008179144932 nodes [time = 38:13]
  Solution [0530] =  U2 D  F2 L  F2 B2 L2  [inside 05-TFS] --->  B2 F2 L' F2 D   @ 000008179161729 nodes [time = 38:13]
  Solution [0531] =  U2 D  F2 L  f2 b2 R2  [inside 05-TFS] --->  b2 f2 L' F2 D   @ 000008179164156 nodes [time = 38:13]
  Solution [0532] =  U2 D  B2 R  F2 B2 R2  [inside 05-TFS] --->  B2 F2 R' B2 D   @ 000008184531696 nodes [time = 38:15]
  Solution [0533] =  U2 D  B2 R  f2 b2 L2  [inside 05-TFS] --->  b2 f2 R' B2 D   @ 000008184534141 nodes [time = 38:15]
  Solution [0534] =  U2 D  B2 R' F2 B2 R2  [inside 05-TFS] --->  B2 F2 R  B2 D   @ 000008184557751 nodes [time = 38:15]
  Solution [0535] =  U2 D  B2 R' f2 b2 L2  [inside 05-TFS] --->  b2 f2 R  B2 D   @ 000008184560196 nodes [time = 38:15]
  Solution [0536] =  U2 D  B2 L' U2 D2 R2  [inside 05-TFS] --->  D2 U2 L  B2 D   @ 000008184727536 nodes [time = 38:15]
  Solution [0537] =  U2 D  B2 L' u2 d2 L2  [inside 05-TFS] --->  d2 u2 L  B2 D   @ 000008184729981 nodes [time = 38:15]
  Solution [0538] =  U2 D  B2 L  U2 D2 R2  [inside 05-TFS] --->  D2 U2 L' B2 D   @ 000008184746760 nodes [time = 38:15]
  Solution [0539] =  U2 D  B2 L  u2 d2 L2  [inside 05-TFS] --->  d2 u2 L' B2 D   @ 000008184749205 nodes [time = 38:15]
  Solution [0540] =  U2 F' B' D2 R2 D2 L2  [inside 05-TFS] --->  B' F' R2 U2 L2  @ 000008240367066 nodes [time = 38:30]
  Solution [0541] =  U2 F' B' D2 L2 D2 R2  [inside 05-TFS] --->  B' F' L2 U2 R2  @ 000008240373888 nodes [time = 38:30]
  Solution [0542] =  U2 F2 U2 B2 R' L' F2  [inside 05-TFS] --->  D2 B2 D2 L' R'  @ 000008251246158 nodes [time = 38:33]
  Solution [0543] =  U2 B2 U2 F2 R' L' B2  [inside 05-TFS] --->  D2 F2 D2 L' R'  @ 000008408383872 nodes [time = 39:16]
```


----------



## cuBerBruce (Dec 12, 2014)

unsolved said:


> Thanks Bruce. Good information. So is your move generator rule-based? Is all that is needed is a history check backwards for 3 plies, with a table-lookup for the legality of the next move series?



Basically, my code currently uses a state machine to look up a bitmap value that indicates which layers can be turned. I am working on updating my single-slice turn version to use the 63-syllables per axis method I described. So basically the current state machine state is used along with the current move to look up the next state of the state machine following the current move. So I don't actually have to look at what the previous moves actually were.


----------



## unsolved (Dec 12, 2014)

cuBerBruce said:


> Basically, my code currently uses a state machine to look up a bitmap value that indicates which layers can be turned.



Is that how you were able to determine that on the non-supercube some moves are duplicates whereas on a supercube they are not? Can you program produce a short list of some of those 3-turn transpositions?



cuBerBruce said:


> I am working on updating my single-slice turn version to use the 63-syllables per axis method I described. So basically the current state machine state is used along with the current move to look up the next state of the state machine following the current move. So I don't actually have to look at what the previous moves actually were.



Are you talking about a predictive index function? I was thinking about using a reverse indexing function to do something similar, but I could not get it to work. Feed in any index (1, 2, 3, 35, 36 37, .... 947 .... 2376518, whatever) and from the index telescopes out a move list. It treats each index as the sum of up to three enumerations from the perpendicular axes, and you work backwards to determine how many predecessor positions there must have been on each axis, which in turn can tell you the coefficients that must go before the expansion equation, and from these you can determine the smallest coefficients (0...35 or 1...36 depending on your preference) and these translate into moves.

It sounds like moving forward from the syllable set is the way to do it. I will experiment with it.

In other news, I am releasing version 2.11 for both 3- and 4-Turns From Solved today. Both programs are in the same folder. Launch whichever one you have RAM for.

*TFS-03 = 152 MB* required for 10,000,019 hash table entries. 
*TFS-04 = 561 MB* required for 36,721,073 hash table entries.

The hash tables are so large for performance reasons. They are nearly collision-free for very fast lookup. Beats the pants off of Binary Search, averaging 1.002 probes per lookup for TFS-03 and about 1.094 probes per lookup for TFS-04. Practically indexing function speeds!

lightningcloudcomputing.com/OO_4x4x4_211.zip

There is a big difference in performance between the 3- and 4-TFS databases. A picture is worth 1,000 words here.

*TFS-03*

Here is a 12-ply position, all slice moves, which has a 10-ply solution:






It finds the first solution after 6 minutes, and completes ply 10 @ 47 minutes on a 3.1 GHz computer. Note: Almost certainly your times will be even faster than this.

Compare that result to...

*TFS-04*






Ply 10 finishes in less than 2.5 minutes!

*EDIT: Afterthought. Should I be concerned that neither of these solution sets features the move b' at the start?*


----------



## unsolved (Dec 12, 2014)

Here is something worthy of its own post and raises an interesting question. Can two solvers both have different solution counts for the same position, and both of them be correct?






I only checked a few of these solutions out, and I am going down the list, but the thought occurred to me, maybe the count is a function of the move generator used. There might not be a "universal count" of solutions unless you use a 36^n move generator and report every permutation.


----------



## cuBerBruce (Dec 12, 2014)

unsolved said:


> *EDIT: Afterthought. Should I be concerned that neither of these solution sets features the move b' at the start?*



The scramble is not optimal (12 moves instead of 10). Therefore, there is no particular reason to assume optimal solutions should start with the same moves as the inverse of the scramble. I also note that the last 2 moves of the scramble commute, so if the scramble were optimal, you would expect solutions starting f' b' or b' f'.



unsolved said:


> Here is something worthy of its own post and raises an interesting question. Can two solvers both have different solution counts for the same position, and both of them be correct?



I see what's happening. You are producing solutions that are the same except for two moves being u' d' and d' u'. Since these commute, my program only shows one of the two solutions. In your program, these moves are appear across the boundary between the search tree and the TFS database generated moves. I'm not sure if it's worth trying to remove such "redundancies" from your solver.


----------



## unsolved (Dec 12, 2014)

cuBerBruce said:


> The scramble is not optimal (12 moves instead of 10). Therefore, there is no particular reason to assume optimal solutions should start with the same moves as the inverse of the scramble. I also note that the last 2 moves of the scramble commute, so if the scramble were optimal, you would expect solutions starting f' b' or b' f'.
> 
> 
> 
> I see what's happening. You are producing solutions that are the same except for two moves being u' d' and d' u'. Since these commute, my program only shows one of the two solutions. In your program, these moves are appear across the boundary between the search tree and the TFS database generated moves. I'm not sure if it's worth trying to remove such "redundancies" from your solver.



I just spent a great deal of time tearing out all such code from the solver, see some of the earlier posts. 

So now we have your solver, and 3 of my solvers (each differing only by the databases loaded) and they all report different solution counts after exhaustively searching the same exact scramble.
This 4x4x4 puzzle is much more subtle than it appears to be on the surface!

I would like to make 2 requests,for the next version of your solver.

1. Use 64-bit data types for your counters. You are overflowing the "node count" and "state check" variables on some of my longer solving runs with your program.
2. Perhaps number your solutions instead of repeating the depth at which you find each one. After the first find, the depth is known, but in the case of a scramble with many solutions, it might be nice to see them and identify them by solution # if we ever run into the need for it in the future.


----------



## qqwref (Dec 13, 2014)

Are you trying all possible ways to solve the last 5-or-so moves of the solution? If you want to print all solutions, that would certainly be worthwhile. Once you've found a position in the TFS database you're already at a solution, and very few of the positions will be solutions, so it doesn't hurt the overall computing time to spend a little extra time checking all possible ways through the TFS database. For instance, r u r' d and d r u r' give the same position, so you could have two solutions that end in these 4 moves, but your program would currently only print one.

I assume you have an ordering of moves on each axis - for instance, U before u before D before d. I suggest that any series of moves on the same axis that does not follow this order should be invalid - even if one move comes before the TFS lookup and one doesn't. So in your above image with 20 solutions where Bruce's program only gives 16:
- Solution 13, f b R2 L2 u' continues with d' l' r' d u
- Solution 14, f b R2 L2 d' is in the 5-TFS, but the d' means you can't continue with another move on the same axis. The 5-TFS solution is u' l' r' d u so you must throw it out. This is not a new solution at all!
Using this method you would throw out solutions 2, 4, 14, and 16 as being valid, but equivalent to other solutions that should already have been found.


----------



## unsolved (Dec 13, 2014)

qqwref said:


> Are you trying all possible ways to solve the last 5-or-so moves of the solution?



By "trying" do you mean verifying the moves listed in the *05-TFS* will solve the cube if applied to it? Yes and no. I did so much up-front verification during the build process, and after testing over 5 billion random probes with no mismatches, I turned off that code with a #define statement. It slowed things down. However, I see I have a misfire with a false-positive: a cube position created a hash code that was in the hash table but not the same cube. It took over 190 billion probes to find one mismatch. Considering there are 64-bits of randomness (a 20-digit number beginning with 18...) I am surprised that it happened so soon. So it looks like I will be forced to perform the additional verification procedure after all (Deja Vu).



qqwref said:


> If you want to print all solutions, that would certainly be worthwhile.



I am thinking about refactoring in my old *solve_termination* options: Halt on first solution, Halt on completion of ply of first solution (its present mode), Search forever (even after finding solutions, to see if other crazy moves still solve it).



qqwref said:


> So in your above image with 20 solutions where Bruce's program only gives 16:
> 
> - Solution 13, f b R2 L2 u' continues with d' l' r' d u
> - Solution 14, f b R2 L2 d' is in the 5-TFS, but the d' means you can't continue with another move on the same axis. The 5-TFS solution is u' l' r' d u so you must throw it out. This is not a new solution at all!
> Using this method you would throw out solutions 2, 4, 14, and 16 as being valid, but equivalent to other solutions that should already have been found.



Well...

*Solution [0014] = f b R2 L2 d' [inside 05-TFS] ---> u' l' r' d u @ 000000018804997 nodes [time = 00:05]*

...certainly does solve the cube!

And, if you remember from just a little while ago, we talked about removing all of the code I added to do the very same thing you are now suggesting!

Obtaining all possible solutions should do just that... so I am rethinking some of this now.

===================================


I don't know why I didn't think of this sooner. I used a full-width move generator (36^n, no move ordering intelligence) to solve the TFS-05 from every possible orientation (all 24; 1 starting cube + 23 possible rotated states). Independent of what crazy moves create a cube position, *if it is not in the hash table of visited/solved positions*, it will add it, along with the solution. This is effectively the same as coming up with the ideal move generation sequence, at the price of having to visit every possible position, even the absurd ones.

So I hooked up the full-width generator to the scramble solver now, instead of using the move-order-by-3-axes technique suggested by Jackube. It now finds 80 solutions.







```
Omnia Obtorquebantur 4x4x4 Version 2.1.1, December 13, 2014. Copyright 2014 by Ed Trice.

                          TOP
                          ---------------------
                          |####|OOOO|^^^^|####|
                          ---------------------
                          |&&&&|####|####|&&&&|
                          ---------------------
                          |XXXX|####|####|XXXX|
                          ---------------------
                          |####|OOOO|^^^^|####|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|~~~~|####|&&&&|   |OOOO|~~~~|####|OOOO|   |XXXX|~~~~|####|XXXX|   |^^^^|~~~~|####|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|   |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|   |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|~~~~|####|&&&&|   |OOOO|~~~~|####|OOOO|   |XXXX|~~~~|####|XXXX|   |^^^^|~~~~|####|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |~~~~|^^^^|OOOO|~~~~|
                          ---------------------
                          |&&&&|~~~~|~~~~|&&&&|
                          ---------------------
                          |XXXX|~~~~|~~~~|XXXX|
                          ---------------------
                          |~~~~|^^^^|OOOO|~~~~|
                          ---------------------


 
  Solutions To Scramble = r l f b r l f b r l f b 
 
  Solution [0001] =  r  l  F2 B2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000007081361 nodes [time = 00:02]
  Solution [0002] =  r  l  F2 B2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000007081364 nodes [time = 00:02]
  Solution [0003] =  r  l  f2 b2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000007085141 nodes [time = 00:02]
  Solution [0004] =  r  l  f2 b2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000007085144 nodes [time = 00:02]
  Solution [0005] =  r  l  b2 f2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000007088921 nodes [time = 00:02]
  Solution [0006] =  r  l  b2 f2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000007088924 nodes [time = 00:02]
  Solution [0007] =  r  l  B2 F2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000007092701 nodes [time = 00:02]
  Solution [0008] =  r  l  B2 F2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000007092704 nodes [time = 00:02]
  Solution [0009] =  r2 u  d  r' l'  [inside 05-TFS] --->  d' u' b  f  l2  @ 000000010849004 nodes [time = 00:03]
  Solution [0010] =  r2 u  d  l' r'  [inside 05-TFS] --->  d' u' b  f  l2  @ 000000010849109 nodes [time = 00:03]
  Solution [0011] =  r2 d  u  r' l'  [inside 05-TFS] --->  d' u' b  f  l2  @ 000000010985084 nodes [time = 00:03]
  Solution [0012] =  r2 d  u  l' r'  [inside 05-TFS] --->  d' u' b  f  l2  @ 000000010985189 nodes [time = 00:03]
  Solution [0013] =  r2 f  b  u' d'  [inside 05-TFS] --->  l' r' d  u  l2  @ 000000011424872 nodes [time = 00:03]
  Solution [0014] =  r2 f  b  d' u'  [inside 05-TFS] --->  l' r' d  u  l2  @ 000000011424977 nodes [time = 00:03]
  Solution [0015] =  r2 b  f  u' d'  [inside 05-TFS] --->  l' r' d  u  l2  @ 000000011560952 nodes [time = 00:03]
  Solution [0016] =  r2 b  f  d' u'  [inside 05-TFS] --->  l' r' d  u  l2  @ 000000011561057 nodes [time = 00:03]
  Solution [0017] =  l  r  F2 B2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000011980241 nodes [time = 00:03]
  Solution [0018] =  l  r  F2 B2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000011980244 nodes [time = 00:03]
  Solution [0019] =  l  r  f2 b2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000011984021 nodes [time = 00:03]
  Solution [0020] =  l  r  f2 b2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000011984024 nodes [time = 00:03]
  Solution [0021] =  l  r  b2 f2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000011987801 nodes [time = 00:03]
  Solution [0022] =  l  r  b2 f2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000011987804 nodes [time = 00:03]
  Solution [0023] =  l  r  B2 F2 u'  [inside 05-TFS] --->  d' b' f' d  u   @ 000000011991581 nodes [time = 00:03]
  Solution [0024] =  l  r  B2 F2 d'  [inside 05-TFS] --->  u' b' f' d  u   @ 000000011991584 nodes [time = 00:03]
  Solution [0025] =  l2 u  d  r' l'  [inside 05-TFS] --->  d' u' b  f  r2  @ 000000015887852 nodes [time = 00:04]
  Solution [0026] =  l2 u  d  l' r'  [inside 05-TFS] --->  d' u' b  f  r2  @ 000000015887957 nodes [time = 00:04]
  Solution [0027] =  l2 d  u  r' l'  [inside 05-TFS] --->  d' u' b  f  r2  @ 000000016023932 nodes [time = 00:04]
  Solution [0028] =  l2 d  u  l' r'  [inside 05-TFS] --->  d' u' b  f  r2  @ 000000016024037 nodes [time = 00:04]
  Solution [0029] =  l2 f  b  u' d'  [inside 05-TFS] --->  l' r' d  u  r2  @ 000000016463720 nodes [time = 00:04]
  Solution [0030] =  l2 f  b  d' u'  [inside 05-TFS] --->  l' r' d  u  r2  @ 000000016463825 nodes [time = 00:04]
  Solution [0031] =  l2 b  f  u' d'  [inside 05-TFS] --->  l' r' d  u  r2  @ 000000016599800 nodes [time = 00:04]
  Solution [0032] =  l2 b  f  d' u'  [inside 05-TFS] --->  l' r' d  u  r2  @ 000000016599905 nodes [time = 00:04]
  Solution [0033] =  u  d  r' l' u'  [inside 05-TFS] --->  d' l2 r2 b  f   @ 000000027767105 nodes [time = 00:07]
  Solution [0034] =  u  d  r' l' d'  [inside 05-TFS] --->  u' l2 r2 b  f   @ 000000027767108 nodes [time = 00:07]
  Solution [0035] =  u  d  l' r' u'  [inside 05-TFS] --->  d' l2 r2 b  f   @ 000000027770885 nodes [time = 00:07]
  Solution [0036] =  u  d  l' r' d'  [inside 05-TFS] --->  u' l2 r2 b  f   @ 000000027770888 nodes [time = 00:07]
  Solution [0037] =  u  d  f' b' u'  [inside 05-TFS] --->  d' b2 f2 l  r   @ 000000027799073 nodes [time = 00:07]
  Solution [0038] =  u  d  f' b' d'  [inside 05-TFS] --->  u' b2 f2 l  r   @ 000000027799076 nodes [time = 00:07]
  Solution [0039] =  u  d  b' f' u'  [inside 05-TFS] --->  d' b2 f2 l  r   @ 000000027802853 nodes [time = 00:07]
  Solution [0040] =  u  d  b' f' d'  [inside 05-TFS] --->  u' b2 f2 l  r   @ 000000027802856 nodes [time = 00:07]
  Solution [0041] =  d  u  r' l' u'  [inside 05-TFS] --->  d' l2 r2 b  f   @ 000000032665985 nodes [time = 00:08]
  Solution [0042] =  d  u  r' l' d'  [inside 05-TFS] --->  u' l2 r2 b  f   @ 000000032665988 nodes [time = 00:08]
  Solution [0043] =  d  u  l' r' u'  [inside 05-TFS] --->  d' l2 r2 b  f   @ 000000032669765 nodes [time = 00:08]
  Solution [0044] =  d  u  l' r' d'  [inside 05-TFS] --->  u' l2 r2 b  f   @ 000000032669768 nodes [time = 00:08]
  Solution [0045] =  d  u  f' b' u'  [inside 05-TFS] --->  d' b2 f2 l  r   @ 000000032697953 nodes [time = 00:08]
  Solution [0046] =  d  u  f' b' d'  [inside 05-TFS] --->  u' b2 f2 l  r   @ 000000032697956 nodes [time = 00:08]
  Solution [0047] =  d  u  b' f' u'  [inside 05-TFS] --->  d' b2 f2 l  r   @ 000000032701733 nodes [time = 00:08]
  Solution [0048] =  d  u  b' f' d'  [inside 05-TFS] --->  u' b2 f2 l  r   @ 000000032701736 nodes [time = 00:08]
  Solution [0049] =  f  b  R2 L2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000048479921 nodes [time = 00:12]
  Solution [0050] =  f  b  R2 L2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000048479924 nodes [time = 00:12]
  Solution [0051] =  f  b  r2 l2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000048483701 nodes [time = 00:12]
  Solution [0052] =  f  b  r2 l2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000048483704 nodes [time = 00:12]
  Solution [0053] =  f  b  l2 r2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000048487481 nodes [time = 00:12]
  Solution [0054] =  f  b  l2 r2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000048487484 nodes [time = 00:12]
  Solution [0055] =  f  b  L2 R2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000048491261 nodes [time = 00:12]
  Solution [0056] =  f  b  L2 R2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000048491264 nodes [time = 00:12]
  Solution [0057] =  f2 r  l  u' d'  [inside 05-TFS] --->  b' f' d  u  b2  @ 000000050584808 nodes [time = 00:13]
  Solution [0058] =  f2 r  l  d' u'  [inside 05-TFS] --->  b' f' d  u  b2  @ 000000050584913 nodes [time = 00:13]
  Solution [0059] =  f2 l  r  u' d'  [inside 05-TFS] --->  b' f' d  u  b2  @ 000000050720888 nodes [time = 00:13]
  Solution [0060] =  f2 l  r  d' u'  [inside 05-TFS] --->  b' f' d  u  b2  @ 000000050720993 nodes [time = 00:13]
  Solution [0061] =  f2 u  d  f' b'  [inside 05-TFS] --->  d' u' l  r  b2  @ 000000051160676 nodes [time = 00:13]
  Solution [0062] =  f2 u  d  b' f'  [inside 05-TFS] --->  d' u' l  r  b2  @ 000000051160781 nodes [time = 00:13]
  Solution [0063] =  f2 d  u  f' b'  [inside 05-TFS] --->  d' u' l  r  b2  @ 000000051296756 nodes [time = 00:13]
  Solution [0064] =  f2 d  u  b' f'  [inside 05-TFS] --->  d' u' l  r  b2  @ 000000051296861 nodes [time = 00:13]
  Solution [0065] =  b  f  R2 L2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000053378801 nodes [time = 00:13]
  Solution [0066] =  b  f  R2 L2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000053378804 nodes [time = 00:13]
  Solution [0067] =  b  f  r2 l2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000053382581 nodes [time = 00:13]
  Solution [0068] =  b  f  r2 l2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000053382584 nodes [time = 00:13]
  Solution [0069] =  b  f  l2 r2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000053386361 nodes [time = 00:13]
  Solution [0070] =  b  f  l2 r2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000053386364 nodes [time = 00:13]
  Solution [0071] =  b  f  L2 R2 u'  [inside 05-TFS] --->  d' l' r' d  u   @ 000000053390141 nodes [time = 00:13]
  Solution [0072] =  b  f  L2 R2 d'  [inside 05-TFS] --->  u' l' r' d  u   @ 000000053390144 nodes [time = 00:13]
  Solution [0073] =  b2 r  l  u' d'  [inside 05-TFS] --->  b' f' d  u  f2  @ 000000055623656 nodes [time = 00:14]
  Solution [0074] =  b2 r  l  d' u'  [inside 05-TFS] --->  b' f' d  u  f2  @ 000000055623761 nodes [time = 00:14]
  Solution [0075] =  b2 l  r  u' d'  [inside 05-TFS] --->  b' f' d  u  f2  @ 000000055759736 nodes [time = 00:14]
  Solution [0076] =  b2 l  r  d' u'  [inside 05-TFS] --->  b' f' d  u  f2  @ 000000055759841 nodes [time = 00:14]
  Solution [0077] =  b2 u  d  f' b'  [inside 05-TFS] --->  d' u' l  r  f2  @ 000000056199524 nodes [time = 00:14]
  Solution [0078] =  b2 u  d  b' f'  [inside 05-TFS] --->  d' u' l  r  f2  @ 000000056199629 nodes [time = 00:14]
  Solution [0079] =  b2 d  u  f' b'  [inside 05-TFS] --->  d' u' l  r  f2  @ 000000056335604 nodes [time = 00:14]
  Solution [0080] =  b2 d  u  b' f'  [inside 05-TFS] --->  d' u' l  r  f2  @ 000000056335709 nodes [time = 00:14]
```


----------



## qqwref (Dec 13, 2014)

unsolved said:


> By "trying" do you mean verifying the moves listed in the *05-TFS* will solve the cube if applied to it?


Nah, I mean computing all solutions to that position in the 5-TFS database, rather than just printing one solution. So a given way to get to the 5-TFS database may not necessarily lead to exactly one solution.



unsolved said:


> Well...
> 
> *Solution [0014] = f b R2 L2 d' [inside 05-TFS] ---> u' l' r' d u @ 000000018804997 nodes [time = 00:05]*
> 
> ...certainly does solve the cube!


Yeah, but it's equivalent to solution 13 (and you can see it just by looking at the d' u' sequence), so it is not a new solution and it would be better to not print it.



unsolved said:


> Independent of what crazy moves create a cube position, *if it is not in the hash table of visited/solved positions*, it will add it, along with the solution.


Wait wait, you're storing the solution too? I guess that makes sense if you only keep a hash of the position - not much else you can do. But then you can't guarantee you will be able to find every solution. You could probably store the actual position in not much more space with a little data compression. If you can fit 3 stickers into one byte, you could put the cube state into 4 64-bit ints.



unsolved said:


> So I hooked up the full-width generator to the scramble solver now, instead of using the move-order-by-3-axes technique suggested by Jackube. It now finds 80 solutions.


Sorry, I don't understand what you mean. I do see a ton of duplicates though (as in, solutions that are exactly the same, just with moves on the same axis transposed or rewritten). Solutions 1-8 and 17-24 are actually only 2 solutions - and only one if you would consider F2 B2 and f2 b2 to be the same (they are equivalent up to a rotation).


----------



## unsolved (Dec 13, 2014)

qqwref said:


> Nah, I mean computing all solutions to that position in the 5-TFS database, rather than just printing one solution. So a given way to get to the 5-TFS database may not necessarily lead to exactly one solution.



Here is what is solved, in the order of solving, and why all solutions in the database represent a complete set.

1. Starting cube, no turns, no rotations. Is it in the database? No, add it.
2. Rotate 23 permutations of it. Check the database. None match, they are all added. (Now any move sequence that produces a rotated, solved cube won't be added, i.e. all the "ridiculous" moves).
3. Loop from 1 to 24. 1 == the unrotated solved cube ... 24 == the last version of a rotated cube that does not produce another rotated cube.
3.A. Inside loop 1, generate every one of the 36 available moves. Check for being in the database already. If not, add the "unmove" to solve the move made to the database. 
3.B. Inside loop 2, generate every one of the 36 available moves. Check for being in the database already...
...
3.X. Inside loop 24, generate every one of the 36 available moves. Check for being in the database already...

4. Same, only for every 2-move sequence, including such winners as U U, R R', L L2, etc. U U will hit a match against U2 so it will never make it in. R R' recreates solved cubes, no chance of getting in there, etc.
5. Same, only for every 3-move sequence...
6. Same, only for every 4-move sequence...
7. Same, only for every 5-move sequence...

So I delegate the legitimacy of the entry to the explicit uniqueness of the cube position, with blatant disregard for whatever sequence produced it. The beauty of it is, the result is exactly the same as if I spent a tremendous amount of thought, time, and energy into coming up with the world's most awesome uniqueness algorithm on my own, but I had to do 0% of that 




qqwref said:


> Yeah, but it's equivalent to solution 13 (and you can see it just by looking at the d' u' sequence), so it is not a new solution and it would be better to not print it.



Equivalency is a function of move generation "bias." As you saw from earlier versions of the program, it filtered "too many" when trying to adhere to a symmetry heuristic. In removing all such code from the program, this is the result. I have decided too much is better than too little. Thanks to you 



qqwref said:


> Wait wait, you're storing the solution too? I guess that makes sense if you only keep a hash of the position - not much else you can do.



Yes, the solution is embedded within the database. Download the program, enter a scramble of 4 moves or fewer. The program prints info from RAM without executing a search. It shows the cube data (6 separate 64-bit integers), the hash code, and the hash index that precipitates out of the modulo divide with the large prime number. Earlier versions of the program also stored the rotation index number (0-23) along with it. I no longer do this.

There's a great deal more than can be done, though. For one, I can work on implementing a BMZ Minimal Perfect Hashing Function to save memory, or implement Quadratic probing to alleviate primary clustering within the hash table. I'm also trying to come up with an algorithm to avoid having to enter the entire cube into the hash table as well in order to guarantee a 100% match. All fun stuff that I enjoy. It will only improve future versions. Right now, I think 179 GB is needed for 6-TFS. That is awfully tempting to someone like me 



qqwref said:


> But then you can't guarantee you will be able to find every solution. You could probably store the actual position in not much more space with a little data compression. If you can fit 3 stickers into one byte, you could put the cube state into 4 64-bit ints.



The two primary objectives of hashing are fast retrieval and not storing the position. I do store some cubies that are from splattered random parts of the cube (but the same parts in each case) for match testing in case of two 64-bit hash numbers being the same. If the bit patterns of the cubies match, the odds of 2 different positions still matching go way down.

Since 6^3 = 216 and 216 < 255 I could use a power series to store 3 stickers into one byte. 

compressed_value = (sticker_1)*(6^2) + (sticker_2)*(6^1) + (sticker_3). I already have 2 in one byte (4 bits each) which turns out to be perfect for move generation on the 4x4x4.



qqwref said:


> Sorry, I don't understand what you mean. I do see a ton of duplicates though (as in, solutions that are exactly the same, just with moves on the same axis transposed or rewritten). Solutions 1-8 and 17-24 are actually only 2 solutions - and only one if you would consider F2 B2 and f2 b2 to be the same (they are equivalent up to a rotation).



Yes, but the whole point was, this is the only way to test 100% if 2 programs have both correctly returned every possible move generation path that leads to a solution. Each version of my program (3-TFS, 4-TFS, 5-TFS) had a different solution count (different move boundaries separate entry into the TFS databases) and Bruce's program also produced a number different from all 3 of them! In the event one program is suspected to be incorrect, how can you determine which one is "correct" based on move count alone? This exercise demonstrates the only real way using solution count as the metric is to go full-width with the move generation. I think it would be very improbable for 2 different full-width programs to produce different solution counts, but I am in the process of seeking verification of this.

Previously, when Bruce's program showed more solutions than mine, it was easy to hunt for a bug in my own program. Now, we can't be so quick to judge on that qualification alone. QED.


----------



## unsolved (Dec 14, 2014)

I have implemented new hash table loading/searching configurations, and introduced user-configurable *Full Width* and *Normal* search modes.

Hash Tables: Explicit or Implicit

Previously, all incarnations of the program featured *Implicit *hashing. If a hash position matched, the implicit assumption was so did the position. But, roughly 1 out of 100 billion cubes will generate an identical 64-bit hash number, due to the nature of the hashing function, not to impune the nature of random numbers which would suggest that 18,446,744,073,709,551,615 nodes should be perused before a duplicate match would be encountered. And so, whenever one of those random cubes would be encountered during the search, you would see a move sequence being reported as a "solve" that had no chance to solve the scrambled cube.

The solution was to also store the entire cube (48 bytes per cube for my bitboard move generator) in the hash table as well. For each matching hash code, a cube comparison is made (very fast since each cube is 6 different 64-bit numbers, if all 6 match the cubes ARE identical). If the cubes do not match, the hash table result is ignore and the search for a match continues. This is what I call the *Explicit Hash Table* version. The down side to using the *EHT* is that 48 additional bytes, times all of the 24 rotated cube states, times all of node counts per depth, will put even the *04-TFS-EHT* at 5.4 GB of RAM.

The good news is, if you have the RAM, you'll always get a known, good solution, and the verification is fast. But, if you don't have the RAM, you can always use the new, verification-in-place version of the *Implicit Hash Table*.

As before, the *IHT* does not store each cube in the *TFS *databases in RAM. But, the new versions of *OO_4x4x4* can resolve hash-match cube-disparities. Whenever a matching hash table entry is found, the stored solution is applied to the cube generated during the search. If the hash table solution does indeed solve the cube, the result is displayed. If the solution does not work, it must be a hash-match disparity, and the hash table data is ignored and the search continues.

The only down side to this is that these hash tables take much longer to generate when the program starts up. That's because the hash tables exclude duplicates, and this process must now evoke the move generator while a great deal of move generation is already happening. The lower RAM requirement makes it worth it for those who do not have enough memory to load the corresponding *EHT*.

Move Generation: Normal or Full Width

As a result of looking at the *rlfb rlfb rlfb* scrambles on 4 different brute force cube solving apps (Bruce's program and the 03-TFS, 04-TFS, and 05-TFS versions of OO_4x4x4), the discovery was made that the total solution count for any given cube is a function of *move generator bias*. While it was debated as to which solutions "should count" and which were "obvious duplicates," what remained unresolved was the answer to the question: 

*"Can you know if a solving program is working correctly just by observing the reported solution count for a given scrambled cube?"*

The answer is: *No.*

This will no doubt spawn arguments such as, "Well if you examine each solution and look for transposing parallel plane rotations made in succession..." but that only serves to prove my point. Examining each solution is not the same as merely enumerating all reported solutions.

The only valid solution count for a given scrambled state must be done via Full Width Searching, which does not exclude transposing moves (but which does exclude moves such as R R or F F', or U2 U', etc.) Any other reported solution count must accept the fact that it incorporated *Move Generator Bias*.






As shown above, typing *search full width* at the scramble prompt now directs OO_4x4x4 to use its 36 * 33^n-1 move generation mode.

To resume the reduced tree move generation mode, type *search normal* at the scramble prompt.

So now there are 6 different versions of OO_4x4x4, each using the same set of source code and only *#define* directives to determine what code to execute. Each version can be run in Full Width search or Normal search mode as well.

03-TFS-e = 3-Turns-From-Solved using Explicit Hash Table probing.
03-TFS-i = 3-Turns-From-Solved using Implicit Hash Table probing.

04-TFS-e = 4-Turns-From-Solved using Explicit Hash Table probing.
04-TFS-i = 4-Turns-From-Solved using Implicit Hash Table probing.

05-TFS-e = 5-Turns-From-Solved using Explicit Hash Table probing.
05-TFS-i = 5-Turns-From-Solved using Implicit Hash Table probing.

Since RAM requirements and performance options vary widely (since 05-TFS-i solves the rlfb-12 move scramble in normal search mode in 8 seconds while 04-TFS-e solves the same scramble in 03:28) I will be putting up a web page to help add to the confusion


----------



## cuBerBruce (Dec 15, 2014)

unsolved said:


> The two primary objectives of hashing are fast retrieval and not storing the position. I do store some cubies that are from splattered random parts of the cube (but the same parts in each case) for match testing in case of two 64-bit hash numbers being the same. If the bit patterns of the cubies match, the odds of 2 different positions still matching go way down.
> 
> Since 6^3 = 216 and 216 < 255 I could use a power series to store 3 stickers into one byte.



You appear to be referring to _stickers_ (or _facelets_) when you (mis)use the word _cubies_ here. The 4x4x4 has 96 stickers (facelets), but only 56 cubies. There are 8 corner cubies, 24 edge cubies, and 24 center cubies. A cubie can have up to 3 stickers (corner cubies). That's also why your representation of the cube is called a facelet level (or sticker level) representation, not a cubie representation.



unsolved said:


> *"Can you know if a solving program is working correctly just by observing the reported solution count for a given scrambled cube?"*
> 
> The answer is: *No.*


I agree that different solvers can output different number of solutions simply because of what you refer to as move generator bias. But in restricting the combinations of moves that the move generator makes, a very significant savings in search time can be achieved. In addition, the user may find it a nuisance being presented with many solutions that are doing essentially the same thing to the cube.

I would say all good solvers at least "canonicalize" solutions so that consecutive moves that commute are generated in a specific order only. Two solvers that both "canonicalize" the order of commuting moves will generate exactly the same number of solutions if no other move generation shortcuts are used.

In the sequence U u' d2, all the moves commute, so you can apply the three moves in any of the six possible ways. Producing all six variants is a basically a waste since someone should easily recognize that the moves commute, and should realize the order of the three moves doesn't matter. These sequence can be thought of as being trivially equivalent.

If several such commuting-move sequences occur in a solution, the number of trivially equivalent solution can grow quite large. A solution having three such 3-move sub-sequences would generate 216 different (but only "trivially" different) solutions.

Another example of sequences that are in some way equivalent is U u R and D d B. As qqwref mentioned, U u and D d have the same affect on the state of the cube except for the resulting orientation of the cube. Because they put the cube into different orientations, the rest of the moves in the solutions will look different. The remaining moves for the first one need to be translated to different moves for the other. For example, in the above sequences U u R and D d B, the R in the first one needs to be translated (mapped) to B for the other. This perhaps may be thought of as semi-trivially equivalent. It may be not so easy to recognize such solutions as being essentially the same just from eyeballing them. Some users might prefer that all these solutions as some may be more fingertrick friendly than others.

There are other sequences that can be thought of as being non-trivially equivalent. We can think of such sequences as being related by a non-trivial identity. For example, consider these two sequences.

F R' F' R U F'
U F' L' U L U'

These two move sequence have exactly the same effect on the cube. However, there is no obvious reason that these should be the same. A user who wants "all" solutions will typically want to see both of these solutions.

Another way solutions can be related is through what I will call "virtual" identities.

For example, consider these two sequences:


```
r2 b2 r2
l2 b2 l2

These two sequences have different effects on the cube, but they both will solve the same position (unless we are talking about the supercube rather than the regular cube).

Using GAP, we can see exactly how these affect the cube:

[CODE]
gap> r2 := (3,83)(7,87)(11,91)(15,95)(35,78)(39,74)(43,70)(47,66);
(3,83)(7,87)(11,91)(15,95)(35,78)(39,74)(43,70)(47,66)
gap> l2 := (2,82)(6,86)(10,90)(14,94)(34,79)(38,75)(42,71)(46,67);
(2,82)(6,86)(10,90)(14,94)(34,79)(38,75)(42,71)(46,67)
gap> b2 := (5,92)(6,91)(7,90)(8,89)(18,63)(22,59)(26,55)(30,51);
(5,92)(6,91)(7,90)(8,89)(18,63)(22,59)(26,55)(30,51)

gap> r2*b2*r2;
(5,92)(6,11)(8,89)(18,63)(22,59)(26,55)(30,51)(87,90)
gap> l2*b2*l2;
(5,92)(7,10)(8,89)(18,63)(22,59)(26,55)(30,51)(86,91)
gap> r2*b2*r2 = l2*b2*l2;
false
```

In the above, 6, 7, 10, and 11 represent the U centers, and 86, 87, 90, and 91 represent the D centers. The first maneuver swaps U centers 6 and 11, and D centers 87 and 90. The 2nd maneuver swaps U centers 7 and 10, and D centers 86 and 91. The two sequences also swap some other pieces, but these other swaps are identical for the two sequences.

If the TFS databases in OO_4x4x4 stores only one sequence for each position, and only uses that sequence to generate a solution, it will (in general) miss some solutions that are "non-trivially" different. This may be fine for people who simply are interested in finding solutions as quickly as possible, but may be disappointing to some users that may want to get all essentially different solutions.


----------



## qqwref (Dec 15, 2014)

cuBerBruce said:


> There are other sequences that can be thought of as being non-trivially equivalent. We can think of such sequences as being related by a non-trivial identity. For example, consider these two sequences.
> 
> F R' F' R U F'
> U F' L' U L U'
> ...


Not to be super nitpicky (your post was really good otherwise), but isn't this the case for *all* pairs of non-equivalent solutions of a given position? They're all related through SOME nontrivial identity, just usually one nobody has explicitly generated or looked at. I would say that if you want to generate all solutions to a position, you should never take non-trivial identities into account, even well-known 10- or 12-move ones.


----------



## cuBerBruce (Dec 15, 2014)

qqwref said:


> Not to be super nitpicky (your post was really good otherwise), but isn't this the case for *all* pairs of non-equivalent solutions of a given position? They're all related through SOME nontrivial identity, just usually one nobody has explicitly generated or looked at. I would say that if you want to generate all solutions to a position, you should never take non-trivial identities into account, even well-known 10- or 12-move ones.



Well, the 4x4x4 has indistinguishable pieces, so solutions may be related to what I called a "virtual" identity rather than a true identity. Also, unless you're doing something like converting all moves to a fixed DLB model, if the non-equivalent solutions are P and Q, the expression P Q' will not necessarily be an identity. Cube rotations might need to be included to make it an identity. But I suppose you can define what it means for two solutions to be "related to an identity" so that any two sequences can be related to a trivial or a non-trivial identity (perhaps a lengthy one).


----------



## unsolved (Dec 15, 2014)

cuBerBruce said:


> You appear to be referring to _stickers_ (or _facelets_) when you (mis)use the word _cubies_ here. The 4x4x4 has 96 stickers (facelets), but only 56 cubies. There are 8 corner cubies, 24 edge cubies, and 24 center cubies. A cubie can have up to 3 stickers (corner cubies). That's also why your representation of the cube is called a facelet level (or sticker level) representation, not a cubie representation.



Yes, I keep falling into the same hole. But I think I wrote the first *Bitboard Facelet* representation, have I not? I only use 6 variables to represent my cube, each one a 64-bit int. My original implementation was an *Array Facelet*, actually swapping matrix elements on the face[6][16] level. Even the Multithreaded Array Facelet was slower than the unencumbered Single-Threaded Bitboard version.



cuBerBruce said:


> I agree that different solvers can output different number of solutions simply because of what you refer to as move generator bias. But in restricting the combinations of moves that the move generator makes, a very significant savings in search time can be achieved. In addition, the user may find it a nuisance being presented with many solutions that are doing essentially the same thing to the cube.



I agree, and never disagreed on this point. I just gave the user the option to select how they want to see the solutions now, given the most recent discovery regarding the *Solution Count Paradox*. 



cuBerBruce said:


> I would say all good solvers at least "canonicalize" solutions so that consecutive moves that commute are generated in a specific order only. Two solvers that both "canonicalize" the order of commuting moves will generate exactly the same number of solutions if no other move generation shortcuts are used.



What is the name of Jakube's canonicalization? The one with the 3-axes and move groups? Does it have a formalized term associated with it?



cuBerBruce said:


> If the TFS databases in OO_4x4x4 stores only one sequence for each position, and only uses that sequence to generate a solution, it will (in general) miss some solutions that are "non-trivially" different. This may be fine for people who simply are interested in finding solutions as quickly as possible, but may be disappointing to some users that may want to get all essentially different solutions.



You can type a move sequence with <= the number of moves of your largest loaded TFS database, and the hash table will display what it finds immediately. Download a copy and bang away at it. Let me know if any such sequence escapes detection. I've done it with a full-width 36^n move generator and encountered no gaps, so I believe the probe-before-add-to-the-hash-table approach has worked. Remember, I solve each depth 24 times, once for each possible starting orientation of the cube. That's why the hash tables are so large now.

My Cube Solved routine examines 24 states, but my hash probing code makes no rotation state queries. If it is in the hashtable, it's one of 24 rotated states. A huge cost in memory, and huge performance gain not to make so many rotation tests.


----------



## cuBerBruce (Dec 15, 2014)

unsolved said:


> You can type a move sequence with <= the number of moves of your largest loaded TFS database, and the hash table will display what it finds immediately. Download a copy and bang away at it. Let me know if any such sequence escapes detection. I've done it with a full-width 36^n move generator and encountered no gaps, so I believe the probe-before-add-to-the-hash-table approach has worked. Remember, I solve each depth 24 times, once for each possible starting orientation of the cube. That's why the hash tables are so large now.
> 
> My Cube Solved routine examines 24 states, but my hash probing code makes no rotation state queries. If it is in the hashtable, it's one of 24 rotated states. A huge cost in memory, and huge performance gain not to make so many rotation tests.



In Version 2.1.1 if I enter r2 b2 r2, I only get one solution displayed (r2 b2 r2). It does not display l2 b2 l2, which I would consider a non-trivially different solution. That's why only one maneuver per TFS database entry is not sufficient if you want to display *all* non-trivially different solutions. If you want to merely guarantee that the program will produce at least one optimal solution, then one maneuver per TFS entry will suffice.


----------



## unsolved (Dec 15, 2014)

cuBerBruce said:


> In Version 2.1.1 if I enter r2 b2 r2, I only get one solution displayed (r2 b2 r2). It does not display l2 b2 l2, which I would consider a non-trivially different solution. That's why only one maneuver per TFS database entry is not sufficient if you want to display *all* non-trivially different solutions. If you want to merely guarantee that the program will produce at least one optimal solution, then one maneuver per TFS entry will suffice.



And what happens when you enter *l2 b2 l2*?

For both *r2 b2 r2* and *l2 b2 r2* I get the same solution, *l2 b2 r2*. My move generator makes *l2* before *r2*, so you should not see *r2 b2 r2* at all.






They both map to the same index and hashcode.






I think this is the exact behavior that is desired. At each and every depth, you want a 1:1 relationship between a scramble and a *database *entry. There are many, many paths to any particular solution. As an example, how many solutions should be reported for the scramble *R L F B R L F B R L F B*?


```
TOP
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------
                          |####|####|####|####|
                          ---------------------

  LEFT                    FRONT                   RIGHT                   BACK
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|^^^^|   |&&&&|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|   |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |XXXX|&&&&|&&&&|XXXX|   |^^^^|OOOO|OOOO|^^^^|   |&&&&|XXXX|XXXX|&&&&|   |OOOO|^^^^|^^^^|OOOO|
  ---------------------   ---------------------   ---------------------   ---------------------
  |&&&&|XXXX|XXXX|XXXX|   |^^^^|^^^^|^^^^|OOOO|   |XXXX|&&&&|&&&&|&&&&|   |OOOO|OOOO|OOOO|^^^^|
  ---------------------   ---------------------   ---------------------   ---------------------

                          BOTTOM
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
                          |~~~~|~~~~|~~~~|~~~~|
                          ---------------------
```

You can see what a can of worms this would open up if at every depth in the tree multiple solutions @ depth were stored. There are 957 solutions @ 1 database node per scramble per ply.

http://lightningcloudcomputing.com/957.txt


----------



## unsolved (Dec 17, 2014)

I just solved up to and including the 7-TFS database for only centers 






And here is an interesting entry:






If you reverse and prime the scramble with *F2 u' f2 u' b2 u2 B2* you don't create the position shown. It rotates the position upside down. However, if you apply the rotation *z2* to a solved cube first, then *F2 u' f2 u' b2 u2 B2* you will create the position shown. The solution is correct. That is the power of rotating the cube 23 times and looking for the shortest entry into the database. The database probe only cares if the solution works with no preference to the rotated state to start with, and this is a clear-cut example.

_____________________________________________________________________________________________________________________

*EDIT: Now if I could only start calling the access code at the correct location, this thing might actually be powerful *






_____________________________________________________________________________________________________________________

*EDIT #2: OK now I think I tracked this one down, so I am releasing an experimental version for testing. This one loads the 4-TFS and probes up to 7-TFS if only centers need solving in the resulting position. And, it probes it in RAM, so it can extend the search by up to 7-plies from the position being generated.*






And here is the download link, about 40 MB compressed with the Centers-4,5,6, and 7 included.

http://lightningcloudcomputing.com/OO_experimental.zip

Try adding some of these into the mix of your scrambles at the tail end. (These should all be optimal solutions as well, no way faster to create the scrambled position that results.)


```
r2 f  d' r2 d' f' d2  @ 000000042288954891 nodes [time = 33:07]
l2 b  d  l2 d  b' d2  @ 000000046279685877 nodes [time = 35:56]
u2 b  u2 b2 d  b  d'  @ 000000057902469587 nodes [time = 44:00]
u2 b  u2 b2 d' b  d   @ 000000057902470675 nodes [time = 44:00]
u2 b' r  u' b  u' r'  @ 000000057924436517 nodes [time = 44:01]
u2 b' r  u2 r  b  r2  @ 000000057924446682 nodes [time = 44:01]
u2 b' r  u2 r2 b  r   @ 000000057924448858 nodes [time = 44:01]
u2 b' r  u2 b' r' b2  @ 000000057924473172 nodes [time = 44:01]
u2 b' r  b  u' r' u'  @ 000000057924927269 nodes [time = 44:01]
u2 b' r  b' r' u2 b2  @ 000000057924950484 nodes [time = 44:01]
u2 b' r  b' u2 r' b2  @ 000000057924964311 nodes [time = 44:01]
```

Maybe something like this:


----------



## unsolved (Dec 20, 2014)

*New Web Page for Downloading Latest Version*







The links on the left will always have the latest version of the program ready for downloading. Let your mouse hoover over a link, and you will see the amount of RAM you need in order to run it. The highest performance version requires 67 GB of RAM, and the lowest needs only 650 MB. 


5-TFS + Centers @ 7-TFS explicit hash table = 67 GB
5-TFS + Centers @ 7-TFS implicit hash table = 20 GB
4-TFS + Centers @ 7-TFS explicit hash table = 28 GB
4-TFS + Centers @ 7-TFS implicit hash table = 7 GB
4-TFS + Centers @ 6-TFS implicit hash table = 2 GB
3-TFS + Centers @ 6-TFS explicit hash table = 650 MB


Explicit hash table: Stores 64-bit hash number plus entire cube position in RAM for explicit verification that the positions must match, therefore the stored solution must be correct for that position.

Implicit hash table: Stores 64-bit hash number without the actual position, and requires the search to also probe the stored PV before being able to determine if the hash table position matches the cube being searched. Less RAM and slower with more CPU activity when hitting multiple solutions.

On my machine, roughly every 90 minutes, there is a 64-bit hash found during the search that matches a position in the table but is *not *a solution. This is why it is very important to verify that the 64-bit hash key is also really associated with the position in question. I thought 64-bits of hash safety would last until the sun would burn out, but this apparently is one of those Birthday Problem type of phenomena.

http://lightningcloudcomputing.com/OO_4x4x4/Rubiks_Revenge_4x4x4_Program.shtml


----------



## qqwref (Dec 22, 2014)

With your bitboard setup, it occurs to me that there may be a faster way to check that the puzzle is solved. Currently I believe you check that each side is equal to 0x22222222 or 0x33333333 or ...

Each side is a 64-bit integer with every 4 bits representing one sticker. If the side is solved, all those 16 stickers are the same. So, if we circular-shift the integer left or right by 4 bits, and it is unchanged, that side is solved. Rotating is a single assembly operation, although unfortunately it can't be written as such in C, so you'll have to write something like "cube._4x4x4_left == (cube._4x4x4_left << 4) | (cube._4x4x4_left >> 60)". It should optimize down though.


----------



## cuBerBruce (Dec 23, 2014)

qqwref said:


> write something like "cube._4x4x4_left == (cube._4x4x4_left << 4) | (cube._4x4x4_left >> 60)"



Just want to point out the | operator (like the || operator) has lower precedence than ==, so the whole expression to right of the == should be parenthesized.

As long as the bitboards are an unsigned type (which I believe is the case), the right shift should work as expected. Just noting that since a right shift can shift in 1s if the value is negative.


----------



## unsolved (Mar 30, 2015)

Jakube said:


> @cuBerBruce: Such a simple idea, but it's actually quite hard to implement it correctly. But I think I figured out the three necessary rules.
> 
> 
> if there are 2 moves on the same axis, both turn in the same direction (U is the same direction as d') and one of the moves is of <D>, then ignore the case.
> ...



I finally got around to implementing *Jakube's Rules* in my 4x4x4 program. Rule #1 was the most difficult to implement, the others were quite easy. My program currently generates the minimal number of nodes per depth. If you subtract from my cumulative totals the total from the prior depth, our numbers match. There is a slight error in Jakube's list starting at depth 4, probably from rounding errors common in Microsoft Excel. I have the correct numbers up to depth 32 (shown at the bottom).

I also have TFS-06 solved now on my machine with 64 GB of RAM. This allows the program to complete depth-12 searches in just under 4 minutes, even though only searching 2.4 million positions per second. Probing the large hash table is a slowdown of a factor of 5, but reducing the search space by a factor of 27 is well worth it.






And the grand totals:






*Edit: Interesting test position*

The test scramble below is one of my "litmus test" positions I have been using for the last year:






Now that I solved every cube position *8-turns*-from a solved state if only the *centers *are disturbed, the program can see an upcoming solution beyond its present depth of search. The scramble was 14 moves in length. At *nominal depth 6*, the program finds sequences leading to the *8-TFS centers* database. At the conclusion of nominal depth 6, the logic indicates it still needs to keep searching for a potential quicker solution. A 14-move solution has been found, but depth 6 + (full) TFS-06 = 12 moves have only been searched to completion. So nominal depth 7 will be able to complete 13 moves of searching with the full *6-Turns-From-Solved *database in RAM.

At nominal depth 7, I expected to see some 7-TFS center database hits (7 + 7 == 14 and matches the optimal depth found), but the program found 13-move solutions with the full 6-TFS database beforehand. So the "noose tightening" algorithm is working fine, only reporting move sequences at or better than the current optimal solution's depth.

The variable search depth code makes things a little more complex, but will have a large payoff in the Stage Solving code, since I use the *Cage Method*.


----------



## cuBerBruce (Apr 1, 2015)

unsolved said:


> I finally got around to implementing *Jakube's Rules* in my 4x4x4 program. Rule #1 was the most difficult to implement, the others were quite easy. My program currently generates the minimal number of nodes per depth. If you subtract from my cumulative totals the total from the prior depth, our numbers match. There is a slight error in Jakube's list starting at depth 4, probably from rounding errors common in Microsoft Excel. I have the correct numbers up to depth 32 (shown at the bottom).



I looked at using a syllable-based approach to see how many different maneuvers we should get at each depth. I got numbers that were generally a bit less than unsolved's numbers. His numbers were generally a bit less than Jakube's numbers. So I looked into why there were discrepancies.

The 4x4x4 obviously has 4 layers for each of the three main axes. Each layer can be in one of 4 positions (that we care about). So there are 4^4 - 256 possible ways a given set of 4 layers can be arranged. But some are essentially equivalent if we don't care about arrangements that are the same except for how the cube is oriented. Also, each time we change axis, we want to make some change for the new axis. So the total number of arrangements that matter is 4^3-1 = 63. This is the number of syllables we need to use.

Jakube's rules correctly allow 12 syllables at depth 1. They also correctly allow 45 syllables of depth 2. This leaves 63 - 12 - 45 = 6 syllables we need at depth 3 (or greater). None require more than 3 moves to produce, so 6 is indeed the number of syllables we need at depth 3.

In looking at Jakube's rules and numbers, it appears he is using 24 "syllables" at depth 3. For depth 3, Jakube allows any layer to remain fixed, and each of the other three layers must be moved different amounts (and not remain fixed, of course). Since we only care about how they move with respect to one another, we can arbitrarily pick one of the layers to be the fixed one. This reduces the number at depth 3 from 24 (what Jakube used) to 6 (in agreement with the number depth-3 syllables I calculated in the previous paragraph).

Thus, to properly reduce to minimal syllables, there should be another rule added to Jakube's rules. This rule could be:

if there are 3 moves on the same axis, ignore the case if the D layer (or L or B) is one of the layers moved.

As for Jakube's rules as stated, what are the correct numbers? Well, I did my own calculations and the results I got exactly match those that unsolved gives in the previous post. So I believe there must be a flaw in Jakube's formula or at least in his calculated numbers.

Using 6 depth-3 syllables, the numbers I get are given below. (I note that here I am counting the "null" maneuver at depth 0, while unsolved chose not to count it in his table.) 


```
depth                                       maneuvers                              cumulative maneuvers

  0                                                 1                                                 1
  1                                                36                                                37
  2                                               999                                              1036
  3                                             27234                                             28270
  4                                            743958                                            772228 
  5                                          20318040                                          21090268
  6                                         554915988                                         576006256
  7                                       15155534808                                       15731541064
  8                                      413919090792                                      429650631856
  9                                    11304715303584                                    11734365935440
 10                                   308747751874992                                   320482117810432
 11                                  8432337451411872                                  8752819569222304
 12                                230299053086277216                                239051872655499520
 13                               6289792617720221568                               6528844490375721088
 14                             171783125652467209536                             178311970142842930624
 15                            4691639939891068296576                            4869951910033911227200
 16                          128135317377520330634880                          133005269287554241862080
 17                         3499556609158513688443392                         3632561878446067930305472
 18                        95577836863059851099339520                        99210398741505919029644992
 19                      2610365803346232902311672320                      2709576202087738821341317312
 20                     71292779277294878418682013184                     74002355479382617240023330496
 21                   1947106558998594761469610899456                   2021108914477977378709634229952
 22                  53178231940562968127779782841344                  55199340855040945506489417071296
 23                1452372670234712302140003953301504                1507572011089753247646493370372800
 24               39666350238991745519997910665750528               41173922250081498767644404036123328
 25             1083344084840212755290083569169244160             1124518007090294254057727973205367488
 26            29587658029717179771387497667419025408            30712176036807474025445225640624392896
 27           808080756551699363435647440171277590528           838792932588506837461092665811901983424
 28         22069827508933413454943894357008405389312         22908620441521920292404987022820307372736
 29        602758180200411471785118384155625740795904        625666800641933392077523371178446048168640
 30      16462177769692502926149019481147829595226112      17087844570334436318226542852326275643394752
 31     449605340620764303649696448853838327821729792     466693185191098739967922991706164603465124544
 32   12279357272333073488607547946405292040181415936   12746050457524172228575470938111456643646540480
```


----------



## unsolved (Apr 1, 2015)

cuBerBruce said:


> I looked at using a syllable-based approach to see how many different maneuvers we should get at each depth. I got numbers that were generally a bit less than unsolved's numbers. His numbers were generally a bit less than Jakube's numbers. So I looked into why there were discrepancies.
> 
> As for Jakube's rules as stated, what are the correct numbers? Well, I did my own calculations and the results I got exactly match those that unsolved gives in the previous post. So I believe there must be a flaw in Jakube's formula or at least in his calculated numbers.



Well that part is at least encouraging.



cuBerBruce said:


> Thus, to properly reduce to minimal syllables, there should be another rule added to Jakube's rules. This rule could be:
> 
> if there are 3 moves on the same axis, ignore the case if the D layer (or L or B) is one of the layers moved.



OK, so then a move sequence such as *U u2 D* should be disallowed?

I tried playing around to create this same position using only *U*, *u* and *d* and couldn't come up with something.

https://alg.cubing.net/?puzzle=4x4x4&setup=U_2U2_D

*EDIT:*

But now I see U2 u' d' then rotating the cube with y' handles that. Hmmm.

https://alg.cubing.net/?puzzle=4x4x4&setup=U2_2U-_2D-_y-

*EDIT AGAIN*

So I added Bruce Rule #4 to the move generator code, turned off the centers database probing code, and this is what my 13-move litmus test position is reporting:






So our *cumulative numbers* match if you factor into account that my program does not generate a null move at depth 0.


```
for(axis_of_rotation = 0; axis_of_rotation < 3; axis_of_rotation++)
{
	present_depth_index = unchanging_depth - which_depth;
	GLOBAL_AXIS[present_depth_index] = axis_of_rotation;

	for(move_group = 0; move_group < 4; move_group++)
	{
		if((axis_of_rotation != last_move_axis) || ((axis_of_rotation == last_move_axis) && (move_group > last_move_group)))
		{
				___4___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___TEST___

				for(move_direction = 0; move_direction < 3; move_direction++)
				{
					GLOBAL_DIRECTION[present_depth_index] = move_direction;

					___3___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___WITH___2___MOVES___IN___THE___SAME___DIRECTION___TEST___

					if(avoid_move_generation == 0)
					{
						which_move_to_make = GLOBAL_AXIS_ROTATION[axis_of_rotation][move_group][move_direction];

						___3___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___BRUCE___RULE___4___

						___2___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___WITH___2___MOVES___IN___THE___SAME___DIRECTION___TEST___

						modified_cube = cube_move_array[which_move_to_make](which_cube);
						search_forever_maximized(modified_cube, which_depth-1, axis_of_rotation, move_group, which_move_to_make, unchanging_depth);
					}
				}
		}
	}
}
```

where...


```
#define ___4___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___TEST___ \
		avoid_move_generation = 1;\
		if(present_depth_index >= 3)\
		{\
			for(i = 0; i <= 2; i++)\
			avoid_move_generation = avoid_move_generation && (GLOBAL_AXIS[present_depth_index - 3] == GLOBAL_AXIS[present_depth_index - i]);\
		}\
		else avoid_move_generation = 0;\
		if(avoid_move_generation) continue;\

#define ___3___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___WITH___2___MOVES___IN___THE___SAME___DIRECTION___TEST___ \
		avoid_move_generation = 1;\
		if(present_depth_index >= 2)\
		{\
			for(i = 0; i <= 1; i++)\
			avoid_move_generation = avoid_move_generation && (GLOBAL_AXIS[present_depth_index - 2] == GLOBAL_AXIS[present_depth_index - i]);\
			if(avoid_move_generation)\
			{\
				unsigned short counter[3];\
				counter[0] = 0; counter[1] = 0; counter[2] = 0;\
				for(i = 0; i <= 2; i++)\
				{\
					counter[GLOBAL_DIRECTION[present_depth_index - i]] = 1 + counter[GLOBAL_DIRECTION[present_depth_index - i]];\
					if(counter[GLOBAL_DIRECTION[present_depth_index - i]] >= 2) avoid_move_generation = 2;\
				}\
				if(avoid_move_generation != 2) avoid_move_generation = 0;\
			}\
		}\
		else avoid_move_generation = 0;\
		if(avoid_move_generation == 2) continue;\


#define ___3___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___BRUCE___RULE___4___ \
		avoid_move_generation = 1;\
		if(present_depth_index >= 2)\
		{\
			for(i = 0; i <= 1; i++)\
			avoid_move_generation = avoid_move_generation && (GLOBAL_AXIS[present_depth_index - 2] == GLOBAL_AXIS[present_depth_index - i]);\
		}\
		else avoid_move_generation = 0;\
		if(avoid_move_generation)\
		{\
			if((which_move_to_make >= MOVE_GENERATOR_L_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_L_TWICE)) continue;\
			if((which_move_to_make >= MOVE_GENERATOR_B_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_B_TWICE)) continue;\
			if((which_move_to_make >= MOVE_GENERATOR_K_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_K_TWICE)) continue;\
		}\

#define ___2___CONSECUTIVE___MOVES___ON___THE___SAME___AXIS___WITH___2___MOVES___IN___THE___SAME___DIRECTION___TEST___ \
		avoid_move_generation = 1;\
		if(present_depth_index >= 1)\
		{\
			avoid_move_generation = (GLOBAL_AXIS[present_depth_index - 1] == GLOBAL_AXIS[present_depth_index]);\
		}\
		else avoid_move_generation = 0;\
		if(avoid_move_generation)\
		{\
			unsigned short same_direction_counter[3];\
			same_direction_counter[0] = 0; same_direction_counter[1] = 0; same_direction_counter[2] = 0;\
			for(i = 0; i <= 1; i++)\
			{\
				same_direction_counter[GLOBAL_DIRECTION[present_depth_index - i]] = 1 + same_direction_counter[GLOBAL_DIRECTION[present_depth_index - i]];\
				if(same_direction_counter[GLOBAL_DIRECTION[present_depth_index - i]] == 2) avoid_move_generation = 2;\
			}\
			if(avoid_move_generation != 2) avoid_move_generation = 0;\
			else\
			{\
if(((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) <= MOVE_GENERATOR_l_TWICE) && ((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) >= MOVE_GENERATOR_R_PLUS_) && (which_move_to_make >= MOVE_GENERATOR_L_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_L_TWICE)) continue;\
if(((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) <= MOVE_GENERATOR_b_TWICE) && ((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) >= MOVE_GENERATOR_T_PLUS_) && (which_move_to_make >= MOVE_GENERATOR_B_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_B_TWICE)) continue;\
if(((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) >= MOVE_GENERATOR_F_PLUS_) && ((GLOBAL_CUBE_SOLUTION[present_depth_index - 1] - 1) <= MOVE_GENERATOR_k_TWICE) && (which_move_to_make >= MOVE_GENERATOR_K_PLUS_) && (which_move_to_make <= MOVE_GENERATOR_K_TWICE)) continue;\
			}\
		}\
```

*EDIT: P.S., Thanks Bruce!*


----------



## Herbert Kociemba (Apr 2, 2015)

cuBerBruce said:


> I looked at using a syllable-based approach to see how many different maneuvers we should get at each depth. I got numbers that were generally a bit less than unsolved's numbers. His numbers were generally a bit less than Jakube's numbers. So I looked into why there were discrepancies.
> 
> The 4x4x4 obviously has 4 layers for each of the three main axes. Each layer can be in one of 4 positions (that we care about). So there are 4^4 - 256 possible ways a given set of 4 layers can be arranged. But some are essentially equivalent if we don't care about arrangements that are the same except for how the cube is oriented. Also, each time we change axis, we want to make some change for the new axis. So the total number of arrangements that matter is 4^3-1 = 63. This is the number of syllables we need to use.
> 
> ...



I do not know how you generate the counts, but there is a quite elegant way to do get them using generating functions. I there are 12/45/6 syllables of length 1/2/3 on one axis we define a generating function a(x) = 12x + 45x^2 + 6x^3 for this axis. Then the generating function for the number of canonical maneuvers is

gf(x) = 1+3a(x)/(1-2a(x))

and the generating function for the cumulated counts is Gf(x) = gf(x)/(1-x)

This works not only for 4x4x4 but for any metric for nxnxn, you have to plug in the correct numbers for the syllables in the formula for a(x) of course. Only in the case of OBTM we have a closed formula for a(x) for nxnxn which is a(x)= (1+3x)^(n-1) - 1 in HTM and a(x)=(1+2x+x^2)^(n-1) - 1 in QTM.

But back to the 4x4x4. If we use a(x) = 12x + 45x^2 + 6x^3 we get 

gf(x) =-(1/2)-3/(-2+48 x+180 x^2+24 x^3)

In Mathematica, you then use for example

Series[gf[x], {x, 0, 10}]

to get the first 10 terms of the Taylor series expansion which gives

1+36 x+999 x^2+27234 x^3+743958 x^4+20318040 x^5+554915988 x^6+15155534808 x^7+413919090792 x^8+11304715303584 x^9+308747751874992 x^10+O[x]^11

These are exactly your numbers.


----------



## unsolved (Apr 2, 2015)

Herbert Kociemba said:


> I do not know how you generate the counts, but there is a quite elegant way to do get them using generating functions.



The way Jake did his original enumeration was quite easy.






The move counts are a function of the sum of legal parallel plane moves. Compute how many legal moves there are when only one plane is moved, then two parallel planes (like U followed by either u d or D), then three consecutive parallel plane moves (*U u2 D* = *U2 u' d'* so one of these must be disallowed) and then add them up.

There is no way to perform 2 consecutive parallel plane moves at depth 1, so that gets as 0, as well as 3 parallel plane moves. So for depth 1 you get 36 moves of one plane (U, R, F, etc..) and 0 for the others. At depth 2, there are 135 parallel plane moves of 2 parallel planes. At depth 3, there are 72 moves of 3 parallel planes. 

The numbers 36, 135, and 72 are shown shaded in purple.

Every other number below the purple is derived from recursive formulas. 

For 1 parallel plane, the total moves at a given depth is 24 times the total sum at the prior depth. 24 * 36 = 864.

For 2 parallel planes, the total moves at a given depth is 90 times the total sum from 2 depths prior. 90 * 36 = 3240.

For 3 parallel planes, the total moves at a given depth is 48 times the total sum from 3 depths prior. 48 * 36 = 1728.

Excel can handle up to depth 10 before rounding errors screw things up. Then you need a big number library to handle the rest.


----------



## Herbert Kociemba (Apr 2, 2015)

If I use a(x) := 12 x + 45 x^2 + *24* x^3 I get Jakes numbers. So as Bruce already stated, he seems to use 24 syllables of length 3.


----------



## rokicki (Apr 2, 2015)

unsolved said:


> Well that part is at least encouraging.
> 
> ```
> for(axis_of_rotation = 0; axis_of_rotation < 3; axis_of_rotation++)
> ...



Wow. You can replace all of this with a small state table. For SST I use
49 states. We have two tables:

const int MOVEPRUNE_STATES = 49 ;
unsigned long long nextmove_mask[MOVEPRUNE_STATES] ;
unsigned char nextmove_state[MOVEPRUNE_STATES][NMOVES] ;

so the move stuff just goes:


```
int recur(const cubepos &cp, int moveprune_state) {
   ...
   unsigned long long movemask = nextmove_mask[moveprune_state] ;
   for (int mv=0; mv<NMOVES; mv++)
      if ((movemask >> mv) & 1) {
         cp2 = cp ;
         cp2.move(mv) ;
         ...
         recur(cp2, nextmove_state[moveprune_state][mv]) ;
         ...
      }
}
```

Generating the state tables can be done just once, using the more complicated
and longer code you show above.

This may reduce your instruction count a fair bit and bump your node evaluation
speed.


----------



## unsolved (Apr 2, 2015)

rokicki said:


> Wow. You can replace all of this with a small state table. For SST I use
> 49 states. We have two tables:
> 
> const int MOVEPRUNE_STATES = 49 ;
> ...



Well the axis rotation data is pretty small.


```
void init_axis_rotation_data(void)
{
	GLOBAL_AXIS_ROTATION[0][0][0] = MOVE_GENERATOR_R_PLUS_;
	GLOBAL_AXIS_ROTATION[0][0][1] = MOVE_GENERATOR_R_MINUS;
	GLOBAL_AXIS_ROTATION[0][0][2] = MOVE_GENERATOR_R_TWICE;
	GLOBAL_AXIS_ROTATION[0][1][0] = MOVE_GENERATOR_r_PLUS_;
	GLOBAL_AXIS_ROTATION[0][1][1] = MOVE_GENERATOR_r_MINUS;
	GLOBAL_AXIS_ROTATION[0][1][2] = MOVE_GENERATOR_r_TWICE;

	GLOBAL_AXIS_ROTATION[0][2][0] = MOVE_GENERATOR_l_PLUS_;
	GLOBAL_AXIS_ROTATION[0][2][1] = MOVE_GENERATOR_l_MINUS;
	GLOBAL_AXIS_ROTATION[0][2][2] = MOVE_GENERATOR_l_TWICE;
	GLOBAL_AXIS_ROTATION[0][3][0] = MOVE_GENERATOR_L_PLUS_;
	GLOBAL_AXIS_ROTATION[0][3][1] = MOVE_GENERATOR_L_MINUS;
	GLOBAL_AXIS_ROTATION[0][3][2] = MOVE_GENERATOR_L_TWICE;

	GLOBAL_AXIS_ROTATION[1][0][0] = MOVE_GENERATOR_T_PLUS_;
	GLOBAL_AXIS_ROTATION[1][0][1] = MOVE_GENERATOR_T_MINUS;
	GLOBAL_AXIS_ROTATION[1][0][2] = MOVE_GENERATOR_T_TWICE;
	GLOBAL_AXIS_ROTATION[1][1][0] = MOVE_GENERATOR_t_PLUS_;
	GLOBAL_AXIS_ROTATION[1][1][1] = MOVE_GENERATOR_t_MINUS;
	GLOBAL_AXIS_ROTATION[1][1][2] = MOVE_GENERATOR_t_TWICE;

	GLOBAL_AXIS_ROTATION[1][2][0] = MOVE_GENERATOR_b_PLUS_;
	GLOBAL_AXIS_ROTATION[1][2][1] = MOVE_GENERATOR_b_MINUS;
	GLOBAL_AXIS_ROTATION[1][2][2] = MOVE_GENERATOR_b_TWICE;
	GLOBAL_AXIS_ROTATION[1][3][0] = MOVE_GENERATOR_B_PLUS_;
	GLOBAL_AXIS_ROTATION[1][3][1] = MOVE_GENERATOR_B_MINUS;
	GLOBAL_AXIS_ROTATION[1][3][2] = MOVE_GENERATOR_B_TWICE;

	GLOBAL_AXIS_ROTATION[2][0][0] = MOVE_GENERATOR_F_PLUS_;
	GLOBAL_AXIS_ROTATION[2][0][1] = MOVE_GENERATOR_F_MINUS;
	GLOBAL_AXIS_ROTATION[2][0][2] = MOVE_GENERATOR_F_TWICE;
	GLOBAL_AXIS_ROTATION[2][1][0] = MOVE_GENERATOR_f_PLUS_;
	GLOBAL_AXIS_ROTATION[2][1][1] = MOVE_GENERATOR_f_MINUS;
	GLOBAL_AXIS_ROTATION[2][1][2] = MOVE_GENERATOR_f_TWICE;

	GLOBAL_AXIS_ROTATION[2][2][0] = MOVE_GENERATOR_k_PLUS_;
	GLOBAL_AXIS_ROTATION[2][2][1] = MOVE_GENERATOR_k_MINUS;
	GLOBAL_AXIS_ROTATION[2][2][2] = MOVE_GENERATOR_k_TWICE;
	GLOBAL_AXIS_ROTATION[2][3][0] = MOVE_GENERATOR_K_PLUS_;
	GLOBAL_AXIS_ROTATION[2][3][1] = MOVE_GENERATOR_K_MINUS;
	GLOBAL_AXIS_ROTATION[2][3][2] = MOVE_GENERATOR_K_TWICE;
}
```

I use *T* for top (as opposed to U), *B* for Bottom (as opposed to Back), and *K* for Back.

So the 3 for loops are just going through 0...2, 0...3, and 0..2.

The MOVE_GENERATOR_R_PLUS_ to MOVE_GENERATOR_K_TWICE are just constants 0 through 35. They are passed to an array of function pointers.


```
which_move_to_make = GLOBAL_AXIS_ROTATION[axis_of_rotation][move_group][move_direction];
modified_cube = cube_move_array[which_move_to_make](which_cube);
```

So cube_move_array[ ... ] takes an index, and that index sends you to the routine that executes the associated move. It only takes 6 lines of code to make any move.


```
BITBOARD_4x4x4_CUBE T_PLUS(BITBOARD_4x4x4_CUBE original_4x4x4_cube)
{
BITBOARD_4x4x4_CUBE new_cube;

/**************************************************************************/
/* Rotating the top will change something on every face except the bottom */
/**************************************************************************/
new_cube._4x4x4_bottom = original_4x4x4_cube._4x4x4_bottom;

/******************************************************************************************/
/* Entire row of cubes moves from right -----> front -----> left -----> back -----> right */
/* new front = old right; new right = old back; new back = old left; new left = old front */ 
/******************************************************************************************/
new_cube._4x4x4_front = (original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_ROW_01);
new_cube._4x4x4_right = (original_4x4x4_cube._4x4x4_right & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_cube._4x4x4_back  & BITMASK_CUBE_FACE_ROW_01);
new_cube._4x4x4_back  = (original_4x4x4_cube._4x4x4_back  & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_cube._4x4x4_left  & BITMASK_CUBE_FACE_ROW_01);
new_cube._4x4x4_left  = (original_4x4x4_cube._4x4x4_left  & BITMASK_CUBE_FACE_NOT_ROW_01) | (original_4x4x4_cube._4x4x4_front & BITMASK_CUBE_FACE_ROW_01);

/*********************************************************************************/
/*                                 Rotate the TOP                                */
/*********************************************************************************/
/*                                                                               */
/* THESE CUBE LOCATIONS BECOME....              THESE CUBE LOCATIONS             */
/*                                                                               */
/*                                                                               */
/*********************************/             /*********************************/
/*  01   *  02   *  03   *   04  */             /*  13   *  09   *  05   *   01  */
/*********************************/             /*********************************/
/*  05   *  06   *  07   *   08  */             /*  14   *  10   *  06   *   02  */
/*********************************/             /*********************************/
/*  09   *  10   *  11   *   12  */             /*  15   *  11   *  07   *   03  */
/*********************************/             /*********************************/
/*  13   *  14   *  15   *   16  */             /*  16   *  12   *  08   *   04  */
/*********************************/             /*********************************/
/*                                                                               */
/*                                                                               */
/*********************************************************************************/

new_cube._4x4x4_top = ((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_13) << 48)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_09) << 28)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_05) << 8)   | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_01) >> 12)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_14) << 36)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_10) << 16)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_06) >> 4)   | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_02) >> 24)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_15) << 24)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_11) << 4)   | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_07) >> 16)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_03) >> 36)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_16) << 12)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_12) >> 8)   | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_08) >> 28)  | \
						((original_4x4x4_cube._4x4x4_top & BITMASK_CUBE_FACE_SQUARE_04) >> 48);

return new_cube;
}
```

When I disable the 64-bit hash key generation and hash table probing, the search reaches ~ 20,000,000 nodes/sec per core. I typically have 12 cores engaged for parallel searching, which can absorb everything generated by the first two for loops.

*EDIT: New versions online for downloading.*

See: https://www.speedsolving.com/forum/showthread.php?46925-Announcing-New-4x4x4-Brute-Force-Solver


----------



## Carrot (May 3, 2015)

This thread has been closed with respect to unsolved's wish.


----------

