slayze
slayze

Reputation: 21

Consistency and admissibility of heuristics for Rush Hour

I am currently implementing a solver for Rush Hour (a very interesting sliding puzzle) using A*. I'm testing the whole thing with a database that contains all the game configurations, and thanks to various optimizations I can now solve the most difficult configuration in under 3s, which is pretty cool.

However, none of my four heuristics manage to find minimal solutions in all 225 configurations that are of interest to me (I ignore the game boards with obstacles), so I assume that the heuristics I use are not valid and consistent, but firstly I don't know why and secondly I can't think of a more useful heuristic.

Here are the heuristics I use:

  1. Count number of fields between the red car and the exit
  1. Count blocking cars between the red car and the exit and penalize the cars that can't move
  1. Count blocking cars starting from cars between the red car and the exit recursively

Based on all my considerations and attempts, I am somewhat at a loss as to how to create a reasonable heuristic that firstly always finds the minimal solutions and secondly is efficient enough to maintain the runtimes.

Upvotes: 0

Views: 91

Answers (0)

Related Questions