Determining playoff clinching scenarios in the NHL using constraint programming
The AWS Generative AI Innovation Center built an automated system that uses constraint programming and custom tree search to determine, with mathematical certainty, when and how an NHL team clinches a playoff spot. The approach was validated against four full NHL seasons of officially published results.
As the NHL regular season nears its end, fans are left wondering whether their team has clinched a playoff spot. Determining this can be a complex task, given the large number of teams, intricate tie-breaking rules, and numerous remaining games. To address this challenge, the AWS Generative AI Innovation Center developed an automated system utilizing constraint programming and tree search techniques.
The system comprises two main components: the 0-day solver and the n-day lookahead solver. The 0-day solver functions as a constraint programming model that determines if a team has already clinched the playoffs. It does this by solving a feasibility problem - essentially asking if there are any possible outcomes to the remaining games that would prevent the team from making the playoffs. The CP-SAT solver from Google OR-Tools is used to solve this model, taking into account all the nuances of the NHL's tie-breaking rules.
The n-day lookahead solver then builds upon the 0-day solver by examining the outcomes of the next n games. It constructs a tree search where each layer of the tree represents a game and each node represents a specific outcome of that game. The solver uses the 0-day solver at each node to check if the accumulated outcomes are sufficient for the team to clinch. Preprocessing, pruning strategies, and node-ordering heuristics are implemented to keep the search efficient and tractable.
To validate the system, the AWS team tested it against the official NHL scenarios from four recent regular seasons (2021-22 to 2024-25). The results showed that the system's scenarios perfectly matched those published by the NHL. Additionally, the system demonstrated significant efficiency, with determining 1-day clinch scenarios requiring a median runtime of just minutes. This offers a major time-saving advantage over manual methods.
The practical applications of this system extend beyond the NHL and its fans. The automated, mathematically rigorous approach can be used by other sports leagues and analytics to determine other milestones, such as division titles or specific playoff seeds. This framework could also be adapted to other leagues, showcasing the versatility of the mathematical optimization approach employed.
Written by urgent.news from AWS Machine Learning's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.