blankblank blank




Online Traveling Salesman Problem Solver



Wikipedia defines the “Traveling Salesman Problem” this way:

given a number of cities and the costs of travelling from any city to any other city, what is the least-cost round-trip route that visits each city exactly once and then returns to the starting city?

You can substitute “address” for “city”, making this an intra-urban travel problem. The OptiMap website solves this problem automatically for up to 24 locations (“nodes”). You can enter the nodes by clicking in a Google Maps interface:

12-1-2008-7.25.50 PM

You can also enter address nodes individually using the “Add Location By Address” box. Even better, you can add text lists of addresses or coordinates (latitude/longitude) by clicking on the “Bulk add by address or (lat, lng).” link, then copying and pasting the list into the text box that shows up. Latitude/longitude should be in decimal format, one set on each line, separated by commas and surrounded by parentheses, e.g. (35.333, –110.254). You can also specify only walking directions, and avoiding highways. The first node or address entered is always considered to be the starting point.

When you’re done entering nodes, click on “Calculate Fastest Roundtrip” to solve the problem for a round-trip that ends where you started:

12-1-2008-7.26.28 PM

You’ll also get a set of Google Maps driving directions for the trip shown in the solution map. By clicking on the “Toggle raw path output” button, you’ll also get a text list of latitude/longitude coordinates in sequence for this route that you could convert into a GPS route:

12-1-2008-7.32.31 PM

The “Calculate Fastest A-Z Trip” works in a similar fashion, but for a one-way trip, where the first address/node you entered is taken as the start “A”, and the last address/node is the destination “Z”.

The technical background and source code are available on the OptiMap website, as are instructions on how to use this on your own website.

Other posts in the Google Maps Tools series

  1. Coordinate Data From Google Maps
  2. Reverse Address Geocoding With Google Maps
  3. Converting Google Maps Search Results To GPX
  4. Coordinate, Elevation, Distance And More In Google Maps
  5. Google Maps "My Maps" Features
  6. Measuring Elevation, Distance And Area In Google Maps
  7. Creating GPS Routes In Google Maps
  8. Thematic Polygon Shapefile Display In Google Maps
  9. Using The Google Maps Interface To Display General Maps And Images
  10. Heat Mapping In Google Maps
  11. Elevation Profile In Google Maps
  12. Embed Google Maps "My Maps" On Your Web Page
  13. Customizing Google Maps Markers
  14. Two Fun Cartographic Google Maps Tools
  15. Simple Guide To Embedding Google Maps "My Maps" On Your Own Webpage
  16. Another Google Maps Geocoder/Reverse Geocoder
  17. Drawing Lines Between Points In Google Maps, Straight And Great Circle
  18. Convert A Google Maps Point To Multiple Text Geographic Formats
  19. Meet Your Friends Halfway
  20. Plotting Swivel Data In Google Maps
  21. Meet Your Friends Halfway II
  22. Geographic Midpoint Calculator
  23. GIS-Like Functionality In Google Maps With ZeeMaps
  24. Creating GPS Waypoints Online From The USGS Geographic Names Information System (GNIS)
  25. MapMyRide.com
  26. Exporting KML Data From Google Maps MyMaps To A GPS
  27. Advanced Tool For Embedding Google Maps MyMaps On Your Website
  28. Draw/Label On Google Maps, And Generate GPX/KML/Embeddable Maps
  29. Another Way To Create Embeddable Google Maps With KML Data
  30. Documenting A Journey With Maptales
  31. Plot A Coordinate Position On Different Map Pages
  32. Worldwide Reverse Geocoding With Google Maps
  33. Google Maps Shaded Relief Site Updates
  34. Digipoint 2: Export Of Google Maps Points In Multiple Formats, And Elevation Data
  35. Google Maps Line Tool Now Supports Distance Measurement
  36. Geographically-Linked Video With VeoGeo
  37. Recent Google Maps Tools
  38. Google Maps Mapplets From Zonums Software
  39. Maximize Google Maps With Google Maps Max
  40. Mapping Zip And Area Code Boundaries, And More
  41. Altitudes And Terrain Profiles In Google Maps
  42. “Friendly” URLs To Address Maps
  43. Quick Zip Code Information
  44. Simple Online Form For Creating An Embeddable Google Map
  45. Embed Synchronized Google/Microsoft Virtual Earth Maps On Your Website/Blog
  46. Worldwide Contour Lines In Google Maps’ Terrain View
  47. Plot Gazetteer Features In A Google Maps Interface
  48. Antipodes Map

Looking for something else? Enter some keywords below, then click "Search".
"This site" searches Free Geography Tools; "Web" searches the Internet using Google.
 



2 Responses to “Online Traveling Salesman Problem Solver”


  1. 1 Alexandre Leroux

    Hi – Here’s an entry with additional info on the traveling salesman: http://technology.slashgeo.org/article.pl?sid=08/01/17/2258255 Cheers and thanks for your useful blog! :-)

  1. 1 Online Geocoding, Address Verification And Shortest Path Utilities From the USC GIS Research Laboratory | Free Geography Tools

Leave a Reply


I welcome all legitimate comments. However, spammers should know that my Akismet filter blocks 99.8% of comment spam, any that gets through the filter is immediately deleted, and the IP address it came from is permanently blocked from accessing this site.