Coder Social home page Coder Social logo

tsp-using-simulated-annealing's Introduction

#The Travelling Salesman Problem

###Problem Statement A salesman has to visit every city and eventually return to the city he started from, thereby making a complete round trip. Of all the possible ways he can make a round trip, we have to find the shortest one of them.

###Difficulty Belonging to the class of NP-complete problems, it get exponentially difficult to explore all the possible paths to find the shortest path as the number of cities increases.

#Simulated Annealing

Motivated from the principles of thermodynamics, simulated annealing is a derivative-free optimization technique that gets a close to optimal solution. Here's how we use Simulated Annealing to solve the Travelling Salesman Problem:

  1. Set temperature very high.
  2. Choose a random ordering of cities.
  3. Compute the total distance of the path given by the random ordering.
  4. Now pick any two random cities, and swap them in the ordering from the previous step.
  5. Again compute the total distance of the new path we obtained after swapping.
  6. The acceptance function gives a probability with which the new path should be considered based on the change in the total distance and the temperature.
  7. Repeat steps 4. to 7. untill no further change in distance is observed.

tsp-using-simulated-annealing's People

Contributors

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