2

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.

AliRa
  • 51
  • 6

1 Answers1

1

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).

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
  • thanks for taking the time to comment on my issue. I have actually reviewed several of these packages in both Python and Julia(BilevelJuMP.jl ...); however, in most cases, these packages did everything to the solution themselves. I would need to take these optimality conditions myself and perhaps modify them by some criteria and then add them to the primal. Perhaps possibly having a series of functions that would give us all such constraints would be ideal for this need: dualConstraints(..) strongDuality(..), KKT(..), each function taking a model object. – AliRa Nov 24 '20 at 18:09
  • unlike the Julia package I just mentioned and EMP solver in GAMS which somehow provide a way to use the dual of certain lower-level constraint, it seems however that Pyomo does not provide such an option. Do you have any idea about that? – AliRa Nov 24 '20 at 19:19