1

I have an optimization problem that I'd like to solve in python. The objective function is NOT convex everywhere. I thought I'd use CVXPY, but any other package in python is welcome. Here is the problem:

Minimize p(x_1) + p(x_2) + ... + p(x_n)

Subject to:

i. 0 <= x_i <= 1 for all i

ii. x_1 + ... + x_n = 1

Where p(x) is a polynomial penalty function. My current function is p(x) = x^3(1-x)^2(x+2).

Remarks:

a. The minimum is obtained whenever one of the variables equals 1, and the others equal zero

b. I am interested in the optimizer correctly identifying such a minimum. I am NOT interested in identifying all minimums. I am just seeking an optimizer capable of identifying one minimum.

c. As you can see here (https://www.wolframalpha.com/input?i=x%5E3%281-x%29%5E2%28x%2B2%29+second+derivative), the function p(x) is convex in the intervals [0, 0.37] and [0.85, 1] and concave between [0.37, 0.85] .

d. I plan to code this project in python.

e. Many thanks for your help!

user35083
  • 11
  • 1
  • CVXPY is for convex problems only. (The letters CVX give that away). – Erwin Kalvelagen Jul 03 '22 at 19:33
  • Thank you! :) Do you know of a solver who can solve my problem above? – user35083 Jul 04 '22 at 11:35
  • You could try a local NLP solver (it worked for me on your problem). The non-convexities are somewhat benign. But in case of trouble, you can try with different starting points to give some confidence we are not in a local minimum (in this specific cases you know the global minimum). A more rigorous approach would be to use a global solver. – Erwin Kalvelagen Jul 05 '22 at 16:57
  • Thank you! Is there any solver in particular that you use or recommend for this problem? Note that the only set of points ( x_1,…,x_n) simultaneously satisfying p’(x_i) = 0 for all x_i AND 0<= x_i <= 1 for all x_i AND x_1 + … + x_n is a global min for this problem. ( ie one value x_i equal to 1 and the others zero ) – user35083 Jul 06 '22 at 19:29

0 Answers0