Lagrangean duality: Difference between revisions

From Cornell University Computational Optimization Open Textbook - Optimization Wiki
Jump to navigation Jump to search
Line 59: Line 59:




The verification of gaps is a convenient tool to check for optimality solutions. The illustration shows that the weak duality has the gap whereas the strong duality does not. Thus, the strong duality only holds true if the duality gap is equal to 0.<br /><br /><br /><br />
The verification of gaps is a convenient tool to check for optimality solutions. The illustration shows that the weak duality has the gap whereas the strong duality does not. Thus, the strong duality only holds true if the duality gap is equal to 0.<br /><br /><br />


==Complementary Slackness==
==Complementary Slackness==

Revision as of 22:15, 12 December 2021

Authors:

Mariet Kurtz, Jerome Terrell, Sonam Tharkay, Ashley Turke, Daniel Yeung

(SYSEN5800 Fall 2021)

Introduction

Origins of the Lagrangian dual is part of a broader concept known as Duality. The theory of duality occurred as part of an intellectual debate and observation amongst Mathematicians, and colleagues, John von Neumann and George Dantzig. During World War II, a discussion occurred where Dantzig began sharing his theory on linear programming, and his simplex method. Neumann quickly surmised that Dantzig's Linear Programming shared an equivalence with his Game Theory and Expanding Economy model. Neumann then began conceptualizing the theory of using an alternate perspective, the dual problem. In which, solving for either the primal or dual would yield an optimal solution. Later that year in 1947 Neumann would formally publish his theory of Duality. This principle would then see several formulations and implementations such as Fenchel, Wolfe, and Lagrangian[1].

The Lagrangian dual has become a common approach to solving optimization problems by constructing the Lagrangian function of the problem and solving the dual problem instead of the primal problem. Optimization problems can be reformulated by taking the Lagrangian and its corresponding gradient to find the optimal value of the optimization problem’s variables. These values are then substituted back into the Lagrangian and the dual problem is constructed by reformulating the optimization problem in terms of a different set of variables (dual variables).

Should it prove difficult to find a solution using the dual problem, Lagrangian relaxation can be utilized instead. This is when an approximation can be determined by using Lagrangian multipliers to add a penalty to constraint violations. The advantage of performing Lagrangian relaxation is that in many situations it is easier to solve the dual than the primal problem.[2] For example, non-convex problems are generally more difficult to solve than convex problems. By reformulating the primal optimization problem into the Lagrangian dual problem, a difficult non-convex problem can oftentimes be turned into an easier convex problem.[3]

Algorithm

Generalization of a typical optimization problem:

Optimization Problem (in Standard Form):

The Lagrangian for the optimization problem above takes the form:

where and are the Lagrange Multipliers (dual variables).[4]

Let the dual variables be non-negative.

The Gradient of the Lagrangian is set equal to zero, to find the optimal values of ().

The Lagrangian dual function () equals the Lagrangian with values substituted out.

The Lagrangian dual optimization problem can be formulated using the following Lagrangian dual function:

At the optimal values of variables , there exists scalar Lagrangian multiplier values where the gradient of the Lagrangian is zero[5]. Hence, solving the dual problem, which is a function of the Lagrangian multipliers () yields the same solution as the primal problem, which is a function of the original variables (). The Lagrangian takes all of the constraints and combines it with the objective function into one larger formula.

Weak and Strong Duality

The strong duality is a concept in mathematical optimization that states the primal optimal objective and the dual optimal objective value are equal. Whereas, in the weak duality, the optimal value from the primal objective is greater than or equal to the dual objective. Thus, in the weak duality, the duality gap is greater than or equal to zero[6].

Illustration of the weak and strong duality[7].







The verification of gaps is a convenient tool to check for optimality solutions. The illustration shows that the weak duality has the gap whereas the strong duality does not. Thus, the strong duality only holds true if the duality gap is equal to 0.


Complementary Slackness

