- Devashri Gadgil
- Varad Deshpande
- Akshay Bheda
The 8-puzzle problem is a puzzle invented by Noyes Palmer Chapman. It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. The goal is to rearrange the blocks so that they are in order. We are permitted to slide blocks horizontally or vertically into the blank square.The following shows a sequence of legal moves from an initial board position to the goal position.
- Make sure you have python installed.
- Make sure you have numpy installed.
- When you import the code in an IDE make sure there are no errors on the imports (numpy and copy).
- Clone the repository
- Go to the folder containing the code.
- Open the terminal and and run command- py A_star.py
- While inputting the initial and goal state, input them as a matrix. For Example, if you want to input a goal state 1 2 3 4 5 6 7 8 0, you should input as matrix as follows: 123 (3 inputs per line)
- Select the heuristic of your choice. If you input any value besides 1, Manhattan heuristic will get selected automatically.