I want to get the lagrange multipliers for a solution from cplex. I am using it via Python.

The problem is continuous with a linear objective function and elements of solution vector $x$ are constrained to be in the interval $[0,1]$. Here are the main cplex calls.

my_prob = cplex.Cplex()


x = my_prob.solution.get_values()

$x$ contains the solution. I want to know what function returns the Lagrange multipliers of the solution. I now think the answer is

l = my_prob.solution.get_dual_values()

Can someone please confirm.

  • $\begingroup$ Is your problem an LP? (You specified that the objective was linear but left the constraints unspecified.) If so, by "lagrange multipliers" do you mean the solution to the dual LP? $\endgroup$
    – prubin
    May 1 '21 at 21:11

First of all, you should determine the sign of the multipliers based on the objective function direction and how the complicating constraints are violated. Then you have to use a standard method like subgradient optimization to solve the lagrangian dualized problem to determine the optimal value of the multipliers. For more details:

  • Marshall L. Fisher, An applications-oriented guide to lagrangian relaxation, Interfaces 15(1985), no. 2, 10-21.
  • Richard Kipp Martin, Large scale linear and integer optimization; a unified approach, Kluwer,1999.
  • Fundamentals of Supply Chain Theory by Lawrence V. Snyder.
  • $\begingroup$ I looked at this. - do you think this is correct ? stackoverflow.com/questions/66827883/… $\endgroup$
    – Dom
    May 1 '21 at 18:09
  • $\begingroup$ @Dom, I think you should start with an algorithm to optimize the Lagrangian dualized such as the subgradient method, etc. Some times the multipliers are set either zero or equal to the marginal value of the complicating constraint at the start of the algorithm. I hope it helps. $\endgroup$
    – A.Omidi
    May 1 '21 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.