Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want solution of this according to the above notes please use python language. Yarmouk University Hijjawi Faculty for Engineering Technology Department of Computer Engineering

image text in transcribed

image text in transcribed

I want solution of this according to the above notes please use python language.

Yarmouk University Hijjawi Faculty for Engineering Technology Department of Computer Engineering CPE 576: Artificial Intelligence HW 06: Solve 8-Puzzle Problem using A Algorithm Date: Wed, 21/12/2022 8-puzzle problem is a 33 grid with 8 tiles (not-empty cells) and 1 blank cell. The aim of this game is to rearrange cells to have the same order of the goal state with the least number of steps, see figure 1 . The allowed actions are left, right, up, and down. This problem can be solved using a variety of search techniques. However, you are required to use the A heuristic algorithm. The only difference between the A and UCS algorithms' implementations is the cost of the path. You might use the following pseudocode. Figure 1: an instance of the 8-puzzle problem (start and goal states) 1. The total cost of the path f=g+h a. g cost is the path cost which is the number of steps from the initial state to the current state in the path b. h cost is a heuristic value which can be computed in different ways, we will solve the problem using 2 different ways i. The number of misplaced cells between current node and goal node (zero value is not counted) ii. Then you are supposed to recompute the heuristic value using Manhattan distance between the misplaced cells 1. Manhattan distance, d=x2x1+y2y1 2. Heuristic value, h=k=0nxk,gxk,s+yk,gyk,s a. n the size of the puzzle, in our case it is 8 b. xk,g the x value of the number k in the goal state c. xk,s the x value of the number k in the goal state d. yk,g the y value of the number k in the goal state e. yk,s the y value of the number k in the goal state Questions: 1. Write the code of A algorithm based on the pseudocode initially with h equals the number of misplaced cells. 2. Are there any logical errors in the mentioned pseudocode? 3. Use Manhattan distance to recompute h value as mentioned above. 4. For the following configuration, what is the number of steps required to solve the puzzle

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago