Umair Khan
  • Home
  • Projects
  • Resume

NBA Scheduling Optimization Project

NBA
Excel
Google Colab
CSV
GitHub

A group Operations Research project developing an integer programming model that generates realistic, rule-compliant NBA schedules while minimizing travel distance.

Authors

Umair Khan

Jacob Herbert

NBA Scheduling Optimization Project

This project was part of our Operations Research course, where my teammate Jacob Herbert and I built an integer programming model that creates realistic, rule-compliant NBA schedules while keeping travel distance as low as possible.

Our model follows the actual NBA scheduling structure (division games, conference games, home/away balance) and scales from a small 5-team subset to the full Eastern Conference.

Project Summary & Skills Used

Our model schedules games between NBA teams over a fixed number of days while:

  • respecting NBA match-up rules
  • keeping home/away games balanced
  • preventing teams from playing more than one game per day
  • minimizing total travel distance

Industrial Engineering concepts

  • Integer Programming
  • Constraint modeling
  • Objective-driven optimization
  • Data pre-processing (Excel + Python)
  • Translating real-world rules into mathematical constraints

Skills I used or developed

  • Python + OR-Tools (integer programming solver)
  • Building and debugging custom constraints
  • Cleaning data from GitHub into a distance matrix
  • Structuring optimization results so they are easy to read and present

Project Development

Initial Idea

Our original goal was to build a simplified version of the NBA scheduling system using integer programming.
We wanted to create a model that followed real NBA rules,division games, conference games, and balanced home/away schedules—while also keeping total travel distance as low as possible. The plan was to start with a very small subset of teams to make sure our constraints and logic worked before scaling up.

How the Scope Evolved

We began with the 5 teams in the Atlantic Division to confirm the model structure, test the constraints, and verify that the solver could produce reasonable outputs.
Once this worked, we expanded the scope to include all 15 teams in the Eastern Conference.
This required building a complete distance matrix, updating our constraint logic, and restructuring the scheduling logic to handle many more match-ups.

Challenges & Roadblocks

We encountered several issues during development:

  • Team name mismatches between GitHub datasets, Excel files, and our Python model caused solver failures.
  • Scaling up the model created a much larger search space, which required tightening constraints to help the solver find solutions.
  • Avoiding duplicate games (e.g., the model scheduling a team twice on the same day) required additional logical constraints.

Each issue was solved through careful debugging, Excel cleanup, and gradually adding constraints one at a time instead of all at once.

Final Outcome

Our final model successfully generated rule compliant schedules for both the 5-team subset and the full Eastern Conference.
The structured travel patterns and balanced home/away splits were better than what we expected, especially once we introduced optimization on total travel distance. The project ended up being more complex than we anticipated, but the final results were significantly cleaner and more organized than an unoptimized schedule.

Project Development Process

1. Starting simple, North Division only

We started with 5 teams in the Atlantic Division (Boston, Toronto, New York, Philadelphia, Brooklyn).
The goal was to make sure all core rules worked before scaling up.

We checked:

  • correct number of games between each pair
  • home/away balance
  • no team playing twice on the same day
  • travel distance staying reasonable

2. Scaling up, Full Eastern Conference

Next, we expanded the model to include all 15 Eastern Conference teams.
To do this, we built a full distance matrix using a GitHub dataset, then cleaned and aligned it in Excel so every team name matched the model inputs exactly.

This step was more challenging because:

  • there were many more match-ups and constraints
  • small typos in team names could cause the model to fail entirely
  • travel distance became a much bigger factor in optimizing the schedule

Once everything was cleaned and consistent, the solver produced a well-structured schedule that still followed NBA-style rules.


Block 5 – Key Features / Highlights

Feature 1 — Realistic NBA rule structure

Our constraints enforce things like:

  • more games against division opponents
  • fewer games against non-division conference opponents
  • balanced home/away games for every team pair
  • at most one game per team per day
  • no team playing itself

These mimic the pre–In-Season Tournament NBA scheduling formula.


Feature 2 — Travel minimization

The objective function minimizes total miles traveled across all scheduled games.

  • In the North only model, travel is extremely compact.
  • In the full Eastern model, we still see structure and clustering in the schedule, instead of random long trips.

Feature 3 — Scalable design

The same model:

  • works on a 5-team Atlantic subset
  • scales to all 15 Eastern teams
  • could be extended to the full NBA or a full 82-game season with more time and extra rules (back-to-backs, TV slots, etc.).

Reflection

What I learned

  • Converting real NBA rules into math is harder than it sounds.
  • A tiny mistake in a constraint (like forgetting an index) can completely break feasibility.
  • Data cleaning and naming consistency are just as important as the model itself.
  • OR-Tools is very powerful once you understand how to structure variables and constraints.

My contributions

  • Helped design and debug the match-ups and home/away constraints.
  • Cleaned and organized the GitHub distance data into a usable CSV.
  • Checked solver outputs and compared them to NBA rules to see if they made sense.
  • Helped format the schedule so it was easy to present in slides.

How I grew

I’m more confident now in:

  • building integer programming models from scratch
  • reading solver output and diagnosing infeasibility
  • using Python + OR-Tools for real applications
  • explaining technical optimization work in a way non-IE people can understand.

Final Thoughts

This project showed how optimization can seriously improve something as messy as professional sports scheduling, fewer miles traveled, cleaner structure, and rules that match what the league actually wants.

With more time, we’d love to add:

  • rest-day and back-to-back limits
  • TV / primetime game rules
  • a full 82-game expansion to the entire NBA.

Even in its current state, the model proves that integer programming isn’t just theory, it can build better NBA schedules in a very real way.