Skip to content

Instantly share code, notes, and snippets.

@tomtheisen
Last active December 30, 2015 02:39
Show Gist options
  • Select an option

  • Save tomtheisen/7763838 to your computer and use it in GitHub Desktop.

Select an option

Save tomtheisen/7763838 to your computer and use it in GitHub Desktop.
Travelling Salesman Scenario

Travelling salesman scenario

Start from (1). Visit every destination. It is not necessary to return to (1).

Visually:

   (3)        13           (2)
    ------------------------
    |\                    /|
    | \                  / |
    |  \                /  |
    |   \              /   |
    |    \ 12         /    |
    |     \          /     |
    |      \        /      |
    |       \      /       |
 10 |        \    /        | 20
    |         \  /         |
    |          \/          |
    |          /\          |
    |         /  \         |
    |        /    \        |
    |       /      \       |
    |      /        \      |
    |     / 11       \     |
    |    /            \    |
    |   /              \   |
    |  /                \  |
    | /                  \ |
    |/                    \|
    ------------------------
   (1)         14         (4)

CSV:

from,to,distance
1,2,11
1,3,10
1,4,14
2,1,11
2,3,13
2,4,20
3,1,10
3,2,13
3,4,12
4,1,14
4,2,20
4,3,12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment