Algorithms to solve pacman puzzles