As of May 31, 2023, we have updated our Code of Conduct.
11 votes
Accepted

Solver for convex optimization with exponent in the objective function

You are missing some details for the claimed convexity of $f(x)$. I will assume that you meant to say convex on the domain $C+mx+\frac{s}{x+t} \geq 0$ and $x+t \geq 0$. In this case the epigraph of $f(...
Henrik Alsing Friberg's user avatar
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. ...
prubin's user avatar
  • 36.4k
8 votes
Accepted

How to solve this linear program with an exponential number of constraints?

For each $k\in\{1,\dots,n\}$, you want the sum of the $k$ smallest $f_i(x)$ to be at least $\sum_{j=1}^k b_j$. Equivalently, you want the sum of the $n-k$ largest $f_i(x)$ to be at most $\sum_{i=1}^n ...
RobPratt's user avatar
  • 28.1k
8 votes
Accepted

How to find the index of the item, the first time appears?

Here's a formulation if at least one $x_i$ must be $1$: \begin{align} \sum_i y_i &= 1 \tag1\label1\\ y_i &\le x_i &&\text{for all $i$} \tag2\label2\\ y_i &\le 1-x_j &&\text{...
RobPratt's user avatar
  • 28.1k
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).
Enrique Gabriel Baquela's user avatar
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 ...
Sutanu's user avatar
  • 3,091
7 votes

How to find the index of the item, the first time appears?

Suppose the index is 1-based and set constant $u_0 = 0$. With binary variables $u_i, y_i, i=1,\dots,n$ and constraints $$ \begin{align} u_i &\geq x_i\\ u_i &\geq u_{i-1}\\ u_i &\leq x_i + ...
xd y's user avatar
  • 1,016
6 votes

Minimize sum of ReLU

Introduce nonnegative variables $y_i$ and minimize $\sum_i y_i$ subject to linear constraints $$y_i \ge v_i \cdot x + b_i$$
RobPratt's user avatar
  • 28.1k
6 votes

Solver for convex optimization with exponent in the objective function

Use Ipopt and a modeling language. For example, JuMP: https://jump.dev/JuMP.jl/stable/tutorials/nonlinear/introduction/ ...
Oscar Dowson's user avatar
5 votes

Solver for convex optimization with exponent in the objective function

Best way is to apply log to the function as optimal solution to log of a function is the same for the function. $ \log f = p[\log (C(x+t)+ mx(x+t)+s)-\log(x+t)]$ Then you have to get the actual ...
Sutanu's user avatar
  • 3,091
5 votes

Is it possible to express these constraints with basic cones?

Let $x_i = \frac{z_i}{y_i}$. Then, presuming $x_i$ does not appear in any of the other constraints, this appears to be a Generalized linear-fractional programming problem per section 4.3.2 "...
Mark L. Stone's user avatar
5 votes
Accepted

Projection to sublevel sets of convex/strongly convex function

The projection can be written as a convex optimization problem \begin{align*} \Pi_{X_{\alpha}}(\bar{x}) \in \arg\min_{x} \quad & \| x - \bar{x} \|\\ \text{s.t.} \quad & f(x) \leq \alpha \end{...
mtanneau's user avatar
  • 3,998
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_{...
Erwin Kalvelagen's user avatar
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 ...
RobPratt's user avatar
  • 28.1k
4 votes

When is $\max_x\{f(g(x))\} = f(\max_x\{g(x)\})$?

A sufficient condition for $\max_x\{f(g(x))\} = f(\max_x\{g(x)\})$ is that $f$ is a monotone increasing function on the range of $g$. This is also sufficient condition for $\min_x\{f(g(x))\} = f(\...
Henrik Alsing Friberg's user avatar
3 votes

How to deal this L0 norm of a vector of L2 or L1 norms in objective?

You can introduce binary variables $\mathbf{z}\in \lbrace 0, 1 \rbrace^n$ (where $n$ is the dimension of $\mathbf{b}$) together with the constraints $b_i \le M_i z_i,$ where $M_i$ is an upper bound ...
prubin's user avatar
  • 36.4k
3 votes

Does solver take advantage of the problem structure?

Assuming you're talking about the time required to build the model: Let's time your two approaches first inside an iPython shell via the %%timeit magic command. ...
joni's user avatar
  • 1,402
3 votes

Does solver take advantage of the problem structure?

Probably the content here will be helpful. Using for-loop outside of the gurobi native construct is slightly faster.
Sutanu's user avatar
  • 3,091
3 votes
Accepted

How to formulate the inequality constraint $\sqrt{x^2+y^2} \leq z$ using gurobipy?

Thanks to the Gurobi staff, this is how to formulate it using the norm constraint: ...
Hussein Sharadga's user avatar
3 votes

Constrained Optimization Closed Form Solution Using KKT Gives Wrong Values

For convenience, let $x_j = \gamma_j / n$, $c_j = \gamma_j^\mathrm{priority} / m$, then the problem is $$ \begin{align*} \min_{x_j} \quad&\sum_{j=0}^m(x_j - c_j)^2\\ \mathrm{s.t.} \quad&0\leq\...
xd y's user avatar
  • 1,016
3 votes

Number of solutions to geometric program

This is a follow-up to the post of Mark Stone. The problem can be formulated in a conic form using https://docs.mosek.com/modeling-cookbook/expo.html#geometric-programming and solves quite well on ...
ErlingMOSEK's user avatar
  • 2,826
3 votes
Accepted

Number of solutions to geometric program

I general, you can't determine infeasibility or unboundedness by the structure. But, if after change of variables to convex form, the objective is strictly convex, the solution, if it exists, is ...
Mark L. Stone's user avatar
3 votes
Accepted

Sensitivity analysis for decision vectors in convex programming

Suppose that $F: R^{n} \rightarrow R^{n}$, $F(x)=b$, and $F$ is differentiable at $x$ with non-singular Jacobian $J(x)$. Then to first order, we can use the Jacobian to find a change $\Delta x$ due ...
Brian Borchers's user avatar
3 votes

Rational LP, its Rational solution and a minimum precision

Finding $N_{common}$ seems equivalent to finding a column scaling such that the optimal solution is integer-valued. Surely, if you want to do this without knowledge of the optimal solution, you are ...
Henrik Alsing Friberg's user avatar
2 votes

Convex optimization with linear constraints. Can I solve it analytically?

You are going to be dealing with various cases depending on the values of $c,d,ab$ and $m.$ I think I can get you part way, but I have not dealt with all the cases. Given that the objective function ...
prubin's user avatar
  • 36.4k
2 votes

On a clarification on usage of inequalities in convex programming

Since you requested a reference I suggest you look into Convex Optimization by Boyd and Vandenberghe. In Section "4.2.1 Convex optimization problems in standard form" you can see that they ...
Henrik Alsing Friberg's user avatar
2 votes

How to find the index of the item, the first time appears?

If number is non-binary, say non negative continuous number $c$, introduce a vector of binary $y_i$ initialized to 0. Have two binary variables $z_1 \ and z_2$ $c - x_i \le My_{i}$ $x_i - c \le M(1-y_{...
Sutanu's user avatar
  • 3,091
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 ...
xd y's user avatar
  • 1,016
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.
Sutanu's user avatar
  • 3,091
2 votes

Decision Variables becoming Constraints

This structure can arise in multi-objective optimization problems. While it is common for multi-objective problems to express each objective function directly in terms of the same variables, there can ...
prubin's user avatar
  • 36.4k

Only top scored, non community-wiki answers of a minimum length are eligible