Originally posted by: SystemAdmin
[phlab said:]
If I get it well, you would like a constraint stronger than the noOverlap constraint on the sequence that also states that the end of an interval variable has the same value as the start of the next interval variable in the sequence.
Then, I would suggest to model it as a cumulFunction with a maximal level of 1 (this will model the 'noOverlap' part of the constraint) and a minimal level of 1 (to model the absence of holes in between intervals) over the interval that spans all the intervals in the sequence.
Something like:
dvar interval a[i in ...] ...; // Intervals in the sequence
dvar interval cover; // Spanning interval
cumulFunction f = sum(i in ...) pulse(a[i],1);
// ...
subject to {
span(cover, a); // Span constraint
alwaysIn(f, cover, 1, 1); // no overlap (f<=1) and no "holes" (f>=1)
// ...
}
Hope it helps,
Philippe
#DecisionOptimization#OPLusingCPOptimizer