Originally posted by: **memop**

Hi.

I am trying to model some logical constraints -given below- in ILOG.

forall (j in tasks) sum(i in stages) x[j,i] == 1;

forall (link in Linked)

Constraint_1: sum (s in stages) s*x[link.linkedTask1][s] - sum(s in stages) s*x[link.linkedTask2][s] == 0;

Constraint_2: sum (s in stages) s*x[link.linkedTask1][s] - sum(s in stages) s*x[link.linkedTask2][2*m-s] == 0;

forall (mind in MinDistances)

Constraint_3: abs(sum (s in stages) s*x[mind.mindisTask1][s] - sum (s in stages) s*x[mind.mindisTask2][s]) >= mind.distance;

Constraint_4: abs(sum (s in stages) s*x[mind.mindisTask1][s] - sum (s in stages) s*x[mind.mindisTask2][2*m-s]) >= mind.distance;

forall (maxd in MaxDistances)

Constraint_5: abs(sum (s in stages) s*x[maxd.maxdisTask1][s] - sum (s in stages) s*x[maxd.maxdisTask2][s]) <= maxd.distance;

Constraint_6: abs(sum (s in stages) s*x[maxd.maxdisTask1][s] - sum (s in stages) s*x[maxd.maxdisTask2][2*m-s]) <= maxd.distance;

Logical constraints could be given such as: Constraint_1 or Constraint_2, Constraint_3 or Constraint_4, Constraint_5 or Constraint_6. Only one of the constraints in each group should be satisfied and active, i.e if Constraint_1 is active, Constraint_2 should not be active, or vice versa.

I have tried some logical constraints definition method, e.g. Big M method, but I could not define the constraints and run the model. I would appreciate it if you have any suggestions. Thank you in advance. Regards.