Skip to main content

Implementing 8-puzzle search in java with full source code | download now

The 8-puzzle problem

In this project you will implement a solution to the 8-puzzle by state-space search, using the search engine described in the lectures, and experiment with search strategies.

What you must do


Implementing 8-puzzle search

In the search2 folder in the Java download on the COM1005/2007 MOLE site is the code for the simple search engine and for Jugs problems. Note that you may have to recompile the code for your version of Java.

• Following the instructions in section 2.9 of the lecture notes, write classes to implement a state-space search for 8-puzzle problems.
• You should not need to change the code for the search engine except perhaps to control how much it prints as a search proceeds, and to stop the search after a given number of iterations (in an 8-puzzle the search tree can become large).
• Test your implementation with breadth-first searches for the following initial con- figurations and the same goal state as above:

Experimenting with Search Strategies


The search engine in the search4 folder implements the following search strategies:
• Breadth-first
• Depth-first
• Branch-and-Bound
• A*

In this case we won’t consider Depth-first and Branch-and-Bound is the same as Breadth- first because we have uniform costs. We’ll compare Breadth-first with 2 variants of A*.
• Adapt your 8-puzzle classes for search4. This means that your 8-puzzle state must now include a local cost g (always 1 for the 8-puzzle), and an estimated remaining cost estRemCost, which is used by A* and must be an underestimate of the true cost.
• Code two alternative methods in your 8-puzzle state class for computing estRemCost, assuming that the target pattern is always the same, as above.
o Hamming distance, which is the number of tiles out of place.
o Manhattan distance, which is the sum of the moves each tile needs to make before it is in its correct position.

The experiment is to compare the efficiency of breadth-first, A*(Hamming) and A* (Manhattan) over a number of puzzles. You are testing the hypothesis that A* is more efficient than breath-first, and the efficiency gain is greater the more difficult the problem and the closer the estimates are to the true cost. CAUTION: 8-puzzle search trees can be surprisingly large. You may have to wait a long time for a search to conclude.


Buy now

CONTACT DETAILS

For any other questions or other tasks please feel free to contact me
via email: mhassnainjamil@gmail.com
via WhatsApp: +92-324-7042178
via skype: hassnainjamil1

Comments

Popular posts from this blog

Are you looking for the article. Congratulations! you are at the right place

Please comment on this post for Article requests Kindly Write Following things in comment: 1)  Name 2)  Article Link 3)  Your Email Id We will process your request as soon as possible. Note: Share this post with friends to help them.

Human Physiology by Stuart Ira Fox [PDF] (12th edition) free download

Addition/Multiplication of two integer numbers in Java using Graphical User Interface (GUI) using Netbeans with source code free download

In this post I will teach you how you can add two integer numbers in Java using Graphical User Interface. I made it very simple and easy for you. At the end of this tutorial you will be able create the following Graphical User Interface with many different properties. I'm using NetBeans IDE (Recommended for you) for this purpose. Just follow the following steps. Open NetBeans editor and click on new project as shown blow Select this project as a Java Application and click on next as show blow After this name your project, what you want. I named is " Addition GUI " as shown in blow fig. After the creating project make a new JFrame Form Class as show blow in fig. Name this class (i.e Addition) and a JFrame Form panel create to move forward as shown blow. Now drag a text field in you frame from Swing Controls as show shown blow After adding text field perform the following function on it. Right Click on text field Press Backspace button to remove all the text from textFiel...