Four years ago, a group of University at Buffalo researchers submitted a paper to the MIT Sloan Sports Analytics Conference, outlining a mathematical approach by which the NFL could potentially produce a materially fair and largely disparity-free schedule.

NFL executives weren't so sure at first. Creating the annual schedule is a difficult task, and a league spokesman offered a gentle, public rebuke, noting that the researchers focused "only on fairness" while failing to consider a series of unavoidable constraints, including accommodating television partners and working around stadium limitations. But as the NFL prepares to release its 2019 schedule this week, the league and the Buffalo researchers -- led by Mark Karwan, Ph.D., a professor of operations research -- are now working together.

The NFL agreed to a three-year research grant in November 2018 to provide year-round method development and schedule testing. The league confirmed the agreement but did not comment further.

"This is a field I've worked in for 46 years, including 43 as a professor," Karwan said by phone last week. "I've worked on very difficult problems that take more than 12 hours on the supercomputer to solve. And this is by far the hardest any of us have ever seen."

Indeed, Karwan calculates there are more possible NFL schedules (10 to the 300th) in a given year than there are atoms in the universe (10 to the 80th). And, intuitively, most of us realize and accept that the schedule always carries some weird elements, whether it be three consecutive road games or a long stretch without a division matchup. We assuage our concerns with the idea that those disparities even out over time, but Karwan's initial research showed that was not always the case.

The whole project was sparked, in fact, by his hometown Buffalo Bills complaining about how often they faced teams who were coming off either a bye or a Thursday night game, which gives their opponents a rest advantage. As it turned out, between 2002 and 2014, the Bills had twice as many of those games as some other teams. The Bills were at a seemingly permanent disadvantage.

The NFL has managed to create a national holiday out of the schedule release, in part because it makes the upcoming season feel imminent but also because of the anger and debate it sparks. And with the full list of constraints in hand, Karwan and his team -- including one of his Ph.D. students, Zach Steever -- determined it is impossible to eliminate every potential quirk or disparity. But working with a dedicated computer chained to a wall for security, on a secure internet connection in a room that requires a password to enter -- "It's like working for the Department of Defense," Karwan said -- the team is focused on lowering the number of those undesirable outcomes.

In developing the schedule, NFL assigns "penalty points" to outcomes such as three-game road trips, games between teams with disparate rest, and road trips following a Monday night road game. In their final proof of concept in 2017 before receiving the grant, Karwan and Steever took the 2016 schedule and lowered the penalty total by 20 percent.

What is the approach? It's, in a word, complicated. Karwan and Steever suggest viewing each NFL schedule possibility as a grain of sand. Even for a powerful computer, the beach is too big to look at every grain. So the challenge is to narrow down the possibilities in a way that prompts the NFL's computers to find better possibilities "in smarter areas of the beach," Steever said.

The first step is based in both math and reality. Before creating the schedule, the NFL identifies a small number of games -- usually between 40 and 50 -- to lock in. The league refers to this as "seeding." It helps accommodate expectations from television partners for key games in certain time slots, as well as about 200 annual requests from owners who prefer their stadiums not be used in a given week because of concerts, baseball games, marathons and other potential complications.

That step is also crucial for the math, however. Establishing one game -- which also means assigning a week, a time slot, a network and a stadium -- eliminates many multiples of schedule possibilities.

"Without it," Karwan said, "there are too many possibilities for any computer you would have. It would never solve."

At that point, the NFL asks its computers to run schedule simulations until it finds one that has an acceptable penalty total. Usually that means juggling the 40 to 50 pre-seeded games. Karwan and Steever believe the key to improving the schedule is to better choose those pre-seeded games, allowing the computer to see stronger schedules that would otherwise be blocked by the initial choices through a process known as integer programming.

Mathematically, they believe, there are ways to identify games that will minimize the elimination of good schedules. A smarter mix of obvious major matchups with others that are friendlier to the math would, in theory, reduce the penalty totals and thus minimize the disparities in the schedule.

Even if all goes well in the coming years, only the most ardent schedule analysis will reveal the hoped-for improvements. But there are plenty of ancillary advantages from a broader sense, Steever explained.

"The hope would be that you notice it in the quality of the games," he said. "Every team knows its opponents before the schedule comes out, but where you place them in the schedule matters. If you create a schedule that minimizes, say, long trips on short weeks or evens out the rest disparity, those kinds of things can factor into quality of the play."

If you're motivated enough, you will never fail to identify slights against your team -- real or perceived -- when the NFL schedule is released. But in the coming years, you might have to work a little harder to find them.