For this assignment you will be implementing an algorithm capable of more efficiently finding paths through a more complicated maze.
A* Search uses a heuristic to try and take "better" steps through a maze.
Typically, the metric used is a simple Euclidean Distance.
Pseudocode for this algorithm is as follows:
def asearch(maze, start, finish):
frontier = PriorityQueue()
frontier.put(start, 0)
came_from = {}
cost_so_far = {}
came_from[start] = None
cost_so_far[start] = 0
while not frontier.empty():
current = frontier.get()
if current == goal:
break
for next in maze.neighbors(current):
new_cost = cost_so_far[current] + maze.cost(current, next)
if next not in cost_so_far or new_cost < cost_so_far[next]:
cost_so_far[next] = new_cost
priority = new_cost + heuristic(goal, next)
frontier.put(next, priority)
came_from[next] = current
This assignment will be hosted on Github Classroom.
cd ..
)git clone <your repository link here>
)
a-star.hpp
under Algorithms
git add . && git commit -m "Done" && git push
Criteria | Points |
---|---|
Functional Correctness | 80 |
Analysis | 10 |
Quality | 10 |
Submissions are handled by Github Classroom. Submissions after the deadline are not graded.