Complementary Slackness implies a relationship between the slackness in primal constraints and the slackness on the dual variable. The Complementary Slackness Theorem can be used to develop a test of optimality for a solution. Slack in corresponding inequalities must be complementary in the sense that it cannot occur simultaneously in both of them thus if the primal is unbounded then the dual is infeasible and vice versa[8]. Complementary Slackness is also used as a tool to find the optimal dual solution when only the optimal primal solution is known[9].


Process

Constructing the Lagrangian dual can be done in four easy steps:

Step 1: Construct the Lagrangian.

Step 2: Take the partial derivatives (gradient) of the Lagrangian with respect to , set each equal to zero, and solve for . The dual variables are non-negative.

Step 3: Substitute terms into the Lagrangian to create the dual function (), which is only a function of the dual variables ().

Step 4: Construct the dual with the dual function () and the new constraints. The dual variables are non-negative.

Numerical Examples

In this section, we will apply the process to solve an example problem.

Construct the Lagrangian dual for the following optimization problem:

 

Step 1: Construct the Lagrangian.



Let the dual variables be non-negative.

Step 2: Take the partial derivatives of the Lagrangian with respect to , set each equal to zero, and solve for .



Step 3: Substitute terms into the Lagrangian to create the dual function (), which is only a function of the dual variables ().

Step 4: Construct the dual with the dual function () and the  new constraints. The dual variables are non-negative.

Applications

The optimal solution to a dual problem is a vector of Karush-Kuhn-Tucker (KKT) multipliers (also known as Lagrange Multipliers or Dual Multipliers), thus the multipliers can be used for nonlinear programming problems to ensure the solution is indeed optimal. Since the Lagrange Multipliers can be used to ensure the optimal solution, Lagrangian duals can be applied to achieve many practical outcomes in optimization, such as determining the lower bounds for non-convex problems, simplifying the solutions of some convex problems meeting the conditions for strong duality, and determining the feasibility of a system of equations or inequalities[10]. The Lagrangian dual is used to compute the Support Vector Classifier (SVC) and effectively provides a lower bound on the objective function, which helps to characterize its solution.[11]

One application where the Lagrangian dual may be applied to find bounds for a complex problem is the symmetric Traveling Salesman Problem. This problem is analytically difficult, but its Lagrangian dual is a convex problem whose optimal solution provides a lower bound on solutions to the primal problem. While the solution to the dual problem may not be feasible in the primal problem, it is possible to use heuristic methods to find a primal solution based on the optimal dual solution[12].

Lagrangian duals have also proven useful in deep learning problems where the objective is to learn optimization problems constrained by hard physical laws. By incorporating duality during the training cycle, researchers can achieve improved results on a variety of problems, including optimizing power flows; optimizing gas compressor usage in natural gas pipelines; transprecision computing, in which the bit width of variables may be reduced to reduce power usage in embedded systems at the cost of increased error; and devising classifiers which are “fair” with respect to a defined protected characteristic[13].

The convex relaxation provided by the Lagrangian dual is also useful in the domains of machine learning[14]; combinatorial optimization, where it generalizes two well-known relaxation techniques in the field, max-stable and max-cut[15]; and 3D registration of geometric data in computer vision, where primal techniques often fail to escape local optima[16]. Lagrangian relaxation is a standard and efficient way to determine the optimal solution of NP-hard combinatorial problems.[17]

In some real-world applications, the dual formulation of a problem has a specific real-world meaning. The following are examples of real-world applications for Lagrangian Duality:

  • In an electrical network, if the primal problem describes current flows, the dual problem describes voltage differences.[18]
  • In an economic model, if the primal problem describes production and consumption levels, the dual problem describes the prices of goods and services.[18]
  • In a structural design model, if the primal problem describes the tension of various beams, the dual problem describes nodal displacements.[18]
  • In a resource allocation model, if the primal problem describes supply as seen by the production manager, the dual problem describes the demand as seen by the supplier. Applying the duality theorem towards both linear programming problems, the production levels and the prices can be set to establish a balance and equilibrium.

Conclusion

