Question: Write a Java program to implement an ( mathrm { A } ^ { * } ) search algorithm for a goal
Write a Java program to implement an mathrmA search algorithm for a goalbased agent to find the cheapest path from the start state to one of the goal states. Use the search space example in Figure to test your program.
Figure : Search Space Example. A is the start state. G G and G are three goal states. The numbers in the black squares are the heuristic values which indicate the estimate cost between the state and the goal state. The numbers on the arcs indicate the pathcost between two states. Follow the instructions below during the implementation of your software program.
The actual pathcost values in the search space is entered to the java program as an mathrmntimes mathrmn square matrix, as shown in the template program at the end of the assignment.
For example: The search space in Figure below is represented by the following times matrix
The heuristic values of all states are represented by an n size vector, as shown in the template program at the end of the assignment.
For example, the heuristic vector of the search space in Figure is represented by the following vector:
mathrmS
The program uses mathrmA search algorithm to find the cheapest path from the start state to one of the goal states. The goal states are the ones with value in the heuristic vector. The software program should print out the cheapest path, the goal state, and the number of cycles it took to reach the final goal state.
Use the template below:
public class MyClass
public static void mainString args
int costmatrix
;
int heuristicvector ;
Identify the Goal States and save them in a new vector
Write a program to implement the A search
Print the cheapest path, the goal state and the number of cycles
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
