cvxgrp / dccp

A CVXPY extension for convex-concave programming
123 stars 31 forks source link

DCCP-Compatible Solvers #74

Open aleolivero opened 2 years ago

aleolivero commented 2 years ago

I'm new to optimization and above all, with DCP y DCCP, I want to consult, what solvers are compatible with the DCCP rules, are all compatibles?

For example, I'am working in a problem where only Gurobi can find the solution, all other solvers fail at some point

And, the only contrains that made the problem DCCP is

Affine <= Convex

The rest of the problem is linear

With DCCP, some solver is more efficient than others? There a list with compatible solvers?

and the last question a solver Couenne can work with cvxpy and DCCP?

sorry if any question is dumb

xinyueshen commented 2 years ago

Hi @aleolivero thank you for your interest in DCCP. For your problem, most of the solvers compatible with CVXPY should be compatible with DCCP, but it may depend on the convex function in the constraint Affine <= Convex. Numerical solver failures can happen, and some solvers may be more efficient than others depending on the specific problem, so the suggestion is that you try different solvers such as ECOS, SCS, OSQP, MOSEK, Gurobi, and see which one works the best numerically. Also, since the other part of your problem is linear, you may try setting the parameter tau to a larger value such as 1 by

problem.solve(method='dccp', tau=1)

It might give you a better performance numerically.

I think solver Couenne is independent of cvxpy and DCCP.

aleolivero commented 2 years ago

Hi! @xinyueshen, thanks for your answer and your time. If the information is useful, the only convex function in the constraint Affine <= Convex is cp.pos() On the other hand, i'm trying the parameter tau = 1 but i dont have results with some solvers (Mosek, ECOS), i'm still trying with anothers!.

stephenpboyd commented 2 years ago

Is there ONE constraint of the form affine_1 <= max(0,affine_2) ?

I guess not. But if so, you can solve the problem globally very easily: (1) solve the problem with constraint affine_1 <= 0, affine_2 <=0; (2) solve the problem with affine_1 <= affine_2, affine_2 >=0. The smaller objective of these is the global solution.

On Jan 31, 2022, at 5:40 AM, aleolivero @.***> wrote:

Hi! @xinyueshen https://github.com/xinyueshen, thanks for your answer and your time. If the information is useful, the only convex function in the constraint Affine <= Convex is cp.pos() On the other hand, i'm trying the parameter tau = 1 but i dont have results with some solvers (Mosek, ECOS), i'm still trying with anothers!.

— Reply to this email directly, view it on GitHub https://github.com/cvxgrp/dccp/issues/74#issuecomment-1025749827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT4UNVEFPYUHK47EUES5OTUY2GLBANCNFSM5NAVUCQQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.

aleolivero commented 2 years ago

Hi @stephenpboyd ! thanks for your time and your help!, For now, the problem has one constrain with that form, the rest of the constrains have the form affine==affine... I will try to apply the constrains as you have explained! Again thanks so much for your time

stephenpboyd commented 2 years ago

Cool. It’s much better to solve just two convex problems and know that you’ve found the global optimal point, rather than using DCCP, which is a heuristic.

On Jan 31, 2022, at 2:31 PM, aleolivero @.***> wrote:

Hi @stephenpboyd https://github.com/stephenpboyd ! thanks for your time and your help!, For now, the problem has one constrain with that form, the rest of the constrains have the form affine==affine... I will try to apply the constrains as you have explained! Again thanks so much for your time

— Reply to this email directly, view it on GitHub https://github.com/cvxgrp/dccp/issues/74#issuecomment-1026277840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT4UNWJI2IRSIQOPHFHZSLUY4ESXANCNFSM5NAVUCQQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.