Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.
Originally posted by: Max518
Hi,
i have two decision variables and i want to programme the expression:
X*Y∈{0,1}
in the constraints.
can anyone provides a example?
are X and Y integer decision variables ?
regards
yes, they are. i defined them as:
//decision variables dvar int Transport[f in Trucks][i in Jobs] in 0..1; dvar int JobSequence[f in Trucks][i in Jobs][j in NullJobs] in 0..1;
Hi
then you could write xy==1 as
dvar int x in -1..1; dvar int y in -1..1; subject to { (x==0) || (y==0) || (x==1) && (y==1) || (x==-1) && (y==-1); }
dvar int x in -1..1; dvar int y in -1..1;
subject to { (x==0) || (y==0) || (x==1) && (y==1) || (x==-1) && (y==-1); }
but for sure if x and y are binary xy will be either 0 or 1
i have another problem. my model is about job assignment. however, only six jobs of ten jobs can be assigned.
i cannot find the problem. could you help me?
attached is my code.
thank you so much.