This algorithm was created as a project for the course Artificial Intelligence of the Athens University of Economics and business. The algorithm finds a solution to the Cannibals & Missionaries problem.
In the Cannibals & Missionaries problem, 3 missionaries and 3 cannibals want to cross from the left bank of a river to the right bank of the river. However, if the cannibals ever outnumber the missionaries on either bank, the cannibals will eat the missionaries. In this case, our algorithm solves the problem for n amount of cannibals and missionaries.
The problem is solved using the A* Algorithm. For more information about the A* Algorithm click here.
Each file has carefully written comments that will help you understand the structure and use of the code in it. That way, you can see read about what is happenning where it is happening.
You can access the content of this repository by
- Cloning the repository
git clone https://github.com/Kyriakos-Bekas/cannibals-ai.git
- Downloading the code by clicking : Code > Download ZIP
Open the command prompt/ integrated terminal and navigate to the path.
In order to execute the program, simply type the following commands:
javac Main.java SpaceSearcher.java State.java
java Main
After that, fill in the prompts with the data that you want to examine and wait for the result.
This algorithm was created by Alexandros Alexiou, Ioannis Skoufoulas and Kyriakos Bekas.
If you found that this repository was valuable to you, consider giving it a star ⭐
Free for use in all personal, public and commercial projects.