I\'ve encountered an interesting problem while programming a random level generator for a tile-based game. I\'ve implemented a brute-force solver for it but it is exponentially
As a base, take a look at an earlier answer I gave on searching. Hill-climbing search programs are a tool every programmer should have in their arsenal as they work much better than plain brute-force solvers.
Here, even a relatively bad search algorithm has as an advantage the fact that it won't generate illegal boards, greatly reducing the expected run time.