The Algorithmically Perfect College Football Weekend

by swtouw

A few weeks ago I read a great blog by Randal Olson on how to compute the optimal road trip across the United States – it inspired me.

My friends and I have always desired to build an optimal road trip, but not for the classic landmarks and sites across the US, rather, the optimal College football road trip.  Starting in mid September and continuing on through late November the NCAA has games that span Thursday through Saturday (and sometimes Tuesday) every weekend.  As a huge College football fan, wouldn’t it be great to find the optimal route to catch three games in back-to-back-to-back nights?

The Plan

So here’s what you’d have to set out to do:

  • Get the full College football schedule
  • Understand where the games are located (coordinates)
  • Determine travel duration between the games
  • Find the route that has the lowest travel time and best games

This ends up being quite different from Randal’s task of the optimal road trip across the United States because there are fewer possible routes, since you must start at Thursday moving to Friday, then Saturday.  Due to this, the optimal route can be determined through brute force fairly easily and no genetic algorithm is necessary (sadly).

So, before you get excited and scroll down to the results, let’s run through the process.  Every data scientist will tell you that “data wrangling” is where they spend 80% of their time – well, that’s true again in this exercise.

The Data

Let’s start with step 1: the games.  There is no downloadable file of all the games with the football stadium addresses (until now).  So, I have to resort to web scraping.  I found a great Chrome plug in called Web Scraper, this saved me an amazing amount of time, check out the video here.  Using web scraper, I went to the fbsschedules website, hit each team’s schedule, which also happens to have the stadium name for the games.  The output of that web scrape can be downloaded here.

Notice that it’s the stadium name and not the actual address.  Well thanks to Google Maps API, this really didn’t matter.  I followed the same steps as Randal did to determine leg of journey durations and thanks to Google’s great API, it was able to determine routes simply from the stadium names.  Couple fun bugs here though:

  1. I tried to drive to Aloha Stadium (U of Hawaii) – Google didn’t like that.
  2. Some kid in Texas decided to name their high school field in Google Maps the same name as Boise State’s real field.  I don’t understand what happened here, it has the reviews and pictures just like the one in Boise.  I tried to make an edit through Google MapMaker which is a way to crowd source features on Google Maps.  My edit was rejected (do they really think that is a College football stadium, see below image?!).  This only became an issue when running routes between Texas Universities and Boise St, I assume because the Google algorithm saw the “secondary” stadium in close proximity – kind of cool.  I ended up manually editing Boise St from its stadium name to its actual address in my scrape data which resolved the API call – Texas A&M was no longer a 10 minute drive from Boise St.  Here’s an image of my MapMaker edit attempt:

Screen Shot 2015-04-29 at 9.09.09 PM

The Algorithm

Ok, so now I had every possible leg and their durations, time for the fun part.  What we can do now is write some code that iterates through every possible Thursday-Friday-Saturday route and see which route is shortest.  However, there’s another wrinkle here: tailgating.  To really get the full college football experience, you need to be there for the tailgate, of course(!).  Well, this could become a problem on the Saturday road trip, because we must assume we start that trip on Saturday morning and the game could potentially start at noon (most of the start times were TBD).

To account for this, we need to make travel time on Saturday more costly.  Well I took a pretty simple approach to do this, I multiplied every travel hour on Saturday by two, so the shorter the Saturday trip, the more “fit” the entire route will be.  To be honest though, this somewhat happened by default anyway, because there are so few Thursday and Friday games, and so many Saturday games, the algorithm typically picked a close proximity Saturday leg before I did this.

Ok, drum roll.  Here are the top 5 routes for every weekend, which would you choose? (note that week 3 is when Thursday games start):

|||||||||||||||||||||||||||| Week: 3 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 15.1

Thu, 17 Sep, Clemson Tigers @ Louisville Cardinals

Hours: 14.6

Fri, 18 Sep, Florida State Seminoles @ Boston College Eagles

