Intro to AI: Assignment #2
This project solves the Traveling Salesperson Problem (TSP) using a Genetic Algorithm. The goal of the TSP is to find the shortest route that a salesperson can take to visit a given set of cities and return to the starting city.
-
Install the required dependencies by running
pip install -r requirements.txt
. -
Select python interpretor we used:
python 3.11
-
Run the Flask web application by running the
sample-code.ipynb
file by using jupyter notebook: -
Open your web browser and access the application at
http://localhost:5678
. -
The homepage provides an overview of the Traveling Salesperson Algorithm, explaining how it works and its applications.
-
Click on the "See our Genetic Algorithm Results" button to view the results of the Genetic Algorithm applied to the TSP.
-
The Genetic Algorithm implementation utilizes the
genetic_algorithm.html
template file and generates a plot of the best route using matplotlib.
sample-code.ipynb
: Contains the Flask application code.templates
: Directory containing the HTML templates used by Flask.templates/index.html
: The main page template displaying information about the Traveling Salesperson Algorithm.templates/genetic_algorithm.html
: The template for displaying the results of the Genetic Algorithm.static
: Directory to store static files such as images.static/plot.png
: The plot image generated by the Genetic Algorithm.requirements.txt
: File specifying the project's dependencies.README.md
: This file providing an overview of the project.