Constraint-based scheduling for a site open seven days a week
Schedules generated in seconds by a CP-SAT solver, legal constraints and fairness included.
The challenge
Building the schedules of a small team on a site open all week, while respecting the contractual weekly hours, cantonal labour law, free weekends and the skills required per post, took considerable time and remained fragile whenever something unexpected happened.
Our response
We modelled the problem as a constraint satisfaction problem and solved it with a CP-SAT solver. The model incorporates hard constraints (post coverage, legal rest periods, hour quotas) and soft constraints (weekend fairness, preferences, assignment continuity) through a weighted objective function. The business parameters are exposed in a configuration file the client can manage without developer intervention. The engine is integrated into an operational intranet that also handles absences, balances and the connection to ticketing.
Key points
CP-SAT model covering legal, contractual and fairness constraints
Business parameters editable by the client without touching the code
Schedule generation in seconds where manual building took hours
Integrated management of absences and leave balances
Bridge to the ticketing platform to align resources with attendance
Technical stack
- Google OR-Tools CP-SAT
- Python (optimisation service)
- Next.js 15 / React 19
- Supabase self-hosted (PostgreSQL, Auth, RLS)
- Third-party ticketing API
- Sovereign Swiss hosting
Sector
Public venues & cultureLet's talk about your project
Tell us about your business challenge and we'll explore together how a tailored AI solution could support it.
