New answers tagged

2

With CPLEX you can use logical constraints. For instance with the OPL API you can write: dvar boolean q; dvar int a; dvar int b; subject to { q==(a+b>=2); } q is 0 iff a+b<=1


5

Introduce a binary variable $\delta \in \{0,1\}$ to indicate whether $q$ is positive or not. You want: $$ \sum_{(i,j) \in A}f_{ij} \le |A| - 1 \quad \Longrightarrow \quad \delta=0 $$ or the contrapositive: $$ \delta=1 \quad \Longrightarrow \quad \sum_{(i,j) \in A}f_{ij} \ge |A| $$ which you can achieve with: $$ \sum_{(i,j) \in A}f_{ij} \ge |A| \delta $$ ...


Top 50 recent answers are included