With the NFL schedule being released last night, I started thinking.  How would one automate the process of creating a schedule for a league such as the NFL?Even if we ignore all the challenges of a real-life schedule and pretend we have an ideal scenario where any team could host a game any week, travel was not a concern, there were no restrictions for consecutive home/away games, no worry of short weeks with Monday or Thursday games, etc., it still seems like a tremendously complex problem.  I'm not sure if it's NP-complete or not in the ideal case, but I'm interested in an algorithm that may be used.The problem gets much more interesting when we take all the special circumstances into account.  A team cannot play a Thursday night game following a Monday night game.  Most teams have specific dates that they cannot host games because of other events, such as concerts or other sporting events in the same complex.  The Jets and Giants share a stadium, so they cannot host games the same day.  The Raiders share their venue with the Athletics, and a part of their seasons overlap. This still doesn't take into account special requests a team may make, such as grouping long trips together or having a bye following a trip to London.What would go into this?  I know that in real life, the parameters of the schedule are plugged into a program that spits out hundreds of potential schedules, which are then reviewed and the best one is picked.  What might that program look like?It's noteworthy that the NFL is probably the simplest of the major sports leagues to schedule, since the season is divided into discrete schedule blocks (weeks) in which each team has exactly 1 game.  In other leagues such as the NBA and NHL, there is simply a long stretch of time into which 82 games need to fit, and at any given time a team may have played several more or fewer games than another.  MLB is even worse, since games are grouped into series and, since teams play every day, there is very little wiggle room to resolve problems.
Algorithm and time-complexity of creating a sports schedule
algorithms;complexity