Hours: 0.6

Sat, 19 Sep, Temple Owls @ UMass Minutemen

————————– Alternate:

Total Hours: 18.1

Thu, 17 Sep, Clemson Tigers @ Louisville Cardinals

Hours: 14.6

Fri, 18 Sep, Florida State Seminoles @ Boston College Eagles

Hours: 3.5

Sat, 19 Sep, Wake Forest Demon Deacons @ Army Black Knights

————————– Alternate:

Total Hours: 19.3

Thu, 17 Sep, Clemson Tigers @ Louisville Cardinals

Hours: 14.6

Fri, 18 Sep, Florida State Seminoles @ Boston College Eagles

Hours: 4.7

Sat, 19 Sep, Central Michigan Chippewas @ Syracuse Orange

————————– Alternate:

Total Hours: 21.2

Thu, 17 Sep, Clemson Tigers @ Louisville Cardinals

Hours: 14.6

Fri, 18 Sep, Florida State Seminoles @ Boston College Eagles

Hours: 6.7

Sat, 19 Sep, East Carolina Pirates @ Navy Midshipmen

————————– Alternate:

Total Hours: 21.3

Thu, 17 Sep, Clemson Tigers @ Louisville Cardinals

Hours: 14.6

Fri, 18 Sep, Florida State Seminoles @ Boston College Eagles

Hours: 6.7

Sat, 19 Sep, Rutgers Scarlet Knights @ Penn State Nittany Lions

|||||||||||||||||||||||||||| Week: 4 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 13.5

Thu, 24 Sep, Cincinnati Bearcats @ Memphis Tigers

Hours: 10.9

Fri, 25 Sep, Boise State Broncos @ Virginia Cavaliers

Hours: 2.6

Sat, 26 Sep, Appalachian State Mountaineers @ Old Dominion Monarchs

————————– Alternate:

Total Hours: 14.1

Thu, 24 Sep, Cincinnati Bearcats @ Memphis Tigers

Hours: 10.9

Fri, 25 Sep, Boise State Broncos @ Virginia Cavaliers

Hours: 3.2

Sat, 26 Sep, Georgia Tech Yellow Jackets @ Duke Blue Devils

————————– Alternate:

Total Hours: 14.2

Thu, 24 Sep, Cincinnati Bearcats @ Memphis Tigers

Hours: 10.9

Fri, 25 Sep, Boise State Broncos @ Virginia Cavaliers

Hours: 3.3

Sat, 26 Sep, Delaware Blue Hens @ North Carolina Tar Heels

————————– Alternate:

Total Hours: 14.3

Thu, 24 Sep, Cincinnati Bearcats @ Memphis Tigers

Hours: 10.9

Fri, 25 Sep, Boise State Broncos @ Virginia Cavaliers

Hours: 3.4

Sat, 26 Sep, Indiana Hoosiers @ Wake Forest Demon Deacons

————————– Alternate:

Total Hours: 14.6

Thu, 24 Sep, Cincinnati Bearcats @ Memphis Tigers

Hours: 10.9

Fri, 25 Sep, Boise State Broncos @ Virginia Cavaliers

Hours: 3.7

Sat, 26 Sep, Virginia Tech Hokies @ East Carolina Pirates

|||||||||||||||||||||||||||| Week: 5 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 19.7

Thu, 1 Oct, Miami (FL) Hurricanes @ Cincinnati Bearcats

Hours: 13.2

Fri, 2 Oct, Memphis Tigers @ USF Bulls

Hours: 6.5

Sat, 3 Oct, North Carolina Tar Heels @ Georgia Tech Yellow Jackets

————————– Alternate:

Total Hours: 19.7

Thu, 1 Oct, Miami (FL) Hurricanes @ Cincinnati Bearcats

Hours: 13.2

Fri, 2 Oct, Memphis Tigers @ USF Bulls

Hours: 6.5

Sat, 3 Oct, Liberty Flames (HC) @ Georgia State Panthers

————————– Alternate:

Total Hours: 19.8

Thu, 1 Oct, Miami (FL) Hurricanes @ Cincinnati Bearcats

Hours: 13.2

Fri, 2 Oct, Memphis Tigers @ USF Bulls

Hours: 6.6

Sat, 3 Oct, South Alabama Jaguars @ Troy Trojans

————————– Alternate:

Total Hours: 20.2

Thu, 1 Oct, Miami (FL) Hurricanes @ Cincinnati Bearcats

Hours: 13.2

Fri, 2 Oct, Memphis Tigers @ USF Bulls

Hours: 7.0

Sat, 3 Oct, San Jose State Spartans @ Auburn Tigers

————————– Alternate:

Total Hours: 20.3

Thu, 1 Oct, Miami (FL) Hurricanes @ Cincinnati Bearcats

Hours: 13.2

Fri, 2 Oct, Memphis Tigers @ USF Bulls

Hours: 7.2

Sat, 3 Oct, Alabama Crimson Tide @ Georgia Bulldogs

|||||||||||||||||||||||||||| Week: 6 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 18.5

Thu, 8 Oct, SMU Mustangs @ Houston Cougars

Hours: 16.9

Fri, 9 Oct, Southern Miss Golden Eagles @ Marshall Thundering Herd

Hours: 1.6

Sat, 10 Oct, Miami (OH) RedHawks (HC) @ Ohio Bobcats

————————– Alternate:

Total Hours: 19.6

Thu, 8 Oct, SMU Mustangs @ Houston Cougars

Hours: 16.9

Fri, 9 Oct, Southern Miss Golden Eagles @ Marshall Thundering Herd

Hours: 2.6

Sat, 10 Oct, Maryland Terrapins @ Ohio State Buckeyes

————————– Alternate:

Total Hours: 20.1

Thu, 8 Oct, SMU Mustangs @ Houston Cougars

Hours: 16.9

Fri, 9 Oct, Southern Miss Golden Eagles @ Marshall Thundering Herd

Hours: 3.2

Sat, 10 Oct, Oklahoma State Cowboys (HC) @ West Virginia Mountaineers

————————– Alternate:

Total Hours: 20.4

Thu, 8 Oct, SMU Mustangs @ Houston Cougars

Hours: 16.8

Fri, 9 Oct, NC State Wolfpack @ Virginia Tech Hokies

Hours: 3.5

Sat, 10 Oct, Georgia Bulldogs @ Tennessee Volunteers

————————– Alternate:

Total Hours: 20.5

Thu, 8 Oct, SMU Mustangs @ Houston Cougars

Hours: 16.8

Fri, 9 Oct, NC State Wolfpack @ Virginia Tech Hokies

Hours: 3.7

Sat, 10 Oct, Miami (OH) RedHawks (HC) @ Ohio Bobcats

|||||||||||||||||||||||||||| Week: 7 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 5.5

Thu, 15 Oct, UCLA Bruins @ Stanford Cardinal

Hours: 2.9

Fri, 16 Oct, UNLV Rebels @ Fresno State Bulldogs

Hours: 2.6

Sat, 17 Oct, San Diego State Aztecs @ San Jose State Spartans

————————– Alternate:

Total Hours: 9.5

Thu, 15 Oct, Western Kentucky Hilltoppers @ North Texas Mean Green

Hours: 8.1

Fri, 16 Oct, Houston Cougars @ Tulane Green Wave

Hours: 1.4

Sat, 17 Oct, Florida Gators @ LSU Tigers

————————– Alternate:

Total Hours: 9.9

Thu, 15 Oct, Western Kentucky Hilltoppers @ North Texas Mean Green

Hours: 8.1

Fri, 16 Oct, Houston Cougars @ Tulane Green Wave

Hours: 1.8

Sat, 17 Oct, UTSA Roadrunners @ Southern Miss Golden Eagles

————————– Alternate:

Total Hours: 12.7

Thu, 15 Oct, UCLA Bruins @ Stanford Cardinal

Hours: 11.8

Fri, 16 Oct, Cincinnati Bearcats @ BYU Cougars

Hours: 0.9

Sat, 17 Oct, Arizona State Sun Devils @ Utah Utes

————————– Alternate:

Total Hours: 12.3

Thu, 15 Oct, Auburn Tigers @ Kentucky Wildcats

Hours: 10.9

Fri, 16 Oct, Houston Cougars @ Tulane Green Wave

Hours: 1.4

Sat, 17 Oct, Florida Gators @ LSU Tigers

|||||||||||||||||||||||||||| Week: 8 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 4.1

Thu, 22 Oct, California Golden Bears @ UCLA Bruins

Hours: 2.2

Fri, 23 Oct, Utah State Aggies @ San Diego State Aztecs

Hours: 1.9

Sat, 24 Oct, Utah Utes @ USC Trojans

————————– Alternate:

Total Hours: 7.9

Thu, 22 Oct, California Golden Bears @ UCLA Bruins

Hours: 2.2

Fri, 23 Oct, Utah State Aggies @ San Diego State Aztecs

Hours: 5.7

Sat, 24 Oct, Washington State Cougars @ Arizona Wildcats

————————– Alternate:

Total Hours: 9.2

Thu, 22 Oct, California Golden Bears @ UCLA Bruins

Hours: 2.2

Fri, 23 Oct, Utah State Aggies @ San Diego State Aztecs

Hours: 7.0

Sat, 24 Oct, New Mexico Lobos @ San Jose State Spartans

————————– Alternate:

Total Hours: 15.5

Thu, 22 Oct, Georgia Southern Eagles @ Appalachian State Mountaineers

Hours: 14.3

Fri, 23 Oct, Memphis Tigers @ Tulsa Golden Hurricane

Hours: 1.2

Sat, 24 Oct, Kansas Jayhawks @ Oklahoma State Cowboys

————————– Alternate:

Total Hours: 9.5

Thu, 22 Oct, California Golden Bears @ UCLA Bruins

Hours: 2.2

Fri, 23 Oct, Utah State Aggies @ San Diego State Aztecs

Hours: 7.3

Sat, 24 Oct, Washington Huskies (HC) @ Stanford Cardinal

|||||||||||||||||||||||||||| Week: 9 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 4.4

Thu, 29 Oct, West Virginia Mountaineers @ TCU Horned Frogs

Hours: 4.2

Fri, 30 Oct, Louisiana Tech Bulldogs @ Rice Owls

Hours: 0.2

Sat, 31 Oct, Vanderbilt Commodores @ Houston Cougars

————————– Alternate:

Total Hours: 5.8

Thu, 29 Oct, West Virginia Mountaineers @ TCU Horned Frogs

Hours: 4.2

Fri, 30 Oct, Louisiana Tech Bulldogs @ Rice Owls

Hours: 1.6

Sat, 31 Oct, South Carolina Gamecocks @ Texas A&M Aggies

————————– Alternate:

Total Hours: 6.3

Thu, 29 Oct, Texas State Bobcats @ Georgia Southern Eagles

Hours: 5.0

Fri, 30 Oct, Louisville Cardinals @ Wake Forest Demon Deacons

Hours: 1.3

Sat, 31 Oct, Miami (FL) Hurricanes @ Duke Blue Devils

————————– Alternate:

Total Hours: 6.6

Thu, 29 Oct, Texas State Bobcats @ Georgia Southern Eagles

Hours: 5.0

Fri, 30 Oct, Louisville Cardinals @ Wake Forest Demon Deacons

Hours: 1.6

Sat, 31 Oct, Troy Trojans @ Appalachian State Mountaineers

————————– Alternate:

Total Hours: 6.6

Thu, 29 Oct, Texas State Bobcats @ Georgia Southern Eagles

Hours: 5.0

Fri, 30 Oct, Louisville Cardinals @ Wake Forest Demon Deacons

Hours: 1.6

Sat, 31 Oct, Clemson Tigers @ NC State Wolfpack

|||||||||||||||||||||||||||| Week: 10 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 7.7

Thu, 5 Nov, Nevada Wolf Pack @ Fresno State Bulldogs

Hours: 2.6

Fri, 6 Nov, BYU Cougars @ San Jose State Spartans

Hours: 5.1

Sat, 7 Nov, Arizona Wildcats (HC) @ USC Trojans

————————– Alternate:

Total Hours: 10.1

Thu, 5 Nov, Baylor Bears @ Kansas State Wildcats

Hours: 7.3

Fri, 6 Nov, Temple Owls @ SMU Mustangs

Hours: 2.8

Sat, 7 Nov, Auburn Tigers @ Texas A&M Aggies

————————– Alternate:

Total Hours: 10.3

Thu, 5 Nov, Baylor Bears @ Kansas State Wildcats

Hours: 7.3

Fri, 6 Nov, Temple Owls @ SMU Mustangs

Hours: 3.0

Sat, 7 Nov, Iowa State Cyclones @ Oklahoma Sooners

————————– Alternate:

Total Hours: 10.4

Thu, 5 Nov, Baylor Bears @ Kansas State Wildcats

Hours: 7.3

Fri, 6 Nov, Temple Owls @ SMU Mustangs

Hours: 3.1

Sat, 7 Nov, Kansas Jayhawks @ Texas Longhorns

————————– Alternate:

Total Hours: 10.8

Thu, 5 Nov, Baylor Bears @ Kansas State Wildcats

Hours: 7.3

Fri, 6 Nov, Temple Owls @ SMU Mustangs

Hours: 3.5

Sat, 7 Nov, New Mexico State Aggies @ Texas State Bobcats

|||||||||||||||||||||||||||| Week: 11 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 21.4

Thu, 12 Nov, Virginia Tech Hokies @ Georgia Tech Yellow Jackets

Hours: 20.2

Fri, 13 Nov, USC Trojans @ Colorado Buffaloes

Hours: 1.2

Sat, 14 Nov, UNLV Rebels @ Colorado State Rams

————————– Alternate:

Total Hours: 21.7

Thu, 12 Nov, Virginia Tech Hokies @ Georgia Tech Yellow Jackets

Hours: 20.2

Fri, 13 Nov, USC Trojans @ Colorado Buffaloes

Hours: 1.5

Sat, 14 Nov, Utah State Aggies @ Air Force Falcons

————————– Alternate:

Total Hours: 22.4

Thu, 12 Nov, Louisiana’s Ragin’ Cajuns @ South Alabama Jaguars

Hours: 21.2

Fri, 13 Nov, USC Trojans @ Colorado Buffaloes

Hours: 1.2

Sat, 14 Nov, UNLV Rebels @ Colorado State Rams

————————– Alternate:

Total Hours: 22.7

Thu, 12 Nov, Louisiana’s Ragin’ Cajuns @ South Alabama Jaguars

Hours: 21.2

Fri, 13 Nov, USC Trojans @ Colorado Buffaloes

Hours: 1.5

Sat, 14 Nov, Utah State Aggies @ Air Force Falcons

————————– Alternate:

Total Hours: 28.8

Thu, 12 Nov, Virginia Tech Hokies @ Georgia Tech Yellow Jackets

Hours: 20.2

Fri, 13 Nov, USC Trojans @ Colorado Buffaloes

Hours: 8.6

Sat, 14 Nov, Kansas State Wildcats @ Texas Tech Red Raiders

|||||||||||||||||||||||||||| Week: 12 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 5.6

Thu, 19 Nov, East Carolina Pirates @ UCF Knights

Hours: 1.8

Fri, 20 Nov, Cincinnati Bearcats @ USF Bulls

