# How do you get the primal solution of an LP from the dual solution?

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*}

• @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. Aug 23, 2022 at 15:28
– Rob
Aug 23, 2022 at 17:09
• Cross-posted: math.stackexchange.com/questions/4517235/… Aug 24, 2022 at 3:15 