Giter Site home page Giter Site logo

sandy4321 / tsp-heuristics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinaychourasiya/tsp-heuristics

0.0 1.0 1.0 2.82 MB

Implementing various heuristics for Traveling Salesman Problem (TSP), Namely Lin-Kernighan Heuristic, Nearest Neighbor Heuristic,

Python 100.00%

tsp-heuristics's Introduction

TSP-heuristics

Implementing various heuristics for Travelling Salesman Problem (TSP). Nearest Neighour heuristic (nn.py), 2-opt (2-opt.py) genetic algorithm(ga_tsp.py, ga_2-opt_tsp.py), Simulated Annealing (runSA.py, runSA2opt.py)).

Description

TSP_Data: this folder has all TSPLIB instances (e.g ch130.tsp, a280.tsp) 
readData.py: this python file is used for reading the TSP instances.  
All other python files are implemetation of algorithm

Steps for running algorithms

Terminal commands

$ python 'algorithm.py' 'filename'  
  • 'algorithm.py': 2-opt.py, nn.py, ga_2-opt_tsp.py, ga_tsp.py
  • 'filename' pick any file from TSP_Data folder eg. ch130.tsp or a280.tsp

Example runs

$ python nn.py kroB100.tsp
$ python 2-opt.py kroB100.tsp
$ python ga_tsp.py kroB100.tsp
$ python ga_2-opt_tsp.py kroB100.tsp
$ python runSA.py kroB100.tsp
$ python runSA2opt.py kroB100.tsp 

Some Results:

TSP Tour TSP Tour

tsp-heuristics's People

Contributors

vinaychourasiya avatar vinayieor avatar

Watchers

James Cloos avatar

Forkers

vikas9087

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.