Answered step by step
Verified Expert Solution
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
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 puzzleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started