0% found this document useful (0 votes)
273 views

Assignment - Problem Search Algorithms

The document provides instructions for homework assignment 1, which involves solving the 15-puzzle problem using uninformed search algorithms. Students are asked to: 1. Implement classes representing the 15-puzzle problem state and goal test and successor functions. 2. Solve an initial 15-puzzle case using Breadth-First Search, Depth-First Search, and Iterative Deepening Search, and report which algorithms work and why some may fail. 3. Try the same algorithms on two more difficult 15-puzzle cases and analyze if the algorithms still work and why.

Uploaded by

Boedhiex Haryono
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
273 views

Assignment - Problem Search Algorithms

The document provides instructions for homework assignment 1, which involves solving the 15-puzzle problem using uninformed search algorithms. Students are asked to: 1. Implement classes representing the 15-puzzle problem state and goal test and successor functions. 2. Solve an initial 15-puzzle case using Breadth-First Search, Depth-First Search, and Iterative Deepening Search, and report which algorithms work and why some may fail. 3. Try the same algorithms on two more difficult 15-puzzle cases and analyze if the algorithms still work and why.

Uploaded by

Boedhiex Haryono
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

INFO405 Artificial Intelligence

Homework 1
Instructions for submitting programs
The beginning of the program should contain comments with your name. You should:
1. All source code.
2. A readme file: explaining how to compile and run the program
3. Executables (for Java, the .class or .jar files)
4. Screen shots of the program execution
5. Answers to questions asked below.
Problem: Solving the 15-puzzle with uninformed search algorithms (15 points)
On page 66 of the AIMA text, the 15-puzzle is introduced as a search problem. Here you
are asked to write programs to solve the following 15 puzzle:
Initial state: (an easy case)
1

11

12

13 10 14
Goal state:

15

10

11

12

13 14 15
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 8-puzzle
implementation to solve the above 15-puzzle problem. To solve a problem with
Uninformed Search, you need to write three classes .
1. a class that represents the Problem state .This class is independent of the
framework and does NOT need to subclass anything . Let us, for the rest of these
instruction, assume you are going to solve the NQueens problem . So in this step
you need to write something like aima.search.nqueens.NQueensBoard .
2. a subclass of aima.search.framework.GoalTest.This implements only a single
function ---boolean isGoalState(Object state); The parameter state is an instance
of the class you created in step 1-a above. For the NQueensProblem you would
need to write something like aima.search.nqueens.NqueensBoardTest
3. a subclass of aima.search.framework.SuccessorFunction .This generates a stream
of Successors where a Successor is an object that represents an (action,

resultantState) pair. In this release of the code the action is a String (something
like "placeQueenAt4,4" and the resultant State is an instance of the class you
create in step 1.a . An example is
aima.search.nqueens.NQueensSuccessorFunction.
You can look at the EightPuzzleDemo.java, EightPuzzleBoard.java,
EightPuzzleGoalTest.java, EightPuzzleSuccessorFunction.java files to figure out how 8puzzle is solved. In your own FifteenPuzzleDemo.java file, try to solve the 15-puzzle
with BreadthFirstSearch, DepthFirstSearch, and IterativeDeepeningSearch. 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.
Now try to solve the 15-puzzle with following initial states:
Case 1: At least 59 steps needed.
11

15

13

12

14
9

3
10
4
8
Case 2: At least 38 steps needed.
13

14

10

15

2
12 11
Do the four uninformed search algorithms still work for the above two more difficult
cases? Why?
Extra Credit (5 points)
Implement a GUI for the 15-puzzle that shows the moves visually.

You might also like