Hi all,
I am testing out the add_automaton calls for a scheduling problem. So far everything is working nicely.
My long winded question I get to below is this: Does the CP-SAT solver perform better if the links are explicit in the
incoming automata? Or can it do the work itself to recognize the
overlaps on its own?
Details:
I have been taking the approach of breaking down the scheduling problem into smaller constraints and then overlapping multiple distinct automata. To take the canonical nurse rostering example, I made one automata for the "work no more than three shifts before being assigned an off shift" constraint, and another for the "no more than two consecutive night shifts in a row" constraint. Again, that worked fine.
I'm gradually adapting more realistic examples from a working, large scale rostering project. I am on the edge of being able to replace my existing code with a new automata-based approach to encoding the day to day rules. But I wonder if it is better to just bite the bullet and generate one giant scheduling automata for each person.
Specifically, I have three kinds of shifts. One can be assigned any day. The other two classes of shifts, call them A and B, are special. They require two (for A) and three (for B) days after each before another A or B shift can be assigned. So [A, other, other, B, other other other, A, ...] etc.
The way I am approaching the problem now, I make one automaton for each A and B shift and overlay them, as they are independent of each other, which gives me about 10 independent automata constraints for each person. It is the case that each of these shifts has special rules, so I
can't just simplify to some generic A shift or generic B shift. For
example, some have specific post-shift rules, others require pairing
with other regular shift, etc. So I need one automaton for each of
these shifts at the moment.
I was just thinking that I can combine them together, so that I have one giant automaton for each person. Right now, there is a link in each automaton that assigns "other A or B shift"; I could just make that into ten separate arrows, one for each of the A and B shifts, copy in the transition rules for each, and I'd have my one big automaton.
Which brings me to my question.
Does the solver perform better if the links are explicit in the incoming automata? Or can it do the work itself to recognize the overlaps on its own?
My suspicion is that it will be better to make one giant automata with all the links and nodes already embedded, so that the solver has more to work with when optimizing.
On the other hand, independent smaller automata might be easier to isolate and test for infeasibilities.
Any insights would be appreciated. I have a few quickie blog post up that I can link if anybody want more detail.
Regards,
James