'Getting slack time in Job Shop with Transitions

I am running a flexible job shop problem with alternatives and transition times.

Is it possible to determine the slack time on a machine; that is the time it is not either working or transitioning? The working time is obvious, but the transition time is dependent on the before and after jobs (selected from a matrix like routing travelling time), so not constant.

I can calculate this fairly easily after the fact in python outside of or-tools, i just wondered if it is possible for or-tools to return this?



Solution 1:[1]

If you use the circuit constraint to encode transitions, you can extend it:

model.Add(start[i] >= end[j] + transition[j, i]).OnlyEnforceIf(next[j][i])

into

model.Add(start[i] == end[j] + transition[j, i] + slack[i]).OnlyEnforceIf(next[j][i])

Thus slack[i] will be set as the waiting time before starting task i. Then you need to decide what to do with the initial slack.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Laurent Perron