Soft-conditioned assignment of tasks to workers

39 views
Skip to first unread message

Borja Menéndez Moreno

unread,
Jan 14, 2022, 9:12:33 AM1/14/22
to or-tools-discuss
Hi,

I'm currently working on an assignment problem with CP-SAT and I would like to know if there is a way of doing some sort of soft-conditioned assignment of tasks to workers. For instance, if we have a worker w1 and tasks t1, t2, t3, t4 and t5, if the worker is assigned task t1, then it's better to assign w1 the task t2 xor t4, but it's not mandatory for him to perform only those tasks, he could end up doing t3 xor t5 if there is no other option -maybe because they are already assigned to other workers-. In this case, all the variables are booleans just to know if w1 performs t1 (or not), t2 (or not), and so on.

I was thinking about using AddBoolOr combined with OnlyEnforceIf since it's not possible to use it with AddBoolXOr, but then it will restrict the possible assignment to t2 or t4 if he's been assigned t1, right? Looking into the docs, I don't know if AddAssumptions could work as I expect.

Do you know a way to model this kind of behavior?

Thanks in advance,

Borja.

Laurent Perron

unread,
Jan 14, 2022, 9:16:59 AM1/14/22
to or-tools-discuss
Plain boolean login.
No boolXor (dunno why you should be using this), nor assumptions (this is to debug infeasible models)
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/876b7429-e847-4dc0-825a-df377b8f74adn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages