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 N-Queens problem.
The N-Queens problem is finding a way to place n queens on an n x n chessboard in such a manner, so that the queens do not attack each other (by being in the same row, column or diagonal).
The problem is solved using the Genetic Algorithm method. Genetic Algorithm is a method inspired by natural selection. For more information about the Genetic 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/n-queens-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 GeneticAlgorithm.java Chromosome.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.