This project was completed for the Artificial Intelligence course of the Department of Computer Science of the Athens University of Economics and Business, during the Fall semester of 2020-2021.
The objective of this assignment was to write a program that implements an AI algorithm (BFS, DFS, A* etc), so that an optimal solution can be found for the Bridge and Torch problem. In this project the A* algorithm with closed set was implemented. Given a number of people that want to cross the bridge, the algorithm must find the optimal solution, meaning the minimum amount of time for all people to pass across.
For a full overview it is highly suggested that you read:
- Project Assignment, that contains all the details about the game rules and what exactly was requested.
- Project Report, that contains all the details about the algorithm implementation and the analysis of the code.
-
Clone repository
git clone https://github.com/nevwalkalone/Bridge-and-Torch-Problem.git
-
Change directory to src
cd Bridge-and-Torch-Problem\src
-
Compile Main.java
javac Main.java
-
Run Main
java Main
When the program runs, the user is asked to give as an input:
- the number of family members that must cross the bridge
- the total time limit that must not be exceeded
- the amount of time that is required for each member to cross from one side to the other
Program then ends with a fully displayed path from initial to terminal state (with exact moves in each step) if a solution that does not surpass the time limit is found.
If you want to contribute, you can always create a pull request or open an issue.