Giter Site home page Giter Site logo

t145 / traveling-salesman Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 2.9 MB

Above-average TSP estimater w/ no strict dependencies

Home Page: https://t145.github.io/salesman

License: GNU Affero General Public License v3.0

Java 99.62% Python 0.38%
algorithm traveling-salesman solution graph distance thought java-8

traveling-salesman's Introduction

traveling-salesman's People

Contributors

t145 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

traveling-salesman's Issues

BUG: Perfectly flat line cases misplace the last collision

Example output:

Hello World!

Input Graph:
{ X: 1.0; Y: 1.0 }
{ X: 2.0; Y: 1.0 }
{ X: 3.0; Y: 1.0 }
{ X: 4.0; Y: 1.0 }
{ X: 5.0; Y: 1.0 }
{ X: 6.0; Y: 1.0 }
{ X: 7.0; Y: 1.0 }
{ X: 8.0; Y: 1.0 }

Sorted Graph:
{ X: 1.0; Y: 1.0 }
{ X: 2.0; Y: 1.0 }
{ X: 3.0; Y: 1.0 }
{ X: 4.0; Y: 1.0 }
{ X: 5.0; Y: 1.0 }
{ X: 6.0; Y: 1.0 }
{ X: 7.0; Y: 1.0 }
{ X: 8.0; Y: 1.0 }

 --- SHORTEST PATH ---
Processing leftovers: { X: 4.0; Y: 1.0 }
Distance: 16.0; Index: 1
Distance: 12.0; Index: 3
Distance: 14.0; Index: 4
Processing leftovers: { X: 6.0; Y: 1.0 }
Distance: 16.0; Index: 3
Distance: 18.0; Index: 2
Distance: 20.0; Index: 1
Distance: 12.0; Index: 5
Distance: 14.0; Index: 4
Processing leftovers: { X: 8.0; Y: 1.0 }
Distance: 16.0; Index: 5
Distance: 18.0; Index: 4
Distance: 20.0; Index: 3
Distance: 22.0; Index: 2
Distance: 24.0; Index: 1
Distance: 14.0; Index: 6
{ X: 1.0; Y: 1.0 }
{ X: 2.0; Y: 1.0 }
{ X: 3.0; Y: 1.0 }
{ X: 4.0; Y: 1.0 }
{ X: 5.0; Y: 1.0 }
{ X: 6.0; Y: 1.0 }
{ X: 8.0; Y: 1.0 }
{ X: 7.0; Y: 1.0 }

 --- VERIFICATION ---
Graph Length:	8
Solution Size:	8
VERIFIED: true

 --- FINAL PHASE ---
SOLUTION: 14.0

Gets the right answer; sqrt(49) * 2 = 14.0

BUG: Difficulty computing perfect squares

Example output:

Hello World!

Input Graph:
{ X: 1.0; Y: 1.0 }
{ X: 4.0; Y: 4.0 }
{ X: 1.0; Y: 4.0 }
{ X: 4.0; Y: 1.0 }

Sorted Graph:
{ X: 1.0; Y: 1.0 }
{ X: 1.0; Y: 4.0 }
{ X: 4.0; Y: 1.0 }
{ X: 4.0; Y: 4.0 }

 --- SHORTEST PATH ---
{ X: 1.0; Y: 1.0 }
{ X: 4.0; Y: 1.0 }
{ X: 1.0; Y: 4.0 }
{ X: 4.0; Y: 4.0 }

 --- VERIFICATION ---
Graph Length:	4
Solution Size:	4
VERIFIED: true

 --- FINAL PHASE ---
SOLUTION: 14.485281374238568

Correct solution: 12.0

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.