Lagrangian Duality
Learn Lagrangian duality and the primal to dual transformation with examples in this lesson.
We'll cover the following
Lagrangian dual
In optimization theory, the Lagrangian dual is a technique for transforming an optimization problem, also known as a primal problem, into a different problem, called the dual problem, which provides a lower bound on the optimal value of the original problem. The Lagrangian dual is named after Joseph-Louis Lagrange, a famous mathematician who significantly contributed to calculus and mechanics.
Lagrangian function
The Lagrangian dual is obtained by introducing a set of auxiliary variables, called Lagrange multipliers or dual variables, to enforce the constraints of the original optimization problem. The resulting Lagrangian function is a function of the original variables, also known as decision variables and the dual variables. It provides a way to express the original optimization problem as a maximization problem over the space of the Lagrange multipliers.
Note: In mathematical optimization, Lagrange multipliers are a set of coefficients that are introduced to find the maxima or minima of a function subject to constraints. They allow the transformation of a constrained optimization problem into an unconstrained one by incorporating the constraints into the objective function.
Primal to dual transformation
Consider an optimization problem (not necessarily convex) in the standard form as follows:
The Lagrangian for the above problem is defined as follows:
Here, and are dual variables.
The Lagrangian dual function can then be defined as follows:
It can be shown that if , then gives a tight lower bound for the objective of the primal problem.
Note: If the primal problem is convex, then gives the optimal value of the objective of the primal problem.
Example
Consider a primal problem being in LP as follows:
Here, , and . The dual problem can be defined as follows:
The following code in cvxpy
shows that the optimal value for the primal problem can be obtained from the optimal value of the dual problem:
Get hands-on with 1400+ tech skills courses.