implementation of astar algorithm for various puzzles.