A Python implementation of an N-Puzzle solver using A* search with the Manhattan distance heuristic.
- Supports 3x3 to 5x5 puzzles
- Finds shortest sequence of moves to solve the puzzle
- Detects unsolvable states
- First line: integer
k(board size) - Next
k*klines: tile numbers (0 represents the empty space)
- First line: number of moves
- Following lines: moves (
UP,DOWN,LEFT,RIGHT)
Run with input file:
python3 solver.py < input.txt
This project is licensed under the MIT License.