I am using cvxpy to maximize a function f(x) given the constraints -1 <= x <= 1. Let's call the solution x0. Now, I define a region around the optimal value f(x0) and want to find another solution x that lies within the defined region and that is maximally different from x0.

The problem statement looks as follows:

constraints = [-1 <= x, x <= 1, f(x) >= f(x0) - eps, f(x) <= f(x0) + eps]

objective_to_maximize = f(x) + cvxpy.norm(x - x0)

However, the cvxpy.norm(x - x0) that is supposed to find a maximally different solution leads to a non-convex problem and therefore a DCP error.

Is there any way to formulate my intention in a disciplined convex way?

Thanks a lot!

  • $\begingroup$ A tip: You can use MathJax to typeset your mathematical formulas. This will make the question much easier to read. $\endgroup$ Mar 11 at 10:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.