Highlights
A* Search - Problem description
The above grids represent two problem environments where an agent is trying to find a path from the start location (S) to the goal location (S). The agent can move to an adjacent square provided the square is white or grey. The agent cannot move to a black square which represents a wall. No diagonal movement is allowed. Moving into a white square has a cost of 1. Moving into a grey square has a cost of 3.
What to do: Undergraduate students, 1-year Edinburgh postgraduate students, and all Dubai postgraduate students
Implement a solution to the grid problem in Java using A* search. Starter code has been provided for you and is available in the accompanying zip file. In particular, the code in the package uk.ac.hw.macs.search is a set of classes that can be used to represent a search problem. To implement a specific search problem, you will need to do the following:
1. Define a class that implements the State interface.
This should include the following:
a. A method for determining whether a state is a goal state (isGoal())
b. A method for computing the heuristic value of a state (getHeuristic())
2. Define a class that implements the SearchOrder interface. This interface has one public method, addToFrontier, that is used to add a set of nodes to the frontier. You can use the costs and/or heuristic values to determine the order that nodes are added to the frontier
The classes in the uk.ac.hw.macs.search.example package show examples of these two interfaces being used to implement depth-first search and breadth-first search, as well as a simple integer-based state. The Main class in this package shows an example of how to use the classes.
To solve the problem, you will also need to implement the following:
1. An appropriate encoding of the state in the grid by implementing the State interface appropriately, including methods for detecting a goal state and computing a heuristic value. You will need to choose or design an appropriate heuristic to use for your search. Include a description of the heuristic in the comments of your code.
2. A class implementing A* search by implementing the SearchOrder interface and implementing addToFrontier appropriately
Test your code on the two grid problems provided by running A* search on them. Submit the code for the implementation as well as the output. Do not change any of the classes in the uk.ac.hw.macs.search: we will test your implementation against the provided classes.
What to do: 2-year Edinburgh postgraduate students only
Describe a solution to the grid problem using A*search. In particular, you should do the following: 1. Draw a graph (with nodes and edges) to represent each of the grid problems as a search problem. Label each of the nodes in your graph and include appropriate costs on the edges.
2. Choose or design an appropriate heuristic to use for both graphs. Describe how your heuristic operates and include the heuristic values on each node in your graph.
3. Apply A* search to each grid and list the states expanded and the goal path for each grid. You do not need to provide a full derivation for each search (unless you wish to do so), however, you should provide at least the first 5 steps of each derivation with calculations for the f values to demonstrate you understand the application of the A* algorithm in your graph.
This Engineering Assignment has been solved by our Engineering Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.