Question: need hellp [5 POINTS] QUESTION 1: (Problem Solving-A* search Algorithm) Consider the problem of sorting numbers into ascending order: 4 1 3 2 1 2
need hellp
![need hellp [5 POINTS] QUESTION 1: (Problem Solving-A* search Algorithm) Consider the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2e4583367d_19966f2e457c1484.jpg)
[5 POINTS] QUESTION 1: (Problem Solving-A* search Algorithm) Consider the problem of sorting numbers into ascending order: 4 1 3 2 1 2 4 3 State representation: a sequence of four numbers Initial state: 4, 1, 3, 2 Goal test: 1, 2, 3, 4. Operators: Swapleft: swaps leftmost numbers e.g., in the initial state, 4 and 1. Swapmiddle: swaps numbers in the middle e.g., in the initial state, 1 and 3. Swapright: swaps rightmost numbers e.g., in the initial state, 3 and 2. Operators should be applied in this order: Swapleft, Swapmiddle, then Swapright Path cost: number of swaps. Apply A* search algorithm to find the minimum number of swaps required to sort the numbers. Draw the search tree, showing the nodes generated and their f-cost values. Show the content of the fringe (priority queue) at each step. The heuristic function that can be used is the Manhattan distance, the sum of the distances of the numbers from their correct locations. For instance, the heuristic value h(n) in the initial state is 3+1+0+2=6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
