while ( !GoalState ) get batches if( batches.count = 1 ) move the pile of disks from the peg containing the batch to the right peg else move first batch on top of second batchUPDATE
peg 1: { 2, 11, 13, 16, 17, 18 } peg 2: { 3, 4, 5, 8, 15 } peg 3: { 6, 9, 10, 20} peg 4: { 1, 7, 12, 14, 19 }The algorithm I have posted before chocked on this config, ie it took a long time to analyse (i have interruped it)
> () >> : 1( 2 11 13 16 17 18 ) 2( 3 4 5 8 15 ) 3( 6 9 10 20 ) 4( 1 7 12 14 19 ) Time : 00:00:01.24 Solved: Analyzed moves= 15, simple moves = 1899991, MaxOperationStackDepth = 39intermediate steps
> () >> : 1( 2 11 13 16 17 18 ) 2( 3 4 5 8 15 ) 3( 6 9 10 20 ) 4( 1 7 12 14 19 ) Strategy Top 1> (1) 4 >> 1: 1( 1 2 11 13 16 17 18 ) 2( 3 4 5 8 15 ) 3( 6 9 10 20 ) 4( 7 12 14 19 ) Strategy Top 2> (2) 1 >> 2: 1( 11 13 16 17 18 ) 2( 1 2 3 4 5 8 15 )3( 6 9 10 20 ) 4( 7 12 14 19 ) Strategy Top 5> (3) 2 >> 3: 1( 11 13 16 17 18 ) 2( 8 15 ) 3( 1 2 3 4 5 6 9 10 20 ) 4( 7 12 14 19 ) Strategy Top 6> (4) 3 >> 4: 1( 11 13 16 17 18 ) 2( 8 15 ) 3( 9 1020 ) 4( 1 2 3 4 5 6 7 12 14 19 ) Strategy Top 7> (5) 4 >> 2: 1( 11 13 16 17 18 ) 2( 1 2 3 4 5 6 7 8 15 ) 3( 9 10 20 ) 4( 12 14 19 ) Strategy Top 8> (6) 2 >> 3: 1( 11 13 16 17 18 ) 2( 15 ) 3( 1 2 3 4 5 6 7 8 9 10 20 ) 4( 12 14 19 ) Strategy Top 10> (7) 3 >> 1: 1( 1 2 3 4 5 6 7 8 9 10 11 13 16 17 18 )2( 15 ) 3( 20 ) 4( 12 14 19 ) Strategy Top 11> (8) 1 >> 4: 1( 13 16 17 18 ) 2( 15 ) 3( 20 ) 4( 1 2 3 4 5 6 7 8 9 10 11 12 14 19 ) Strategy Top 12> (9) 4 >> 1: 1( 1 2 3 4 5 6 7 8 9 10 11 12 13 16 17 18 ) 2( 15 ) 3( 20 ) 4( 14 19 ) Strategy Top 13> (10) 1 >> 4: 1( 16 17 18 ) 2( 15 ) 3( 20 ) 4( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 19 ) Strategy Top 14> (11) 4 >> 2: 1( 16 17 18 ) 2( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ) 3( 20 ) 4( 19 ) Strategy Top 15> (12) 2 >> 1: 1( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18) 2( ) 3( 20 ) 4( 19 ) Strategy Top 18> (13) 1 >> 4: 1( ) 2( ) 3( 20 ) 4( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ) Strategy Top 19> (14) 4 >> 3: 1( ) 2( ) 3( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ) 4( ) Strategy Top 20> (15) 3 >> 4: 1( ) 2( ) 3( ) 4( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )UPDATE 2
// update SimpleMoves SimpleMoves += Math.Pow(2.0, n) - 1.0;Following config would require 1.37081612192351E+15 simple moves
var xx = new State( new List<uint> { 1, 7, 11, 12, 13, 15, 17, 21, 24, 28, 31, 38, 39, 48, 49, 50 }, new List<uint> { 9, 14, 23, 27, 32, 35, 37, 45, 46 }, new List<uint> { 2, 4, 10, 19, 26, 30, 34, 36, 42, 44, 47}, new List<uint> { 3, 5, 6, 8, 16, 18, 20, 22, 25, 29, 33, 40, 41, 43} );