Original Message:
Sent: Wed April 30, 2025 09:24 AM
From: Olivier Lhomme
Subject: Docplex CP Sequence_var issue
Hello,
You can simply add a dummy interval of size 0, say DI, between two phases to synchronize. Then constrain the last tasks (possibly dummy too as Thierry suggested to you) of each sequenceVars of phase 1 to be before DI, and constrain the first tasks of the sequenceVars of phase 2 to be after DI.
That way you will have a linear number of additional constraints instead of quadratic.
------------------------------
Olivier Lhomme
Original Message:
Sent: Tue April 22, 2025 08:39 PM
From: Ross Dye
Subject: Docplex CP Sequence_var issue
Hi Thierry
Thanks for the response. It looks like your solution is trying to create some "connection" between the upstream & downstream sequences to avoid 'ambiguity'?. If so can you help me understand the issue please?
My problem is quite a bit more complicated than mentioned previously - as mentioned I simplified the model to isolate the problem.
In reality the model is similar to:
In addition there may be multiple stages - the above shows only two stages, ie there may be T3,T4,T5 etc feeding to C1,C2...
So how would I apply your solution to this model. I think it will be problematic if I make the start of ALL intervals at B start_after ALL intervals at A.
Greatly appreciate your advice. I am at an impasse right now
Thanks
Ross
------------------------------
Ross Dye
Original Message:
Sent: Wed April 16, 2025 04:33 AM
From: Thierry Sola
Subject: Docplex CP Sequence_var issue
Hello Ross,
You can define three "dummy" interval variables of null size lastA, firstB and firstB1.
You constraint lastA to be the last in sequence A and firstB (respectively firstB1) to be the first in sequence B (respectively B1).
See docplex.cp.modeler.last(sequence, interval) and docplex.cp.modeler.first(sequence, interval).
You must force lastA to finish before firstB and firstB1 start. See docplex.cp.modeler.end_before_start(a, b, delay=None).
Regards,
Thierry.
------------------------------
Thierry Sola
Original Message:
Sent: Wed April 09, 2025 10:20 PM
From: Ross Dye
Subject: Docplex CP Sequence_var issue
Experts:
I am developing a production scheduling application using Docplex CP and Python and have encountered an issue when using sequence variables
I have distilled the problem in an attempt to isolate the issue as follows.
I have a 2 stage production process as illustrated. Imagine it as a mixing process A followed by a bottling process B
Both A and B have sequence variables with transition matrices. For A there are multiple colours, and for B there are multiple bottle sizes. Consider the intervening object a tank. There is a temporal constraint that states that activities on B must start_after A.
THIS WORKS EXACTLY AS REQUIRED !!!
The problem arises if there are alternatives at B, as below:
If there is no sequence_var & transitions on A, it works fine, and sequences and transitions are respected and makespan is minimised per objective.
BUT, when there are sequence variables on all three resources, the result is NO SOLUTION. The solver runs endlessly until solve time limit without finding a solution.
NOTE: it is not infeasible
I figure this means that at least one variable is not instantiated.
Questions:
1. Is there an issue with sequence_var's in DOCPLEX CP?
2. How can I find which variable(s) are not instantiated during the solve?
3. What additional constraints should I add to properly constrain the problem?
Thanks
Ross