In this programming assignment you will write a code to solve 8-puzzle problems. The objective of the puzzle is to rearrange a given initial configuration (starting state) of 8 numbers on a 3 x 3 board into a final configuration (goal state) with a minimum number of actions. For this assignment our goal state is:
1 2 3
4 5 6
7 8 _
JDK 1.8 - is the baseline JDK against which this project is developed.
- Open your terminal and go to the project repository
- Now, type cd aima-core\src\main\java and press Enter
- Again, type javac .\poai572\lab1\EightPuzzleTerminalTest.java and press Enter
- Type java .\poai572\lab1\EightPuzzleTerminalTest.java
Example: java .\poai572\lab1\EightPuzzleTerminalTest.java "D:\COM572\Assignment\part-2\S4.txt" "h1"
Output: Total nodes generated, Total time taken, Path length, PathThis program can solve Eight Puzzle Problem with file algorithms:
- BFS: Breadth First Search
- IDS: Iterative Deepening Search
- h1: A* Search with Misplaced Tile Heuristic
- h2: A* Search with Manhattan Distance Heuristic
- h3: A* Search With Direct Adjacent Tile Reversal Heuristic
Input: file-path Output: Total nodes generated, Total time taken, Path length, Path (for all algorithms)
- Open the project repository
- Go to aima-core\src\main\java\poai572\lab1</b> repository
- Open the EightPuzzleSingleFileTest.java file
- Set your file-path to final static FILE_PATH variable
- Run the file
Input: folder-path, algorithm
Output: Average Execution Time, Average Nodes Generated
- Open the project repository
- Go to aima-core\src\main\java\poai572\lab1</b> repository
- Open the EightPuzzleMultipleFileTest.java file
- Set your folder-path to final static FOLDER_PATH variable
- Set your algorithm to final static ALGORITHM variable
- Run the file