This project is a Python implementation of an 8 Puzzle Solver using the Iterative Deepening Algorithm. The 8 Puzzle is a sliding puzzle consisting of a 3x3 grid with 8 numbered tiles and an empty space. The goal is to rearrange the tiles from an initial configuration to a goal configuration.
- Clone or download the project repository to your local machine.
- Ensure that you have Python installed on your system.
- Open a terminal or command prompt and navigate to the project directory.
- Run the
main.py
file using the following command:python main.py
. - The program will prompt you to input the initial configuration of the puzzle. You can either provide your own input by entering the numbers separated by spaces, or you can press Enter to use the default puzzle configuration.
- If you choose to enter your own input, make sure to follow the correct format with 9 numbers separated by spaces. For example:
1 2 3 4 5 6 7 8 0
. - The program will then apply the Iterative Deepening Algorithm to solve the puzzle and display the steps taken to reach the goal configuration.
- If a solution is found, the program will display the solution path, the number of steps taken, and the total number of nodes expanded during the search process.
- If a solution cannot be found within a reasonable amount of time or memory, the program will display an appropriate message.
- Python 3.x
main.py
: The main Python script that implements the 8 Puzzle Solver using the Iterative Deepening Algorithm.