How do I add KKT conditions, dual feasibility constraints into the primal model using Pyomo or Julia?

679 views Asked by At

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:

  1. How do I add the dual of certain constraints to the objective function?
  2. 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.

1

There are 1 answers

2
Erwin Kalvelagen On

For Pyomo consult the packages pyomo.bilevel (link) and pyomo.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).