Giter VIP home page Giter VIP logo

nick-mazuk / traveling-salesman Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 28.48 MB

A real-time traveling salesman visualizer. Compare 6 algorithms in either a bustling suburb or a lifeless, theoretical void. The choice is yours, and see the results in real-time!

Home Page: https://traveling-salesman.nickmazuk.com/

JavaScript 0.07% HTML 1.74% CSS 89.38% TypeScript 8.62% SCSS 0.20%
tsp tsp-problem tsp-solver tsp-benchmark tsp-approximation travelling-salesman-problem traveling-salesman

traveling-salesman's Introduction

Real-time Traveling Salesman Visualizer

TSP

What is the traveling salesman problem?

How can Amazon deliver toilet paper in 2 days? This isn't a simple problem. At the very last stretch, Amazon loads your toilet paper into a van. But that van has dozens of other deliveries. So Amazon needs to find the shortest route between every house. Finding that shortest route is the traveling salesman problem.

Add, move, or remove houses…

TSP

  • Add houses: Click somewhere empty to add a house
  • Move houses: Click and drag to move it around
  • Remove houses: Just click a house and it's gone

…and the route updates in real-time!

TSP

Unlike most traveling salesman visualizers, this one updates in real-time. Explore how minor movements can cause massive changes.

Choose your algorithm wisely…

TSP

Select an algorithm from the dropdown menu.

  • Brute Force: Checks every possible path, guarantees shortest path
  • Greedy: Each house connects with the next closest house
  • Annealing: Gradually improves through random changes, avoids local mins
  • 2-opt: Chooses random path, then uncrosses intersections
  • Speedy: Custom algorithm, combines greedy, annealing, and 2-opt
  • BOGO: Chooses random path, odds of finding shortest path is 1:(n - 1)!

…because some are just better than others.

TSP

Some take way too long to finish. Others find paths that are way too long. Choose wisely or you'll have to wait until the heat death of the universe for an answer.

Choose your own reality.

TSP

Find the shortest route through some bustling suburbs, or test the limits of the algorithms on a lifeless, theoretical void. The choice is yours!

Explore this simulation in depth

TSP

Learn the specifics behind each algorithm.

Check out the code on Github (and star the repo).

Now start exploring! Ready, set, go…

traveling-salesman's People

Contributors

dependabot[bot] avatar nick-mazuk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

traveling-salesman's Issues

Can't move a destination while in Brute Force Mode

If the interface is set to Brute Force Mode, then it is impossible to move a destination. A prompt warning that Brute Force mode is slow appears, changing the focus away from the drag and drop.

To achieve an equivalent result, one must select another algorithm, move the destination, then change back to Brute Force Mode.

Chrome Version 83.0.4103.116 (Official Build) (64-bit) on Windows 10 (64-bit)

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.