Giter Site home page Giter Site logo

snowswallowhe / tsp_animation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gumpu/tsp_animation

0.0 2.0 0.0 30 KB

The source code for an animation of four algorithms trying to solve a traveling salesman problem

License: GNU General Public License v3.0

Python 99.24% Makefile 0.76%

tsp_animation's Introduction

TSP_Animation

The source code for an animation of four algorithms trying to solve a traveling salesman problem

You can find the animation on:

https://www.youtube.com/watch?v=q6fPk0--eHY

Given a set of 200 cities four algorithms are used to find the shortest tour of all 200 cities. The algorithms are:

  1. Random path, start a city and randomly select the next city from the remaining not visited cities until all cities are visited.
  2. Greedy, start a city select as next city the unvisited city that is closest to the current city
  3. 2-Opt, First create a random tour, and then optimize this with the 2-opt algorithm
  4. Simulated Annealing. First create a random tour, and then optimize this with 2-opt in combination with simualted annealing.

To create the animation you will need python (Version 2) and ffmpeg.

For python you need one additional library (matplotlib) and its dependcies. You can install it with:

pip install matplotlib

To create the animation use:

make .anim
make

This should create a file called sa.mp4. This should be playable with vlc.

tsp_animation's People

Contributors

gumpu avatar

Watchers

James Cloos avatar  avatar

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.