Back to The Portfolio
The Puzzle

     The puzzle is a program that is written to solve the 8-puzzle. It uses hillclimbing and backtracking methods in order to select what to do. The goal state is always taken to be that in which the blank space is in the lower right corner, and the numbers run sequentially from the upper left corner. The program will continue until the goal state has been reached, the tries count is at maximum, or there are no more rules to try for any puzzle state created.
     Below are the puzzle states that are used as examples in this folder.
Puzzle1
412
753
8 6
Puzzle2
 12
563
478
Puzzle3
4 2
715
863

These are the source code files.

ThePuzzle.java
StepBackTree.java
StepBackNode.java