6 votes

Modeling an either-or-constraint

Based on the clarification about regions, it seems that all you have to do is add the constraints $$x_{ij}=0\quad\forall i\in I,j\notin J.$$ How to handle the "treat it differently" part may ...
user avatar
  • 28.9k
5 votes

Modeling an either-or-constraint

You can introduce an additional binary variable $y$ that takes value $1$ if and only if at least one node from $I$ is matched with another one from $J$: \begin{align*} x_{ij} &\le y \quad \forall ...
user avatar
  • 10.1k
3 votes

Impact of soft constraints in MILP

From a paper on the branch-and-cut in MILP solvers: Because cuts are often based on infeasibility, models with soft constraints that are always feasible can present unique challenges for deriving ...
user avatar
  • 361
2 votes

Restriction on gurobipy problem

Try m.addConstrs(x[i] <= C[i] * sum(x[j] for j in range(i)) for i in index) Python's range(n) yields an iterator from ...
user avatar
  • 566

Only top scored, non community-wiki answers of a minimum length are eligible