Skip to main content

All Questions

0 votes
1 answer
75 views

How to write conditional constraints and sum the result in Linear Programming in Python?

I want to use the sum of a series of linear expressions as objective and constraints. These linear expressions are chosen to be included or not based on some conditions. I can achieve it in Excel ...
Shwing's user avatar
  • 13
2 votes
2 answers
184 views

Are McCormick Envelopes exact for the following class of optimization problems?

I have the following optimization problem: \begin{align*} \text{minimize} \quad &\mathbf{c^T x} \\ \text{such that} \quad &\mathbf{x} \in S. \end{align*} Here, $S$ is a polyhedron of the form $...
graphtheory123's user avatar
2 votes
1 answer
78 views

Minimizing sum(abs(Ax-c)) for binary decision variables - terminology and methods?

My problem requires choosing a fixed number of vectors from a large set of vectors such that the sum of these vectors is close to some known target vector. That is, given known parameters: $$ l, m, n \...
G_B's user avatar
  • 1,857
2 votes
1 answer
223 views

Set a limit on value change of a binary variable

I am working on an Energy Management problem. The objective is to minimize the electricity bill for the customer. I have a time-series data with 15 min. intervals spanning the course of 1 year. The ...
Kushagr Goyal's user avatar
2 votes
1 answer
126 views

How to model the constraints of min and max in cvxpy

I have a continuous variable $x_{ij}\in[0,1]$ and I need to write the following constraint: $$M_i-m_i+1\leq C_i$$ where $M_i=\max\{j: x_{ij}>0\}$ and $m_i=\min\{j: x_{ij}>0\}$
zdm's user avatar
  • 403
4 votes
2 answers
309 views

Linear condition between two continuous variables

There are two real variables $x$ and $y$. The conditions are such that: if $y\le 0$, then $x=0$ if $y>0$, then $x=y$ How to write linear equations or inequalities to satisfy both the conditions?
Lorentz's user avatar
  • 41
0 votes
1 answer
105 views

How to model this constraint in a better way?

I have a resource allocation problem. There are $M$ users and $N$ resources (machines). One user can be assigned to multiple resources/machines. But maximum $B$ machines can be activated at a time for ...
KGM's user avatar
  • 2,377
3 votes
1 answer
194 views

Reformulate constraints

I have the following constraints and am wondering whether I can formulate the whole thing more narrowly and with fewer constraints. $x_{itk}$ is binary and $u_{it}, v_{itk}\in [0,1]$. $M$ is a Big-M ...
manofthousandnames's user avatar
1 vote
1 answer
45 views

Converting a function composing of multipe pieces into a linear equation

I have a variable (alpha) which depends on some other binary variables, denoted as X_i. So, for some combination of other variables, alpha may take a value (Beta_j). I added some auxillary variables (...
Sam's user avatar
  • 97
1 vote
1 answer
88 views

How to model $\max\limits_{x\in X} \min\limits_{y\in Y} \max\limits_{z\in Z} f(z)$ as single MILP

I have the following optimization problem: \begin{align*} \max\limits_{x\in X} &\min\limits_{y\in Y} \max\limits_{z\in Z} & f(z) \\ &\text{such that} & (x, y, z)\in P \end{align*} ...
graphtheory123's user avatar
1 vote
1 answer
89 views

Linearizing a quadratic constraint

I am working on a quadratic conic optimization problem, but I have discovered that it would be preferable if the quadratic constraint is linearly approximated. In other words, I need some way to make ...
Mikkel Honningsvåg Sandhaug's user avatar
0 votes
2 answers
126 views

Converting a piecewise function to linear equations

I am trying to build a MILP model. In this model, I have a dependent variable (alpha) that its value depends on the value of some other variables (or different combination of some other variables). In ...
Sam's user avatar
  • 97
-1 votes
1 answer
74 views

How to linearize a product of an integer and a binary variable

i have this constraint right here, which is not linear. How would i linearize such a product. $number_t$ is a positive integer and $new_t$ and $reset_t$ are binary. $$number_t = (number_{t-1}+new_t)\...
Uni ewr's user avatar
  • 71
2 votes
1 answer
251 views

Replace the constraint using ==> by a linear formulation

I would like to know how to express the continuity constraint without using a decision variable in the conditional form. My challenge is to stay with a linear formulation. I will start to explain my ...
Basma Ben Mahmoud's user avatar
1 vote
1 answer
141 views

How do I linearize such a constraint?

I was wondering, how one would linearize such a constraint, to make it applicable to LPs. $ a_{i}=(a_{i-1}+b_{i})(1-c_{i})-d_{i}$ $a_i$ gives information of the number of assigned jobs to machine $i$. ...
manofthousandnames's user avatar

15 30 50 per page
1
2 3 4 5
7