# Questions tagged [constraint]

For questions related to constraints, i.e. any restriction or relation a set of decision variables has to satisfy.

131 questions
Filter by
Sorted by
Tagged with
74 views

### How to linearize this multiplicative constraint?

I have a constraint in the form $\sqrt{|\sum_{c\in C}{h_cw_c}|^2}\ge\sqrt{x}\zeta$ Here, $h_c$ is s row vector (know), $w_c$ is a column vector (variable). $x$ and $\zeta$ are also optimization ...
197 views

66 views

331 views

### Possibility of indexing decision variables with 2 indices using a set of tuples in Pyomo

I am currently attempting to solve a network problem that is not fully connected.Thus, I have attempted to do some preprocessing of data so as to form a set of tuples, e.g. $\{(a,b), (c,e),\ldots\}$, ...
309 views

### View of Constraints and Decision Variables in Pyomo

I have just attempted to construct my first Pyomo model. However, I was unable to locate any documentation that shows how to view constraints, decision variables. As my model is big, I need to see ...
413 views

### SLSQP Optimisation loop takes several iterations to compute error function despite jacobian

I have an error function $f : w \rightarrow f(w)$ that I want to minimize, $w$ being a vector of length 211. There are some constraints on $w$. I managed to compute the jacobian $J$ and even with it ...
559 views

### Change coefficient in PuLP

Once a model is implemented in PuLP, how do you change a coefficient (e.g., $a_{ij}$, $b_i$ or $c_j$) of a program of the from $\min\{c^{\top}x: Ax=b, x\geq0\}$? Specifically: How to update ...
107 views

### Pyomo: Help setting up my model

I have been working with a model for the past couple of weeks, but I am not sure what am I doing wrong as every time Pyomo returns that is infeasible or ...
127 views

### SDP relaxation with greater-than and less-than inequalities at the same time

I am dealing with the following nonconvex fractional quadratic optimization problem \begin{align} & \min_{\boldsymbol{x}} && \max_{t \in \mathcal{T}} \frac{\boldsymbol{a}_t^T \boldsymbol{...
95 views

### Pyomo: Struggling to get a constraint to work

I am trying to model an Electric Vehicle scheduling to minimise the electricity bill. Of course, the EV will only be able to charge every time that is plugged into a charging station (i.e. it cannot ...
123 views

### Space constraint in scheduling problem

I'm studying an MIP model with a scheduling problem and I'm wondering if the space constraint is correct. If there is space in the factory at that time, the block can be processed, where $i$ is the ...
82 views

223 views

### Using big M values for a constraint

I want to enforce $x_{i,j}=x_{k,j}\implies z_i \neq z_k$ where $k = i-1$ so I used \begin{align}z_k + 1 - (x_{i,j} - x_{k,j})) \leq z_i \leq z_k - 1 - (x_{i,j} - x_{k,j})\quad\text{for each $j$}\end{...
40 views

### Enforcing discontinuous range for a variable

I want to enforce the following ranges for a set of variables, where the ranges for each variable are discontinuous. For example, I have two sets of ranges for each variable, \begin{align}\sf LB_1 &...
128 views

2k views

### How to formulate (linearize) a maximum function in a constraint?

How to formulate (linearize) a maximum function in a constraint? Suppose $C = \max \{c_1, c_2\}$, where both $c_1$ and $c_2$ are variables. If the objective function is minimizing $C$, then it can be ...
465 views

### Is there a better way to formulate this constraint?

Let $x_{r}^{j}=1\iff$ the machine schedules job $j$ using resource $r$. My constraint says that: a resource cannot be used twice, i.e., if $x_{r}^{j}=1$, then $x_{r}^{j'}=0$ for $j'\neq j$. I write ...
108 views

### Constraint programming in OPL: intervals covering time slots

I am trying to model the following: There is a shop open from xx AM to yy PM. In each 30 min time slot, there have to be demand[timeSlot] = x employees present. E.g. the shop is open from 08am to ...
119 views

### Minimizing a variable over the intersection of simplex and linear constraints

I am solving: \begin{align} \begin{array}{rll} y^* = \min & y & \\ \mathrm{s.t.} & a_i^\top x \leq y, & i=1,\ldots,m \\ & x \succeq 0,\ \mathbf{1}^\top x = 1. & \end{array} \...
106 views

### How can I model this binary logic?

I am looking for a constraint to express the following: IF W1 = 0 AND W2 = 0 THEN Y = 0 IF W1 = 0 AND W2 = 1 THEN Y = 1 IF W1 = 1 AND W2 = 0 THEN Y = 0 IF W1 = 1 AND W2 = 1 THEN Y <= 1 ...
215 views

### How can this be expressed as a MILP constraint?

I am looking for a constraint to express the following: IF W1 = 0 AND W2 = 0 THEN Y = 1 IF W1 = 0 AND W2 = 1 THEN Y = 1 IF W1 = 1 AND W2 = 0 THEN Y = 0 IF W1 = 1 AND W2 = 1 THEN Y <= 1 ...
60 views

### Iterative calculus with Excel - N° 2

In continuation with the previous post, I propose you another problem. I have this model: \begin{align}\min&\quad F\\\text{s.t.}&\quad F-(1150x_{B_{1}}+1000x_{B_{2}}+1350x_{B_{3}}-S_{1})=430\...
793 views

### How to find the idle intervals in integer programming?

I have a scheduling problem with one machine and one job. I defined a binary variable $z_t$ that is 1 iff the job is scheduled at time $t$ (the job can be served in multiple times that are not ...
247 views

474 views

### The general meaning of "constraint relaxation" in the context of the Shortest Path Problem

I've read that in the context of the Shortest Path Problem, the use of the term "relaxation" ("relaxing edges") [...][the use of the term "relaxation"] is historical. The outcome of a relaxation ...
286 views

### TSP with constraints in OR Tools

I am completely new to OR Tools, but what I have tried so far seems very powerful. I have, however, run into a problem that I cannot seem to figure out how to solve. I am trying to model a TSP ...
633 views

### Bin packing variant

I am currently struggling with a bin packing variant, where we have fuel and compartments of a tank truck. Some industry constraints apply, but the whole picture is that you must fit the total volume ...