Search
You will program the A* algorithm in order to search through the given state space.
Implement an A* algorithm that finds the optimal path to the desired goal state. If there is no optimal path, the returned value should be None. You should use the maze environment kuimaze2.SearchProblem. For fulfilling the task, you need to select and implement a heuristic function. The impact of selecting different functions is well explained in link.
None
kuimaze2.SearchProblem
This task will teach you about:
kuimaze2
example_search.py
agent.py
In file agent.py, implement class Agent with the following methods:
Agent
__init__
environmnent: SearchProblem
find_path
State
The following Python modules may be useful in implementing some parts of the A* algorithm: queue, heapq.
The evaluation consists of two parts:
Algorithm quality:
Code quality:
You can follow PEP8, although we do not check all PEP8 demands. Most of the IDEs (certainly PyCharm) point out mishaps with regards to PEP8. You can also read some other sources for inspiration about clean code (e.g., here) or about idiomatic python (e.g., medium, python.net).
This screenshot comes from a previous version of kuimaze. The current version produces slightly different images. Main difference: diagonal moves are not allowed now.
kuimaze