# Shortest route between several addresses?

**URL:** <https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411>\
**Category:** Factual Questions\
**Created:** [April 12, 2006, 6:43pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411 "2006-04-12T18:43:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earthworm\_Jim](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@Earthworm\_Jim](https://boards.straightdope.com/u/Earthworm_Jim)\
**Post date:** [April 12, 2006, 6:43pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/1 "2006-04-12T18:43:35Z")

</div>

I’m in the market to buy a house & have several I want to look at within about 30 miles of each other. Is there anything similar to [maps.google.com](http://maps.google.com) that will let me put in several addresses & plot the shortest route for visiting all of them? (Time is money, dontcha know.)

Thanks!

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [April 12, 2006, 7:17pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/2 "2006-04-12T19:17:34Z")

</div>

Wop, a real-life example of the [travelling salesman problem](http://en.wikipedia.org/wiki/Traveling_Salesman_Problem).

Sorry, I don’t have a solution.

---

<div class="post-metadata">

**Author:** ![Trunk](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Trunk](https://boards.straightdope.com/u/Trunk)\
**Post date:** [April 12, 2006, 7:25pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/3 "2006-04-12T19:25:06Z")

</div>

> [@Earthworm Jim](#):
>
> I’m in the market to buy a house & have several I want to look at within about 30 miles of each other. Is there anything similar to [maps.google.com](http://maps.google.com) that will let me put in several addresses & plot the shortest route for visiting all of them? (Time is money, dontcha know.)
> 
> Thanks!

Yeah, as DarrenS mentioned, that’s a very complicated problem.

I doubt that it is built into any thing like google.maps or mapquest.

If it was really important to you, you could google

_code for travelling salesman_

but even at that point, you’d have to give it all of the “pairwise” travel times between all of your houses. I don’t know if one woudl be set up to be very user friendly.

You might have to edit an input file by hand, and maybe even compile one of them.

---

<div class="post-metadata">

**Author:** ![nivlac](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@nivlac](https://boards.straightdope.com/u/nivlac)\
**Post date:** [April 12, 2006, 7:39pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/4 "2006-04-12T19:39:07Z")

</div>

For visiting “several” houses, using a TSP approach is way overkill. Just mark off the locations on a map and eyeball a reasonable sequence for your visits. For exact driving distances between houses, you can use Yahoo or Mapquest.

---

<div class="post-metadata">

**Author:** ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)\
**Post date:** [April 12, 2006, 8:21pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/5 "2006-04-12T20:21:44Z")

</div>

A decent first cut is to go first to the one closest to you. Then to the one closest to that. etc.

In fact, many people stop there.

Lots of interesting strategies have been applied to drive to a ‘pretty good’ solution, but I’m not aware of any free stuff that operates on real-world roads.

---

<div class="post-metadata">

**Author:** ![Rucksinator](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Rucksinator](https://boards.straightdope.com/u/Rucksinator)\
**Post date:** [April 12, 2006, 10:25pm UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/6 "2006-04-12T22:25:16Z")

</div>

I’m waiting for an answer to this, too. I drive around to different addresses every day, and my first hour of the day or so is planning my route. I’ve pretty much learned the lay of the land by now, so I can read the driving directions and figure out the best route.  
All I can tell you is to plug each address into Mapquest, study the directions and the (barely readable) maps, and then try plugging 2 of the addresses to see how far apart they are. Better get to hoppin’.

---

<div class="post-metadata">

**Author:** ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)\
**Post date:** [April 13, 2006, 3:44am UTC](https://boards.straightdope.com/t/shortest-route-between-several-addresses/352411/7 "2006-04-13T03:44:40Z")

</div>

TSP can be brute forced for most reasonable sized solutions. It would require you to enter all the travel times in by hand though.
