The Shortest Possible Baseball Road Trip

by Ben Blatt
(You can also read the results from this post in the Wall Street Journal here)

Every year thousands of baseball fans take long multi-city road trips to ballparks across the nation. When planning such a road trip, a normal person would plan a vacation that included many enjoyable drives, a relaxed pace, and plenty of non-baseball related stops along the way. However, being a member of HSAC where we strive for optimality and efficiency, I tried to find the shortest possible baseball road trip to all 30 stadiums.

Before I could start to find the solution using linear programming (see ‘methods’ for a more complete explanation), I had to determine what the rules of the road trip would be and how to define ‘shortest’. One could simply find the route which involves the least amount of total driving. This trip (which I included below) fails to account for the reality of the problem as a team only is playing at home half the time. Although the trip may be short in distance, it would take a very long time to complete. Instead, I  defined the ‘shortest’ trip as the trip with the smallest difference between the start time of the first game and the time to return to that city after seeing all 30 teams.

There are many reasonableness constraints that I had to apply to the problem. I assumed that each game took four hours to attend. To determine the time it takes to travel between two cities I used the time estimate by Google Maps. Originally, I had no requirements for rest which led to a 30 ballpark trip in less than 30 days. However, this featured many day trips of about 15-20 hours which I didn’t feel were in the spirit of a road trip. To combat this, I put in a rule that requires 8 hours of rest for every 12 hours of driving. Below is the resulting trip itinerary. The entire trip, which starts and ends in Kansas City, takes 34 days and 3 hours to complete.

(All times EST)
Blue Jays @ Royals         7:05        6/6
Tigers @ Rangers            8:05       6/7
Cardinals @ Astros          8:05       6/8
Royals @ Angels              10:05     6/10
Nationals @ Padres         8:35       6/11
Reds @ Giants                 8:05       6/12
Giants @ D-Backs           9:40       6/14
Reds @ Dodgers             3:10        6/15
Royals @ Athletics         3:35        6/16
Phillies @ Mariners       10:10      6/17
Tigers @ Rockies           3:10        6/19
Rays @ Brewers            8:10        6/20
Orioles @ Pirates          7:05         6/21
Padres @ Red Sox        1:35          6/22
Mariners @ Nationals  1:05         6/23
Rockies @ Yankees       7:05        6/24
Athletics @ Phillies       7:05        6/25
Reds @ Orioles              1:35       6/26
Reds @ Rays                  7:10       6/27
Pirates @ Blue Jays      7:07       6/29
Mets @ Tigers               1:05      6/30
Yankees @ Mets           7:10        7/1
Indians @ Reds             7:10        7/2
White Sox @ Cubs        2:20       7/3
Rays @ Twins               2:10        7/4
Phillies @ Marlins        7:10        7/6
Rockies @ Braves         1:05       7/7
Twins @ White Sox      8:10       7/8
Blue Jays @ Indians     7:05       7/9
D-Backs @ Cardinals    2:15      7/10

It should be noted that I cannot say with absolute certainty whether or not the trip I found is the truly the shortest. This problem is an example of the ‘traveling salesman problem’ which, for large amounts of ‘cities’, cannot be solved in any reasonable amount of time. The fact that I took the schedules into account only added to the computational complexity of the problem. However, after running portions of the data through my program for a total of 40 hours and watching the results plateau relatively quickly,  I am confident that my solution is either optimal or extremely close to optimal.  Of course, if different rules were used for rest or travel times, the program would yield different answers.

Below is the shortest route when the schedules are not taken into account.

Los Angeles (Dodgers)
San Diego
Phoenix
Arlington
Houston
Tampa Bay
Miami
Atlanta
Washington D.C.
Baltimore
Philadelphia
New York (Yankees)
New York (Mets)
Boston
Toronto
Detroit
Cleveland
Pittsburgh
Cincinnati
Chicago (White Sox)
Chicago (Cubs)
Milwaukee
Minneapolis
St.Louis
Kansas City
Denver
Seattle
San Francisco
Oakland
Los Angeles (Angels)
Los Angeles (Dodgers)

