DEV Community

Cover image for Scheduling Is a Constraint Problem Before It Is an AI Problem
Seven Billion Analytics
Seven Billion Analytics

Posted on Originally published at sevenbillion.co

Scheduling Is a Constraint Problem Before It Is an AI Problem

If you are a developer handed a "make our factory schedule smarter" ticket, the first instinct is often to reach for a model. Resist it for a moment. Production scheduling is mostly a constraint satisfaction problem, and the hard part is getting the constraints right.

Here is the shape of it. Inputs come from the ERP: production orders, routings, bills of materials, work-center calendars and stock. Then come the limits. Line capacity, shifts and operator skills, maintenance windows, tooling, material arrival dates, and sequence-dependent changeover times from a changeover matrix. Then the odd plant-specific rules. One dairy plant we built for had to respect blast-freezer curves, because a run that clashes with freezer capacity simply cannot happen.

The solver underneath is a constraint-programming and mixed-integer model (CP-SAT or MILP). Its job is not to find one perfect answer. It returns several feasible plans that trade changeovers against overtime against late orders, fast enough for a person to compare them. In that dairy case, a week of plans comes back in 90 seconds.

The key concept is finite capacity. Basic ERP logic usually assumes every machine has unlimited capacity, so it can load three weeks of work onto a line that has two. A finite model only places an operation where a resource actually has room, which is why its output can run as written.

Takeaway for builders: the most valuable artifact in these projects is often not code. It is the written list of rules that until now lived in a senior planner's head. Many of them have never been documented anywhere. Spend your first session extracting and encoding those rules, and the solver work gets much easier.

The approved plan then goes back to the ERP or MES with an audit trail, and the ERP stays the system of record. Our AI production scheduling page shows how that integration is structured.

Full walkthrough, step by step: How to Schedule Production with AI: A Guide

Top comments (0)