The slate wasn’t finalized until a computer in western Europe spit out option number 52,129, which accounted for marathons in Detroit and Chicago, turned Los Angeles into an odd focal point on New Year’s Eve and made teams playing overseas happy with their byes

This is the fourth straight year I’ve done a story on the making of the NFL schedule. Each year, I speak to the four-person team of schedule-makers, led by NFL broadcasting and schedule czar Howard Katz, after the hay is in the barn . . . sometime late in the day after the schedule is finalized.

But this year I feared the jig was up. At 12:22 a.m. on Monday, Katz emailed to say there was a long way to go before the schedule would be finished—and he wasn’t feeling very confident. On Monday afternoon the scheduling team presented to Roger Goodell one iteration of the tens of thousands spewed from nearly 400 computers that looked quite good; Goodell thought the schedule was good enough to play, but also thought three teams’ slates had minor flaws, and that the Los Angeles TV schedule had holes. Back to work. On Tuesday at 11:05 p.m., a few hours after returning from the funeral for Pittsburgh owner Dan Rooney, Katz sounded even more pessimistic about an optimal schedule getting done in time for the projected 8 p.m. ET Thursday release.

From l. to r., Charlotte Carey, Howard Katz, Blake Jones and Michael North. Eric Espino/NFL

But a breakthrough happened while the schedule-makers slept. At 2:21 a.m. on Wednesday, schedule number 52,129 shot out of a computer and fixed the four problems Katz & Co. hadn’t been able to get over—making three team schedules less arduous, and giving the Los Angeles market better doubleheader games.

“Making the schedule is always a balance,” says senior director of broadcasting Mike North, who has worked on the annual three-month schedule marathon for 19 years. “In this case, how much of what we liked about the schedule could be kept intact by addressing teams X, Y and Z, plus the TV games with the two L.A. teams now? In this case, we were able to fix the problems without creating others.”

The winning schedule, remarkably, was spit out of a computer in western Europe. But more about that later.

For now, as I examined the work of the schedule-makers, five headlines stand out:

The Raiders are back. Oakland had one prime-time game in 2015, and two in 2016. This year, the Raiders have the NFL max of five prime-time games, plus four doubleheader games that will be nationally televised. The league will be in a TV mess if the Raiders are not the emerging star team they appeared to be at the end of 2016. “Most years,” said North, “you count on seeing Dallas, Green Bay, Pittsburgh and New England in prime time a lot. This year you’ll get five Raiders games and four doubleheader games, meaning more than half their games will be on national TV. It’s been a long time since that’s happened—maybe a generation.”

Odd slate for the Pats. A predictable opener, versus Kansas City on Thursday night, Sept. 7, to start the season. (If you wonder why no Atlanta there, it’s simple: The Falcons wanted to open their new stadium in Week 2 at home, and the combination of the new venue plus being the defending NFC champs meant that would be a huge Week 2 game. Thus, Green Bay at Atlanta on Sunday night in Week 2 . . . the league also wouldn’t put the Falcons in the league’s marquee game in Week 1 and 2.) But after New England’s Week 9 bye, the Pats play five of six on the road, including back-to-back games in altitude, at Denver and against the Raiders in Mexico City, in Weeks 10 and 11.

• THE TERRIBLE 2013 NFL DRAFT: What went into making ’13 the worse first round in memory—and what to learn from it

Lots of coast-to-coast trips made the schedule harder to formulate. The NFC East plays the NFC West and AFC West this year. The AFC West plays the AFC East and NFC East this year. The Chargers have two trips to the Meadowlands. Washington has two trips to Los Angeles. The Raiders have five games in the Eastern Time Zone. The Raiders will play east in Week 1 (Tennessee), Week 3 (Washington), Week 8 (Buffalo), Week 9 (Miami—Oakland requested one back-to-back eastern swing) and Week 16 (Philadelphia), on Christmas night.

No bye weeks until Week 5. Might seem like a minor thing, but since the NFL went to 16 games played on 17 weekends, the byes have regularly started in Week 4. Teams prefer to have their bye closer to the middle of the season. This year, no team has a bye in the first four weeks.

No flex scheduling in Week 16. NBC has Minnesota-Green Bay on Saturday, Dec. 23, then Raiders-Eagles on Christmas night, a Monday. Those games are set in stone, so teams (and fans) won’t have to wonder 13 days before the game if it might be moved to a different time.

* * *

One of the strangest things about the 2017 NFL schedule: All four California teams will be playing in Los Angeles on New Year’s Eve. The Raiders are at the L.A. Chargers, and the 49ers are at the L.A. Rams. Both games kick off at 4:25 p.m. ET. There’s nothing wrong with this, of course. It’s just odd.

In the past, things like a Papal trip to Philadelphia, a huge international rugby game in Chicago and various concert tours have derailed the work of Katz and his team, which includes North and two new members: director of broadcasting Blake Jones and broadcast manager Charlotte Carey. There were not many unique events this year to derail the schedule. The World Junior Hockey Championships in Buffalo put the Bills on the road in Weeks 16 and 17 (the Bills were fine with it), while marathons in Detroit and Chicago made the Lions and Bears unable to play at home, respectively, on Oct. 8 and Oct. 15. “The start/finish lines in those races are in the parking lots of those two stadiums,” North said. “If we could avoid it, we needed to.”

Every team’s going to have some anger about some parts of its schedule, to be sure. “But we’re throwing away schedules, lots of them, we would have used 10 years ago,” said Katz. “One weekend, the computer spit out 297 schedules we considered playable. We threw them all in the garbage because they had flaws we weren’t willing to accept. But they would have been acceptable before.”

• ANDY BENOIT’S FILM ROOM: Don’t Bring Any Disrespect at Jamal Adams

Some of the reasons seem quirky to most people, but they aren’t that way locally. The Bengals had been in a tizzy because they had been assigned to open seven straight seasons on the road. This year, their 50th season, they strongly requested a home game in Week 1. Thus, they’ll open the season the same way they closed 2016: at home, against the Ravens.

Three of the teams playing London in Weeks 3 and 4—Baltimore, Jacksonville and Miami—asked the league to avoid giving them byes the following week. One team in London, New Orleans in Week 4, wanted to follow the overseas game with a bye. All four teams got their wish.

“One of the issues people wouldn’t expect,” said Katz, “is that we’ve got 10 teams playing international games this year—eight teams in London, two in Mexico City. Most of those teams have a request as to where they want to be before that game, or after that game. So that’s something else to add.” The Rams, for instance, wanted to play in Eastern Time the week before playing in London against the Cardinals on Oct. 22 . . . and so the league put the L.A. Rams in Jacksonville on Oct. 15. The Rams will practice in Florida for a couple of days before going to London.

* * *

When Goodell initially saw the first iteration of the schedule his group found acceptable, Katz said the commissioner was “generally complimentary.” But one of the problems Goodell and the schedule-makers couldn’t get over was that one NFL club (Katz wouldn’t say which) had a three-game road trip, which included a trip to the opposite coast, followed by another road game. They would have played the schedule. They didn’t want to play the schedule.

Katz calls North “our computer-whisperer.” When Katz’s group had problems with the three teams and the Los Angeles TV schedule, North refined what he was asking the computer on Tuesday night. The NFL uses two primary software partners, Optimal Planning Solutions of Vernon, British Columbia, and Gurobi Optimization of Boston. As North explained, the available servers used by Optimal or Gurobi in the cloud could be in Europe, Asia or some American city. And when he checked the time stamp Wednesday morning of schedule possibility 52,129, it was five hours ahead of New York—meaning on some computer in western Europe.

“It’s a remarkable concept,” North said, “compared to actually having the machines physically in the office. It wasn’t that long ago that we only had a dozen we used. Now I wish we had another 1,000.”

And it wasn’t that long before that when the NFL had a couple of humans, led by longtime director of broadcasting Val Pinchbeck, make the schedule by hand—and by trial-and-error. There’s a lot to envy about the old days in the NFL, but making the schedule is not one of them.

Question? Comment? Story idea? Let us know at talkback@themmqb.com