solve 8-puzzle problem using A* algorithm