Python3 code for the Fundamentals of AI course lab.
Feel free to reuse / distribute / contribute.
Mattia Rigon (2024) - Added support for LRTA* with non-uniform action costs.
Extra required packages: matplotlib
, networkx
, numpy
.
In search/
, run: python3 search.py alg
, where alg
in {bfs, dfs, ucs, greedy, astar}
Extra required packages: matplotlib
, networkx
, numpy
, seaborn
.
To run Steepest Hill-climbing (other variants are commented out) on 2D grid problems, try: python3 hill_climbing.py
.
To run the genetic seach algorithm on the Master Sandwitch problem, try: python3 hill_climbing.py
.
To run or online A* (online DFS is commented) on maze problems, try: python3 online_search.py
.