Find a cheapest solution to the 8-puzzle

Assignment Help Data Structure & Algorithms
Reference no: EM132479627

Description of task

You need to find a cheapest solution to the 8-puzzle. Given the initial state and the goal state of 8-puzzle, you need to use BFS, DFS, and Dijkstra algorithms.

For the BFS and DFS algorithms, the cost of moving tile is 1 and ordering of a move is: left, up, right, and down. For example

1   3    4

8   0    2

7   6    5

 

1   3    4           1  0  4                       1  3  4        1   3   4

0   8    2           8  3  4                       8  2  0        8   6   2

7   6    5           7  6  5                       7   6   5        7   6   5

For the Dijkstra algorithm, suppose that the cost of a move in the 8-puzzle is equal to the number of the moved tile plus the number of displaced tiles. That is, the cost of moving tile 1 is $1+the number of displaced tiles of 1, the cost of moving tile 2 is $2+the number of displaced tiles of 2, and so on. Calculate the number of displaced tiles, for each states and implement theDijkstra algorithm that finds a cheapest solution; it should read a start state from a file, and print outthe shortest path cost and a cheapest sequence of moves that leads to the goal state given in Figure below:

1   2    3

8        4

7   6    5

Use the programing language of your choice.

You may assume that the puzzle always has a solution; that is, the program does not have to deal with unsolvable states.

The format for encoding start states is as follows:

<tile><tile ><tile >
<tile><tile ><tile >
<tile><tile ><tile >

Each <tile>is a digit from 0 to 8, where 0 marks the blank space, and the other digits are real tiles. For example, the following file encodes the start state:
7 2 4
5 0 6
8 3 1

Sample file 1:
1 34
8 02
7 65

Solutions:The shortest path cost =11

Sample file 2:
1 3 4
8 0 6
7 5 2
Solution: The shortest path cost = 30

Final report, slides, and codes: A report that represents the performance evaluation of your solution should include the description of your task, summary of results, main conclusions, comparison of solutions, using different algorithms, and discussion of any surprising discoveries (including the title page, abstract, 3-5 pages, font 12, double space).

Demonstration and presentation: The project concludes with a 10-15 min presentation held during the classes.

Attachment:- Dijkstra algorithm.rar

Reference no: EM132479627

Questions Cloud

What is the percentage increase in sales : Assume the following sales data for a company: Current year $862,747. What is the percentage increase in sales from the preceding year to the current year
Characterize the probability density function : If random variables X and Y are normally distributed, X ~ N(µ = 1,s^2 = 2), and Y ~ N(µ = 2, s^2 = 3), fully characterize the probability density function of Z
Record all relevant journal entries : White Mountain Company-accounting for long-term notes: White Mountain requests that you record journal entries for a note it received in 20X5
Which deliverables would you expect to socialize : As part of the operationalizing a Big Data Analytics project, which deliverables would you expect to socialize with a business intelligence analyst versus.
Find a cheapest solution to the 8-puzzle : Find a cheapest solution to the 8-puzzle. Given the initial state and the goal state of 8-puzzle, you need to use BFS, DFS, and Dijkstra algorithms
Construct a production cost worksheet : Required - Construct a production cost worksheet assuming that spoilage is recognized and the weighted- average method is used
Write about rootkit using your own words : Cybercriminals use many different types of malware to attack systems. Write about Rootkit using your own words, explain how to defend yourself against.
Standard deviation of the sample means : Drawing repeated samples of 25 recruits each, we expect the standard deviation of the sample means to be about?
What is the project NPV : Revenues and other operating costs would be constant over the project's 3-year life. What is the project's NPV? (Hint: Cash flows are constant in Years 1-3.)

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd