I've to model certain bilevel problems. The approach is to delete the second level problems by replacing them with their KKT conditions or replacing them with their optimality conditions, such as strong duality ... I wish to do this automatically without calculating these conditions myself and hardcoding them back to the primal. I have two main issues I would like to have your assistance about:
- How do I add the dual of certain constraints to the objective function?
- Are there any ways for me to do what I want, and if not, where can I start to write them so that eventually they get the primal model and return a model with primal, dual constraints, and strong duality or KKT conditions? I guess getting the constraints and manually form the dual problem could be the right approach.
I really appreciate any help you can provide, no matter whether this would be in Julia or Pyomo.
For Pyomo consult the packages
pyomo.bilevel
(link) andpyomo.mpec
(link). I usually prefer to reformulate by hand just so I know what is happening (and use a tool to confirm I did it correctly).