This repository was created as a part of my 'The basics of artificial intelligence' course at FIT CTU. The repository contains C++ code with implementation of algorithms for both systematic and non-systemating search of the state space.
- C++ compiler (g++)
- Make
Compile by running make
in the subproject folder. A binary will be created in bin folder.
Maze solver, loads a specified maze from a text file, allows the selection of a algorithm used to find the solution and displays an animation of its progress in the terminal.
The binary takes a path to this maze file as an argument. The format of a maze is as follows:
X
- wall
Start and goal tiles are specified using coordinates below the maze in the format start x, y
and end x, y
.
For example maze, see ./hw01/examples directory.
After loading the maze, the solver offers a selection of algorithms to use for solving the maze:
- Random search
- Depth-first search (DFS)
- Breadth-first search (BFS)
- Greedy search
- A*
The solver displays an animation of the algorithm's progress in terminal, with highlighted opened and closed tiles.
Travelling salesman problem solver using the hill-climbing algorithm.
The solver loads specified TSP problem from a CSV file and approximates a solution while displaying its progress.
The binary takes a path to the problem CSV file as an argument. The format of the problem is CSV, structured as follows:
city,distances
for each row
where city is a name of a city and distances is a comma-separated list of distances from this city to all the other cities in the same order as the cities are in the rows. For example TSP problem, see ./hw02/examples directory.