Once again, because of the size of the program I cannot be certain this is the true optimal solution. While checking the solution on Google Maps, I have found that the ideal schedule between Chicago and Denver can change depending on whether or not you choose the city center or the actual stadium as the destination.

Methods:

I realize that the results above and the brief explanation above are probably enough to satisfy most people’s interest in the topic. However, for those of our readers who know linear programming the below PDF contains the linear program I used for this problem.

Shortest Possible Baseball Road Trip Linear Program

If you don’t know anything about linear programming and don’t have the time to take Applied Math 121 here at Harvard, here is a brief synopsis using our road trip example.

We are start by asking the question: given a set of variables which are bounded by a set of constraints, what values of the variables will maximize (or minimize) a given objective? In our case, the variables would be ‘whether or not a certain game is attended’, an example constraint is ‘must attend all the ballparks’, and the objective is ‘to minimize the total time of the trip’.

The constraints create a ‘feasible region’ which contains the possibles values for the variables. The simplex algorithm is then used to find the feasible solution with the optimal value. The simplex algorithm in this case returns an optimal solution with fractional variable values. However, some of our variables in this case were binary (you either attend a game or you don’t) and therefore cannot be fractional. To fix this, we use branch and bound which creates two subproblems for binary variables (one subproblem in which the variable must be 0 and one subproblem in which the variable must be 1). The simplex algorithm then is applied to each subproblem until the problem is split into more subproblems etc. Eventually, all (or most) subproblems will be exhausted and an optimal solution (or one close to it) is found. In our case, we had thousands of variables and tens of thousands of constraints which the program had to run through. After many hours (thanks to Arjun Modi and Serena Bai for running portions of code on their computer) the result was the solution for the shortest road trip given above.

Ben Blatt can be contacted at bbblatt@gmail.com.

About the author

harvardsports

View all posts

