Or-tools provides ingredients to tackle scheduling problems
For starters, we have (Conditional) Interval variables
slv.FixedDurationIntervalVar(start_min, start_max,
duration, optional, name)
Or-tools provides ingredients to tackle scheduling problems
For starters, we have (Conditional) Interval variables
slv.FixedDurationIntervalVar(start_min, start_max,
duration, optional, name)
The start and end time can be accessed in multiple ways:
x.StartMin(), x.StartMax(), x.EndMin(), x.EndMax()
x.StartExpr(), x.EndExpr()
Or-tools provides ingredients to tackle scheduling problems
For starters, we have (Conditional) Interval variables
slv.FixedDurationIntervalVar(start_min, start_max,
duration, optional, name)
The activities may be optional
We will only deal with non-optional activities
Or-tools provides ingredients to tackle scheduling problems
Second, we have precedence constraints:
x.StartsAfterEnd(y)
x.StartsAfterEndWithDelay(y, delay)
x.EndsAfterStart(y)
...
x
and y
are two activity variablesIn principle, we could also use:
y.EndExpr() <= x.StartExpr()
Or-tools provides ingredients to tackle scheduling problems
Third, we have resource constraints:
CUMULATIVE
, accessible as:slv.Cumulative(X, reqs, cap, name)
X
is a list of activity variablesreqs
is the list of resource requirementscap
is the resource capacityOr-tools provides ingredients to tackle scheduling problems
Third, we have resource constraints:
slv.DisjunctiveConstraint(X, name)
Or-tools provides ingredients to tackle scheduling problems
Finally, we have specialized search strategies:
slv.Phase(X, strategy)
Where strategy
can take the values:
slv.INTERVAL_SET_TIMES_FORWARD
("SetTimes" from ch9)slv.INTERVAL_SET_TIMES_BACKWARD
(a "SetTimes" variant)We do not have a specialized LNS operator
An important thing to keep in mind:
Or-tools is not a state-of-the-art scheduling solver!
Other CP solvers (e.g. IBM CP Optimizer) are better
Let's consider a simple scheduling problem:
n
(non-optional) activitiesi
has a fixed duration di
ui
"Soft" means that the deadline can be exceed, for a cost:
ci=wimax
w_i
is a weight and s_i
is the activity start time\max(0, s_i + d_i - u_i)
is called "tardiness"The objective is to minimize the sum of costs
We will tackle the problem via CP and LNS
That said, you have a starting script in the start-kit