# Questions tagged [cvxpy]

CVXPY is a Python-embedded modeling language for convex optimization problems.

41 questions
Filter by
Sorted by
Tagged with
1 vote
33 views

### Penalize absolute value while keeping the problem DPP (CVXPY)

I am trying to implement the objective function max a . x + c . abs(x - g). where all elements of c are non-positive, ...
• 21
122 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\}$
• 403
1 vote
112 views

108 views

• 63
145 views

### Does Gurobipy exploits sparsity of the optimization problem?

What happens when a (sparse) csr matrix / array is submitted to Gurobi (via Cvxpy framework in python). Does it exploit the sparsity Information about the matrix or ...
• 470
222 views

### Geometric Programming with Simple Affine Equality Constraint

Consider a Geometric Program (GP),  \begin{array}{cl} \operatorname{minimize} & f_{0}(x) \\ \text { subject to } & f_{i}(x) \leq 1, \quad i=1, \ldots, m, \\ & g_{i}(x)=1, \quad i=1, \...
• 215
229 views

### Constraints like "max(column a + column b) == 2" are not DCP

I am struggling with the following constraint on a minimization problem cvx.max(z[:, i] + z[:, j]) == 2 where z is a Boolean ...
• 900
382 views

### Translate LP format to Numpy matrices

We have a large-scale optimization problem (~10K vars and ~10K constraints) in the form of LP format file (generated using Cplex ...
• 470
460 views

### Adding CVXPY abs to optimization problem turns out to be non-DCP

I have tried to solve an optimization problem using CVXPY library. This problem aims to minimize the distance between a vector of $n$ variables ($\beta$), which can be positive or negative real ...
• 39
1 vote
86 views

### Convex Optimization with Variable Dependency / no unmet demand carry forward

I'm running into an issue with a Linear Optimization Problem. The ultimate goal is to come back with an optimal production quantity (prod_qty) across several items ...
• 11
162 views

### DCP formulation of sum of nonconvex and convex functions

I am trying to find a DCP formulation for the following convex objective function (using CVXPY): Let $x$ be the $N$-dimensional vector variable on which we optimize on, $c$ be a known scalar value ...
• 41
158 views

### Constraint raises DCP Error

I have defined a problem which will minimize the cost of to run a pump. That is defined as the objective of the problem. ...
428 views

### Practical open source LP solvers for large linear programming problem with $10^7$ parameters

I have an LP problem of the form $\min\ c^Tx$ subject to $Ax\leq b$ where $x$ consists of 30 million parameters and $A$ is a very very sparse matrix of size 30M by 30M (with only 3 ones per row). I ...
• 151
1 vote
174 views

### Optimization Multiple Constraints

I am trying to solve a linear algebra problem: an optimization problem and I am using CVXOPT. I've split the problem into 3 components In its simplest form, The general formulation for CVXOPT is \...
• 173
1 vote
378 views

### Minimum trade size in CVXPY

I'm trying to replicate some of the suggestions of this paper. On page 40-41, it's made the following suggestion when it comes to enforcing a minimum trade size: In this context, ...
• 119
2k views

### Impose binary constraint on integer matrix with CVXPY

So I have the following matrix: $$P_{i,j}= \begin{bmatrix} x_0 & x_1 & x_2 \\ y_0 & y_1 & y_2 \\ z_0 & z_1 & z_2 \end{bmatrix}$$ where ...
• 293
247 views

### Matrix Singularity Constraint

I'm using CVXPY. Given a $2\times2$ matrix $A$, is it possible to add a singularity constraint? Anything equivalent to: $|A| = 0$: The determinant is $0$ $\operatorname{rank}(A) \leq 1$ Smallest ...
• 195
409 views

• 157