Operations Research Asked by user152503 on February 15, 2021
Given $n$ variables $x_{i}$ where $iin [0,n)$, denoted as a vector $x$, given a linear objective function that we want to minimize $c^top x$ with 2 constraints:
How can I solve this optimization problem?
The only thing I can think of is to convert the 2nd constraint to be the product of all $x$ bigger than $1$. I cannot think of a way to turn the 2nd constraint into a ‘common’ quadratic one.
Can anyone share some ideas?
This is a convex optimization problem which can be modeled as a combination of Second Order (SOCP) and Exponential cones.
It is easy to enter into a conic convex optimization tool, such as CVX (MATLAB), CVXPY (Python), CVXR ("R"), or YALMIP (MATLAB), which can call Mosek 9.x, ECOS, or SCS to solve it.
Here is CVX code (note: indices for x
run from 1 to n, because MATLAB vector indexing starts at 1 rather than 0)
cvx_begin
variable x(n)
minimize(c'*x)
subject to
x'*x <= n+1-small_positive_number
sum(log(x)) >= 0
cvx_end
where small_positive_number
is a small positive number such as 1e-6.
If you want sum(log(x))
to be strictly positive, you can use a small positive number, such as 1e-6, instead of 0, on the right-hand side of that constraint.
Answered by Mark L. Stone on February 15, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP