This project utilizes a Genetic Algorithm (GA) to solve the Travelling Salesman Problem (TSP). The TSP involves finding the most efficient route that visits a set of cities exactly once and returns to the starting city, minimizing the total distance traveled..
- Genetic Algorithm: Utilizes a genetic algorithm to evolve and optimize possible solutions for the Travelling Salesman Problem (TSP).
- Greedy Algorithm: Implements a greedy algorithm to find near-optimal solutions for the TSP, considering different starting cities.
- Random Algorithm: Compares the performance of the genetic algorithm with a random algorithm that selects starting cities randomly.
- Efficient Route: Finds an optimal or near-optimal solution to the TSP by evolving a population of routes over generations.
- Customization: Easily customizable parameters such as population size, mutation rate, and crossover strategy to adapt to different problem instances.
- Python 3.0
- NumPy library
- Clone the repository:
git clone https://github.com/x1tedbtw/TSP_GA.git
- Navigate to the project directory:
cd TSP_GA
3.Install dependencies:
pip install numpy
- Run the TSP solver:
python main.py