Originally posted by: SystemAdmin
[shadi said:]
Dear alex,
Duals defined as a float array, becuase the dual variables that the cp model receive from the main model is a float and not int.
i changed the declaration to int and i get the following error:
*** ERROR: "Duals": Cannot use type int[range] for float[range]
im using column generation method to minimize the final cost.
i want to write the reduced cost constraint in the cp model to add columns with negative reduced cost only.
so i tried using two ways:
1. cNew - sum(j in tripRng) Duals[tripSeq[j]] < 0;<br />2. cNew - sum (j in Trips) Duals[j]*flagTripInColumn[j] < 0;<br /> where
flagTripInColumn[j]=1 if trip j is covered by the new column
=0 if trip j not covered by the new column =>
so i assigned it as following (i dont know if it is correct)
forall (tr in Trips)
flagTripInColumn[table][tr][td] == sum (i in tripRng)(tripSeq[i] == tr);
after implementation of the second option, i didnt receive runtime errors but i didnt receive to the optimum solution, i think there is an error in the
reduced cost critirion.
thanks in advenced
Kshieboun Shadi
#DecisionOptimization#OPLusingCPOptimizer