Rush Hour
if you\'re not familiar with it, the game consists of a collection of cars of varying sizes, set either horizontally or vertically, on a NxM grid
I wrote a sudoku solver. While the details are completely different, I think the overall problem is similar. For one thing, trying to do smart heuristics in a sudoku solver is much slower than a brute force solution. Trying every move, with a few simple heuristics and no duplicates is the way to go. It is slightly more difficult to check for duplicate board states in rush hour, but not much.
If you look at the board in you sample, there are only 4 valid moves. At any given time, there will only be a few valid moves.
At each level of recursion, copy the board state and try every valid move on the board. For each empty square, move every car that can onto that square. If the new board state is not in the history list, then recurse another level. By history list, I mean give each level of recursion access to each board that led to that state, probably in a linked list. Use hashes to quickly discard unequal states.
The key to this is having a simple board state that can be easily copied and modified. Probably an array with one int per square saying what car covers that square, if any. Then you just need to iterate through the squares and figure out legal moves. A legal move means empty squares between the test square and a car oriented towards it.
As with sudoku, the worst possible option would be a genetic algorithm.