https://github.com/timbo-rafa/genetic-algorithm
Parallel Genetic Algorithm python code for the Travelling Salesman Problem.
https://github.com/timbo-rafa/genetic-algorithm
algorithms demo genetic-algorithm python python3 qa tdd test travis tsp-problem
Last synced: 19 days ago
JSON representation
Parallel Genetic Algorithm python code for the Travelling Salesman Problem.
- Host: GitHub
- URL: https://github.com/timbo-rafa/genetic-algorithm
- Owner: timbo-rafa
- Created: 2016-06-07T15:51:45.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-08-22T18:34:15.000Z (almost 7 years ago)
- Last Synced: 2025-03-02T13:14:29.097Z (over 1 year ago)
- Topics: algorithms, demo, genetic-algorithm, python, python3, qa, tdd, test, travis, tsp-problem
- Language: Python
- Homepage:
- Size: 854 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/timbo-rafa/genetic-algorithm)
# Genetic Algorithm
Genetic Algorithm for the Traveling Salesman Problem
## Problem
#### Definition
Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?
It is an NP-hard problem in combinatorial optimization.
#### Data Modeling
The TSP can be modelled as an undirected weighted graph, such that cities are the graph's vertices, paths are the graph's edges, and a path's distance is the edge's weight.
It is a minimization problem starting and finishing at a specified vertex
after having visited each other vertex exactly once.
#### Solution Technique
Genetic algorithms are evolutionary techniques used for optimization purposes according to survival of the fittest idea. These methods do not ensure optimal solutions; however, they give good approximation usually in time. The genetic algorithms are useful for NP-hard problems, especially the traveling salesman problem. We used this technique here.
## Installation
```bash
git clone https://github.com/timbo-rafa/genetic-algorithm
cd genetic-algorithm
pip install networkx
```
## Running

### Testing
Tests made using [nose](http://nose.readthedocs.io/en/latest/)

### Profiling
