This project addresses the challenge of using Q-learning and DFS algorithms to distribute orange fox species in territories, ensuring that foxes of the same species cannot coexist in the same territory. The problem is modeled using graphs, where foxes represent vertices and edges connect foxes of the same species.
The minimum number of colors required for proper vertex coloring corresponds to the number of territories needed. Coloring graphs is an NP-hard problem, implying that deterministic solutions (since there are no polynomial solutions to the problem) are quite computationally intensive. Therefore, the problem cannot grow significantly.
- Graph Representation: Visual representations of colored graphs, showcasing the distribution of fox species in different territories.
- Coloring Algorithms: Python DFS (Depth-First Search) and Q-Learning implementations are used to color the graphs.
- Hyperparameter Analysis: Analysis of hyperparameters, providing graphical images by iteratively varying hyperparameters.
- Algorithm Complexities: Analys includes time and space complexities for each implemented algorithm, aiding in understanding their efficiency.
As seen in figures 1, 2 and 3 in the analysis of hyperparameters, no consistent pattern for optimal combinations was observed, attributed to the small problem size and limited executions. Notably, DFS outperformed Q-learning in time and results, primarily because the Q-learning model's memory space complexity grows exponentially with the number of colors due to its specific formulation.
The project dependencies are described in ./dependencies/requirements.txt
within the repository. In summary, heres what you're gonna need in order to run the project:
For installing dependencies more quickly, you can run the following command at terminal, inside the clonned repository:
sudo apt update && sudo apt install python3 python3-pip
pip3 install -r ./dependencies/requirements.txt
Make sure you have all Dependencies before running the project.
First, clone this repository. After that, simply execute the fox_ia.ipynb
file with the command:
sudo jupyter notebook fox_ia.ipynb
Feel free to create a new branch, fork the project, create a new Issue or make a pull request contact one of us to develop at repo, inserting new algorithms and other analysis.