Can I solve bilevel optimization problems in Gurobi?
AnsweredLet us say we are trying to solve this problem [Source],
For example, in GAMS, this can be solved as :
Positive Variables x, y1, y2;
Variables objout, objin;
Equations defout, defin, e1, e2, e3, e4;
defout.. objout =e= sqr(x-1) + 2*sqr(y1) - 2*x;
defin.. objin =e= sqr(2*y1-4) + sqr(2*y2-1) + x*y1;
e1.. 4*x + 5*y1 + 4*y2 =l= 12;
e2.. - 4*x - 5*y1 + 4*y2 =l= -4;
e3.. 4*x - 4*y1 + 5*y2 =l= 4;
e4.. - 4*x + 4*y1 + 5*y2 =l= 4;
Model bard / all /;
$echo bilevel x min objin y1 y2 defin e1 e2 e3 e4 > "%emp.info%"
solve bard use emp min objout;
Is there an equivalent solver for Gurobi?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
No, Gurobi does not support bilevel programming. In rare cases, you can translate a bilevel program into a single-level program and then solve this with Gurobi. But in general, bilevel programming is not supported by Gurobi.
3 -
@Tobias Achterberg In the case provided here (I guess it is one of your "rare" cases) of QP inner and outer, the KKT conditions for the inner will be an LP other than the complementarity condition, which can be expressed as mixed-integer linear (using Big M) or LP + indicator constraints. So altogether, the outer + KKT for inner can be expressed as single-level MIQP or QP with indicator constraints. So this should be doable in Gurobi.
1 -
Thank you @Tobias and @Mark. I am trying to re-write the bi-level programs as a single level program which will let Gurobi solve it.
0
Post is closed for comments.
Comments
4 comments