New answers tagged

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 ...
user avatar
  • 28.7k
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 ...
user avatar
  • 10k
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" -&...
user avatar
  • 28.7k
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 \...
user avatar
  • 166
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.
user avatar
  • 3,253
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: <...
user avatar
  • 564
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; $...
user avatar
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 ...
user avatar
  • 21.7k
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": &...
user avatar
  • 1,421
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$ ...
user avatar

Top 50 recent answers are included