Originally posted by: JCGar
Hello,
I have a binary decision variable dvar boolean X , an integer variable dvar int bu and dvar int+ zh;
X [<h,u,c>] = {<1 1 1> <1 1 2> <1 1 3> <1 1 4> <1 1 5> <1 2 1> <1 2 2>
<1 2 3> <1 2 4> <1 2 5> <1 3 1> <1 3 2> <1 3 3>
<1 3 4> <1 3 5> <1 4 1> <1 4 2> <1 4 3> <1 4 4>
<1 4 5> <1 5 1> <1 5 2> <1 5 3> <1 5 4> <1 5 5>
<2 1 1>}
I have a restriction like this:
subject to{
forall (h in 1..2, c in res[h] )
bu[<h,c>] >= sum(u in res[h]) x[<h,u,c>] ) - 1 ;
forall (h in 1..2)
zh[h] >= maxl( c in res[h]) bu[<h,c>] ;
}
variable bu give me: bu = [0 -1 -1 1 1 0]; that is correct.
But I I would like to know if it is possible to add the values in c, to get something like this: bu = [0 -1 -2 -1 0 0 ]
Regards.
#DecisionOptimization#MathematicalProgramming-General