Originally posted by: isczg
The 100 constraints are not sufficient to ensure the nesting condition.
For example:
there are three interval A[1], A[2], A[3], if we write the following constraints
(lengthOf(A1) >= lengthOf(A2)) => (overlapLength(A(1),A(2))==lengthOf(A(2)))
(lengthOf(A1) <=lengthOf(A2)) => (overlapLength(A(1),A(2))==lengthOf(A(1)))
(lengthOf(A2) >= lengthOf(A3)) => (overlapLength(A(2),A(3))==lengthOf(A(3)))
(lengthOf(A2) <= lengthOf(A3)) => (overlapLength(A(2),A(3))==lengthOf(A(2))
and if a specific solution satisfies:
A2.length > A1.length > A3.length
then the above constraints can only guarantee that "A2 includes A1" and "A2 includes A3", but "A1 includes A3" was missed.
So we should add the constraint for every pair of intervals, and it is O(n2).
regards,
#DecisionOptimization#OPLusingCPOptimizer