Reputation: 25
I am trying to build a schedule using Google OR-TOOLS CP-SAT. I found a problem, because there is requirement, that some of the tasks from different jobs should be scheduled one after another, if they belong to the same material.
I've gathered tasks with the same material, task number and requested finish date to the same groups. As below we can see, e.g. material F task 20 group 13 is in the middle, near the end and at the end of the schedule. I'd like to keep them together.
I've tried to minimize the distance between the end and start of each task in the group, but it causes throwing some of the tasks outside the calendar and significantly extends the time to find a feasible solution.
I've also tried to understand this recipe from Laurent Perron, but I am not sure if this is the way to solve my problem.
Is there any way to force the solver to keep tasks in group, in the order that we choose before processing the data?
Upvotes: 1
Views: 239
Reputation: 11064
Is adding precedences between these tasks enough, or should they be direct successors ?
For the first case just add these precedences.
For the second case you will need a circuit constraints to do the transitive reduction from precedences to successors, then force the relevant successor arcs to be true.
Upvotes: 0