2026-04-27
Automatons in CP-SAT for Rostering
I have a long-term client who needs to schedule doctors according to their capabilities, but also according to a complex set of rules. I developed a working solver years ago using OR-Tools and CP-SAT. Everytime they ask for some small improvement, I take the opportunity to revisit my core abstractions to see if I can’t figure out a more elegant way to approach the problem.
Recently I’ve been studying a published example of nurse rostering that uses the add_automaton() function from CP-SAT. I believe this is a good approach that will fix all the things, so I am writing this series of blog posts. In the end, I think I’ve unvented something relating to the DFA graph’s dual, but we’ll see if that has legs.