Description
The KKT conditions generated for a inner problem with a well-defined objective equation (defobj) need to be the same as if the objective is not defined explicitly. Contributor: Jan-H. Jagla, November 2009
Small Model of Type : GAMS
Category : GAMS Test library
Main file : empbp04.gms
$title Bilevel model with and without explicitly defined objective equation (EMPBP04,SEQ=465)
$onText
The KKT conditions generated for a inner problem with a well-defined
objective equation (defobj) need to be the same as if the objective is not
defined explicitly.
Contributor: Jan-H. Jagla, November 2009
$offText
variables x, y, obj;
equations upper, lower, defobj;
upper.. y =g= x;
lower.. y =g= -x;
defobj.. obj =e= y;
model implicit /upper,lower/;
model explicit /all/;
x.lo = -2;
x.l = x.lo;
y.l = 2;
lower.m = EPS;
execute 'echo FileName explicit.gms > jams.opt';
execute 'echo bilevel min obj y defobj lower > "%emp.info%"';
explicit.optfile = 1;
solve explicit using emp min x;
execute 'echo FileName implicit.gms > jams.op2';
execute 'echo bilevel min y lower > "%emp.info%"';
implicit.optfile = 2;
solve implicit using emp min x;
execute 'diff -bw explicit.gms implicit.gms'
abort$errorlevel 'explicit.gms and implicit.gms differ';