Solving a tile puzzle problem the size of NxM with up to 2 empty spaces using various search algorithms:
- BFS
- DFID
- A*
- IDA*
- DFBnB
Minimizing the following cost:
Single move - 5
Vertical double move - 6
Horizontal double move - 7
Double moves are allowed only into 2 empty spaces.
Create a file "input.txt" in the directory
With the following format:
Line 1: BFS / DFID / A* / IDA* / DFBnB - Choose algorithm
Line 2: with time / no time - Out put running time
Line 3: with open / no open - Displaying the open list during run time
Line 4: NxM - Board size
Next N lines: Starting state
Next line: "Goal state:"
Next N lines: Goal state
A*
with time
no open
3x3
1,2,3
4,7,_
5,6,_
Goal state:
1,2,3
4,5,6
7,_,_
The output will be written in a file named "output.txt"
In the following format:
Line 1: Steps of the solution
Line 2: Number of nodes generated
Line 3: Cost of the solution
Line 4: (Optional) Running time of the program
Turning "with open" will display the open list in the console.
6R-7D-6U-7R-5R-5U-7L-7L
Num: 328
Cost: 40
0.048 seconds