This repository contains two distinct examples of solving classic optimization problems using genetic algorithms in Python. These examples are part of a workshop designed to teach the principles and implementation of genetic algorithms.
Santa Claus needs to find the shortest route to deliver gifts worldwide. This example demonstrates how to solve the TSP using a genetic algorithm.
- Location:
TSP-Solver/src/Santa_travel.py
- Data:
TSP-Solver/data/santaDistance01.json
Santa must select the most optimal assortment of gifts subject to weight constraints. This example illustrates the application of a genetic algorithm to solve the Knapsack Problem.
- Location:
Knapsack-Problem/src/Santa_bag.py
- Python 3.x
- DEAP
- NumPy
- NetworkX (for TSP visualization)
- Matplotlib (for TSP visualization)
Install all required packages using:
pip install -r requirements.txt