9
votes
Accepted
Determining the optimize lambda in Multi-Objective Optimization
There is no mathematical way to derive (or justify) a value for $\lambda$. The justification has to be made in the context of a specific problem and a specific (reasonably credible) decision maker. ...
8
votes
Determining the optimize lambda in Multi-Objective Optimization
Another approach could be generating the Pareto Frontier, solving the problem several times for different values of lambda, using a Weighted sum algorithm (see this or this).
7
votes
Translate LP format to Numpy matrices
As has been discussed in the comments already, your suggested workflow is more complicated than it needs to be without providing any advantages. Gurobi is perfectly capable of handling LP files and if ...
7
votes
Mixed integer quadratic programming (MIQP) in CVXPY
What you described is a problem for which every variable is semicontinuous. In mixed integer programming, the variables are $(x,y)\in\mathbb{Z}^{n_1} \times \mathbb{R}^{n_2}$. For (pure) integer ...
7
votes
Determining the optimize lambda in Multi-Objective Optimization
In addition to the above answers, there's good deal of discussion here. One of the experts logically breaks down some key questions like avoiding dominating solution by sticking to single combination ...
6
votes
Simple OLS problem can only be solved in SCS. Is the dual infeasible?
Mosek does not fail. Mosek says the problem is dual infeasible which means if the problem has solution, then it is unbounded. In fact Mosek has a quite good certificate for that.
Since your problem ...
6
votes
Matrix Singularity Constraint
No, it is an intrinsically non-convex constraint. Just take a diagonal matrix, and the feasible set would be the coordinate axes, i.e. nonconvex and highly ill-conditioned as the feasible set has ...
6
votes
Adding CVXPY abs to optimization problem turns out to be non-DCP
I think you want cp.norm1(beta - s), with no need for abs. This is DCP-compliant.
Taking separate norms of ...
6
votes
Accepted
Constraints like "max(column a + column b) == 2" are not DCP
Not sure if it is DCP, but you can write it as a quadratic constraint:
$$\sum_k z_{k,i} z_{k,j} \ge 1$$
You can also linearize as follows:
\begin{align}
\sum_k x_{k,i,j} &\ge 1 \\
x_{k,i,j} &\...
5
votes
Portfolio optimization with indicator function constraint in CVXPY
I assume that $w_i$ is a continuous variable with $0 \le w_i \le 1$ and $w_i^\text{start}$ is a constant with $0 \le w_i^\text{start} \le 1$.
You want to enforce $$|w_i-w_i^\text{start}| > 0 \...
4
votes
Accepted
Is not the substitution method supposed to reduce the computation cost?
If you have a long equality constraint $x=\sum_j a_j y_j$ and $x$ appears multiple times in your model, performing the substitution can greatly increase the number of nonzero coefficients in the ...
4
votes
Accepted
How to solve this mixed integer quadratic program using cvxpy or other method?
Maybe work with a slightly different objective. Basically, you want:
$$ A_{i j}^l / A_{j +l}^l \approx D_{i j}^l / D_{ijH}^l $$
You could do:
$$ \min \sum |A_{i j}^l - A_{j +l}^l \cdot D_{i j}^l / D_{...
4
votes
Accepted
Directly calling gurobipy API causes substantially longer runtime than calling cvxpy
As others have pointed out already, you are not solving the same instances. When writing out the MPS files using a gurobi.env file containing ...
4
votes
Directly calling gurobipy API causes substantially longer runtime than calling cvxpy
Note that the model fingerprint differs. I suspect that the variable or constraint orders are different.
4
votes
Accepted
Maximizing a Ratio/Percent
CVXPY makes this easy to do, using its disciplined quasiconvex programming (DQCP) capability.
An example is provided at https://www.cvxpy.org/examples/dqcp/concave_fractional_function.html . ...
4
votes
Practical open source LP solvers for large linear programming problem with $10^7$ parameters
If you can't find (or can't afford) a solver that will handle a problem with that many nonzero matrix coefficients, and if your problem has a structure that fits one of the following methods, you ...
3
votes
How to represent the objective function of the Weapon Target Assignment problem in CVXPY?
Now
$$
\begin{array}{rcl}
t_j & \geq & \prod_{i=1}^m (1-p_{ij})^{x_{ij}} \\
& = & exp(\ln(\prod_{i=1}^m (1-p_{ij})^{x_{ij}})) \\
& = & exp(\sum_{i=1}^m x_{ij} \ln(...
3
votes
How to represent the objective function of the Weapon Target Assignment problem in CVXPY?
TLDR: This can be formulated and solved in CXVPY with Mosek as solver, as a Mixed-Integer (generalized) Geometric Programming problem, using CVXPY's Disciplined Geometric Programming (DGP) capability. ...
3
votes
Accepted
Is solving a quadratic programming optimization problem using python slower than C++?
As far as I know, the core of almost all of the optimization solvers has been written in C/C++ and other their available APIs are playing as a thin layer to exchange information on the both sides, ...
3
votes
Accepted
Impose binary constraint on integer matrix with CVXPY
Set boolean=True for the matrix variable P, and use the constraints you have proposed.
3
votes
Accepted
Make Optimization term fit into DCP rules
Formulation (7) on p. 6 of the linked paper is very explicitly linear in the matrix variable M and the newly introduced matrix variable ...
3
votes
Geometric Programming with Simple Affine Equality Constraint
You might be able to use the suggestions in
https://docs.mosek.com/modeling-cookbook/expo.html#geometric-programming
to convert your problem to a conic optimization problem. It might also make it ...
2
votes
DCP formulation of sum of nonconvex and convex functions
For all $c>0$ the function of one variable $$g(x)=c^{x/L}\cdot L - \ln(c)\cdot x=\exp(\ln(c)x/L)\cdot L-\ln(c)\cdot x$$ is convex increasing on $x\geq 0$ (derivative check) and DCP representable (...
2
votes
Constraint raises DCP Error
After a few hours extra deliberation and and working on the problem, I was able to figure out the reason.
It was as I thought initially and my calculation for my ...
2
votes
Accepted
Does the cvxpy replace the max function by MIP formulation under the hood?
No. Firstly you should use cp.maximum instead of cp.max. Secondly, it is converted to a convex programming problem (LP in this ...
2
votes
Does the cvxpy replace the max function by MIP formulation under the hood?
Natively I am not sure since solvers that come do not have MIP capability
Scroll down for list of solvers
And this link to source code max seems to suggest it uses max function.
2
votes
Is solving a quadratic programming optimization problem using python slower than C++?
Agree with Omidi.
One need to timeit and test timing of model loading/updating using one or two constraints using loops. Like Numpy/pandas in python allows vars to be listed in array/dataframe. That ...
2
votes
Accepted
Simulating an integer quadratic knapsack problem
The constraints are fine.
Per the CVXPY "Choosing a solver" table, neither GLPK_MI nor SCPY support QP. You need a solver in that table having an X in both the QP and MIP columns.
The error ...
2
votes
Optimal blending of gasoline via LP
The key is in the last sentence: nothing is lost in blending. So the combined amount of crude 1 and crude 2 used to make super equals the amount of super produced, and so on.
1
vote
Simple OLS problem can only be solved in SCS. Is the dual infeasible?
Also don't think the other_constraint is required. If first constraint & variable declaration constrain the following
$x$ is non negative and $ \sum_i x_i = 1$. So all $X$s will be $\le$1 anyway.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cvxpy × 30optimization × 10
python × 10
convex-optimization × 10
mixed-integer-programming × 9
linear-programming × 7
disciplined-convex-programming × 7
quadratic-programming × 6
gurobi × 5
integer-programming × 2
cplex × 2
reformulation-linearization × 2
finance × 2
solver × 1
constraint × 1
linearization × 1
constraint-programming × 1
binary-variable × 1
nonconvex-programming × 1
inventory × 1
duality × 1
indicator-constraints × 1
c++ × 1
assignment-problem × 1
multi-objective-optimization × 1