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 ...
5
votes
Accepted
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
constraint × 161optimization × 43
modeling × 40
mixed-integer-programming × 38
linear-programming × 29
integer-programming × 20
pyomo × 18
python × 16
logical-constraints × 16
binary-variable × 14
linearization × 13
constraint-programming × 13
convex-optimization × 9
scheduling × 8
indicator-constraints × 8
cplex × 7
gurobi × 7
nonlinear-programming × 7
quadratic-programming × 6
convexity × 6
big-m × 6
solver × 4
combinatorial-optimization × 4
nonconvex-programming × 3
pulp × 3