Overall, Lagrangian duality is a very useful way to solve complex optimization problems, since it is oftentimes an effective strategy for reducing the difficulty to find the solution to the original problem. The process to find the Lagrangian dual is simple and can be implemented in a wide range of problems. Lagrangian duality is used in a variety of applications, including the traveling sales problem, deep learning models, and computer vision.

References

  1. A Bachem, Marting Grötschel, B H Korte, Mathematical Programming: The State of the Art. Springer-Verlag, 1983.
  2. Claude Lemaréchal, Computational combinatorial optimization: Lagrangian Relaxation, Springer-Verlag, 2001.
  3. S. Boyd, L. Vandenberghe, Convex Optimization, Cambridge University Press, 2009, https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf
  4. S. Wolf, S. M. Günther, An Introduction to Duality in Convex Optimization, Technische Universität München, 2011, https://www.net.in.tum.de/fileadmin/TUM/NET/NET-2011-07-2/NET-2011-07-2_20.pdf
  5. J. Nocedal, S. J. Wright, Numerical Optimization. Springer, 1999.  (PDF at http://link.springer.com/book/10.1007/b98874)
  6. R.J. Vanderbei, Linear Programming: Foundations and Extensions. Springer, 2008.  (PDF at http://link.springer.com/book/10.1007/978-0-387-74388-2)
  7. B. Ghojogh, Illustration of weak duality and strong duality, ResearchGate, https://www.researchgate.net/figure/Illustration-of-weak-duality-and-strong-duality_fig6_355093246
  8. J. Birge, F. Louveaux, Introduction to Stochastic Programming, Springer, 2011. (PDF at http://link.springer.com/book/10.1007/978-1-4614-0237-4)
  9. R.J. Vanderbei, Linear Programming: Foundations and Extensions. Springer, 2008.  (PDF at http://link.springer.com/book/10.1007/978-0-387-74388-2)
  10. S. Wolf, S. M. Günther, An Introduction to Duality in Convex Optimization, Technische Universität München, 2011, https://www.net.in.tum.de/fileadmin/TUM/NET/NET-2011-07-2/NET-2011-07-2_20.pdf
  11. T. Hastie, R. Tibshirani, J. Friedman. The Elements of Statistical Learning, Springer, 2009. (PDF at http://statweb.stanford.edu/~tibs/ElemStatLearn/)
  12. S. Timsj, An Application of Lagrangian Relaxation to the Traveling Salesman Problem, https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.31.843&rep=rep1&type=pdf
  13. F. Fioretto, P. Van Hentenryck, T. W. K. Mak, C. Tran, F. Baldo, M. Lombardi, Lagrangian Duality for Constrained Deep Learning, https://web.ecs.syr.edu/~ffiorett/files/papers/ecml2020_arxiv.pdf
  14. J. Hui, Machine Learning - Lagrange multiplier & Dual decomposition, https://jonathan-hui.medium.com/machine-learning-lagrange-multiplier-dual-decomposition-4afe66158c9
  15. C. Lemarechal, F. Oustry, Semidefinite Relaxations and Lagrangian Duality with Application to Combinatorial Optimization, https://hal.inria.fr/inria-00072958/document
  16. J. Briales, J. Gonzalez-Jimenez, Convex Global 3D Registration with Lagrangian Duality, https://openaccess.thecvf.com/content_cvpr_2017/papers/Briales_Convex_Global_3D_CVPR_2017_paper.pdf
  17. A. Ben-Tal, L.E. Ghaoui, A. Nemirovski. Robust optimization. Princeton University Press, 2009. (PDF at http://www2.isye.gatech.edu/~nemirovs/FullBookDec11.pdf)
  18. 18.0 18.1 18.2 R. M. Freund, Applied Lagrange Duality for Constrained Optimization, Massachusetts Institute of Technology, 2004,  https://ocw.mit.edu/courses/sloan-school-of-management/15-094j-systems-optimization-models-and-computation-sma-5223-spring-2004/lecture-notes/duality_article.pdf