As summer approaches, you might feel the urge to get out on the road, feel the wind in your hair… maybe compute an algorithm or two?

If you're Randy Olson, that might just be the best way to start the summer. Olson, an intrepid data tinkerer, last year created a fascinating series of maps outlining a road trip that took its driver to a national landmark, historic site, monument or park in each of the Lower 48 states. What was special about this road trip was that Olson used an algorithm to figure out the most direct route between all of the stops — and discovered a route that would take only 9.33 days of driving, if the driver doesn't stop.

This year, Olson has a new and improved trip. The new path takes you through all of the U.S. capitals in the Lower 48 states, from Pierre, S.D., to Hartford, Conn., plus Washington, D.C. (Because the trip is designed to be taken by car, Olson excluded Alaska — too far — and Hawaii — too far and too wet.)

If you want to visit all the capitals in the Lower 48, the best route is the one below, Olson says. Note that this drive is just a big circle, so you can hop on anywhere, whether you live in California or Ohio. Without any traffic, this trip would take 8.5 days to drive continuously — although we would recommend sleep and bathroom breaks.

The coolest thing about this year's trip is that Olson breaks it down for those who might want to visit fewer states. If you don't have the time or gas money to visit all 48,  you can choose a trip that's optimized for your budget or area.

For example, below is a trip that will take you through 10 state capitals in the northeastern United States. If you drive continuously, you can complete this trip in under 24 hours, Olson says.

Here's what Olson's algorithm looks like as it calculates the shortest trip between three state capitals, then four, then five, then six, and so on. You can see how, as states are added, the route changes so that the path will still be the shortest distance circumnavigating all these points.

You can see more of these shorter trips, which start from Boston and Rhode Island, here. Unfortunately, Olson isn't a full-time trip planner, so he hasn't done the same for other parts of the country. But if you're also a data tinkerer and you want to use his code to plan your own trip, you can find that here.

See also: