Planning the perfect road trip is n't just about creating the ultimate playlist and getting a map - what you really need are algorithms . Now the man behind the 'Where 's Waldo ' algorithm has created a road trip route revealing the best way to visit 48 US states . Using a series of equation , the Michigan data scientist says his method can also be used on shorter journeys , beating Google maps on providing the best route possible . Zoom in on this interactive map to find the best road trip route across the US . Randy Olsen came up with the map when Discovery News challenged him to plot the best route across continental America . His only limitation was to make one stop in all 48 contiguous US states , along with Washington D.C. and two stops in California . Each stop would be at a national natural landmark , national historic site , national park or national monument . And the car could never leave US soil . To create the map , Mr Olsen first found the shortest distance by road between each of the 50 landmarks provided . The tricky part was putting the landmarks in order to eliminate as much driving back on himself as possible . Zoom in on this interactive map to find the best road trip route across Europe . The man behind the 'Where 's Waldo ' algorithm has created a road trip route revealing the best way to visit 50 US states . The resulting 13,699-mile route would take 9.33 days of non-stop driving if you had the road to yourself . Rather than looking at every possible solution , Randy Olsen used something known as a 'genetic algorithms ' which starts with just a few random solutions . It then manipulates these solutions , while trying something slightly different each time , until it finds one that it ca n't improve on . The resulting 13,699-mile route would take 9.33 days of non-stop driving if you had the road to yourself . In his blog , Mr Olson explains how he used information from Google Maps API and wrote code to discover the optimum distance to drive to all 50 landmarks . This was the same code he had previously created to discover Waldo – or Wally in the UK . 'With 50 landmarks to put in order , we would have to exhaustively evaluate 3 x 1064 possible routes to find the shortest one , ' he wrote . 'If you started computing this problem on your home computer right now , you 'd find the optimal route in about 9.64 x 1052 years — long after the sun has entered its red giant phase and devoured the Earth . 'This complication is why Google Map 's route optimisation service only optimises routes of up 10 waypoints . ' Rather than looking at every possible solution , he used something known as a 'genetic algorithms ' which starts with just a few random solutions . It then manipulates these solutions , while trying something slightly different each time , until it finds one that it ca n't improve on . The data scientist has also created another road trip map that makes stops at the top-ranked TripAdvisor cities.This map is 12,290 miles long and is similar to the original but skips over North Dakota , Vermont and West Virginia . The resulting 13,699-mile route would take 9.33 days of non-stop driving if you had the road to yourself . Mr Olsen , however , advises putting aside two to three months to complete the trip . 'You 'll hit every major area in the U.S. on this trip , and as an added bonus , you wo n't spend too long driving through the endless cornfields of Nebraska , ' he wrote on his blog . The data scientist has also created another road trip map that makes stops at the top-ranked TripAdvisor cities . This map is 12,290 miles long and is similar to the original but skips over North Dakota , Vermont and West Virginia . 'This is especially interesting because TripAdvisor reviewers recommend cities like Flint , Michigan — the seventh most crime-ridden city in the U.S. — over any city in North Dakota , Vermont and West Virginia . I 'll leave the interpretation of that fact to the reader , ' Olson wrote . Olson also created an ideal European road trip and he 's released the code so that anyone can create their own route . The European trip covers 16,287 miles and 14 days of driving , and Mr Olsen advises putting three months aside to explore the cities .
Michigan data scientist , Randy Olsen , came up with route using an algorithm that calculates shortest distance . The 13,699-mile route travels through 48 states and would take 1064 of non-stop driving on clear roads . Mr Olsen also created a 12,290-mile road trip map that makes stops at the top-ranked TripAdvisor cities in US . He has created a European road trip and released code used to create it so that any can create a custom route .