Email me your answers to the following two problems. For each problem, you should email me your source code (*.java files), and a screenshot of your program executing. You must also answer any questions asked.
There is a Basic Problem and an Advanced Problem. You may choose either one. Choose the advanced problem only if you are a good programmer. You do not need to do both problems. You may collaborate with one other student, but you must let me know if you are doing this.
The 15 puzzle is a larger version of the 8 Puzzle. Your assignment is to write a program to solve this puzzle.
Here is the goal state:
and here is an easy initial state (it's not far from the goal):
First, you should download the Java implementation of algorithms from Norvig and Russell's Artificial Intelligence - A Modern Approach from http://code.google.com/p/aima-java/downloads/list. If you don't have Eclipse, you should install it now. Then you can do "File-Import...-Import Existing projects into Workplace" and import the aima-java project. If the import process doesn't work, you will need to create a new project in the same folder and then you will see the classes in Eclipse. Make sure you can run the EightPuzzleDemo.
Now you need to extend the existing 8-puzzle implementation to solve the above 15-puzzle problem. Remember that documentation for the book code is here. To solve a problem with Uninformed Search using the code from the text, you need to write four classes:
The EightPuzzleDemo.java file is set up to run many search algorithms on the 8 Puzzle. In your own FifteenPuzzleDemo.java file, try to solve the 15-puzzle with BreadthFirstSearch, DepthFirstSearch, DepthLimitedSearch, and IterativeDeepeningSearch. (This just means you don't include the calls to the other methods.) Do all of these four uninformed search algorithms work in this case? If not, report which algorithms work and which not, and explain why some algorithms fail and why some algorithms work (just a sentence or two for each method).
Now try to solve the 15-puzzle with following initial states (this just involves editing the initialization in your FifteenPuzzleDemo.java file): Case 1: At least 59 steps needed.
Case 2: At least 38 steps needed.
Do the four uninformed search algorithms still work for the above two more difficult cases? Why or why not (a sentence or two for each method)?
Peg Solitaire is a game consisting of a playing board with 33 holes together with 32 pegs. In the picture above, the hole in the center is empty and the remaining holes contain pegs. The goal is to remove all the pieces except one, which should be in the center. A piece can be removed by jumping an adjacent piece over it into an empty hole. Jumps are permitted horizontally or vertically, but not diagonally.
Your assignment consists of two parts, plus one extra credit part: