by kevinmannix · 9y ago · 0 comments
The NFL actually has quite a prolific GitHub organization [0]. I recommend looking through if you have a few minutes.
I'm not sure how widely known this is, but the actual matchups, not order and dates, are completely deterministic.
Teams play their division twice for six games. They play the other three teams in their conference with the same division standing last season (e.g. division champs will play each other). They play four teams from a rotating division in the other conference. And finally they play the remaining three teams from a rotating division in their conference.
I've always been a football fan but it took me a while to realize the NFL doesn't actually schedule rivalries like Brady/Manning every year, they just happen because those teams consistently win their division.
The workflow would be interesting. Presumably you have some hard and fast rules and then you try to encode bad/good/better rules. Let the computers churn out options. Maybe iterate with some new rules. The start going through the options manually.
I've worked on conference schedules :-) We don't use computers but it usually goes something like heuristics -> coarse optimization -> hand-tuning.
On top of that, there are other competitive factors involved, e.g., in Baltimore, the Orioles and Ravens generally can't be playing mass-attendance games at the same time because they are too close together, and share parking infrastructure. That of course has to be scheduled around.
Beyond that, there's the rather mundane reality that stadiums aren't just used for sports. Even during football season, megastars like Beyonce and the Rolling Stones need venues to play in. And of course, stadiums are loaned / leased out for a panoply of other reasons as well.
However, SAT solvers and constraint solvers blend in naturally and in fact even ship with many Prolog implementations! Thus, you can have the best of both worlds by simply using Prolog together with such solvers. Thus, using Prolog gives you both a Turing-complete programming language and a highly optimized constraint solver for combinatorial tasks, assuming you choose an implementation that is sophisticated enough. For example, in SICStus Prolog, check out CLP(B) and CLP(FD) for combinatorial tasks involving Boolean and integral variables.
For example, one of the most highly rated Prolog question on Stackoverflow is about a related task involving Tennis match scheduling:
http://stackoverflow.com/questions/4747498/tennis-match-sche...
The posted Prolog solution is quite concise and very efficient, thanks to the built-in constraint solvers that most Prolog systems provide nowadays.