Last week, I saw a map going around Facebook claiming to be a car route across the United States that hit all of the country's major landmarks. I thought, Hey, neat. But when I looked more closely, I saw quite a few states obviously missing, and I when I did a quick search on Snopes.com, I found that in fact the map was of a route taken in 2001 by photographer Brian DeFrees, who wasn't driving to every major landmark in every state.
But wouldn't it be nice to have a map that hit landmarks in every state and not only that, wouldn't it be great if the map represented the optimal, most efficient route across the country?
This Happened Here: Road Trip On The Edge Of The Himalayas
Who could pull off such a map? The first person I thought of was Michigan State University doctoral student Randy Olson.
Earlier in the month, I blogged about the algorithm he devised that helps Where's Waldo fans plot the fastest search path through a two-page illustration to locate the iconic young man. So, I fired off an email to Randy and asked him if he could use his algorithmic talents to plot the optimum road trip route across the United States. He answered yes almost immediately, but requested that I put together a list of the stops first. Sure thing!
After some rounds of emails, the trip wound up having three simple parameters:
I also included Washington, D.C. and added two stops in California to get us to an even 50 stops.
Next, Randy did the hard stuff. He details the challenges of optimizing such a route in this blog. To get around some of those challenges, he used information freely available from Google Maps API and wrote a bit of code to calculate the distance and time it would take to drive between all 50 landmarks, which represents 2,500 individual routes.
8 Far-Flung Walking Sojourns
It would take a computer millions of years to account for every twist and turn along a continental drive and give us the absolute best route - one that backtracked as little as possible. But hey, we just don't have that kind of time. So Randy pulled the genetic algorithm card again, which he used for the Where's Waldo solution.
He writes: "Instead of exhaustively looking at every possible solution, genetic algorithms start with a handful of random solutions and continually tinker with these solutions - always trying something slightly different from the current solution and keeping the best one - until they can't find a better solution any more."
The algorithm evaluates whether a solution is good or not based on something called a fitness function. "For the road trip itinerary, the fitness function was the shortest distances between waypoints," Olson told me.
The result is not the absolute best route between all of the landmarks, but rather a route that's pretty darn good.
Here's the map.