8 puzzle problem implemented by using Brute Force Search.
This code contains the implementation of brute force seach algorithm to solve the 8 puzzle problem. There are four acions carried out on the blank tile by mowing it to attain the final output namely:
- Move Right
- Move Left
- Move Up
- Move Down For simplicity the blank tile has the value 0.
python -version 3
Numpy
Enter the following to run the python file.
cd [to 'source code' directory containing eight_puzze.py file]
python3 eight_puzzle.py
As soon as you run the program, the following prompt occurs in the command window:
Enter 9 elements of the puzzle:
Please enter the elements of the matrix row wise typing enter
Enter 9 elements of the puzzle:
1
3
2
4
5
6
8
0
7
The program takes input in the form
1 3 2
4 5 6
8 0 7
Please don't press space after typing numbers. Only press enter as it may give errors.
Text files will be generated outside source code folder.