New answers tagged constraint
2
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 ...
2
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 ...
1
vote
Impact of soft constraints in MILP
This is to a large extent an expanded version of Joris's comment.
Things that have to be a certain way, period, require hard constraints. Examples: "We cannot ship more stuff than we have" -&...
2
votes
Quadratically constrained convex optimization
Since $\boldsymbol\Sigma$ is PSD, there exists $\boldsymbol Q$ s.t. $\boldsymbol Q^\top\boldsymbol Q=\boldsymbol \Sigma$ (by Cholesky, or eigendecomposition).
Then $\boldsymbol w^\top\boldsymbol \...
7
votes
Quadratically constrained convex optimization
For all things convex, Mosek's modeling cookbook and conic modeling cheatsheet have you covered.
In your case, see the section on convex quadratic sets.
6
votes
How to put this restriction using Gurobi in python
Firstly, your constraint should rather look this this:
$$\sum_{j=0}^{i}X_j \leq H_i \quad \forall i \in I$$
$$\sum_{j=0}^{i}X_j \geq L_i \quad \forall i \in I$$
In your code this should translate to:
<...
1
vote
Passing exact number of allocations as constraint to pyomo in a sourcing problem
I will first formalize the described problem in mathematical notations, I think it is more suitable, rather than a piece of code, for providing a better understanding.
So, let
$B$ be the brands set;
$...
8
votes
Accepted
How to transform a (thermal) range constraint into the objective function
Introduce nonnegative variables $Z^+(t)$ and $Z^-(t)$, impose linear constraints
$$T_\min \le T(t)-Z^+(t)+Z^-(t) \le T_\max,$$
and minimize $$\sum_t (Z^+(t)+Z^-(t)).$$
Notice that this approach easily ...
2
votes
How to solve assignment problem with type constraints?
Some articles dealing with constraints limiting the number of job types assigned to a given machine can be found with the keywords "class constrained" or "color constraints":
&...
1
vote
How to solve assignment problem with type constraints?
I think your problem looks like a Multi-resource Generalized Assignment Problem. Here are two papers that describe it:
Garvish and Pirkul (1991) and Mazzola and Wilcox (2001).
The amount of jobs $a_j$ ...
Top 50 recent answers are included
Related Tags
constraint × 160optimization × 42
modeling × 40
mixed-integer-programming × 37
linear-programming × 29
integer-programming × 20
pyomo × 18
logical-constraints × 16
python × 15
binary-variable × 14
linearization × 13
constraint-programming × 13
convex-optimization × 9
scheduling × 8
indicator-constraints × 8
cplex × 7
nonlinear-programming × 7
gurobi × 6
quadratic-programming × 6
convexity × 6
big-m × 6
solver × 4
combinatorial-optimization × 4
nonconvex-programming × 3
pulp × 3