Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 1.49 KB

README.md

File metadata and controls

42 lines (36 loc) · 1.49 KB

🐍TSP Genetic Algorithm

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..

Table of Contents

Features

  • 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.

Getting Started

Prerequisites

  • Python 3.0
  • NumPy library

Installation

  1. Clone the repository:
git clone https://github.com/x1tedbtw/TSP_GA.git
  1. Navigate to the project directory:
cd TSP_GA

3.Install dependencies:

pip install numpy

Usage

  1. Run the TSP solver:
python main.py