44 Comments

  • I take it the program runs much faster if you pick a starting city and assume you’ll just drive home from the 30th stadium, wherever that is. Such a program would be useful to have on the web for people trying to plan such a trip.

  • Did you limit to only one game in a day?

    It would be very easy to see a 1pm at Yankee Stadium and a 7pm at Citi Field if schedules allowed; similarly Orioles-Nationals. I also know from personal “research” that you can watch a 1pm game at Yankee stadium and get to Citizens Bank Park to see the Phillies first pitch at 7:30 by relying on Amtrak.

    • There’s been a long-standing scheduling rule that the two-team cities (NY, LA, and Chicago) will never have both teams at home the same day. So to catch both teams in order you have to focus on Sun-Mon, or Wed-Thur/Thur-Fri combos, when the teams move from one series to the next. The only other legitmate “same day” combo would be a day game at Wrigley Field in Chicago, then driving 82 miles north to catch an evening game in Milwaukee.

      • I think the best “same day” possibility is in SoCal since there are two LA teams and one in San Diego. It’s probably close to the Cubs-Brewers distance though.

      • I’m going to argue the word “never” here. For example – on August 19-21, the Cubs are at home against the Cardinals, and the Sox are at home against the Rangers. Specifically, one could catch the 1:20 Cubs game – and allowing 4.5 hours, catch the Red Line to the Sox game and make it in time for a 7:05 first pitch.

        So perhaps “rarely” is more appropriate.

        I like the rule of one game per day, because it means a late-running game doesn’t impact getting to another.

      • There is one other two-team city (the SF Bay Area), and seeing a Giants day game and an A’s night game or vice versa would certainly be possible. I’d also consider Orioles-Nationals. In both of these cases, I’m not sure if an attempt is made to keep the two teams from being at home on the same day. The Phillies and Orioles are also within 100 miles, a straight shot down I-95: if seeing the Phillies on the same day as the Mets or Yankees is possible, then a Phillies-Orioles combo should also be possible.

  • shortest route when the schedules are not taken into account.

    This list has the Dodgers twice and no Rangers.

  • You seem to have missed Arlington from your shortest route without schedule. Can I assume it comes after Phoenix?

  • Thanks for the comments!

    David-You are correct that picking the initial city would cut down on the time and may even be more practical since you probably want to start in your hometown. That being said, when I was testing my program I initially only input about 20 cities and it still would not be considered ‘quick’.

    David Y-I did not restrict that possibility. It happened not to come up in the solution but there are definitely some pairs of cities that given the right start times that would be possible.

    Mitch, ‘grotin’, and Evan-Thanks for the catch. It is suppose to be before Houston, I just forgot to include it. The reason I had the Dodgers twice is to signify that it is a loop although I realize that is probably assumed. It should be noted that although the trip starts and ends in LA, because schedules are not taken into account the order of the trip does not matter as long as it is a loop

  • This is really cool. Altho, wouldn’t be shorter to visit the Angels first or second, so that you don’t have to return to the LA area in the end? That way it saves all the miles going from Oakland to Anaheim.

  • Dear Ben,

    Good for you for figuring this out! I could have used you when I did this in 2003. I wasn’t looking to set any speed or distance records; just see the great American pastime in all 30 parks. I went to school in AZ, but live in the Metro NYC area. So to spruce up my drive home in May, and out in August, I made sure to hit up cities with ballparks. If you’re not hellbent on 30 park in 30 days, each city has great things to see and offer. My favorite was def St Louis, MO. The old Busch stadium was #28 on my list and people were very friendly supportive of my adventures. Least favorite: Detroit….saw a Thursday afternoon game vs the White Sox and it was pretty drab. Left there and saw the Rocket pitch for the Yanks in Cleveland as they took on the Indians the same night. What a great summer! Good luck to you!

  • Devon-So I considered a road trip to be a complete loop and therefore a requirement to return to LA. If you got rid of this condition (sell the car at the end and fly home?) I would imagine the ideal trip would be one that started in Seattle and ended in either Boston or Miami.

    Keith and James- I haven’t taken a long road trip at all myself and without funding this trip is, just as you put, a ‘fantasy’. Obviously some people like James have been able to go to all 30 parks (although possibly a trip to the new Nationals Park is in order?) and probably know a lot more of what such a road trip is actually like.

  • Fun stuff, Ben. Now here’s another challenge for you: Find the shortest trip, (a) in miles traveled and (b) in days, that would allow you to see all 30 teams without necessarily seeing all 30 parks. This might be a more fun trip to actually do, since you’d often get to spend 2 days in the same city.

    P.S. to David Yanofksy: It’s pretty rare for 2 teams in the same metro area to be at home on the same day.

  • Much if this actually seems fairly reasonable, but there are parts that would not be pleasant. That Baltimore-Tampa-Toronto swing is the definition of insanity. The need to go down to Florida twice is what really screws it up.

  • You can count on a mid-week Thursday afternoon game at 1:05pm in Atlanta July 7 vs. the Rockies to be boring, hot, humid and hum-drum. Usually a little more electricity; better weather (and crowds) at the night games and/or games vs. Phillies, Dodgers, Yankees, Red Sox, Marlins or Mets. Just sayin’.

  • Wow, somebody has way too much time on their hands but since you do please tell me how much all of this travel and tickets and hotels will cost. Keep it brief. Haha. Thanks, Jeff Turner

  • Rainouts–and we’ve had plenty of them this season–would play havoc with this itinerary.

  • 4 things-
    1. Great work! I congratulate you!
    2. Do you have and can you publish the Google Maps Distances & Times between every ballpark-pair?
    3. Could you enhance the model a little bit to try to capture as many 2 games-in-a-day situations? That might be a doable enhancement.
    4. Could you change your optimization to optimize for total cost– including local fuel prices, other automobile-related costs, and local hotel costs (i.e. avoiding overnights in expensive cities where possible)? (LOL- I know that’s a huge complexification of the model, not to mention the data collection requirements.)

    Thank you!
    SG

  • Ben,

    Found this on the net, and let me congratulate you. Every year, when the schedule comes out (at least for the past 5 seasons), I have manually tried to see if one can visit all ballparks in any calender month (i.e. 30 ballparks/games in 31 days), and never have been successful. I always thought there was an easier way via computers to figure this out.

    If you ever decided to build a website, I’d love to be a part of it, and have a few suggestions: Beyond the ability to decide where someone wants to start, how about the option of picking a favorite team, so you can maximize seeing a specific team on the trip as many times as possibly?

    -Lee

  • Is there anyway you would release the code for this? I’d love to see it and perhaps do some smaller (midwest only, northest only) trips.

    Thanks for posting. Great applicaiton of the traveling salesman.

  • This is such an interesting article. My longest trip has been 9,000 miles in 17 days seeing 14 games while seeing the sights. (weekend in Vegas, mount rushmore, grand canyon). Over the course of a few years, I have been to all 30 stadiums until this new round of stadiums came out. As of now, I’ve been to 36 stadiums and am missing National Park, both NY stadiums and Minnesota’s new one.
    Well, good luck to all that are making a baseball trip this summer however short or long.

  • >Jimmy R said: I think the best “same day” possibility is in SoCal since there are two >LA teams and one in San Diego. It’s probably close to the Cubs-Brewers distance >though.

    For that matter you could also do the two NY teams and Philly, as well as the two Chicago teams and Milwaukee.

  • This is basically what UPS and FedEx do to determine their routes. They also employ additional rules like “minimize left hand turns” and so on. Very cool – thanks for sharing!

  • How about reducing this to a practical guide, by introducing a cost variable and changing the objective to “cheapest continuous journey” for each possible starting city; afterall anyone seriously contemplating this is going to factor in time-off work plus travel costs over total time or total distance, and would substitute air/train travel + rentals for their personal vehicle if that was more cost effective, while staying at home while getting the nearby cities out of the way to save on lodging.

    Specifically, use the median daily wage for the starting city times the number of non-holiday days one would have to miss (assume he/she misses all workdays that fall between initiating travel for the first pitch of the first game and the morning after a full nights sleep at home after return travel from the last pitch of the last game), factor in traditional >28-day advance-purchase airfare/trainfare/busfare between cities and/or typical one-way or round trip car-rental rates plus mileage, and lodging each night in a location one can arrive at by either 10pm or within 2hrs of the stadium (whichever is later) while staying there not less than 8 hours, always inclusive of the 2-5am window (use mileage only for the first few or last few games where one starts and ends travel at home taking in games at nearby stadiums).

    Simplify as is reasonable by assuming that when booked the cheapest standard ticket for a game is always available, a fixed per/mile gas consumption charge, and average discount lodging
    rates for greater metros, and possibly omitting non-ballpark greater metros en route between ballparks.

    • Thanks for your interest Lee. The dates have been released but not the game times and those will have an impact on the optimized trip. There will probably be a 2012 road trip post once they are released.

  • Hi Ben-

    I have decided to take a Sabbatical and take my Dad on a roadtrip to visit all 30 parks this summer. He is very ill and this is something I have always wanted to do with him. I really enjoyed your article and i was hoping to speak with you about how I would schedule something like this. I can be reached at jamesjustinshea@gmail.com if you have a couple minutes to spare. Thank you again for your time and such creative work.

    Best,

    Justin Shea

  • would love to see the 2012 schedule! i’ve always dreamed of doing a 30 parks in 30 days roadtrip but man is it a pain in the butt trying to figure it all out!

Leave a Reply to Evan V Cancel reply

Your email address will not be published. Required fields are marked *