I am new to Optimization so I think the following question may be very easy, but I'm not sure how to solve it.

The dual of an LP is an LP. If we solve the dual LP, we can get the optimal value for the primal problem. But:

  1. How do we get the optimal decision variables for the primal?

  2. Does it make a difference if we only relax some of the constraints?

My Work for Finding Dual of LP

\begin{align*} &\text{min } &c^Tx \\ &\text{s.t. } &Ax = b \\ &&Bx \le d \\ \end{align*}

We form the Lagrangian ($\mu \ge 0$): \begin{align*} L(x, \lambda, \mu) &= c^Tx + \lambda^T (Ax - b) + \mu^T (Bx - d) \\ &= (c + A^T \lambda + B^T \mu)^Tx - \lambda^Tb - \mu^Td \end{align*}

Thus we see that the dual function is $$d(\lambda, \mu) = \inf_x L(x, \lambda, \mu) = \begin{cases} - \lambda^Tb - \mu^Td \ \ \ &\text{if } \ \ \ c + A^T \lambda + B^T \mu = 0 \\ - \infty & \text{otherwise} \end{cases}$$ and therefore the dual problem is \begin{align*} &\text{max } &-\lambda^Tb - \mu^Td \\ &\text{s.t. } &c + A^T \lambda + B^T \mu = 0\\ \end{align*}

  • $\begingroup$ @Rob Thanks for the suggestion. Your link answers the question of how to find the dual; but I know how to do this, as I demonstrated in the OP. My question is about how to deduce the primal solution from the dual solution. $\endgroup$
    – Helix
    Aug 23, 2022 at 15:28
  • $\begingroup$ Please note that there are some answers here: stackexchange.com/… - and you are allowed to answer your own question. $\endgroup$
    – Rob
    Aug 23, 2022 at 17:09
  • $\begingroup$ Cross-posted: math.stackexchange.com/questions/4517235/… $\endgroup$
    – RobPratt
    Aug 24, 2022 at 3:15

2 Answers 2


The duals or shadow prices of the dual model give you a primal solution. See http://yetanothermathprogrammingconsultant.blogspot.com/2022/08/primal-dual-and-equilibrium-format-of.html for a simple example.

  • $\begingroup$ Is this your website? If so, that should be disclosed. (kudos to you if it is yours, looks good!) $\endgroup$ Aug 23, 2022 at 22:55
  • 5
    $\begingroup$ Clearly, this is a website of Erwin and that is not hidden. See his SE profile. $\endgroup$ Aug 24, 2022 at 9:17

an intuitive transformation

I'm also interested in this problem. I think the transformation between the dual solution and the primal solution must be related to KKT conditions, so I give my intuitive solution.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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