Hours: 3.9

Sat, 21 Nov, Georgia Tech Yellow Jackets @ Miami (FL) Hurricanes

————————– Alternate:

Total Hours: 5.8

Thu, 19 Nov, East Carolina Pirates @ UCF Knights

Hours: 1.8

Fri, 20 Nov, Cincinnati Bearcats @ USF Bulls

Hours: 4.0

Sat, 21 Nov, Western Kentucky Hilltoppers @ FIU Golden Panthers

————————– Alternate:

Total Hours: 5.9

Thu, 19 Nov, East Carolina Pirates @ UCF Knights

Hours: 1.8

Fri, 20 Nov, Cincinnati Bearcats @ USF Bulls

Hours: 4.2

Sat, 21 Nov, Chattanooga Mocs @ Florida State Seminoles

————————– Alternate:

Total Hours: 8.3

Thu, 19 Nov, East Carolina Pirates @ UCF Knights

Hours: 1.8

Fri, 20 Nov, Cincinnati Bearcats @ USF Bulls

Hours: 6.5

Sat, 21 Nov, South Alabama Jaguars @ Georgia State Panthers

————————– Alternate:

Total Hours: 8.7

Thu, 19 Nov, East Carolina Pirates @ UCF Knights

Hours: 1.8

Fri, 20 Nov, Cincinnati Bearcats @ USF Bulls

Hours: 7.0

Sat, 21 Nov, Idaho Vandals @ Auburn Tigers

|||||||||||||||||||||||||||| Week: 13 ||||||||||||||||||||||||||||

————————– Top Option:

Total Hours: 2.9

Thu, 26 Nov, Texas Tech Red Raiders @ Texas Longhorns

Hours: 2.7

Fri, 27 Nov, Navy Midshipmen @ Houston Cougars

Hours: 0.2

Sat, 28 Nov, Charlotte 49ers @ Rice Owls

————————– Alternate:

Total Hours: 3.7

Thu, 26 Nov, Texas Tech Red Raiders @ Texas Longhorns

Hours: 2.9

Fri, 27 Nov, Baylor Bears @ TCU Horned Frogs

Hours: 0.8

Sat, 28 Nov, UTEP Miners @ North Texas Mean Green

————————– Alternate:

Total Hours: 5.6

Thu, 26 Nov, Texas Tech Red Raiders @ Texas Longhorns

Hours: 2.7

Fri, 27 Nov, Navy Midshipmen @ Houston Cougars

Hours: 2.9

Sat, 28 Nov, Middle Tennessee Blue Raiders @ UTSA Roadrunners

————————– Alternate:

Total Hours: 6.7

Thu, 26 Nov, Texas Tech Red Raiders @ Texas Longhorns

Hours: 2.7

Fri, 27 Nov, Navy Midshipmen @ Houston Cougars

Hours: 4.0

Sat, 28 Nov, Texas A&M Aggies @ LSU Tigers

————————– Alternate:

Total Hours: 7.0

Thu, 26 Nov, Texas Tech Red Raiders @ Texas Longhorns

Hours: 2.9

Fri, 27 Nov, Baylor Bears @ TCU Horned Frogs

Hours: 4.1

Sat, 28 Nov, Oklahoma Sooners @ Oklahoma State Cowboys

Conclusion

I’d select the last option in week 7, you start in Lexington (great town) and finish with two nights in/near New Orleans.  Interesting how much the Thursday/Friday games drive the algorithm, but as discussed, this was expected.  They did limit the complexity of the algorithm by limiting the possible road trips – however, this also limited how “fit” any of these routes could actually be (see weeks 5 and 11).  The fittest route is found in our final week, with some small hops around Texas.  I considered adding NFL Sunday to the algorithm, but again, this would limit the possible fitness even further just like Thursday and Friday did.  Plus, my wife would kill me if the trip ran until Monday.

See you in Lexington!

Oh, and if you want to see the source code, it’s found here.