Rubik's Cube Thistlethwaite Four Phase Algorithm I am trying to understand The Four-Phase-Algorithm ( Thistlethwaite's 52-move algorithm ) for Rubik's Cube but no easy understandable explaination is given. It would be helpful if given with a small example. I am trying forward to write a code on it.
 A: I'm workkng from the description on Jaap's puzzle page.
First, fix an orientation of the cube.  I'm going to assume White is on top, Yellow on bottom, and Red in front.
Phase 1 is to get all the edge pieces "GOOD".  Each edge piece is either GOOD or BAD, depending on how it is flipped around.  A GOOD edge piece can be restored to its home location and rotation without twisting the top or bottom layers of the cube.  Performing a quarter turn of the top or bottom layer flips all the edge cubies on it from GOOD to BAD or vice versa.  You know you're done with phase 1 when all the edge cubies are GOOD.  This can be done in a worst case of 7 moves.
Phase 2 involves getting all of the corners in a similar "GOOD" orientation, and placing the edge cubies { White, Yellow } x { Red, Orange } into their slice, i.e. not touching the Blue or Green sides.  Every corner piece has a Blue or Green square on it.  A corner piece is GOOD when its Blue or Green square is on either of the Blue or Green faces, i.e. having a Blue square on the Green face is GOOD.  No quarter-turn U or D moves will be necessary (but U^2 or D^2 may be), and this can be accomplished in 10 or fewer moves.
The end goal of phase 3 is to get every square on all sides of the cube either correct or the opposite color.  All squares on the Red side should be Red or Orange, all squares on the Blue side should be Blue or Green, etc.  This can be done using only F, B, F^2, B^2, L^2, R^2, U^2, and D^2 moves, and can be done in 13 or fewer moves.
The fourth phase is to get the cube totally solved.  This can be done with only U^2, D^2, L^2, R^2, F^2, and B^2 moves, with a maximum of 15 of them.
Each of these phases can be treated as a simple depth first search problem.  However, you can use color substitutions and pregenerated lookup tables to speed up individual solutions.
Take phase 3 for instance.  Virtually replace all the Orange stickers with Red, all the Yellow stickers with White, and all the Green stickers with Blue.  Now the goal of this phase changes to solving this color-reduced cube.  When you find a series of moves that solves it, go back to the original cube at the end of phase 2 with its full coloration and replay those moves onto it.  
