7

I am trying to model some logical constraints in ILOG. Logical constraints could be given such as:

  • Constraint 1 or Constraint 2,

  • Constraint 3 or Constraint 4,

  • Constraint 5 or Constraint 6.

The six constraints in question are listed below. \begin{align}&\,\,\sum_{s=1}^Sx_{is}=1\quad\forall i\in T\\\text{Constraint}\,1:&\,\,\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{js}&=0&\quad(i,j)\in\text{linked}\\\text{Constraint}\,2:&\,\,\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{j(2\cdot m-s)}&=0&\quad(i,j)\in\text{linked}\\\text{Constraint}\,3:&\,\,\left\vert\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{js}\right\vert&\ge d_1&\quad(i,j)\in\min\\\text{Constraint}\,4:&\,\,\left\vert\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{j(2\cdot m-s)}\right\vert&\ge d_1&\quad(i,j)\in\min\\\text{Constraint}\,5:&\,\,\left\vert\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{js}\right\vert&\le d_2&\quad(i,j)\in\max\\\text{Constraint}\,6:&\,\,\left\vert\sum_{s=1}^Ss\cdot x_{is}-\sum_{s=1}^Ss\cdot x_{j(2\cdot m-s)}\right\vert&\le d_2&\quad(i,j)\in\max\end{align} 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. Since there are too many sum functions in my model, it is very challenging to build a big-M model. So I need your help.

I would appreciate it if you have any suggestions. Thank you in advance. Regards.

LarrySnyder610
  • 13,141
  • 3
  • 41
  • 105
memop
  • 71
  • 2

1 Answers1

3

You can enforce constraints 1 and 2 by instead imposing $x_{i,s}= x_{j,s}+ x_{j, 2m-s}$. For the other four, you can impose no-good constraints of the form $$x_{i,s}+ \sum\limits_{(j,t)\in D_{i,s}} x_{j,t}\le 1,$$ where $D_{i,s}$ is the set of disallowed assignments for $j$ if $i$ is assigned to $s$.

RobPratt
  • 32,006
  • 1
  • 44
  • 84
  • Thank you Rob. Your suggestion for constraint 1 and 2 can be runnable constraints.But I do not understand that your suggestion for the other four is additional constraints or instead of related my constraints? Regards. – memop Oct 18 '19 at 15:39
  • The no-good constraints would replace constraints 3 through 6. – RobPratt Oct 18 '19 at 15:43
  • RHS is $d_1$ for constraints 3-4 and $d_2$ for constraints 5-6. RHS $\le1$ means the only variable is equal to $1$. E.g. if $d_1$ is $3$ these constraints won't be suitable. The aim of these constraints is that the gap of assignment places between two related variables should be $\min d_1$ and $\max d_2$. E.g. if the gap minimum between variable $x_1$ and $x_7$ is $2$ the assignment $x_{15}=1$ and $x_{71}=1$ is proper but if $x_{15}=1$ and $x_{74}$ this is not proper as the assignment place of $x_1$ is $5$ and $x_7$ is $4$ and the gap is $5-4=1<2$. A similar situation is valid for maximum gap. – memop Oct 18 '19 at 16:31
  • I made a correction just now. – RobPratt Oct 18 '19 at 16:51
  • Thanks Rob. I will try your suggestion. It is important to define $D_{is}$ by using ILOG expression. Regards. – memop Oct 18 '19 at 17:10
  • Dear Rob. I have tried several methods to define D_{is} by using ILOG CPLEX optimization software. But I failed to define the set. I don't know if you know ILOG or not, however, I wonder if you have a suggestion. Thank you very much in advance. Regards. – memop Oct 26 '19 at 23:57
  • I don't know ILOG, but here's how you would do it in PROC OPTMODEL from SAS:set D {i in ISET, s in SSET} = setof {<(i),j> in MIN, t in SSET: abs(s-t) < d1 or abs(s-(2*m-t)) < d1} <j,t> union setof {<(i),j> in MAX, t in SSET: abs(s-t) > d2 or abs(s-(2*m-t)) > d2} <j,t>; Maybe it will help you. – RobPratt Oct 27 '19 at 03:06
  • @memop: It's not clear what you are using to build your model. Are you writing it in OPL or building it using one of CPLEX's APIs (in which case, which API)? – prubin Oct 28 '19 at 17:32
  • Dear Rob Pratt thank you for your answer, I will try your code to convert to ILOG code. Dear @prubin I use OPL to model my problem. Thank you for your interest. – memop Oct 29 '19 at 19:35