A330280: Least number of moves required to solve an n X n Simon Tatham's Twiddle puzzle.
Best known solutions for 3 <= n <= 7.

Each move (2x2 rotation) is described with 3 integers: r c dir.
r and c are the row and column of the top-left cell involed in the rotation,
while dir is the rotation direction: 1 is clockwise and -1 is counter clockwise.

By Dmitry Kamenetsky and Wladimir Leite, 20/04/2020



a(3) = 10, found by Dmitry Kamenetsky
Original grid
987
654
321
after move 1: 1 1 -1
987
641
352
after move 2: 1 0 -1
987
451
632
after move 3: 1 1 -1
987
412
653
after move 4: 1 0 -1
987
152
463
after move 5: 0 0 1
197
582
463
after move 6: 0 1 -1
172
598
463
after move 7: 1 1 -1
172
583
496
after move 8: 0 1 -1
123
578
496
after move 9: 1 1 -1
123
586
479
after move 10: 1 0 1
123
456
789

a(4) = 24, found by Dmitry Kamenetsky
1 1 -1
2 1 1
0 2 -1
2 2 -1
1 1 -1
2 0 1
2 0 1
1 1 -1
0 0 -1
1 2 1
0 2 -1
1 0 1
1 1 -1
1 1 -1
0 0 -1
2 0 -1
0 2 -1
0 0 -1
2 2 -1
1 1 -1
1 1 -1
2 0 -1
2 2 -1
1 2 1


a(5) <= 48, found by Wladimir Leite
3 3 1
3 2 -1
2 2 1
2 2 1
1 2 1
1 1 -1
0 1 1
0 0 -1
1 0 1
1 1 -1
2 1 1
2 2 -1
0 2 -1
1 1 1
2 2 -1
2 3 -1
2 0 -1
3 3 1
2 2 -1
2 1 -1
3 2 1
0 2 -1
2 0 -1
1 2 -1
1 1 1
2 2 -1
3 1 1
0 3 1
1 3 -1
1 2 1
2 2 -1
2 1 -1
3 0 1
3 0 1
2 1 -1
2 0 1
3 0 -1
1 0 1
2 1 -1
1 1 -1
0 2 -1
0 3 1
1 2 -1
1 1 -1
1 2 -1
2 1 1
0 3 1
1 3 -1

a(6) <= 88, found by Wladimir Leite
1 2 -1
2 3 -1
3 3 1
2 2 -1
4 2 -1
3 1 1
2 0 -1
1 1 1
0 2 -1
1 3 1
2 2 -1
2 4 -1
3 3 1
3 2 -1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