3 ms·
Should be far easier to create a heuristic search solution. Very naively you could probably get good results by exploring nodes in order by sum of distances fr
by TimPC 12y ago
Should be far easier to create a heuristic search solution. Very naively you could probably get good results by exploring nodes in order by sum of distances from blocks to colour points if blocks could move in any direction. You'll eliminate most of the move away and out of screen behaviours naturally and by preventing the exploration of a previously explored state. You could explore better heuristics but given that the branching factor is only n where n is the number of blocks, most puzzles are solved in under 50 moves and most solutions get pruned quickly both position duplication or bad solutions quickly mangling the heuristic. The hard problems for this program are ones where you have to make a whole sequences of moves away from the objective in order to get a key directional move that accomplishes it.