Optimization Principles and Algorithms Ed2 v1
Optimization Principles and Algorithms Ed2 v1
Optimization Principles and Algorithms Ed2 v1
Optimization:
Principles and Algorithms
Michel Bierlaire
EPFL Press
Optimization:
Principles and Algorithms
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Michel Bierlaire
Every engineer and decision scientist must have a good mastery of optimization, an essential
element in their toolkit. Thus, this articulate introductory textbook will certainly be welcomed
by students and practicing professionals alike. Drawing from his vast teaching experience,
the author skillfully leads the reader through a rich choice of topics in a coherent, fluid and
tasteful blend of models and methods anchored on the underlying mathematical notions
(only prerequisites: first year calculus and linear algebra). Topics range from the classics to
some of the most recent developments in smooth unconstrained and constrained optimiza-
tion, like descent methods, conjugate gradients, Newton and quasi-Newton methods, linear
programming and the simplex method, trust region and interior point methods.
Furthermore elements of discrete and combinatorial optimization like network optimization,
integer programming and heuristic local search methods are also presented.
This book presents optimization as a modeling tool that beyond supporting problem formu-
lation plus design and implementation of efficient algorithms, also is a language suited for
interdisciplinary human interaction. Readers further become aware that while the roots of
mathematical optimization go back to the work of giants like Newton, Lagrange, Cauchy,
Euler or Gauss, it did not become a discipline on its own until World War Two. Also that its pre-
sent momentum really resulted from its symbiosis with modern computers, which made it
possible to routinely solve problems with millions of variables and constraints.
With his witty, entertaining, yet precise style, Michel Bierlaire captivates his readers and
awakens their desire to try out the presented material in a creative mode. One of the out-
standing assets of this book is the unified, clear and concise rendering of the various algo-
rithms, which makes them easily readable and translatable into any high level program-
ming language. This is an addictive book that I am very pleased to recommend.
MICHEL BIERLAIRE holds a PhD in mathematics from the University of Namur, Belgium. He is full professor at the
School of Architecture, Civil and Environmental Engineering at the Ecole Polytechnique Fédérale de Lausanne,
Switzerland. He has been teaching optimization and operations research at the EPFL since 1998.
EPFL Press
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Optimization:
Principles and Algorithms
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Cover Illustrations: Abstract cubes background, © ProMotion and Architectural detail of modern
roof structure, © Lucian Milasan – Fotolia.com
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Michel Bierlaire
Optimization:
EPFL Press
Principles and Algorithms
This book is published under the editorial direction of
Professor Robert Dalang (EPFL).
The EPFL Press is the English-language imprint of the Foundation of the Presses polytechniques et
universitaires romandes (PPUR). The PPUR publishes mainly works of teaching and research of the Ecole
polytechnique fédérale de Lausanne (EPFL), of universities and other institutions of higher education.
www.epflpress.org
To Patricia
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Preface
Optimization algorithms are important tools for engineers, but difficult to use. In
fact, none of them is universal, and a good understanding of the different methods is
necessary in order to identify the most appropriate one in the context of specific appli-
cations. Designed to teach undergraduate engineering students about optimization,
this book also provides professionals employing optimization methods with significant
elements to identify the methods that are appropriate for their applications, and to
understand the possible failures of certain methods on their problem. The content
is meant to be formal, in the sense that the results presented are proven in detail,
and all described algorithms have been implemented and tested by the author. In
addition, the many numeric and graphic illustrations constitute a significant base for
understanding the methods.
The book features eight parts. The first part focuses on the formulation and the
analysis of the optimization problem. It describes the modeling process that leads to
an optimization problem, as well as the transformations of the problem into an equiv-
alent formulation. The properties of the problem and corresponding hypotheses are
discussed independently of the algorithms. Subsequently, the optimality conditions,
the theoretical foundations that are essential for properly mastering the algorithms,
are analyzed in detail in Part II. Before explaining the methods for unconstrained
continuous optimization in Part IV, algorithms for solving systems of non linear
equations, based on Newton’s method, are described in Part III. The algorithms for
constrained continuous optimization constitute the fifth part. Part VI addresses op-
timization problems based on network structures, elaborating more specifically on
the shortest path problem and the maximum flow problem. Discrete optimization
problems, where the variables are constrained to take integer values, are introduced
in Part VII, where both exact methods and heuristics are presented. The last part is
an appendix containing the definitions and theoretical results used in the book.
Several chapters include exercises. Chapters related to algorithms also propose
projects involving an implementation. It is advisable to use a mathematical program-
ming language, such as Octave (Eaton, 1997) or Matlab (Moled, 2004). If a language
such as C, C++, or Fortran is preferred, a library managing the linear algebra, such
as LAPACK (Anderson et al., 1999), can be useful. When time limits do not allow
a full implementation of the algorithms by the students, the teaching assistant may
prepare the general structure of the program, including the implementation of opti-
mization problems (objective function, constraints, and derivatives) in order for the
Optimization: Principles and Algorithm viii
students to focus on the key points of the algorithms. The examples described in
detail in this book enable the implementations to be verified.
Optimization is an active research field, that is, permanently stimulated by the
needs of modern applications. Many aspects are absent from this book. “Every choice
entails the rejection of what might have been better,” said Andre Gide. Among the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
There are many books on optimization. Within the vast literature, we may cite
the following books in English: Beck (2014), Calafiore and El Ghaoui (2014), Ben-
Tal et al. (2009), Boyd and Vandenberghe (2004), Ben-Tal and Nemirovski (2001),
Conn et al. (2000), Kelley (1999), Kelley (1995), Birge and Louveaux (1997), Den-
nis and Schnabel (1996), Axelsson (1994), Polyak (1987), Scales (1985), Coleman
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(1984), McCormick (1983), Gill et al. (1981), Fletcher (1980), Fletcher (1981), Or-
tega and Rheinboldt (1970), and Fiacco and McCormick (1968). Several books are
also available in French. Among them, we can cite Korte et al. (2010), Dodge (2006),
Cherruault (1999), Breton and Haurie (1999), Hiriart-Urruty (1998), Bonnans et al.
(1997), and Gauvin (1992).
The bibliographic source for the biographies of Jacobi, Hesse, Lagrange, Fermat,
Newton, Al Khwarizmi, Cauchy, and Lipschitz is Gillispie (1990). The information
about Tucker (Gass, 2004), Dantzig (Gass, 2003), Little (Larson, 2004), Fulkerson
(Bland and Orlin, 2005), and Gomory (Johnson, 2005) come from the series IFORS’
Operational Research Hall of Fame. The source of information for Euler is his
biography by Finkel (1897). Finally, the information on Davidon was taken from his
web page
www.haverford.edu/math/wdavidon.html
and from Nocedal and Wright (1999). The selection of persons described in this work
is purely arbitrary. Many other mathematicians have contributed significantly to the
field of optimization and would deserve a place herein. I encourage the reader to read,
in particular, the articles of the series IFORS’ Operational Research Hall of Fame
published in International Transactions in Operational Research, expressly
dealing with Morse, Bellman, Kantorovich, Erlang, and Kuhn.
Online material
The book has a companion website:
www.optimizationprinciplesalgorithms.com
The algorithms presented in the book are coded in GNU Octave, a high-level in-
terpreted language (www.gnu.org/software/octave), primarily intended for numerical
computations. The code for the algorithms, as well as examples of optimization prob-
lems, are provided. All the examples have been run on GNU Octave, version 3.8.1.
on a MacBook Pro running OS X Yosemite 10.10.2. If you use these codes, Michel
Bierlaire, the author, grants you a nonexclusive license to run, display, reproduce, dis-
tribute and prepare derivative works of this code. The code has not been thoroughly
tested under all conditions. The author, therefore, does not guarantee or imply its
reliability, serviceability, or function. The author provides no program services for
the code.
Optimization: Principles and Algorithm x
Acknowledgments
I would like to thank EPFL Press for their support in the translation of the French
version and the publication of this book. The financial support of the School of
Architecture, Civil and Environmental Engineering at EPFL is highly appreciated.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
I am grateful to my PhD advisor, Philippe Toint, who passed on his passion for
optimization to me. Among the many things he taught me, the use of geometric
interpretations of certain concepts, especially algorithmic ones, proved particularly
useful for my research and my teaching. I hope that they will now benefit the readers
of this book.
I also thank Thomas Liebling who put his trust in me by welcoming me into his
group at EPFL back in 1998. Among other things, he asked me to take care of the
optimization and operations research courses, which year after year have enabled me
to build the material that is gathered in this book. But I am especially grateful for
his friendship, and all the things that he has imparted to me.
I would like to thank my doctoral students, teaching assistants, and postdocs, not
only for the pleasure of working with them, but also for their valuable help in the
optimization course over the years, and their comments on various versions of this
book.
Earlier versions of the manuscript were carefully read by the members of the Trans-
port and Mobility Laboratory at the EPFL, and in particular Stefan Binder, Anna
Fernandez Antolin, Flurin Hänseler, Yousef Maknoon, Iliya Markov, Marija Nikolic,
Tomas Robenek, Riccardo Scarinci, and Shadi Sharif. Thomas Liebling provided a
great deal of comments, with excellent suggestions to improve the style and the con-
tent of the book. He caught several errors and imprecisions. It greatly improved the
quality of the text. If there are still mistakes (and there are always some that escape
scrutinity), I clearly take full responsibility. Errata will be published on the website
as mistakes are caught.
I am so proud of my children, Aria and François, who have recently started the
difficult challenge of obtaining a university degree. Finally, I dedicate this book to
Patricia. I am really lucky to know such a wonderful person. Her love is a tremendous
source of joy and energy for me.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Contents
2 Objective function 29
2.1 Convexity and concavity . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2 Differentiability: the first order . . . . . . . . . . . . . . . . . . . . . . 31
2.3 Differentiability: the second order . . . . . . . . . . . . . . . . . . . . 39
2.4 Linearity and non linearity . . . . . . . . . . . . . . . . . . . . . . . . 42
2.5 Conditioning and preconditioning . . . . . . . . . . . . . . . . . . . . . 45
2.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3 Constraints 51
3.1 Active constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2 Linear independence of the constraints . . . . . . . . . . . . . . . . . . 56
3.3 Feasible directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3.1 Convex constraints . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3.2 Constraints defined by equations-inequations . . . . . . . . . . 62
3.4 Elimination of constraints . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.5 Linear constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
xii CONTENTS
3.5.1 Polyhedron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.5.2 Basic solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.5.3 Basic directions . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
4 Introduction to duality 93
4.1 Constraint relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.2 Duality in linear optimization . . . . . . . . . . . . . . . . . . . . . . . 102
4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
VI Networks 487
21 Introduction and definitions 491
21.1 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
21.2 Cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
21.3 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
21.4 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
CONTENTS xv
27 Heuristics 647
27.1 Greedy heuristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
27.1.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . . . . 648
27.1.2 The traveling salesman problem . . . . . . . . . . . . . . . . . 649
27.2 Neighborhood and local search . . . . . . . . . . . . . . . . . . . . . . 656
27.2.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . . . . 662
27.2.2 The traveling salesman problem . . . . . . . . . . . . . . . . . 665
27.3 Variable neighborhood search . . . . . . . . . . . . . . . . . . . . . . . 669
27.3.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . . . . 670
27.3.2 The traveling salesman problem . . . . . . . . . . . . . . . . . 672
27.4 Simulated annealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
27.4.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . . . . 677
27.4.2 The traveling salesman problem . . . . . . . . . . . . . . . . . 679
27.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
27.6 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
B Definitions 689
C Theorems 695
D Projects 699
D.1 General instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
D.2 Performance analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
References 703
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part I
problem
Formulation and analysis of the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Harlow Shapley
Chapter 1
Formulation
Contents
1.1 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1 Projectile . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.2 Swisscom . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.3 Ch^ateau Laupt-Himum . . . . . . . . . . . . . . . . . . . 9
1.1.4 Euclid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.5 Agent 007 . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.6 Indiana Jones . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.1.7 Geppetto . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2 Problem transformations . . . . . . . . . . . . . . . . . . . 16
1.2.1 Simple transformations . . . . . . . . . . . . . . . . . . . 16
1.2.2 Slack variables . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3 Hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.4 Problem definition . . . . . . . . . . . . . . . . . . . . . . . 21
1.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.1 Modeling
The need to optimize is a direct result of the need to organize. Optimizing consists in
identifying an optimal configuration or an optimum in a system in the broadest sense
of the term. We use here Definition 1.1, given by Oxford University Press (2013).
Definition 1.1 (Optimum). (In Latin optimum, the best). The most favorable
or advantageous condition, value, or amount, especially under a particular set of
circumstances.
As part of a scientific approach, this definition requires some details. How can we
judge that the condition is favorable, and how can we formally describe the set of
circumstances?
6 Modeling
In practice, this step is probably the most complicated and most important. The
most complicated because only experience in modeling and a good knowledge of
the specific problem can guide the selection. The most important because the rest
of the process depends on it. An inappropriate selection of decision variables can
generate an optimization problem that is too complicated and impossible to solve.
2. The description of the method to assess the state of the system in question, given
a set of decision variables. In this book, we assume that the person performing
the modeling is able to identify a formula, a function, providing a measure of the
state of the system, a value that she wants to make the smallest or largest possible.
This function, called objective function, is denoted by f and the aforementioned
measure obtained for the decision variables x is a real number denoted by f(x).
3. The mathematical description of the circumstances or constraints, specifying the
values that the decision variables can take.
The modeling process is both exciting and challenging. Indeed, there is no uni-
versal recipe, and the number of possible models for a given problem is only limited
by the imagination of the modeler. However, it is essential to master optimization
tools and to understand the underlying assumptions in order to develop the adequate
model for the analysis in question. In this chapter, we provide some simple examples
of modeling exercises. In each case, we present a possible modeling.
1.1.1 Projectile
We start with a simple problem. A projectile is launched vertically at a rate of 50
meters per second, in the absence of wind. After how long and at which altitude does
1 See Appendix A about the mathematical notations used throughout the book.
Formulation 7
it start to fall? Note that, in this case, the decision variables represent a state of the
system that the analyst wants to calculate.
The modeling process consists of three steps.
Decision variables A single decision variable is used. Denoted by x, it represents
the number of seconds from the launch of the projectile. Note that in this case,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
the decision variables represent a state of the system that the analyst wants to
calculate.
Objective function We seek to identify the maximum altitude reached by the ob-
ject. We must thus express the altitude as a function of the decision variable. Since
we are dealing with the uniformly accelerating movement of an object subjected
to gravity, we have
g 9.81 2
f(x) = − x2 + v0 x + x0 = − x + 50 x ,
2 2
where g = 9.81 is the acceleration experienced by the projectile, v0 = 50 is its
initial velocity, and x0 = 0 is its initial altitude.
Constraints Time only goes forward. Therefore, we impose x ≥ 0.
We obtain the optimization problem
9.81 2
max − x + 50 x , (1.1)
x∈R 2
subject to (s.t.)
x ≥ 0. (1.2)
1.1.2 Swisscom
The company Swisscom would like to install an antenna to connect four important
new customers to its network. This antenna must be as close as possible to each
client, giving priority to the best customers. However, to avoid the proliferation of
telecommunication antennas, the company is not allowed to install the new antenna
at a distance closer than 10 km from the other two antennas, respectively located at
coordinates (−5, 10) and (5, 0) and represented by the symbol ✪ in Figure 1.1. The
coordinates are expressed in kilometers from Swisscom’s headquarters. Swisscom
knows the geographic situation of each customer as well as the number of hours of
communication that the customer is supposed to consume per month. This data is
listed in Table 1.1. At which location should Swisscom install the new antenna?
The modeling process consists of three steps.
Decision variables Swisscom must identify the ideal location for the antenna, i.e.,
the coordinates of that location. We define two decision variables x1 and x2
representing these coordinates in a given reference system.
Objective function The distance di (x1 , x2 ) between a customer i located at the
coordinates (ai , bi ) and the antenna is given by
q
di (x1 , x2 ) = (x1 − ai )2 + (x2 − bi )2 . (1.3)
8 Modeling
3
✻
✪ 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(x1 , x2 )
✪ ✲ 4
To take into account the communication time, we measure the sum of the distances
weighted by the number of consumed hours:
Constraints The constraints on the distances between the antennas can be expressed
as q
(x1 + 5)2 + (x2 − 10)2 ≥ 10 (1.5)
and q
(x1 − 5)2 + x22 ≥ 10 . (1.6)
Formulation 9
We can combine the various stages of modeling to obtain the following optimiza-
tion problem:
q
min f(x1 , x2 ) = 200 (x1 − 5)2 + (x2 − 10)2
x∈R2
q
+ 150 (x1 − 10)2 + (x2 − 5)2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
q (1.7)
+ 200 x21 + (x2 − 12)2
q
+ 300 (x1 − 12)2 + x22
subject to (s.t.)
q
(x1 + 5)2 + (x2 − 10)2 ≥ 10
q (1.8)
(x1 − 5)2 + (x2 − 10)2 ≥ 10 .
1.1.3 Ch^
ateau Laupt-Himum
The Château Laupt-Himum produces rosé wine and red wine by buying grapes from
local producers. This year they can buy up to one ton of Pinot (a red grape) from a
winegrower, paying e 3 per kilo. They can then vinify the grapes in two ways: either
as a white wine to obtain a rosé wine or as a red wine to get Pinot Noir, a full-bodied
red wine. The vinification of the rosé wine costs e 2 per kilo of grapes, while that of
the Pinot Noir costs e 3.50 per kilo of grapes.
In order to take into account economies of scale, the Château wants to adjust the
price of its wine to the quantity produced. The price for one liter of the rosé is e 15
minus a rebate of e 2 per hundred liters produced. Thus, if they produce 100 liters
of rosé, they sell it for e 13 per liter. If they produce 200, they sell it for e 11 per
liter. Similarly, they sell the Pinot Noir at a price of e 23 per liter, minus a rebate of
e 1 per hundred liters produced.
How should the Château Laupt-Himum be organized in order to maximize its
profit, when a kilo of grapes produces 1 liter of wine?
The modeling process consists of three steps.
1
23 − x2 .
100
The revenues corresponding to the production of x1 liters of rosé wine and x2
liters of Pinot Noir are equal to
2 1
x1 15 − x1 + x2 23 − x2 .
100 100
It costs 3x3 to purchase the grapes. To produce a liter of wine, they need one kilo
of vinified grapes, which costs e 2 for the rosé and e 3.50 for the Pinot Noir. The
total costs are
2x1 + 3.5 x2 + 3x3 .
The objective function that the Château Laupt-Himum should maximize is
2 1
x1 15 − x1 + x2 23 − x2 − (2x1 + 3.5 x2 + 3x3 ) .
100 100
Constraints The Château cannot buy more than 1 ton of grapes from the wine-
grower, i.e.,
x3 ≤ 1, 000 .
Moreover, they cannot produce more wine than is possible with the amount of
grapes purchased. As one kilo of grapes produces one liter of wine, we have
x1 + x2 ≤ x3 .
It is necessary to add constraints which are, although apparently trivial at the
application level, essential to the validity of the mathematical model. These con-
straints specify the nature of the decision variables. In the case of Château Laupt-
Himum, negative values of these variables would have no valid interpretation. It
is necessary to impose
x1 ≥ 0 , x2 ≥ 0 , x3 ≥ 0 . (1.9)
We combine the modeling steps to obtain the following optimization problem:
2 1
max f(x) = x1 15 − x1 + x2 23 − x2 − (2x1 + 3.5 x2 + 3x3 ) (1.10)
x∈R3 100 100
subject to
x1 + x2 ≤ x3
x3 ≤ 1 000
x1 ≥ 0 (1.11)
x2 ≥ 0
x3 ≥ 0 .
Formulation 11
1.1.4 Euclid
In about 300 BC, the Greek mathematician Euclid was interested in the following
geometry problem: what is the rectangle with the greatest area among the rectangles
with given perimeter L? This is considered as one of the first known optimization
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
2x1 + 2x2 = L
x1 ≥ 0 (1.15)
x2 ≥ 0.
100 m
007
x
80 m
0 ≤ x ≤ 80 .
We can combine the different steps of the modeling to obtain the following opti-
mization problem:
q
18
min f(x) = x + 0.6 1002 + (80 − x)2 (1.19)
x∈R 100
subject to
x≥0
(1.20)
x ≤ 80 .
This example is inspired by Walker (1999).
Formulation 13
has for these reptiles, it is impossible for him to wade through them, and he considers
passing over them. However, the roof is not strong enough, so he cannot walk on it.
Ever ingenious, he places the end of a ladder on the ground, blocked by a boulder,
leans it on the wall, and uses it to reach the other end of the room (Figure 1.3). Once
there, he uses his whip to get down to the floor on the other side of the snake room.
Where on the floor must he place the end of the ladder, so that the length used is as
small as possible, and the ladder thus less likely to break under his weight? We write
the optimization problem that would help our hero.
x2
✻
h=5m
❄
✛ ✲ x1
ℓ = 10 m
or
x1 x2 − hx1 − ℓx2 = 0 .
Finally, the ends of the ladder must be outside the room, and
x1 ≥ ℓ and x2 ≥ h .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We can combine the modeling steps to obtain the following optimization problem:
q
min x21 + x22 (1.21)
x∈R2
subject to
x1 x2 − hx1 − ℓx2 = 0
x1 ≥ ℓ (1.22)
x2 ≥ h .
1.1.7 Geppetto
The company Geppetto Inc. produces wooden toys. It specializes in the manufacture
of soldiers and trains. Each soldier is sold for e 27 and costs e 24 in raw material. To
produce a soldier, 1 hour of carpentry labor is required, as well as 2 hours of finishing.
Each train is sold for e 21 and costs e 19 in raw material. To produce a train, it takes
1 hour of carpentry labor and 1 hour of finishing. Geppetto has two carpenters and
two finishing specialists each working 40 hours per week. He himself puts in 20 hours
per week on finishing work. The trains are popular, and he knows that he can always
sell his entire production. However, he is not able to sell more than 40 soldiers per
week. What should Geppetto do to optimize his income?
The modeling process is organized in three steps.
Decision variables Geppetto’s strategy is to determine the number of soldiers and
trains to produce per week. Thus, we define two decision variables:
• x1 is the number of soldiers to produce per week,
• x2 is the number of trains to produce per week.
Objective function The objective of Geppetto is to make as much money as pos-
sible. The quantity to maximize is the profit. Geppetto’s gains consist of the
income from the sales of the toys, minus the cost of the raw material. Geppetto’s
income is the sum of the income from the sales of the soldiers and the sales of the
trains. The income (in e ) from the sales of the soldiers is the number of soldiers
sold multiplied by the selling price of one soldier, i.e., 27 x1 . The income from
the sales of the trains is 21 x2 . The total income for Geppetto is 27 x1 + 21 x2 .
Similarly, we evaluate the material costs to 24 x1 + 19x2 . The gain is
or
f(x) = 3x1 + 2x2 . (1.24)
Formulation 15
Constraints The production is subject to three main constraints. First, the available
labor does not allow more than 100 finishing hours (performed by two workers and
Geppetto) and 80 hours of carpentry (performed by two carpenters). Furthermore,
to avoid unsold objects, they should not produce more than 40 soldiers per week.
The number of hours per week of finishing is the number of hours of finishing
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
for the soldiers, multiplied by the number of soldiers produced, plus the hours of
finishing for the trains, multiplied by the number of trains produced. This number
may not exceed 100, and we can express the following constraint:
x1 + x2 ≤ 80 . (1.26)
Finally, the constraint to avoid unsold products can simply be written as:
x1 ≤ 40 . (1.27)
At this stage, it seems that all the constraints of the problem have been described
mathematically. However, it is necessary to add constraints that are, although
apparently trivial at the application level, essential to the validity of the mathe-
matical model. These constraints specify the nature of the decision variables. In
the case of Geppetto, it is not conceivable to produce parts of trains or soldiers.
The decision variables must absolutely take integer values, so that
x1 ∈ N , x2 ∈ N . (1.28)
We combine the different stages of the modeling to obtain the following optimiza-
tion problem:
subject to
2x1 + x2 ≤ 100
x1 + x2 ≤ 80 (1.30)
x1 ≤ 40.
Even though the modeling step is completed, we are not yet out of the woods. In-
deed, there are many ways to write a given problem mathematically. Algorithms and
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
software often require a special formulation based on which they solve the problem.
In this chapter, we study techniques that help us comply with these requirements.
Obtaining the mathematical formulation of a problem does not necessarily end the
modeling process. In fact, the obtained formulation may not be adequate. In particu-
lar, the software capable of solving optimization problems often require the problems
to be formulated in a specific way, not necessarily corresponding to the result of
the approach described in Section 1.1. We review some rules for transforming an
optimization problem into another equivalent problem.
min f(x) ,
x∈X ⊆ Rn
n
where X is a subset of R . Consider a function g : R → R that is strictly
increasing on Im(f) = z | ∃x ∈ X such that z = f(x) , i.e., for any z1 , z2 ∈ Im(f),
g(z1 ) > g(z2 ) if and only if z1 > z2 . Thus,2
Similarly, if the function f generates only positive values, taking the logarithm of
the objective function or taking its square does not change its solution:
argminx∈X ⊆ Rn f(x) = argminx∈X ⊆ Rn log f(x) , (1.34)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and
2
argminx∈X ⊆ Rn f(x) = argminx∈X ⊆ Rn f(x) , (1.35)
as g(x) = x2 is strictly increasing for x ≥ 0. Note that the log transformation is
typically used in the context of maximum likelihood estimation of unknown pa-
rameters in statistics, where the objective function is a probability and, therefore,
is positive. The square transform is relevant namely when f(x) is expressed as a
square root (see the example on Indiana Jones in Section 1.1.6). In this case, the
square root can be omitted.
2. A maximization problem whose objective function is f(x) is equivalent to a mini-
mization problem whose objective function is −f(x):
and
max f(x) = − min −f(x) . (1.37)
x x
Similarly, we have
argminx f(x) = argmaxx −f(x) , (1.38)
and
min f(x) = − max −f(x) . (1.39)
x x
x = x+ − x− . (1.42)
In this case, we can meet the requirements of the software and impose x+ ≥ 0 and
x− ≥ 0, without loss of generality.
18 Problem transformations
x=e
x+a (1.43)
subject to
6x − y2 ≥ 1 (1.46)
2 2
x +y =3 (1.47)
x≥2 (1.48)
y ∈ R, (1.49)
and transform it in such a way as to obtain a minimization problem, in which all the
decision variables are non negative, and all constraints are defined by lower inequali-
ties. We get the following problem:
− x + 2)2 − sin(y+ − y− )
min (e (1.50)
e, y+ , y−
x
subject to
2
x + 2) + y+ − y−
−6(e +1≤0 (1.51)
2 +
− 2
(e
x + 2) + y − y −3≤0 (1.52)
2
x + 2)2 − y+ − y− + 3 ≤ 0
−(e (1.53)
e
x≥0 (1.54)
+
y ≥0 (1.55)
−
y ≥ 0, (1.56)
where
(1.50) is obtained by applying (1.37) to (1.45),
(1.51) is obtained by applying (1.40) to (1.46),
(1.52) and (1.53) are obtained by applying (1.41) to (1.47),
(1.54) is obtained by applying (1.43) to (1.48),
(1.55) and (1.56) are obtained by applying (1.42) to (1.49).
Note that the transformed problem has more decision variables (3 instead of 2 for the
original problem) and more constraints (6 instead of 3 for the original problem).
When the solution e x∗ , y+∗ , y−∗ of (1.50)–(1.56) is available, it is easy to obtain
the solution to the original problem (1.45)–(1.49) by applying the inverse transfor-
mations, i.e.,
x∗ = e
x∗ + 2
(1.57)
y∗ = y+∗ − y−∗ .
Formulation 19
• The slack variable y is introduced directly in the specification, and its value is
explicitly restricted to be non negative:
g(x) + y = 0
g(x) ≤ 0 ⇐⇒ (1.58)
y ≥ 0.
The above specification does not completely eliminate inequality constraints. How-
ever, it simplifies considerably the nature of these constraints.
• The slack variable is introduced indirectly using a specification enforcing its non
negativity. For example, the slack variable can be defined as y = z2 , and
g(x) ≤ 0 ⇐⇒ g(x) + z2 = 0. (1.59)
• The slack variable can also be introduced indirectly using an exponential, that is,
y = exp(z), and
g(x) ≤ 0 ⇐⇒ g(x) + ez = 0. (1.60)
The limitation of this approach is that there is no value of z such that g(x)+ez = 0
when the constraint is active, that is when g(x) = 0. Strictly speaking, the two
specifications are not equivalent. However, the slack variable exp(z) can be made
as close to zero as desired by decreasing the value of z, as
lim ez = 0. (1.61)
z→−∞
So, loosely speaking, we can say that the two specifications are “asymptotically
equivalent.”
The slack variable (z2 , ez or y) thus introduced measures the distance between the
constraint and the point x. The special status of such variables can be effectively
exploited for solving optimization problems.
subject to
π
sin x1 ≤ (1.63)
√ 2
ln ex1 + ex2 ≥ e (1.64)
x1 − x2 ≤ 100 . (1.65)
20 Hypotheses
We introduce the slack variable z1 for the constraint (1.63), the slack variable z2
for the constraint (1.64), and the slack variable y3 for the constraint (1.65). The
obtained optimization problem is
subject to
π
sin x1 + z21 = (1.67)
2
√
ln ex1 + ex2 − ez2 = e (1.68)
x1 − x2 + y3 = 100 (1.69)
y3 ≥ 0 . (1.70)
Note that the objective function is not affected by the introduction of slack variables.
1.3 Hypotheses
The methods and algorithms presented in this book are not universal. Each approach
is subject to assumptions about the structure of the underlying problem. Specific
assumptions are discussed for each method. However, there are three important
assumptions that concern (almost) the whole book: the continuity hypothesis, the
differentiability hypothesis, and the determinism hypothesis.
The continuity hypothesis consists in only considering problems for which the
objective to optimize and the constraints are modeled by continuous functions of
decision variables. This hypothesis excludes problems with integer variables (see
discussion in Section 1.1.7). Such problems are treated by discrete optimization
or integer programming.3 An introduction to discrete optimization in provided in
Part VII of this book. We also refer the reader to Wolsey (1998) for an introduction to
combinatorial optimization, as well as to Schrijver (2003), Bertsimas and Weismantel
(2005), and Korte and Vygen (2007).
The differentiability hypothesis (which obviously implies the continuity hypoth-
esis) also requires that the functions involved in the model are differentiable. Non
differentiable optimization is the subject of books such as Boyd and Vandenberghe
(2004), Bonnans et al. (2006), and Dem’Yanov et al. (2012).
The determinism hypothesis consists in ignoring possible errors in the data for the
problem. Measurement errors, as well as modeling errors, can have a non negligible
impact on the outcome. Stochastic optimization (Birge and Louveaux, 1997) enables
the use of models in which some pieces of data are represented by random variables.
Robust optimization (see Ben-Tal and Nemirovski, 2001 and Ben-Tal et al., 2009)
produces solutions that are barely modified by slight disturbances in the data of the
problem.
3 The term “programming”, used in the sense of optimization, was introduced during the Second
World War.
Formulation 21
subject to
h(x) = 0 (1.72)
g(x) ≤ 0 (1.73)
and
x ∈ X, (1.74)
Definition 1.5 (Local minimum). Let Y = x ∈ Rn | h(x) = 0 , g(x) ≤ 0 and x ∈ X
be the feasible set, that is the set of vectors satisfying all constraints. The vector
x∗ ∈ Y is called a local minimum of the problem (1.71)–(1.74) if there exists ε > 0
such that
f(x∗ ) ≤ f(x) , ∀x ∈ Y such that x − x∗ < ε . (1.75)
Definition 1.6 (Strict local minimum). Let Y = x ∈ Rn | h(x) = 0 , g(x) ≤
0 and x ∈ X be the feasible set, that is the set of vectors satisfying all the constraints.
The vector x∗ ∈ Y is called a strict local minimum of the problem (1.71)–(1.74) if
there exists ε > 0 such that
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Definition 1.7 (Global minimum). Let Y = x ∈ Rn | h(x) = 0 , g(x) ≤ 0 and x ∈
X be the feasible set, that is the set of vectors satisfying all the constraints. The
vector x∗ ∈ Y is called a global minimum of the problem (1.71)–(1.74) if
Definition 1.8 (Strict global minimum). Let Y = x ∈ Rn | h(x) = 0 , g(x) ≤
0 and x ∈ X be the feasible set, that is the set of vectors satisfying all the constraints.
The vector x∗ ∈ Y is called a strict global minimum of the problem (1.71)-(1.74) if
The notions of local maximum, strict local maximum, global maximum and strict
global maximum are defined in a similar manner.
Example 1.9 (Local minimum and maximum). Figure 1.4 illustrates these defini-
tions for the function
5 7 11
f(x) = − x3 + x2 − x + 3. (1.79)
6 2 3
The point x∗ ≃ 0.6972 is a local minimum of f. Indeed, there is an interval x∗ −
1 ∗ 1 ∗
2 , x + 2 , represented by the dotted lines, such that f(x ) ≤ f(x), for any x in the
e∗
interval. Similarly,
∗ 1 the x ≃ 2.1024 is a local maximum. Indeed, there
point exists
an interval ex − 2, ex∗ + 12 , represented by the dotted lines, such that f(e
x∗ ) ≥ f(x),
for any x in the interval.
hi (x) = xi (1 − xi ) = 0 , i = 1, . . . , n .
Formulation 23
3.5
local maximum
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2.5 x∗ x̃∗
f(x)
2
local minimum
1.5
1
0 0.5 1 1.5 2 2.5 3
x
Figure 1.4: Local minimum and maximum for Example 1.9
We thus get n differentiable constraints and the hypotheses are satisfied. However,
since each feasible point is isolated, each of them is a local minimum of the problem.
Therefore, algorithms for continuous optimization designed to identify local minima
are useless for this type of problem.
f(x) ≥ M , ∀x ∈ Y . (1.80)
and
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
inf f(y) = 0 .
y∈Y
This example shows that an optimization problem is not always well defined, and
that no solution may exist. Theorem 1.14 identifies cases where the problem is well-
defined, and where the infimum of a function on a set is reached by at least one
point of the set. In this case, the point is a global minimum of the corresponding
optimization problem.
If Y is compact, it is bounded and the sequence has at least one limit point x∗ . If f is
coercive (Definition B.22), the sequence (xk )k is bounded and has at least one limit
point x∗ . In both cases, due to the lower semi-continuity of f in x∗ , we have
and
f(x∗ ) = inf f(y).
y∈Y
Note that some functions may include local minima and have no global minimum,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
as for Example 1.9, shown in Figure 1.4, where the function (1.79) is unbounded from
below, as
5 7 11
lim − x3 + x2 − x + 3 = −∞.
x→+∞ 6 2 3
In some cases, an optimization problem with constraints can be simplified and
the constraints ignored. Before detailing such simplifications in Section 3.1, we state
now a general theoretical result when the optimum is an interior point of the set of
constraints.
min f(x).
x∈Y2
1.5 Exercises
Exercise 1.1 (Geometry). We want to determine a parallelepiped with a volume of
unity and minimal surface.
1. Formulate this problem as an optimization problem by determining
(a) the decision variables,
(b) the objective function,
(c) the constraint(s).
2. Formulate this problem as a minimization problem with only lower inequality
constraints.
Exercise 1.2 (Finance). A bank wants to determine how to invest its assets for the
year to come. Currently, the bank has a million euros that it can invest in bonds, real
estate loans, leases or personal loans. The annual interest rate of different investment
types are 6% for bonds, 10% for real estate loans, 8% for leases, and 13% for personal
loans.
To minimize risk, the portfolio selected by the bank must satisfy the following
restrictions:
• The amount allocated to personal loans must not exceed half of that invested in
bonds.
• The amount allocated to real estate loans must not exceed that allocated to leases.
• At most 20% of the total invested amount can be allocated to personal loans.
1. Formulate this problem as an optimization problem by determining
(a) the decision variables,
(b) the objective function,
(c) the constraint(s).
2. Formulate this problem as a minimization problem with only lower inequality
constraints.
3. Formulate this problem as a maximization problem with equality constraints and
with non negativity constraints on the decision variables.
Formulation 27
Exercise 1.3 (Stock management). The company Daubeliou sells oil and wants to
optimize the management of its stock. The annual demand is estimated at 100,000
liters and is assumed to be homogeneous throughout the year. The cost of storage
is e 40 per thousand liters per year. When the company orders oil to replenish its
stock, this costs e 80. Assuming that the order arrives instantly, how many orders
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
must the company Daubeliou place each year to satisfy demand and minimize costs?
Formulate this problem as an optimization problem by determining
1. the decision variables,
2. the objective function,
3. the constraint(s).
Advice:
• Set the amount of oil to order each time as a decision variable.
• Represent in a graph the evolution of the stock as a function of time.
Exercise 1.4 (Measurement errors). Mr. O. Beese is obsessed with his weight. He
owns 10 scales and weighs himself each morning on each of them. This morning he
got the following measurement results:
He wishes to determine an estimate of his weight while minimizing the sum of the
squares of measurement errors from the 10 scales. Formulate the optimization prob-
lem that he needs to solve.
Exercise 1.5 (Congestion). Every day, 10,000 people commute from Divonne to
Geneva. By train, the journey takes 40 minutes. By road, the travel time depends on
the level of congestion. It takes 20 minutes when the highway is completely deserted.
When there is traffic, travel time increases by 5 minutes per thousand people using
the highway (assuming that there is one person per car). If 4,000 people take the car
and 6,000 take the train, the travel time by road is equal to 20 + 5 × 4 = 40 minutes,
which is identical to the travel time by train. In this situation, it would be of no
interest to change one’s mode of transport. We say that the system is at equilibrium.
However, from the point of view of the average travel time per person, is this situation
optimal? Formulate an optimization problem to answer the question.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 2
Objective function
Contents
2.1 Convexity and concavity . . . . . . . . . . . . . . . . . . . 29
2.2 Differentiability: the first order . . . . . . . . . . . . . . . 31
2.3 Differentiability: the second order . . . . . . . . . . . . . 39
2.4 Linearity and non linearity . . . . . . . . . . . . . . . . . . 42
2.5 Conditioning and preconditioning . . . . . . . . . . . . . 45
2.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Definition
2.1 is shown
in Figure 2.1. The line segment connecting the points
x, f(x) and y, f(y) is never below the graph of f. The point z = λx + (1 − λ)y is
somewhere between x and y when 0 ≤ λ ≤ 1. The point with coordinates z, λf(x) +
(1−λ)f(y) is on the line segment between the points x, f(x) and y, f(y) . In order
for the function to be convex, this point must never (i.e., for all x, y and 0 ≤ λ ≤ 1)
be below the graph of the function.
(z, f(z))
x z y
(y, f(y))
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(x, f(x))
Note that convexity and concavity are not complementary properties. A function
may be neither convex nor concave. This is the case of the function represented in
Figure 2.2.
If the partial derivatives ∂f(x)/∂xi exist for all i, the gradient of f is defined as
follows.
∂f(x)
∂x1
..
∇f(x) =
.
.
(2.5)
∂f(x)
∂xn
The gradient plays a key role in the development and analysis of optimization
algorithms.
Example 2.6 (Gradient). Consider f(x1 , x2 , x3 ) = ex1 +x21 x3 −x1 x2 x3 . The gradient
of f is given by
x1
e + 2x1 x3 − x2 x3
∇f(x1 , x2 , x3 ) = −x1 x3 . (2.6)
2
x1 − x1 x2
The analysis of the behavior of the function in certain directions is also important
for optimization methods. We introduce the concept of a directional derivative.
∇f(x)T d . (2.8)
this book, we deal with continuous differentiable functions for which a distinction is
unnecessary.
Example 2.9 (Directional derivative). Consider f(x1 , x2 , x3 ) = ex1 + x21 x3 − x1 x2 x3 ,
and
d1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
d = d2 . (2.9)
d3
The directional derivative of f in the direction d is
( d1 d2 d3 ) ∇f(x1 , x2 , x3 ) =
(2.10)
d1 (ex1 + 2x1 x3 − x2 x3 ) − d2 x1 x3 + d3 (x21 − x1 x2 ) ,
Proof. We use (C.1) from Taylor’s theorem (Theorem C.1) to evaluate the function
in x + αd by employing the information in x. We have
f(x + αd) = f(x) + αdT ∇f(x) + o αkdk Taylor
T
= f(x) + αd ∇f(x) + o(α) kdk does not depend on α.
The result follows from the fact that dT ∇f(x) < 0 by assumption, and that o(α) can
be made as small as needed. More formally, according to the definition of the Landau
notation o( · ) (Definition B.17), for any ε > 0, there exists η such that
o(α)
< ε, ∀0 < α ≤ η .
α
o(α) o(α)
≤ < −dT ∇f(x) , ∀0 < α ≤ η . (2.15)
α α
and f(x + αd) < f(x), ∀0 < α ≤ η. The result (2.14) is obtained in a similar manner,
by choosing ε = (β − 1)∇f(x)T d in the definition of the Landau notation. We have
ε > 0 because β < 1 and ∇f(x)T d < 0.
Among all directions d from a point x, the one in which the slope is the steepest
is the direction of the gradient ∇f(x). To show this, we consider all directions d that
have the same norm (the same length) as the gradient and compare the directional
derivative for each of them.
∗T
=d ∇f(x) definition of d∗ .
2
Since d∗ T ∇f(x) = ∇f(x) ≥ 0, the function increases in the direction d∗ , which
corresponds to the steepest ascent.
If the direction of the gradient corresponds to the steepest ascent of the function x,
we need only consider the direction opposite the gradient −∇f(x) to find the steepest
descent.
and the direction opposite the gradient is that in which the function has its
steepest descent.
55
50
−1
45 d3 =
3
40
1
f(x + αdi ) 35 d2 =
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1
30
25 d1 = ∇f(x)
20
15
10
5
0
0 0.2 0.4 0.6 0.8 1
α
1 2
Figure 2.3: Shape of the function 2 x1 + 2x2 at point (1, 1)T in several directions
18
16 d1 = −∇f(x)
14
−1 1
f(x + αdi ) 12 d2 = d3 =
−1 −3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10
8
6
4
2
0
0 0.2 0.4 0.6 0.8 1
α
1 2
Figure 2.4: Shape of the function 2 x1 + 2x2 at point (1, 1)T in several directions
Proof. Necessary condition. We first show that (2.18) is a necessary condition. Let
x, y ∈ X be arbitrary and let us consider d = y − x. We evaluate the directional
derivative of f in the direction d and obtain
the right term is nothing else than the equation of the hyperplane that is tangent to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
the function f at point x. In this case, we see that a function is convex if and only
if the graph is never below the hyperplane tangent. Figure 2.5 illustrates this idea in
the case of a function with one variable.
We conclude this section by generalizing the notion of the gradient for the func-
tions of Rn → Rm . In this case, the various partial derivatives are arranged in a
matrix called the gradient matrix. Each column of this matrix is the gradient of the
corresponding component of f.
∂f ∂f2 ∂fm
1 (2.24)
···
∂x1 ∂x1 ∂x1
. .. .. ..
=
.. . . .
.
∂f ∂f2 ∂fm
1
···
∂xn ∂xn ∂xn
Objective function 39
The gradient matrix is often used in its transposed form and is then called the
Jacobian matrix of f.
∇f1 (x)T
..
J(x) = ∇f(x)T = . . (2.25)
T
∇fm (x)
is defined by
∂2 f(x) ∂2 f(x) ∂2 f(x)
···
∂x21 ∂x1 ∂x2 ∂x1 ∂xn
2
∂2 f(x) ∂2 f(x)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∂ f(x)
···
∂x2 ∂x1 ∂x22 ∂x2 ∂xn
∇2 f(x) = . (2.27)
.. .. ..
. . .
2
∂ f(x) 2
∂ f(x) ∂ f(x)
2
···
∂xn ∂x1 ∂xn ∂x2 ∂x2n
Note that the Hessian of f is the gradient matrix and the Jacobian matrix of ∇f.
Example 2.20 (Hessian). Consider f(x1 , x2 , x3 ) = ex1 + x21 x3 − x1 x2 x3 . The Hessian
of f is given by
x1
e + 2x3 −x3 2x1 − x2
∇2 f(x1 , x2 , x3 ) = −x3 0 −x1 . (2.28)
2x1 − x2 −x1 0
Just like the gradient, the Hessian gives us information about the convexity of the
function.
1
f(y) = f(x) + (y − x)T ∇f(x) + dT ∇2 f(x + αd)d . (2.29)
2
If 0 < α ≤ 1, x+αd ∈ X by convexity (Definition B.2) of X, and the matrix ∇2 f(x+αd)
is positive semidefinite (Definition B.8). Therefore,
Then, we have
f(y) ≥ f(x) + (y − x)T ∇f(x) . (2.31)
We now need only invoke Theorem 2.16 to prove the convexity of f. The strict
convexity is proven in a similar manner.
Objective function 41
Since the second derivative of a function of one variable gives us curvature informa-
tion, (2.34) provides us with information about the curvature of the function f in
the direction d. In particular, when α = 0, this expression gives information on the
curvature of f in x. To avoid the length of the direction influencing the notion of
curvature, it is important to normalize. We obtain the following definition.
dT ∇2 f(x)d
(2.35)
dT d
represents the curvature of the function f in x in the direction d.
In linear algebra, the quantity (2.35) is often called the Rayleigh quotient of ∇2 f(x)
in the direction d. One should immediately note that the curvature of the function
x in the direction −d is exactly the same as in the direction d.
Example 2.23 (Curvature). Consider f(x) = 21 x21 + 2x22 , and x = (1, 1)T , as in
Examples 2.14 and 2.15. The curvature of the function in different directions is given
below:
d −d dT ∇2 f(x)d/dT d
( 1 4 )T ( −1 −4 )T 3.8235
( 1 1 )T ( −1 −1 )T 2.5
( −1 3 )T ( 1 −3 )T 3.7
42 Linearity and non linearity
When a constant term is added to a linear function, the result is said to be affine.
Note that minimizing (2.38) is equivalent to minimizing (2.36). Note that all
linear functions are affine. By abuse of language, a non linear function is actually a
function that is not affine.
Objective function 43
Definition 2.26 (Non linear function). Any function that is not affine is said to be
non linear.
The set of non linear functions is vast, and one needs to be a little more precise
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
in their characterization. Intuitively, the function shown in Figure 2.8 seems more
non linear than the one in Figure 2.9. The slope of the former changes quickly with
x, which is not the case for the latter. This is formally captured by the Lipschitz
continuity (Definition B.16) of the gradient.
3
−x
2.5 f(x) = ecos(e )
2
f(x)
1.5
0.5
0
-5 -4 -3 -2 -1 0
x
Figure 2.8: Example of a non linear function
40
30
20 x2
f(x) = 100 + 3x + 1
10
f(x)
0
-10
-20
-30
-10 -5 0 5 10
x
Figure 2.9: Example of another non linear function
44 Linearity and non linearity
Intuitively, the definition says that the slopes of the function at two close points
are close as well. And the more so when M is small. Actually, when f is linear, the
slope is the same at any point, and (2.40) is verified with M = 0. The value of M
for the function represented in Figure 2.9 is low, while it is large for the function
illustrated in Figure 2.8, where the slope varies dramatically with small modifications
of x.
The constant M can be interpreted as an upper bound on the curvature of the
function. The greater M is, the smaller the curvature is. If M = 0, the curvature is
zero, and the function is linear. Note that this constant is essentially theoretical and
that it is generally difficult to obtain a value for it.
Among the non linear functions, quadratic functions play an important role in
optimization algorithms.
Ad1 = λ1 d1 . (2.45)
dT1 Ad1
λ1 = . (2.46)
dT1 d1
quadratic function with two dimensions (Figure 2.11(a)), this translates into nearly
circular level curves (Figure 2.11(b)).
Example 2.31 (Conditioning). The quadratic function
i.e.,
x1 1/2 √ 0 x1′
= . (2.50)
x2 0 2/6 x2′
We obtain
1 ′2 1 ′2
f(x1′ , x2′ ) =
x + x2 , (2.51)
2 1 2
for which the Hessian is the identity matrix, and the condition number is 1, for all
(x1′ , x2′ ).
f̃(x ′ ) = f(M−1 x ′ )
∇f̃(x ′ ) = M−T ∇f(M−1 x ′ )
(2.52)
∇2 f̃(x ′ ) = M−T ∇2 f(M−1 x ′ )M−1
= M−T ∇2 f(x)M−1 .
Objective function 47
40
30
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
f(x1 , x2 ) 20
10
0
-2
-1
-2 0 x1
-1 1
x2 0 1 2
2
(a) Function
0 x2
-1
-2
-2 -1 0 1 2
x1
(b) Level curves
In the context of optimization, the matrix for the change of variables should be
positive definite in order to preserve the nature of the problem.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 48 Conditioning and preconditioning
f(x1 , x2 )
-2
-1
-2 0 x1
-1 1
x2 0 1 2
2
(a) Function
0 x2
-1
-2
-2 -1 0 1 2
x1
(b) Level curves
x ′ = LT x ⇐⇒ x = L−T x ′ . (2.54)
In this case
The conditioning of the function f̃ in x ′ is 1. According to Definition 2.29, κ2 ∇2 f̃(x ′ )
≥ 1 and the obtained conditioning is the best possible. The best preconditioning of f
in x consists in defining the change of variables based on the Cholesky factorization
of ∇2 f(x).
Example 2.34 (Preconditioning). Consider
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 2 25 2 √
f(x1 , x2 ) = x + x + 3x1 x2 − 12 x1 − π x2 − 6 . (2.55)
2 1 2 2
We have
x1 + 3x2 − 12
∇f(x1 , x2 ) = √ (2.56)
3x1 + 25 x2 − π
and T
2 1 3 1 0 1 0
∇ f(x1 , x2 ) = = . (2.57)
3 25 3 4 3 4
We define
x1′ 1 3 x1
= , (2.58)
x2′ 0 4 x2
i.e.,
x1 1 −3/4 x1′
= . (2.59)
x2 0 1/4 x2′
We obtain
2 2
1 3 ′ 25 1 ′ 3 3 ′
f̃(x1′ , x2′ ) = ′
x1 − x2 + x + ′
x1 − x2 x2′
2 4 2 4 2 4 4
√
3 π ′
− 12 x1′ − x2′ − x −6 (2.60)
4 4 2
√
1 ′2 1 ′2 ′ π
= x1 + x2 − 12 x1 + 9 − x2′ − 6 .
2 2 4
It is easy to verify that ∇2 f̃(x1′ , x2′ ) = I. Note that there are no longer any crossed
terms in x1′ x2′ .
50 Exercises
2.6 Exercises
Exercise 2.1. Among the following functions, which are convex and which are con-
cave? Justify your answer.
1. f(x) = 1 − x2 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2. f(x) = x2 − 1.
q
3. f(x1 , x2 ) = x21 + x22 .
4. f(x) = x3 .
5. f(x1 , x2 , x3 ) = sin(a)x1 + cos(b)x2 + e−c x3 , a, b, c ∈ R.
Exercise 2.2. For each of the following functions:
• Calculate the gradient.
• Calculate the Hessian.
• Specify (and justify) whether the function is convex, concave, or neither.
• Calculate the curvature of the function in a direction d at the specified point x̄.
• Make a change of variables to precondition the function, using the Hessian at the
specified point x̄. Please note that the matrix for a change of variables must be
positive definite.
1 9
1. f(x1 , x2 ) = x21 + x22 , x̄ = (0, 0)T .
2 2
1 3
2. f(x1 , x2 ) = x1 + x32 − x1 − x2 , x̄ = (9, 1)T .
3
3. f(x1 , x2 ) = (x1 − 2)4 + (x1 − 2)2 x22 + (x2 + 1)2 , x̄ = (2, −1)T .
Chapter 3
Constraints
Life would be easier without constraints. Or would it? In this chapter, we investigate
ways to remove some of them, or even all of them. And when some remain, they need
to be properly understood in order to be verified. As algorithms need to move along
directions that are compatible with the constraints, such directions are characterized
in various contexts. We put a special emphasis on linear constraints, which the
analysis simplifies significantly.
Contents
3.1 Active constraints . . . . . . . . . . . . . . . . . . . . . . . 52
3.2 Linear independence of the constraints . . . . . . . . . . 56
3.3 Feasible directions . . . . . . . . . . . . . . . . . . . . . . . 60
3.3.1 Convex constraints . . . . . . . . . . . . . . . . . . . . . . 60
3.3.2 Constraints defined by equations-inequations . . . . . . . 62
3.4 Elimination of constraints . . . . . . . . . . . . . . . . . . 75
3.5 Linear constraints . . . . . . . . . . . . . . . . . . . . . . . 78
3.5.1 Polyhedron . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.5.2 Basic solutions . . . . . . . . . . . . . . . . . . . . . . . . 83
3.5.3 Basic directions . . . . . . . . . . . . . . . . . . . . . . . . 87
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
min x2 (3.1)
x∈R
subject to
x ≤ 4
(3.2)
x ≥ −10.
It is illustrated in Figure 3.1, where the inequality constraints are represented by
vertical lines, associated with an arrow pointed towards the feasible domain. The
solution to this problem is x∗ = 0. In fact, one could also choose to ignore the
constraints and still obtain the same solution. We say that the constraints are inactive
at the solution. When using the notation (1.73), the problem can be written as
min x2 (3.3)
x∈R
subject to
g1 (x) = x−4 ≤ 0
(3.4)
g2 (x) = −x − 10 ≤ 0.
We have g1 (x∗ ) = −4 and g2 (x∗ ) = −10, and g1 (x∗ ) < 0 and g2 (x∗ ) < 0. The fact
that the inequality constraints are strictly verified characterizes inactive constraints.
f(x)
x∗ = 0 f(x) = x2
-10 -5 0 5 10
x
subject to
x ≤ 4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(3.6)
x ≥ 1.
It is illustrated in Figure 3.2, where the inequality constraints are represented by
vertical lines, associated with an arrow pointed towards the feasible domain. The
solution to this problem is x∗ = 1. In this case, we can ignore the constraint x ≤ 4.
However, the constraint x ≥ 1 cannot be ignored without modifying the solution. It
is said to be active. Using the notation (1.73), the problem can be written as
min x2 (3.7)
x∈R
subject to
g1 (x) = x−4 ≤ 0
(3.8)
g2 (x) = 1−x ≤ 0.
We have g1 (x∗ ) = −3 and g2 (x∗ ) = 0, and g1 (x∗ ) < 0 and g2 (x∗ ) = 0. The first
constraint is verified with strict inequality and is inactive. The second constraint is
verified with equality and is active.
f(x) = x2
f(x)
x∗ = 1
-4 -2 0 2 4
x
gi (x) ≤ 0 (3.9)
54 Active constraints
is said to be active in x∗ if
gi (x∗ ) = 0, (3.10)
and inactive in x∗ if
gi (x∗ ) < 0. (3.11)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
hi (x) = 0 (3.12)
hi (x∗ ) = 0. (3.13)
subject to
g(x) ≤ 0, (3.15)
x ∈ Y ⊆ Rn , (3.16)
where g : Rn −→ Rm is continuous and Y is a subset of Rn . If x∗ is feasible, i.e.,
g(x∗ ) ≤ 0, and if A(x∗ ) ⊆ {1, . . . , p} is the set of indices of the active constraints
in x∗ , i.e.,
A(x∗ ) = {i|gi (x∗ ) = 0}, (3.17)
we consider the following optimization problem P2
subject to
gi (x) = 0, i ∈ A(x∗ ), (3.19)
x ∈ Y ⊆ Rn . (3.20)
Here, x∗ is a local minimum of P1 if and only if x∗ is a local minimum of P2 .
Constraints 55
as illustrated in Figure 3.3. Consider two feasible neighborhoods around x∗ . The first
one is defined as
and contains neighbors of x∗ that are feasible for the problem P1 . The second is
defined as
We show that
Y2 (ε̃) ⊆ Y1 (^ε). (3.25)
Indeed, take any x in Y2 (ε̃). In order to show that it belongs to Y1 (^ε), we need to
show that g(x) ≤ 0, x ∈ Y, and kx − x∗ k ≤ ^ε. Since ε̃ ≤ ^ε, we have kx − x∗ k < ε̃ ≤ ^ε,
and the third condition is immediately verified. The second condition (x ∈ Y) is
inherited from the definition of Y2 (ε̃). We need only to demonstrate that g(x) ≤ 0.
To do this, consider the constraints of A(x∗ ) separately from the others. By definition
of Y2 , we have gi (x) = 0 for i ∈ A(x∗ ), which implies gi (x) ≤ 0. Take j 6∈ A(x∗ ).
Since ε̃ ≤ εj , we have gj (x) < 0 according to (3.21), which implies gj (x) ≤ 0. This
completes the proof that g(x) ≤ 0, so that x ∈ Y1 (^ε).
As a result of (3.25), since x∗ is the best element (in the sense of the objective
function) of Y1 (^ε) (according to Definition 1.5 of the local minimum), and since x∗
belongs to Y2 (ε̃), it is also the best element of this set, and a local minimum of P2 .
Necessary condition. Let X1 be the set of feasible points of P1 and X2 the set of
feasible points of P2 . We have X2 ⊆ X1 . Let x∗ be a local minimum of P2 . We assume
by contradiction that it is not a local minimum of P1 . Then, for any ε > 0, there
exists x ∈ X1 such that kx − x∗ k ≤ ε and f(x) < f(x∗ ). Since x∗ is a local minimum
of P2 , x cannot be feasible for P2 , and x 6∈ X2 ⊆ X1 , leading to the contradiction.
56 Linear independence of the constraints
gj (x) > 0
x∗✛ εj ✲
gj (x) < 0
subject to
Ax = b (3.27)
x ≥ 0 (3.28)
Since the inequality constraints are simple, we analyze in more details the system
of equations Ax = b. Like any linear system, three possibilities may arise:
• the system is incompatible, and there is no x such that Ax = b;
• the system is underdetermined, and there is an infinite number of x such that
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ax = b;
• the system is non singular, and there is a unique x that satisfies Ax = b.
In an optimization context, incompatible and non singular systems have little rele-
vance because they leave no degree of freedom to optimize any objective. We thus
only consider underdetermined systems.
If the system is compatible, the rank of A (Definition B.29) gives us information
on the relevance of the various constraints. If the rank is deficient, this means that
certain rows of A form a linear combination of the others, and the corresponding
constraints are redundant. This is formalized by Theorem 3.6 and illustrated by
Example 3.7.
Ãx = b̃ ⇐⇒ Ax = b, (3.29)
Proof. Since the rank of A is r, this signifies that m − r rows of A can be written as
linear combinations of r other rows. Without loss of generality, we can assume that
the last m − r rows are linear combinations of the first r rows. By denoting aTk the
kth row of A, we have
r
X
ak = λjk aj k = r + 1, . . . , m and ∃j t.q. λjk 6= 0. (3.30)
j=1
Denote à the matrix composed of the first r rows of A, and b̃ the vector composed
of the first r components of b. Then, ℓi = i, i = 1, . . . , r.
=⇒ Consider x such that Ãx = b̃. According to the definition of Ã, we have that x
satisfies the first r equations of the system, i.e., aTi x = bi for i = 1, . . . , r. Select
k as an arbitrary index between r + 1 and m, and demonstrate that x satisfies the
58 Linear independence of the constraints
= bk according to (3.31).
x1 + x2 + x3 = 1
x1 − x2 + x4 = 1 (3.32)
x1 − 5x2 − 2x3 + 3x4 = 1
i.e.,
1 1 1 0 1
A = 1 −1 0 1 b = 1 . (3.33)
1 −5 −2 3 1
The rank of A is equal to 2, but there are 3 rows (the determinant of any squared
submatrix of dimension 3 is zero). This means that one of the rows is a linear
combination of the others. Since the system is compatible (for instance, x1 = 2/3,
x2 = 0,x3 = 1/3, x4 = 1/3 is feasible), one of the constraints must be redundant. In
this case, if aTi represents the ith row of A, we have
x1 + x2 + x3 = 1
(3.35)
x1 − x2 + x4 = 1
or by
∇h(x+ )T x = ∇h(x+ )T x+ − h(x+ ).
Therefore, the gradients of equality constraints play a similar role as the rows of
the matrix A in (3.27). As for the inequality constraints, we saw in Section 3.1 that
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
those that are inactive at x+ can be ignored, and that those that are active can be
considered equality constraints. Consequently, we can define the condition of linear
independence as follows.
We have
2x1 −2x1
∇g(x) = and ∇h(x) = .
2x2 − 2 1
2
h(x) = x2 − x21 = 0
1.5
1 •xa
0.5
x2
0 •xb
-1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x1
Figure 3.4: Linear independence of the constraints
60 Feasible directions
Consider the point xa = (1, 1)T , that is feasible, and for which the constraint
(3.36) is active. We have
2 −2
∇g(xa ) = and ∇h(xa ) = .
0 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
These two vectors are linearly independent, and the linear independence of the con-
straints is satisfied in xa . Figure 3.4 represents the normalized vectors
√ !
∇g(xa ) 1 ∇h(xa ) −2 5
5
= and = √ .
k∇g(xa )k 0 k∇h(xa )k 5
5
Consider the point xb = (0, 0)T , that is also feasible, and for which the constraint
(3.36) is active. We have
b 0 b 0
∇g(x ) = and ∇h(x ) = .
−2 1
These vectors are represented as normalized in Figure 3.4. They are linearly depen-
dent because ∇g(xb ) = −2∇h(xb ), and the linear independence of the constraints is
not satisfied in xb .
In short, it is a direction that can be followed, at least a little bit, while staying
within the feasible set. Some examples are provided in Figure 3.5, where the feasible
set is the polygon represented by thin lines, feasible directions are represented with
thick plain lines, and infeasible directions with thick dashed lines.
Theorem 3.11 (Feasible direction in a convex set). Let X be a convex set, and
consider x, y ∈ X, y 6= x. The direction d = y − x is a feasible direction in x and
x + αd = x + α(y − x) is feasible for any 0 ≤ α ≤ 1.
•y
d=y−x
x•
Proof. According to the definition of an interior point (Definition 1.15), there exists
a (convex) neighborhood V = {z such that kz − xk ≤ ε} such that V ⊆ X and ε > 0.
Consider an arbitrary direction d, and let y = x + εd/kdk be the point where the
direction intersects the border of the neighborhood. Since ky − xk = ε, then y ∈ V.
Since V is convex, Theorem 3.11 is invoked to demonstrate that d is feasible.
This result is particularly important. The fact that all directions are feasible at
an interior point gives freedom to algorithms in the selection of the direction. This
is what motivates the method of interior points, as described in Chapter 18.
62 Feasible directions
Theorem 3.13 (Feasible directions: linear case). Consider the optimization prob-
lem (3.26)–(3.28) min f(x) subject to Ax = b and x ≥ 0, and let x+ be a feasible
point. A direction d is feasible in x+ if and only if
1. Ad = 0, and
2. di ≥ 0 when x+
i = 0.
If we choose α ≤ η, we have
x+
α≤η≤− i
∀i t.q. x+
i > 0 and di < 0,
di
and
x+
i + αdi ≥ 0
because di < 0.
Constraints 63
is a feasible direction.
Proof. The two conditions of Theorem 3.13 are trivially satisfied for d.
To switch to the non linear case, we must use the gradients of the constraints.
Before this, we propose to interpret Theorem 3.13 in terms of gradients.
The first condition of the theorem concerns equality constraints. We have seen
that the rows of the matrix A are the gradients of the constraints, i.e. ∇hi (x) = ai ,
with
hi (x) = aTi x − bi = 0.
∇hi (x)T d = 0 i = 1, . . . , m.
gi (x) = −xi ≤ 0 i = 1, . . . , p,
and
0
..
.
0
∇gi (x) = −1 and ∇gi (x)T d = −di .
0
..
.
0
The second condition of the theorem can be expressed as follows: “If the constraint
gi (x) is active at x+ , then ∇gi (x+ )T d ≤ 0.” We should also note that if an inequality
constraint is not active at x+ , it does not involve any condition on the direction for
the latter to be feasible.
64 Feasible directions
Unfortunately, the generalization of these results to the non linear case is not
trivial. We develop it in two steps. We first see how to characterize feasible directions
for an inequality constraint. We treat the equality constraint later.
We observe that the gradient of an inequality constraint at a point where it is
active points toward the outside of the constraints, as shown by Example 3.15.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x2
✻
✛ 1
(x
2 1
− 1)2 + 1
(x
2 2
− 1)2 <= 1
2
✲
✲
x1
Intuitively, the gradient direction and the directions that form an acute angle with
it cannot be considered as feasible directions.
In this case, nothing can guarantee that there exists α such that x+ + αd is feasible.
However, we can make the infeasibility as little as desired by choosing a sufficiently
small α.
We now analyze the feasible directions for an equality constraint
h(x) = 0.
h(x) ≤ 0
−h(x) ≤ 0.
Since the equality constraints pose a problem, we address the problem in the other
direction. Instead of positioning ourselves on a feasible point x+ and wondering how
to reach another one, we attempt to identify the ways to reach x+ while remaining
feasible. To do this, we introduce the concept of feasible sequences.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
h(x) = x21 − x2 = 0,
satisfies the three conditions of Definition 3.17 and belongs to S(x+ ). It is illustrated
in Figure 3.8.
h(x) = x21 − x2 = 0
x2
•
••
•••••••••
+•
x =0
-1 -0.5 0 0.5 1
x1
Figure 3.8: Example of a feasible sequence
Constraints 67
Given that the sequence (xk )k is feasible in x+ , we consider the directions con-
necting xk to x+ by normalizing them:
xk − x+
dk = . (3.40)
kxk − x+ k
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We should keep in mind that these directions are generally not feasible directions.
We are looking at what happens at the limit.
Example 3.19 (Feasible direction at the limit). We consider once again Exam-
ple 3.18. We have xk − x+ = xk ,
√
+ k2 + 1
kxk − x k =
k2
and !
√ k
dk = k2 +1 .
√ 1
k2 +1
At the limit, we obtain
1
d = lim dk = .
k→∞ 0
These directions are illustrated in Figure 3.9. Note that
+ 0
∇h(x ) = and ∇h(x+ )T d = 0.
−1
d1
h(x) = x21 − x2 = 0
x2
d2
d3
•
•• d
•••••••••
+•
x =0
-1 -0.5 0 0.5 1
x1
Figure 3.9: Example of a feasible direction at the limit
Example 3.20 (Feasible direction at the limit). As for Example 3.18, we consider
the constraint in R2 :
h(x) = x21 − x2 = 0,
!
(−1)k
xk = k
1
k2
satisfies the three conditions of Definition 3.17 and belongs to S(x+ ). The calculation
of the directions gives
k !
(−1) k
√
dk = k2 +1
√ 1 ,
k2 +1
and limk→∞ dk does not exist. However, if we consider the subsequences defined by
the even and odd indices, respectively, we obtain
′ 1
d = lim d2k =
k→∞ 0
and
′′ −1
d = lim d2k+1 = ,
k→∞ 0
• h(x) = x21 − x2 = 0
d1
x2
d2
d3
• d4
d ′′ • d′
• •• •••••••• •
x+ = 0
-1 -0.5 0 0.5 1
x1
Figure 3.10: Example of a feasible sequence
We can now formally define the notion of a feasible sequence at the limit.
Constraints 69
Definition 3.21 (Feasible direction at the limit). Consider the optimization problem
(1.71)–(1.74), and a feasible point x+ ∈ Rn . Let (xk )k∈N be a feasible sequence in
x+ . The direction d 6= 0 is a feasible direction at the limit in x+ for the sequence
(xk )k∈N if there exists a subsequence (xki )i∈N such that
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
d xki − x+
= lim . (3.41)
kdk i→∞ kxki − x+ k
Note that any feasible direction d is also a feasible direction at the limit. Just
take the feasible sequence xk = x+ + k1 d in Definition 3.21.
Definition 3.22 (Tangent cone). A feasible direction at the limit is also called a
tangent direction. The set of all tangent directions in x+ is called the tangent cone
and denoted by T (x+ ).
We can now make the connection between this concept and the constraint gradient.
According to Theorem 3.16 and the associated comments, we consider all directions
that form an obtuse angle with the active inequality constraint gradients and those
that are orthogonal to the equality constraint gradients.
and
dT ∇hi (x+ ) = 0, i = 1, . . . , m, (3.43)
and of all their multiples, i.e.,
Theorem 3.24 (Feasible directions at the limit). Consider the optimization prob-
lem(1.71)–(1.74), and a feasible point x+ ∈ Rn . Any feasible direction at the
limit in x+ belongs to the linearized cone in x+ , that is
Proof. Let d be a normalized feasible direction at the limit, and xk a feasible sequence
such that
xk − x+
d = lim . (3.46)
k→∞ kxk − x+ k
gi (x+ ) = 0.
hi (x+ ) = 0.
hi (x+ ) ≤ 0
−hi (x+ ) ≤ 0
which are both active at x+ . According to the first point already demonstrated,
we have 0 ≤ dT ∇hi (x+ ) and 0 ≤ −dT ∇hi (x+ ), and obtain (3.43).
Theorem 3.24 does not yet provide a characterization of feasible directions at the
limit. Nevertheless, such a characterization is important, especially since the notion
of linearized cone is easier to handle than the concept of feasible direction at the limit.
Unfortunately, such a characterization does not exist in the general case. Therefore,
it is useful to assume that any element of the linearized cone is a feasible direction at
the limit. This hypothesis is called a constraint qualification.1
1 Several constraint qualifications have been proposed in the literature. This one is sometimes
called the Abadie Constraint Qualification, from the work by Abadie (1967).
Constraints 71
h(x) = x21 − x2 = 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
d ′′ x+ = 0 d′
x2
-1 -0.5 0 0.5 1
x1
Figure 3.11: Gradient and feasible directions at the limit
that is
T (x+ ) = D(x+ ). (3.48)
Proof. Theorem 3.24 shows that T (x+ ) ⊆ D(x+ ). To demonstrate that D(x+ ) ⊆
T (x+ ), consider a normalized direction2 d that belongs to the linearized cone D(x+ ).
We need to create a feasible sequence (xk )k , such that (3.41) is satisfied.
For each inequality constraint i active at x+ , we have
Following the arguments developed in Theorem 3.5, there exists ε such that all
constraints that are inactive at x+ are also inactive in any point of the sphere of
radius ε centered in x+ . Consider the sequence (xk )k with
ε
xk = x+ + d k = 1, 2, . . . (3.51)
k
Each xk is situated in the sphere mentioned above, and satisfies the inequality con-
straints that are inactive at x+ . For the inequality constraints that are active at x+ ,
we have
Since d is in the linearized cone at x+ , ∇gi (x+ )T d = aTi d ≤ 0, and xk is feasible for
any inequality constraint. For the equality constraint, we obtain in a similar manner
ε T
hi (xk ) = ā d.
k i
Finally, we now need only deduce from kdk = 1 that, for any k,
xk − x+ (ε/k)d
= =d
kxk − x+ k ε/k
Proof. Theorem 3.24 shows that T (x+ ) ⊆ D(x+ ). To demonstrate that D(x+ ) ⊆
T (x+ ), consider a normalized direction d that belongs to the linearized cone D(x+ ).
We create a feasible sequence (xk )k , such that (3.41) is satisfied. We create it implic-
itly and not explicitly.
To simplify the notations, we first assume that all constraints are equality con-
straints. We consider the Jacobian matrix of constraints in x+ , ∇h(x+ )T ∈ Rm×n ,
for which the rows are constraint gradients in x+ (see Definition 2.18). Since the
constraints are linearly independent, the Jacobian matrix is of full rank. Consider a
matrix Z ∈ Rn×(n−m) for which the columns form a basis of the kernel of ∇h(x+ )T ,
i.e., such that ∇h(x+ )T Z = 0. We apply the theorem of implicit functions (Theo-
rem C.6) to the parameterized function F : R × Rn → Rn defined by
h(x) − µ∇h(x+ )T d
F(µ, x) = . (3.53)
ZT (x − x+ − µd)
∇x F(µ, x) = (∇h(x) Z)
is non singular since the columns of Z are orthogonal to those of ∇h(x), and since
the two submatrices are of full rank. Then, we have a function φ such that
x+ = φ(0) (3.54)
Since d is in the linearized cone, we deduce from the first part of (3.55)
and φ(µ) is feasible. We use φ to build a feasible sequence. To do so, we show that
φ(µ) 6= x+ when µ 6= 0. Assume by contradiction that φ(µ) = x+ . In this case,
h(x+ ) − µ∇h(x+ )T d −µ∇h(x+ )T d
F(µ, x+ ) = = = 0. (3.57)
ZT (x+ − x+ − µd) −µZT d
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
If µ 6= 0, and since the matrices ∇h(x+ )T and Z are of full rank, we deduce that d = 0,
which is impossible since kdk = 1. Then, if µ 6= 0, we necessarily have φ(µ) 6= x+ .
We are now able to generate a feasible sequence. To do so, we consider a sequence
(µk )k such that limk→∞ (µk )k = 0. Then, the sequence
xk = φ(µk ) (3.58)
satisfies all conditions to be a feasible sequence (see Definition 3.17). We now need
to demonstrate that d is a feasible direction at the limit.
For a sufficiently large k, such that µk is sufficiently close to zero, we use a Taylor
series of h around x+
in (3.55) to obtain
0 = F(µ , x )
k k+ T
∇h(x ) (xk − x+ ) + o(kxk − x+ k) − µk ∇h(x+ )T d
=
ZT (xk − x+ − µk d)
∇h(x ) (xk − x+ − µk d) + o(kxk − x+ k)
+ T
=
ZT (xk − x+ − µk d)
∇h(x+ )T
= (xk − x+ − µk d) + o(kxk − x+ k)
ZT
∇h(x+ )T xk −x+
+
k −x k)
= T kx −x
µk
+ k − kx −x+ k d + o(kx
kxk −x+ k .
Z k k
Then, since the matrices ∇h(xk )T and ZT are of full rank, we have
xk − x+ µk
lim − d = 0. (3.59)
k→∞ kxk − x+ k kxk − x+ k
Define
xk − x+ µk
d̃ = lim +
and c = lim ,
k→∞ kxk − x k k→∞ kxk − x+ k
xk − x+
lim = d.
k→∞ kxk − x+ k
Constraints 75
from which we deduce the feasibility of φ(µ). Inactive constraints do not pose a prob-
lem, since there is a sphere around x+ such that all elements satisfy these constraints.
Since Definition 3.17 is asymptotic, we can always choose k sufficiently large such
that xk belongs to this sphere.
Feasible directions at the limit are an extension of the concept of a feasible direction.
It enables us to identify in which direction an infinitesimal displacement continues
to be feasible. Unfortunately, the definition is too complex to be operational. The
linearized cone, based on the constraint gradients, is directly accessible to the calcu-
lation. We usually assume that the constraint qualification is satisfied.
x3 = 1 − x1 − x2
(3.62)
x4 = 1 − x1 + x2 .
Thus, the optimization problem can be rewritten so as to depend only on two variables
x1 and x2 :
without constraint.
76 Elimination of constraints
Ax = b (3.64)
AP = (B N) (3.65)
where B ∈ Rm×m contains the m first columns of AP, and N ∈ Rm×(n−m) contains
the n − m last ones. Recalling that PPT = I, we write (3.64) in the following manner
The variables xB are called basic variables, and the variables xN non basic variables.
Example 3.30 (Elimination of variables – II). In Example 3.29, we have
1 1 1 0 1
A= b= .
1 −1 0 1 1
The variables to eliminate are x3 and x4 . They correspond to the last two columns
of the constraint matrix, and we choose the permutation matrix to make them the
first two, that is
0 0 1 0
0 0 0 1
P= 1 0 0 0
0 1 0 0
Constraints 77
to obtain
1 0 1 1 1 0 1 1
AP = (B|N) = B= N=
0 1 1 −1 0 1 1 −1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and
x3
xB = = B−1 (b − NxN )
x4
1 0 1 1 1 x1
= −
0 1 1 1 −1 x2
1 − x1 − x2
=
1 − x1 + x2
It is relatively easy to remove linear equality constraints. However, note that the
calculation of the matrix B−1 can be tedious, especially when m is large, and it is
sometimes preferable to explicitly maintain the constraints for the problem.
The elimination of non linear constraints can be problematic. An interesting
example, proposed as an exercise by Fletcher (1983) and again by Nocedal and Wright
(1999), illustrates this difficulty.
Example 3.31 (Elimination of non linear constraints). Consider the problem
subject to
(x1 − 1)3 = x22
3
x22 = (x1 − 1)3
2
0
x2
(1, 0)
-1
-2
-3
-3 -2 -1 0 1 2 3
x1
Figure 3.12: The problem in Example 3.31
78 Linear constraints
as shown in Figure 3.13. The problem is that the substitution can only be performed
if x1 ≥ 1, since x22 must necessarily be non negative. This implicit constraint in the
original problem should be explicitly incorporated in the problem after elimination.
It plays a crucial role since it is active at the solution.
20
x21 + (x1 − 1)3
10
0
-10
f̃(x1 )
-20
-30
-40
-50
-60
-3 -2 -1 0 1 2 3
x1
Figure 3.13: The problem without constraint in Example 3.31
3.5.1 Polyhedron
We analyze the linear constraints (3.27)–(3.28) from a geometrical point of view. The
central concept in this context is the polyhedron.
Constraints 79
{x ∈ Rn |Ax = b, x ≥ 0} , (3.72)
Note that according to Theorem 3.6, the matrix A is assumed to be of full rank
without loss of generality.
The identification of vertices or extreme points of a polyhedron is possible thanks
to the technique of elimination of variables described above. We begin by formally
defining a vertex.
x
P
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
z̃
x̃
ỹ
AP = (B|N) (3.74)
Proof. Without loss of generality, and to simplify the notations in the proof, we
assume that the m columns chosen are the m first ones, such that the permutation
matrix P = I. We assume by contradiction that there exists y, z ∈ P, y 6= x, z 6= x
and 0 ≤ λ ≤ 1 such that
x = λy + (1 − λ)z. (3.76)
After decomposition, we obtain
xB = λyB + (1 − λ)zB , (3.77)
and
xN = λyN + (1 − λ)zN . (3.78)
Since y and z are in P, we have yN ≥ 0 and zN ≥ 0. Since 0 ≤ λ ≤ 1, the only way
for xN = 0 is that yN = zN = 0. Then,
yB = B−1 (b − NyN ) = B−1 b = xB , (3.79)
Constraints 81
and
zB = B−1 (b − NzN ) = B−1 b = xB . (3.80)
We obtain x = y = z, which contradicts the fact that y and z are different from x,
and proves the result.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
It then appears that the vertices can be characterized by the set of active con-
straints.
x∗i
αi = − .
di
α∗ = min αi
i|di >0
and j an index for which the minimum is reached, i.e., α∗ = αj . The point x1 = x0 +
α∗ d belongs to the polyhedron by construction. Moreover, (x1 )j = 0 and (x0 )j > 0.
Then, the dimension of L(x1 ) is strictly inferior to that of L(x0 ). We now need
only repeat the procedure to obtain, after a certain number of iterations k at most
equal to the dimension of L(x0 ), a point xk such that dim L(xk ) = 0. According to
Theorem 3.36, xk is a vertex of P. This proof is illustrated in Figure 3.15, where
the linear manifold {x|Ax = b} is shown. In this example, L(x0 ) is the represented
plane, L(x1 ) is the straight line corresponding to the second coordinate axis, and
L(x2 ) = {x2 }.
Constraints 83
✻
x0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x1
✲
x2 = xk
with
1 1 1 0 1
A= b= . (3.83)
1 −1 0 1 1
84 Linear constraints
x2 ✻
3
d1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
d3
❘ x1 + x2 = 1
❄ ✠
c4
■d
1 ✲
c3
d 2 x1
✠
■ x −x =1
1 2
This basic solution is feasible and also corresponds to point 2 in Figure 3.16.
3. Basic solution with x1 and x4 in the basis (j1 = 1, j2 = 4).
1
1 0 1 0 1 0
B= ; B−1 = ; xB = B−1 b = ;x =
0 .
1 1 −1 1 0
0
This basic solution is feasible and also corresponds to point 2 in Figure 3.16.
4. Basic solution with x2 and x3 in the basis (j1 = 2, j2 = 3).
0
1 1 0 −1 −1 −1
B= ; B−1 = ; xB = B−1 b = ;x =
2 .
−1 0 1 1 2
0
The notion of a basic solution (Definition 3.38) enables us to analyze the poly-
hedron in terms of active constraints of the optimization problem (Definition 3.4).
Let x be a feasible basic solution such that xB = B−1 b > 0. We say that it is non
degenerate. In this case, there are exactly n active constraints in x: the m equal-
ity constraints and the n − m non basic variables which are 0, and which make the
86 Linear constraints
Theorem 3.40 (Equivalence between vertices and feasible basic solutions). Let P =
{x ∈ Rn |Ax = b, x ≥ 0} be a polyhedron. The point x∗ ∈ P is a vertex of P if and
only if it is a feasible basic solution.
xB = B−1 (b − NxN ).
Since x∗ is not a feasible basic solution, there exists at least one component k of
xN that is not zero. We construct the direction d for which the basic component
is
dB = −B−1 Ak ,
where Ak is the kth column of A, and the non basic component for all zero
components, except the kth one which equals 1. Therefore,
X
Ad = BdB + Ndn = −BB−1 Ak + Aj dj = −Ak + Ak = 0.
jnon basic
It is important to note that Theorem 3.40 does not guarantee a bijective rela-
tionship between the vertices of the polyhedron and the feasible basic solutions in all
Constraints 87
cases. Indeed, when some of the components of xB = B−1 b are zero, there are more
than n active constraints, and the feasible basic solution is defined by more than n
equations in a space of n dimensions. We say in this case that we are dealing with a
degenerate feasible basic solution.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
that is,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
dB = −B−1 Ap . (3.88)
i.e., that all the elements of dNp are zero, except the one corresponding to the variable
p, which is 1.
Note that these directions are not always feasible, as discussed later. But first, we
illustrate the concept with Example 3.39.
Example 3.43 (Basic directions). Consider the polygon in Example 3.39, and the
feasible basic solution where x2 and x4 are in the basis. Then
0 0 0 1 0
1 1 0 0 0
x=
0 and P = 0 0 0 1 .
2 0 1 0 0
The basic direction corresponding to the non basic variable x1 is
1 0 1 −1 1
−B−1 A1 − −1
d1 = P = P 1 1 1 = P −2 =
1 1 1 0 ,
0
0 0 −2
and the basic direction corresponding to the non basic variable x3 is
1 0 1 −1 0
−B−1 A3 − −1 −1
= P 1 1 0 = P =
d3 = P 0 0 1 .
0
1
1 1 −1
Constraints 89
These two directions are shown in Figure 3.16, from the feasible basic solution 3.
We now consider the feasible basic solution where x1 and x4 are in the basis (point
2 in Figure 3.16). Then,
1 1 0 0 0
0 0 0 1 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x=
0 and P = 0 0 0 1 .
0 0 1 0 0
These directions are not represented in Figure 3.16. Finally, consider the feasible
basic solution where x1 and x2 are in the basis. Then,
1 1 0 0 0
0 0 1 0 0
x=
0 and P = 0 0 1
= I.
0
0 0 0 0 1
b4 is a feasible direction,
These two directions are shown in Figure 3.16. Note that d
b
whereas d3 is not.
90 Linear constraints
in x.
where N is the set of indices of the non basic variables, dj ∈ Rn the jth basic
direction, and (d)j ∈ R, the jth component of d.
Proof. Consider a feasible direction d, and assume without loss of generality that the
basic variables are the m first ones. According to Theorem 3.13, we have
Ad = BdB + NdN = 0
and
n
X
dB = −B−1 NdN = − (d)j B−1 Aj (3.92)
j=m+1
where ek ∈ Rn−m is a vector for which all the components are zero, except the kth
one, which is 1. According to Definition 3.42, (3.92) and (3.93) are written as
Xn Xn
dB −B−1 Aj
d= = (d)j = (d)j dj , (3.94)
dN ej−m
j=m+1 j=m+1
The proof of Theorems 3.27 and 3.28 is inspired by Nocedal and Wright (1999).
That of Theorems 3.36 and 3.37 is inspired by de Werra et al. (2003).
3.6 Exercises
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x1 + x2 ≤ 3
x1 + x3 ≤ 7
x1 ≥ 0
x2 ≥ 0
x3 ≥ 0.
−x1 + x2 ≤1
x1 + 2x2 ≤ 4.
Exercise 3.5. Consider the feasible set defined by the following constraints:
x1 − x2 ≥ −2
2x1 + x2 ≤ 8
x1 + x2 ≤ 5
x1 + 2x2 ≤ 10
x1 ≥ 0
x2 ≥ 0
Chapter 4
Introduction to duality
There are those who are subject to constraints and others who impose them. We
now take the point of view of the second category in order to analyze an optimization
problem from a different angle.
Contents
4.1 Constraint relaxation . . . . . . . . . . . . . . . . . . . . . 93
4.2 Duality in linear optimization . . . . . . . . . . . . . . . . 102
4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Everest, culminating at 8,848 meters (Figure 4.1(b)). The billionaire thus decides to
set the fine at e 4,041. In this case, climbing Everest would give the mountaineer
8,848 − 4,041 = e 4,807, which is exactly the same amount as if he decided to climb
Mont Blanc. Therefore, the mountaineer has no interest in violating the constraint,
and the final solution to the problem is the same as with the constraint.
We can model the problem of the climber by calling his position (longitude/latitude)
x and the corresponding altitude f(x). The first problem is a constrained optimization
problem:
max f(x)
x
subject to
x ∈ Alps .
The fine imposed by the billionaire is denoted by a(x), and depends on the position
x. In particular, a(x) = 0 if x ∈ Alps. The optimization problem is now without
constraints and can be expressed as
subject to
1 − x1 − x2 = 0
x1 ≥ 0 (4.2)
x2 ≥ 0
for which the solution is x∗ = (0, 1)T with an optimal value 1. We now relax the
constraint 1 − x1 − x2 = 0 and introduce a fine that is proportional to the violation
of the constraint, with a proportionality factor λ. This way, the fine is zero when the
constraint is satisfied. We obtain the following problem:
subject to
x1 ≥ 0
(4.4)
x2 ≥ 0 .
• If λ = 0, (4.3) becomes 2x1 + x2 and the solution to the problem is x∗ = (0, 0)T
with an optimal value of 0 (Figure 4.3). This solution violates the constraint of
the original problem, and the optimal value is lower. It is a typical case where
the penalty value is ill-suited, and where it becomes interesting to violate the
constraint.
96 Constraint relaxation
30
20
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10
2x + y 0
-10
-20
-30 10
5
0 x2
-5
-10 -5 -10
0 5 10
x1
30
20
10
2−y 0
-10
-20
-30
10
5
0 x2
-5
-10 -5 0 -10
5 10
x1
30
20
10
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1+x 0
-10
-20
-30
10
5
0 x2
-5
-10 -5 0 -10
5 10
x1
As we did in Example 4.2, we can minimize the Lagrangian function for each fixed
value of the parameters λ and µ. Indeed, the Lagrangian function now depends only
on x. The function that associates a set of parameters to the optimal value of the
associated problem is called a dual function.
is the dual function of the problem (1.71)–(1.73). The parameters λ and µ are called
dual variables. In this context, the variables x are called primal variables.
98 Constraint relaxation
If we take Example 4.1, −q(λ, µ) represents the mountaineer’s prize1 if the bil-
lionaire imposes a fine for violation of the constraints λT h(x) + µT g(x).
For inequality constraints, since only non negative values of g(x) should be avoided
and result in a fine, it is essential that µ ≥ 0. Indeed, the term µT g(x) is non negative,
and thus penalizing, only when g(x) > 0.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Theorem 4.5 (Bound from dual function). Let x∗ be the solution to the opti-
mization problem (1.71)–(1.73), and let q(λ, µ) be the dual function to the same
problem. Consider λ ∈ Rm and µ ∈ Rp , µ ≥ 0. Then,
and the dual function provides lower bounds on the optimal value of the problem.
Proof.
Corollary 4.6 (Objective functions of the primal and dual). Let x be a feasible
solution of the optimization problem (1.71)–(1.73), and let q(λ, µ) be the dual
function to the same problem. Consider λ ∈ Rm and µ ∈ Rp , µ ≥ 0. Then,
Proof. Denote x∗ the optimal solution of the primal problem. As x is primal feasible,
we have f(x∗ ) ≤ f(x). The results follows from Theorem (4.5).
If we take the point of view of the billionaire, the problem is to define these fines
in such a manner that the mountaineer wins as little as possible with the new system.
He tries to optimize the dual function, ensuring that the considered parameters λ and
µ ≥ 0 do not generate an unbounded problem. This optimization problem is called
the dual problem.
1 The sign of q is changed because the problem with the mountaineer is one of maximization and
not minimization.
Introduction to duality 99
subject to
µ≥0 (4.11)
and
(λ, µ) ∈ Xq (4.12)
is the dual problem of the problem (1.71)–(1.73). In this context, the original problem
(1.71)–(1.73) is called the primal problem.
subject to
h1 (x) = 1 − x1 − x2 = 0 (λ)
g1 (x) = − x1 ≤0 (µ1 ) (4.14)
g2 (x) = − x2 ≤ 0 (µ2 ) .
The Lagrangian function of this problem is
In order for the dual function to be bounded, the coefficients of x1 and x2 have to be
zero, and
2 − λ − µ1 = 0 , 1 − λ − µ2 = 0 ,
or
µ1 = 2 − λ , µ2 = 1 − λ . (4.15)
subject to
λ ≤ 1,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
for which the solution is λ∗ = 1. According to the equalities (4.15), we have µ∗1 = 1
and µ∗2 = 0.
As a direct consequence of Theorem 4.5, the optimal value of this problem can
never exceed the optimal value of the original problem. This result is called the weak
duality theorem.
Theorem 4.9 (Weak duality). Let x∗ be the optimal solution to the primal prob-
lem (1.71)–(1.73) and let (λ∗ , µ∗ ) be the optimal solution to the associated dual
problem (4.10)–(4.12). Then
Corollary 4.10 (Duality and feasibility). Consider the primal problem (1.71)–
(1.73) and the associated dual problem (4.10)–(4.12).
• If the primal problem is unbounded, then the dual problem is not feasible.
• If the dual problem is unbounded, then the primal problem is not feasible.
Proof. If the optimal value of the primal problem is −∞, there is no dual variable
(λ, µ) that satisfies (4.16) and the dual problem is not feasible. Similarly, if the
optimal value of the dual problem is +∞, there is no primal variable x that satisfies
(4.16) and the primal problem is not feasible.
Corollary 4.11 (Optimality of the primal and the dual). Let x∗ be a feasible so-
lution of the primal problem (1.71)–(1.73) and let (λ∗ , µ∗ ) be a feasible solution
of the associated dual problem (4.10)–(4.12). If q(λ∗ , µ∗ ) = f(x∗ ), then x∗ is
optimal for the primal, and (λ∗ , µ∗ ) is optimal for the dual.
Proof. Consider any x feasible for the primal. From Theorem 4.5, we have
proving the optimality of x∗ . Similarly, consider any (λ, µ) feasible for the dual. From
the same theorem, we have
Corollary 4.12 (Duality and feasibility (II)). Consider the primal problem (1.71)–
(1.73) and the associated dual problem (4.10)–(4.12).
• If the primal problem is infeasible, then the dual problem is either unbounded
or infeasible.
• If the dual problem is infeasible, then the primal problem is either unbounded
or infeasible.
Proof. We show the contrapositive. If the dual problem is bounded and feasible, it
has an optimal solution. From Corollary 4.11, the primal problem has also an optimal
solution, as is therefore feasible. The second statement is shown in a similar way.
The dual problem has interesting geometric properties. Indeed, the objective
function to maximize is concave, and the domain Xq is convex.
or
q αγ + (1 − α)γ̄ ≥ αq(γ) + (1 − α)q(γ̄) , (4.18)
which demonstrates the concavity of q (Definition 2.3). Since γ and γ̄ are in Xq , then
q(γ) > −∞ and q(γ̄) > −∞. According to (4.18), we also have q(αγ+(1−α)γ̄) > −∞
and this way αγ + (1 − α)γ̄ is in Xq , proving the convexity of Xq (Definition B.2).
102 Duality in linear optimization
subject to
Ax = b
(4.20)
x≥0
and we have
h(x) = b − Ax and g(x) = −x .
L(x, λ, µ) = cT x + λT (b − Ax) − µT x
T (4.21)
= c − AT λ − µ x + λT b .
In this case, the dual function is q(λ, µ) = λT b and the dual problem is written as
max λT b (4.22)
λ,µ
Introduction to duality 103
subject to
µ≥0
(4.23)
µ = c − AT λ .
By eliminating µ, renaming λ x, and changing the maximization to a minimization,
we obtain
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
AT x ≤ c . (4.25)
This is another linear optimization problem. We calculate its dual problem. Since
there are no equality constraints, we have
max −µT c
µ
subject to
µ≥0
Aµ = b .
By replacing µ by x, and transforming the maximization into a minimization, we
obtain the original problem (4.19)–(4.20). The dual of the dual problem is the primal
problem. We can now generalize these results.
Theorem 4.14 (Dual of a linear problem). Consider the following linear problem:
subject to
A1 x1 + B1 x2 + C1 x3 = b1
A2 x1 + B2 x2 + C2 x3 ≤ b2
A3 x1 + B3 x2 + C3 x3 ≥ b3
(4.27)
x1 ≥ 0
x2 ≤ 0
x3 ∈ Rn3 ,
where x1 ∈ Rn1 , x2 ∈ Rn2 , x3 ∈ Rn3 , b1 ∈ Rm , b2 ∈ Rpi and b3 ∈ Rps . The
matrices Ai , Bi , Ci , i = 1, 2, 3, have appropriate dimensions. The dual of this
problem is
max γT b = γT1 b1 + γT2 b2 + γT3 b3 (4.28)
γ
104 Duality in linear optimization
subject to
(γ1 ∈ Rm )
γ2 ≤ 0
γ3 ≥ 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(4.29)
AT1 γ1 + AT2 γ2 + AT3 γ3 = T
A γ ≤ c1
BT1 γ1 + BT2 γ2 + BT3 γ3 = BT γ ≥ c2
CT1 γ1 + CT2 γ2 + CT3 γ3 = CT γ = c3
T T
with γ = γT1 γT2 γT3 ∈ Rm+pi +ps and A = AT1 AT2 AT3 ∈
(m+pi +ps )×n1
R . The matrices B and C are defined in a similar manner.
µx1 = c1 − AT γ
µx2 = BT γ − c2
CT γ = c3 .
We now need only use µx1 ≥ 0 and µx2 ≥ 0 to obtain the result.
Introduction to duality 105
Note that the problem (4.26)–(4.27) combines all the possibilities of writing the
constraints of a linear problem: equality, lower inequality, upper inequality, non pos-
itivity, and non negativity. The result can be summarized as follows:
• For each constraint of the primal there is a dual variable
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Theorem 4.15 (The dual of the dual is the primal). Consider a (primal) linear
optimization problem. If the dual is converted into a minimization problem, and
we calculate its dual, we obtain a problem equivalent to the primal problem.
subject to
x 1 ∈ Rm
x2 ≥ 0
x3 ≤0
T T T
A1 x1 + A2 x2 + A3 x3 ≥ −c1
BT1 x1 + BT2 x2 + BT3 x3 ≤ −c2
CT1 x1 + CT2 x2 + CT3 x3 = −c3 .
According to Theorem 4.14, the dual of this problem is
max −c1 γ1 − c2 γ2 − c3 γ3
γ1 ,γ2 ,γ3
subject to
A1 γ1 + B1 γ2 + C1 γ3 = b1
A2 γ1 + B2 γ2 + C2 γ3 ≤ b2
A3 γ1 + B3 γ2 + C3 γ3 ≥ b3
γ1 ≥ 0
γ2 ≤ 0
γ3 ∈ Rn3 .
106 Duality in linear optimization
We now need only replace γ by x, and convert the maximization into a minimization
to obtain (4.26)–(4.27) and prove the result.
Example 4.16 (Dual of a linear problem). Consider the linear optimization problem
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
−x1 + 3x2 = 5
2x1 − x2 + 3x3 ≥ 6
x3 ≤ 4
x1 ≥ 0
x2 ≤ 0
x3 ∈ R .
subject to
γ1 ∈ R
γ2 ≥ 0
γ3 ≤ 0
−γ1 + 2γ2 ≤1
3γ1 − γ2 ≥2
3γ2 + γ3 = 3 .
This is also a linear problem. We write it as a minimization problem and rename the
variables x.
min −5x1 − 6x2 − 4x3
subject to
x1 ∈ R
x2 ≥ 0
x3 ≤ 0
x1 − 2x2 ≥ −1
−3x1 + x2 ≤ −2
−3x2 − x3 = −3 .
subject to
γ1 − 3γ2 = −5
−2γ1 + γ2 − 3γ3 ≤ −6
−γ3 ≥ −4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
γ1 ≥ 0
γ2 ≤ 0
γ3 ∈ R .
It is easy to verify that this problem is equivalent to the original problem.
Theorem 4.17 (Strong duality). Consider a linear optimization problem and its
dual. If one problem has an optimal solution, so does the other one, and the
optimal value of their objective functions are the same.
that is
Ay − rb = 0, (4.30)
and
T c
(y r) < 0,
−bT λ∗ − ε
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
that is
cT y − rbT λ∗ − rε < 0. (4.31)
We distinguish two cases.
r = 0 In this case, (4.30) is Ay = 0 and (4.31) is cT y < 0. Applying Farkas’ lemma
to the compatible system AT λ ≤ c (it is verified at least by λ∗ ), we obtain that
cT y ≥ 0, for each y ≥ 0 such that Ay = 0, contradicting (4.30)–(4.31). Therefore
r 6= 0.
r > 0 Divide (4.30) by r, and define x∗ = y/r to obtain
Ax∗ − b = 0. (4.32)
As y ≥ 0 and r > 0, x∗ is feasible for the primal problem. Dividing also (4.31) by
r, we obtain
cT x∗ − bT λ∗ − ε < 0. (4.33)
Denote δ = cT x∗ − bT λ∗ . By Corollary (4.6), as x∗ is primal feasible and λ∗ dual
feasible, we know that δ = cT x∗ − bT λ∗ ≥ 0. Therefore, (4.33) is written as
0 ≤ δ < ε.
4.3 Exercises
Exercise 4.1. Consider the optimization problem
Exercise 4.2. Same questions as for Exercise 4.1 for the problem
1 2
min (x + x22 ) s.c. x1 ≥ 1 .
x∈R2 2 1
Exercise 4.3. Consider a matrix A ∈ Rn×n such that AT = −A, and the vector
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
min cT x
x∈Rn
subject to
Ax ≥ −c
x ≥ 0.
Demonstrate that this problem is self-dual, i.e., that the dual problem is equivalent
to the primal problem.
Exercise 4.4. Consider the optimization problem
subject to
x1 − x2 ≤ 2
−x1 + x2 ≤ −3
x1 , x2 ≥ 0.
1. Write the Lagrangian.
2. Write the dual function.
3. Write the dual problem.
4. Represent graphically the feasible set of the primal problem.
5. Represent graphically the feasible set of the dual problem.
Exercise 4.5. Same questions for the following problem.
min −x1 − x2
x∈R2
subject to
−x1 + x2 ≤ 1
1
x1 − x2 ≤ 0
2
x1 , x2 ≥ 0 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part II
Optimality conditions
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Albert Einstein
Chapter 5
Unconstrained optimization
Contents
5.1 Necessary optimality conditions . . . . . . . . . . . . . . . 115
5.2 Sufficient optimality conditions . . . . . . . . . . . . . . . 120
5.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
∇f(x∗ ) = 0 . (5.1)
Proof. We recall that −∇f(x∗ ) is the direction of the steepest descent in x∗ (Theorem
2.13) and assume by contradiction that ∇f(x∗ ) 6= 0. We can then use Theorem 2.11
with the descent direction d = −∇f(x∗ ) to obtain η such that
f x∗ − α∇f(x∗ ) < f(x∗ ) , ∀α ∈ ]0, η] ,
116 Necessary optimality conditions
2
we have
1 2 T 2 ∗
f(x∗ + αd) − f(x∗ ) = α d ∇ f(x )d + o kαdk2 from (5.1)
2
1
= α2 dT ∇2 f(x∗ )d + o(α2 ) kdk does not depend on α
2
≥0 x∗ is optimal .
1 T 2 ∗ o(α2 )
d ∇ f(x )d + ≥ 0. (5.3)
2 α2
Intuitively, as the second term can be made as small as desired, the result must hold.
More formally, let us assume by contradiction that dT ∇2 f(x∗ )d is negative and that
its value is −2ε, with ε > 0. According to the Landau notation o(·) (Definition B.17),
for all ε > 0, there exists η such that
o(α2 )
< ε, ∀0 < α ≤ η ,
α2
and
1 T 2 ∗ o(α2 ) 1 T 2 ∗ o(α2 ) 1
d ∇ f(x )d + ≤ d ∇ f(x )d + < − 2ε + ε = 0 ,
2 α2 2 α2 2
which contradicts (5.3) and proves that dT ∇2 f(x∗ )d ≥ 0. Since d is an arbitrary
direction, ∇2 f(x∗ ) is positive semidefinite (Definition B.8).
From a geometrical point of view, the second-order condition means that f is
locally convex in x (Theorem 2.21).
Example 5.2 (Affine function). Consider an affine function (see Definition 2.25):
f(x) = cT x + d, (5.4)
illustrated in Figure 5.1 (see Section 11.6 for a discussion of this function). The point
T
1 1 is a local minimum of the function. We have
400 x31 − 400 x1 x2 + 2x1 − 2
∇f(x1 , x2 ) = ,
200 x2 − 200 x21
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
T
which is indeed zero in 1 1 . Moreover,
1200 x21 − 400 x2 + 2 −400 x1
∇2 f(x1 , x2 ) = ,
−400 x1 200
T
which, in 1 1 , is:
802 −400
∇2 f(1, 1) = ,
−400 200
for which the eigenvalues are positive (0.39936 and 1,001.6) and the Hessian matrix
T
is positive semidefinite. Note that the conditioning of f in 1 1 is high (2,508)
and that the function is ill-conditioned at the solution (Section 2.5).
x1 x2
T
illustrated in Figure 5.2. The point 0 0 satisfies the necessary optimality
conditions. Indeed,
−4x31
∇f(x1 , x2 ) =
−4x32
T
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
is zero in 0 0 . Moreover,
2 −12 x21 0
∇ f(x1 , x2 ) =
0 −12 x22
T
is positive semidefinite in 0 0 . However, this is not a local minimum.
T To
demonstrate this, consider a non zero arbitrary direction
T d = d1 d2 and take
a step α > 0 of any length from the point 0 0 . We have
x2
x1
T
is zero in 0 0 . Moreover,
2 100 0
∇ f(x1 , x2 ) =
0 −6x2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
T
is positive semidefinite in 0 0 . However,
T it is not a local minimum. To show
this, consider the direction d = 0 1 and take any one step α > 0 from the
T
point 0 0 . We have
x2 x1
Proof. We assume by contradiction that there exists a direction d and η > 0 such
that, for any 0 < α ≤ η, f(x∗ + αd) < f(x∗ ). With an identical approach to the proof
of Theorem 5.1, we have
o(α2 )
< ε, ∀α, 0 < α ≤ η̄ ,
α2
and then, for any α ≤ min(η, η̄), we have
o(α2 ) o(α2 )
− ≤ < ε,
α2 α2
such that
1 T 2 ∗ o(α2 )
d ∇ f(x )d = − 2 − ε < 0 ,
2 α
which contradicts the fact that ∇2 f(x∗ ) is positive definite.
Unconstrained optimization 121
1 2
f(x1 , x2 ) = x + x1 cos x2
2 1
illustrated in Figure 5.4. We use the optimality conditions to identify the minima of
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3
2
1
0
-1
-6
-4
-2
0
x2
2 -1.5
4 -0.5 -1
0.5 0
6 1
1.5 x1
T T
This gradient is zero for x∗k = (−1)k+1 , kπ , k ∈ Z, and for x̄k = 0, π2 + kπ ,
k ∈ Z, as illustrated in Figure 5.5. We also have
2 1 − sin x2
∇ f(x1 , x2 ) = .
− sin x2 −x1 cos x2
Since this matrix is positive definite, each point x∗k satisfies the sufficient optimality
conditions and is a local minimum of the function.
By evaluating the Hessian matrix in x̄k , we get for any k
2 1 (−1)k+1
∇ f(x̄k ) = .
(−1)k+1 0
122 Sufficient optimality conditions
x∗2 6
x̄1
4
x∗1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x̄0 2
x∗0 0 x2
x̄−1 -2
x∗−1
-4
x̄−2
x∗−2 -6
-1.5 -1 -0.5 0 0.5 1 1.5
x1
It means that any point strictly between x∗ and x+ is also strictly better than x∗ .
Consider an arbitrary ε > 0, and demonstrate that Definition 1.5 of the local minimum
is contradicted. If ε ≥ kx∗ − x+ k, (1.75) is not satisfied for x = x+ , when taking α = 1
in (5.7). If ε < kx∗ − x+ k, consider 0 < η < 1 such that kηx∗ + (1 − η)x+ k = ε. In
this case, (1.75) is not satisfied for x = αx∗ + (1 − α)x+ with η ≤ α < 1 according to
(5.7). Since η < 1, such α always exist.
Unconstrained optimization 123
We now consider a strictly convex function, and assume that x∗ and y∗ are two
distinct global minima, and then x∗ 6= y∗ and f(x∗ ) = f(y∗ ). According to Definition
2.2, we have
f αx∗ + (1 − α)y∗ < αf(x∗ ) + (1 − α)f(y∗ ) = f(x∗ ) = f(y∗ ) , ∀α ∈ ]0, 1[ ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We conclude this chapter with a discussion of the optimality conditions for quadratic
problems (Definition 2.28).
x∗ = −Q−1 g (5.9)
The gradient is
Λr yr + gr
∇f(y) = .
gn−r
If gn−r 6= 0, the gradient is different from zero for any value of y, and the necessary
optimality condition is never verified. Now, if gn−r = 0, the variables yn−r do
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
not affect the objective function. We fix yn−r to any arbitrary value and solve
the problem for yr :
1
min f(yr ) = yTr Λr yr + gTr yr . (5.16)
2
As Λr is positive definite, the first result of this theorem applies, and
y∗r = −Λ−1
r gr . (5.17)
The last result of Theorem 5.10 has a geometric interpretation. The Schur de-
composition actually identifies one subspace where the quadratic function is strictly
convex (the subspace corresponding to the positive eigenvalues), and one subspace
where the function is linear (the subspace corresponding to zero eigenvalues). In this
latter subspace, in order to guarantee that the function is bounded, the linear part
must be constant, which corresponds to the condition gn−r = 0 (see Example 5.2).
5.3 Exercises
For the following optimization problems :
1. Calculate the gradient and the Hessian of the objective function.
2. Identify the critical points.
3. Eliminate those that do not satisfy the necessary optimality conditions.
4. Identify those that satisfy the sufficient optimality conditions.
Exercise 5.1. min x21 + x22 .
x∈R2
1 3
Exercise 5.2. min x + x32 − x1 − x2 .
3 1
x∈R2
1
Exercise 5.3. min x2 + .
x∈R x−2
Exercise 5.4. min x61 − 3x41 x22 + 3x21 x42 − x62 .
x∈R2
Exercise 5.5. min f(x), where f is defined by one of the functions of Exercise 2.2.
x∈R2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 6
Constrained optimization
Contents
6.1 Convex constraints . . . . . . . . . . . . . . . . . . . . . . 128
6.2 Lagrange multipliers: necessary conditions . . . . . . . . 133
6.2.1 Linear constraints . . . . . . . . . . . . . . . . . . . . . . 133
6.2.2 Equality constraints . . . . . . . . . . . . . . . . . . . . . 137
6.2.3 Equality and inequality constraints . . . . . . . . . . . . . 142
6.3 Lagrange multipliers: sufficient conditions . . . . . . . . 152
6.3.1 Equality constraints . . . . . . . . . . . . . . . . . . . . . 153
6.3.2 Inequality constraints . . . . . . . . . . . . . . . . . . . . 154
6.4 Sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . 159
6.5 Linear optimization . . . . . . . . . . . . . . . . . . . . . . 165
6.6 Quadratic optimization . . . . . . . . . . . . . . . . . . . . 171
6.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
∇f(x∗ )T d ≥ 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(6.1)
Since d = limk (xk − x∗ ), and ∇f(x∗ )T d < 0, there exists an index K such that
T
xk − x∗ ∇f(x∗ ) < 0 for all k ≥ K. In addition, the term o kxk − x∗ k can be made
as small as desired by making k sufficiently large (see Theorem 2.11 or Theorem 5.1
for a more formal analysis of this result). Therefore, there exists an index k large
enough that f(xk ) < f(x∗ ), which contradicts the local optimality of x∗ .
This general result does not take into account a possible structure in the con-
straints. We now propose optimality conditions for specific problems.
min f(x) ,
x∈X
Proof. We assume by contradiction that (6.3) is not satisfied. In this case, according
to Definition 2.10, the direction d = x − x∗ is a descent direction. According to
Theorem 2.11, there exists η > 0 such that
an acute angle with the gradient, as illustrated in Figure 6.1. When the convex set
has a particular structure, the necessary optimality conditions can be simplified, as
shown in Example 6.4.
3
X ∇f(x∗ )
2
1 x − x∗
x∗•
0
-1
-2
-3
-3 -2 -1 0 1 2 3
min f(x)
x∈X⊂Rn
with
X = x | ℓi ≤ xi ≤ ui , i = 1, . . . , n , (6.5)
∂f(x∗ )
(xi − x∗i ) ≥ 0 . (6.6)
∂xi
∂f(x∗ )
≥ 0.
∂xi
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2. x∗i = ui . If we choose
ui − ℓi ui + ℓi
xi = ui − = ,
2 2
x is feasible. Moreover, xi − x∗i = −(ui − ℓi )/2 < 0. The condition (6.6) implies
that
∂f(x∗ )
≤ 0.
∂xi
3. ℓi < x∗i < ui . If we choose
ui + x∗i
xi = ,
2
x is feasible. Moreover, xi − x∗i = (ui − x∗i )/2 > 0 because x∗i < ui . The condition
(6.6) implies that
∂f(x∗ )
≥ 0.
∂xi
If we choose
ℓi + x∗i
xi = ,
2
x is feasible. Moreover, xi − x∗i = (ℓi − x∗i )/2 < 0 because ℓi < x∗i . The condition
(6.6) implies that
∂f(x∗ )
≤ 0.
∂xi
By combining these two results, we get
∂f(x∗ )
= 0.
∂xi
Then, in the case of bound constraints defined by (6.5), the necessary optimality
conditions can be written as
∂f(x∗ )
≥ 0, if x∗i = ℓi
∂xi
∂f(x∗ )
≤ 0, if x∗i = ui
∂xi
∂f(x∗ )
= 0, if ℓi < x∗i < ui
∂xi
for any i such that ℓi < ui . Finally, let us note that, in the case where ℓi = ui , each
feasible x is such that xi = ℓi = ui = x∗i and the condition (6.6) is trivially satisfied,
regardless of the value of ∂f(x∗ )/∂xi .
Constrained optimization 131
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.7 ≤ x1 ≤ 2
−1 ≤ x2 ≤ 1 .
T T
The solution is x∗ = 0.7 0 and ∇f(x∗ ) = 1.4 0 . Since x∗1 = ℓ1 = 0.7, we
∗ ∗ ∗
have ∂f(x )/∂x1 ≥ 0. Since ℓ2 < x2 < u2 , we have ∂f(x )/∂x2 = 0.
Figure 6.2(a) illustrates the problem
subject to
−2 ≤ x1 ≤ −0.7
−1 ≤ x2 ≤ 1 .
T T
The solution is x∗ = −0.7 0 and ∇f(x∗ ) = −1.4 0 . Since x∗1 = u1 =
∗ ∗ ∗
−0.7, we have ∂f(x )/∂x1 ≤ 0. Since ℓ2 < x2 < u2 , we have ∂f(x )/∂x2 = 0.
Figure 6.2: Illustration of the necessary optimality condition for bound constraints
Theorem 6.5 (Sufficient optimality conditions for convex constraints – I). Consider
the optimization problem
min f(x) ,
x∈X
f(x) − f(x∗ ) ≥ 0 , ∀x ∈ X ,
1
min f(x) = (x − z)T (x − z) subject to x ∈ X.
x 2
Since f is convex and ∇f(x) = x − z, a necessary and sufficient condition for x∗ to be
the projection on z over X is
T
x∗ − z (x − x∗ ) ≥ 0 , ∀x ∈ X . (6.7)
Theorem 6.7 (Optimality conditions for convex constraints – II). Consider the
optimization problem
min f(x) ,
x∈X
P
Proof. Consider z(α) = x∗ − α∇f(x∗ ). According to (6.7), we have z(α) = x∗ for
all α > 0 if and only if
T
x∗ − z(α) (x − x∗ ) ≥ 0 , ∀x ∈ X , ∀α > 0 ,
or
T
x∗ − x∗ + α∇f(x∗ ) (x − x∗ ) ≥ 0 , ∀x ∈ X , ∀α > 0 .
to handle. The most common cases, where the linearized cone is equivalent to the
tangent cone, are optimization problems with linear constraints (Theorem 3.27) and
linearly independent constraints (Theorem 3.28). Therefore, we present the results for
only these cases. It is also possible to develop optimality conditions by considering the
linearized cone from a general point of view. The details are described in Mangasarian
(1979) and Nocedal and Wright (1999). The necessary optimality conditions are
generally called Karush-Kuhn-Tucker conditions or KKT conditions. In fact, for
many years, they were called Kuhn-Tucker conditions, following the article by Kuhn
and Tucker (1951). It later turned out that Karush (1939) had already formulated
them independently. John (1948) proposed a generalization a decade later (Theorem
6.12).
Note that the theory of Lagrange multipliers extends beyond the optimality con-
ditions presented in this book and that they can also be adapted to non differentiable
optimization. We refer the interested reader to Bertsekas (1982) and Rockafellar
(1993).
In this text, we adopt the approach of Bertsekas (1999), who first presents these
conditions in the case of linear constraints, and then for problems including linearly
independent equality constraints. The proof provides intuitions that are reused in
the development of algorithms. Subsequently, we generalize the result for problems
that also include inequality constraints.
subject to
Ax = b (6.10)
Proof. We employ the technique for the elimination of constraints described in Section
3.4 to convert the optimization problem with constraints into an optimization problem
without constraint (3.70). To simplify the proof, we can assume that the variables
are arranged in a way that the m variables to eliminate are the m first ones. Then,
P = I in (3.70) and the minimization problem is
−1
B b − NxN
min g(xN ) = f . (6.13)
xN ∈Rn−m xN
If x∗ = (x∗B , x∗N ) is a local minimum of the problem with constraints, then x∗N is a
local minimum of the problem without constraints and the necessary condition (5.1)
applies to (6.13). By using chain rule differentiation (see (C.6) of Theorem C.3) we
obtain:
∇g(x∗N ) = −NT B−T ∇B f(x∗ ) + ∇N f(x∗ ) = 0 , (6.14)
where ∇B f(x∗ ) and ∇N f(x∗ ) represent the gradient of f with regard to the variables
xB and xN , respectively. If we define
∇B f(x∗ ) + BT λ∗ = 0 , (6.16)
Constrained optimization 135
∇N f(x∗ ) + NT λ∗ = 0 . (6.17)
Equations (6.16) and (6.17) form (6.11), which proves the first-order result.
To demonstrate the second-order result, we first derive (6.11) to obtain
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Then,
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x1 + x2 + x3 =1
x1 − x2 + x4 = 1 .
The solution to this problem is
2/3 4/3
0 0
x∗ =
1/3
and ∇f(x∗ ) =
2/3 .
1/3 2/3
By decomposing
1 1 1 0
A= B N = ,
1 −1 0 1
we obtain
∗ −T ∗ 1/2 1/2 4/3 −2/3
λ = −B ∇B f(x ) = − = ,
1/2 −1/2 0 −2/3
and (6.11) is expressed as
4/3 1 1 4/3 −4/3 0
0 1 −1 −2/3 0 0 0
+ + = .
2/3 1 0 −2/3 = 2/3 −2/3 0
2/3 0 1 2/3 −2/3 0
= 3y23 + 3y24 ≥ 0 .
Constrained optimization 137
subject to
x ∈ Sε (6.29)
has a solution in Sε , denoted by xk . One should keep in mind that the problem (6.28)–
(6.29) is subject to constraints. Nevertheless, we demonstrate that, for a sufficiently
1 Since the constraints are linearly independent, the constraint qualification is satisfied and the
linearized cone corresponds to the tangent cone.
138 Lagrange multipliers: necessary conditions
large k, the solution lies strictly inside Sε and is therefore a solution to the problem
(6.28) without constraint (according to Theorem 3.5). The role of Sε is to ensure that
no local minima other than x∗ are found.
We have
Fk (xk ) ≤ f(x∗ ) . (6.30)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
k 2 α ∗ 2
Fk (x∗ ) = f(x∗ ) + h(x∗ ) + x − x∗ = f(x∗ ),
2 2
because h(x∗ ) = 0. Then, when k → ∞, the value of Fk (xk ) remains bounded. We
show by contradiction that this implies that
2
Indeed, if (6.31) is not satisfied, then the term k2 h(xk ) tends towards +∞. Since
F(xk ) remains bounded, this signifies that either f(xk ), or kxk − x∗ k2 tends towards
−∞. However f(xk ) is bounded from below by f(x∗ ) over Sε (according to (6.27))
and kxk − x∗ k2 is positive, which leads to a contradiction and proves (6.31).
Let bx be a limit point of the sequence (xk )k (Definition B.20). According to (6.31),
we have h(b x) = 0 and b x is feasible for the original problem and thus f(x∗ ) ≤ f(bx).
Moreover, according to (6.30)
2
x − x∗
x) + α b
lim Fk (xk ) = f(b ≤ f(x∗ ) . (6.32)
k→∞
Then,
2
f(b x − x∗
x) + α b ≤ f(b
x) . (6.33)
∗ 2
As a result, α b
x−x = 0 and bx = x∗ . The sequence xk k
converges to x∗ . According
to Definition B.19, there exists b
k such that
where ε is the radius of the sphere Sε involved in the definition of the local minimum
(6.27). The point xk is inside Sε when k is sufficiently large.
According to Theorem 1.16, xk is a local minimum of the unconstrained prob-
lem (6.28). We can apply the necessary optimality conditions of an unconstrained
problem, given by Theorem 5.1:
x0
b
Sε
b
0.9ε
b
xk
x∗
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Since the constraints are linearly independent by hypothesis, the matrix ∇h(x∗ )T
∇h(x∗ ) is of full rank and invertible. By continuity of ∇h (indeed, h is continuously
differentiable), there exists a k sufficiently large such that ∇h(xk )T ∇h(xk ) is also
−1
invertible. By multiplying (6.37) by ∇h(xk )T ∇h(xk ) , we obtain
−1
kh(xk ) = − ∇h(xk )T ∇h(xk ) ∇h(xk )T ∇f(xk ) + α(xk − x∗ ) . (6.38)
When k → ∞, we define
λ∗ = lim kh(xk ) (6.39)
k→∞
We also have
T −1 T
lim yk = y − ∇h(x∗ ) ∇h x∗ ∇h(x∗ ) ∇h x∗ y = y , (6.42)
k→∞
T
because ∇h x∗ y = 0. Then, from (6.36),
m
!
X
yTk ∇2 F(xk )yk = yTk 2
∇ f(xk ) + k 2
hi (xk )∇ hi (xk ) yk
i=1
As ∇h(xk )T yk = 0,
m
!
X
yTk ∇2 F(xk )yk = yTk 2
∇ f(xk ) + k hi (xk )∇ hi (xk ) yk + αyTk yk .
2
i=1
If (6.24) is not satisfied, (6.44) is not valid for all α > 0. Indeed, if yT ∇2xx L(x∗ , λ∗ )y <
0, (6.44) is not satisfied for the values of α such that
yT ∇2xx L(x∗ , λ∗ )y
α<− .
yT y
Since α can be arbitrarily chosen, this concludes the proof.
Note that for linear constraints, h(x) = Ax − b, ∇h(x) = AT and (6.23) is written
as
∇f(x∗ ) + AT λ∗
= 0,
Ax − b
which is equivalent to (6.11) of Theorem 6.8.
Example 6.11 (Karush-Kuhn-Tucker: equality constraints). Consider the optimiza-
tion problem
min x1 + x2 (6.45)
x∈R2
subject to
x21 + (x2 − 1)2 − 1
h(x) = = 0. (6.46)
−x21 + x2
The set of constraints is illustrated in Figure 6.5. We have
1 2x1 −2x1
∇f(x) = and ∇h(x) = . (6.47)
1 2x2 − 2 1
The Lagrangian function of the problem is
L(x, λ) = x1 + x2 + λ1 x21 + (x2 − 1)2 − 1 + λ2 (−x21 + x2 ) (6.48)
and
1 + 2λ1 x1 − 2λ2 x1
1 + 2λ1 (x2 − 1) + λ2
∇L(x, λ) =
x2 + (x − 1)2 − 1
.
(6.49)
1 2
−x21 + x2
Constrained optimization 141
2
h2 (x) = x2 − x21
1.5
1 • a
x
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.5
x2
0 • b
x
-0.5 h1 (x) = x21 + (x2 − 1)2 − 1
-1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x1
Figure 6.5: Illustration of the KKT conditions
T
The point xa = 1 1 is a local minimum of the problem. The constraints are
a
linearly independent in x because the matrix
a 2 −2
∇h(x ) = (6.50)
0 1
The condition ∇L(xa , λ∗ ) = 0 is satisfied. Note that the linearized cone is empty
in xa and that the second-order
T condition is trivially satisfied.
The point xb = 0 0 is also a local minimum (in fact, we are dealing with a
global minimum of the problem). We have
1
1 − 2λ1 + λ2
∇L(xb , λ) =
,
(6.52)
0
0
which cannot be zero for any λ. The necessary condition is not satisfied in this case.
Indeed, the constraints are not linearly independent in xb because the matrix
0 0
∇h(xb ) = (6.53)
−2 1
We now present the result of John (1948) for equality constraints, which consti-
tutes a generalization of Theorem 6.10.
Proof. In the case where the constraints are linearly independent, Theorem 6.10 ap-
plies and (6.54) is trivially obtained with µ∗0 = 1. In the case where the constraints
are linearly dependent, then there exist λ∗1 , . . . , λ∗m , not all zero, such that
m
X
λ∗i ∇hi (x∗ ) = 0 ,
i=1
µ∗j ≥ 0 , j = 1, . . . , p , (6.56)
and
µ∗j gj (x∗ ) = 0 , j = 1, . . . , p , (6.57)
where L is the Lagrangian function (Definition 4.3). If f, h and g are twice
differentiable, then
yT ∇2xx L(x∗ , λ∗ , µ∗ )y ≥ 0 , ∀y 6= 0 such that
T ∗
y ∇hi (x ) = 0 , i = 1, . . . , m (6.58)
T ∗ ∗
y ∇gi (x ) = 0 , i = 1, . . . , p such that gi (x ) = 0 .
Constrained optimization 143
Proof. We consider the active inequality constraints at the solution as equality con-
straints and let us ignore the other constraints in order to obtain the problem
minx∈Rn f(x) subject to h(x) = 0, gi (x) = 0, for any i ∈ A(x∗ ), where A(x∗ ) is
the set
of active constraints in x∗ (Definition 3.4). According to Theorem 3.5 where
Y = x | h(x) = 0 , x∗ is a local minimum of the optimization problem with equality
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
with µ∗i = 0 if i 6∈ A(x∗ ). We thus get (6.55). Similarly, the second-order condition
of Theorem 6.10 implies that
and (6.58) is satisfied. We note that (6.57) is trivially satisfied. Indeed, if the con-
straint gj (x∗ ) ≤ 0 is active, we have gj (x∗ ) = 0. If on the other hand it is not, we
have µ∗j = 0. We now need only demonstrate (6.56).
We take the same proof as Theorem 6.10, by defining the penalty function for
inequality constraints with
g+
i (x) = max 0, gi (x) , i = 1, . . . , p . (6.62)
Since g+ 2
j (x) is differentiable and
∇g+ 2 +
j (x) = 2gj (x)∇gj (x) , (6.64)
we can invoke the same development as in the proof of Theorem 6.10. Since we have
obtained (6.39), we have
And since g+
i (x) ≥ 0, we get (6.56).
144 Lagrange multipliers: necessary conditions
6
x21 ≤ 1 + x2
4 x21 + (x2 − 3)2 ≤ 9
2
x2
0 •
(x1 − 3)2 + x22 ≤ 9
-2
-4
-4 -2 0 2 4 6
x1
Figure 6.6: Karush-Kuhn-Tucker optimality conditions
T
The point x∗ = 0 0 is a local minimum of this problem. The constraints
g1 (x) ≤ 0 and g2 (x) ≤ 0 are active in x∗ , whereas the constraint g3 (x) ≤ 0 is not.
The point x∗ is also a local minimum of the problem where the two active inequality
constraints are replaced by equality constraints, and the active constraint is ignored,
that is
min x1 + x2 (6.70)
x∈R2
subject to
(x1 − 3)2 + x22 = 9
(6.71)
x21 + (x2 − 3)2 = 9 ,
Constrained optimization 145
or, equivalently
h1 (x) = x21 − 6x1 + x22 = 0
(6.72)
h2 (x) = x21 − 6x2 + x22 = 0 .
The gradient of the constraints is written as
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2x1 − 6 2x1
∇h(x) = . (6.73)
2x2 2x2 − 6
According to the KKT conditions (Theorem 6.10), λ∗ is given by (6.25) and we have
T !−1 T
∗ −6 0 −6 0 −6 0 1 1/6
λ =− = .
0 −6 0 −6 0 −6 1 1/6
Then, the necessary first-order KKT condition for the initial problem is written as
!
∗ ∗
1 − 6µ∗1 + 2(µ∗1 + µ∗2 + µ∗3 )x∗1
∇Lx (x , µ ) = = 0,
1 − 6µ∗2 + 2(µ∗1 + µ∗2 )x∗2 − µ∗3
T
where L is defined by (6.69), x∗ = 0 0 and
λ∗1 1/6
µ∗ = λ∗2 = 1/6 .
0 0
Since the linearized cone is empty in x∗ , the necessary second-order KKT condition
is trivially satisfied.
1 2 1 2
L(x, µ) = x − x + µ(x2 − 1) .
2 1 2 2
T
The point x∗ = 0 1 is a local minimum of the problem. The constraint is
active in this point. The first-order condition (6.55) is expressed as
∗ ∗ x∗1 0
∇x L(x , µ ) = = =0
−x∗2 + µ∗ −1 + µ∗
146 Lagrange multipliers: necessary conditions
60 10
40
20
0 5
-20
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-40 0 x2
-60
-5
-10 -10
-5
x2 0 -10 -10 -5 0 5 10
5 5 0x -5
1010 1 x1
(a) Surface (b) Level curves
and is satisfied.
T Note that if we choose a feasible direction y, for instance y =
0 −1 , the condition (6.76) is not satisfied. It is only valid for y orthogonal to
active constraints.
Example 6.16 (Physical interpretation of KKT conditions). We consider the opti-
mization problem
min x1
x∈R2
subject to
h1 (x) = x1 − sin x2 = 0 .
T
The equality constraint is represented in Figure 6.8(a). The point xa = −1 3π/2
is a local minimum of the problem. We have
1 1
∇f(x) = , ∇h(x) =
0 − cos x2
6 λ∗ = −1
1
3 •
xb
2
1
h(x) = x1 − sin x2 = 0
0
-2 -1 0 1 2
x1
(a) Equality constraint
5 −∇f(xa )
xa•
4
x2
1
g(x) = x1 − sin x2 ≤ 0
0
-2 -1 0 1 2
x1
(b) Inequality constraint
Using the fact that −∇f(xa ) is the direction with the steepest descent (Theorem
2.13), we can interpret this condition as an equilibrium between the “force” −∇f(xa ),
which drives the solution to lower values of the objective function, and the force
−λ1 ∇h(xa ), which maintains the solution on the constraint. If xa is optimal, this
signifies that the forces are balanced and that their sum is zero. In our example, since
the “force” −∇f(xa ) acts in the same direction as −∇h(xa ), the multiplier λ∗1 should
be negative so that the two “forces” can compensate each other.
T
If we now take the point xb = sin(3) 3 , the “forces” −∇f(xb ) and −λ∇h(xb )
are not balanced. This is not only the case when λ = λ∗1 , as shown in Figure 6.8(a),
but for all λ.
148 Lagrange multipliers: necessary conditions
subject to
g1 (x) = x1 − sin x2 ≤ 0 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The inequality constraint is represented in Figure 6.8(b). The point xa = (−1, 3π/2)
is not a local minimum of the problem. In fact, the direction −∇f(xa ) is feasible and
the associated “force” drives the solution towards feasible values.
Note that the constraint is active in xa and that the equation
is satisfied for µ1 = −1. The interpretation of the forces signifies that the “force”
−µ1 ∇g1 (xa ) drives the solution to the right and prevents it from going inside the
feasible domain, which is incompatible with the definition of the inequality constraint.
The condition (6.56) in Theorem 6.13, µ∗ ≥ 0 signifies that, for an inequality con-
straint, the “force” can only act in a single direction, so as to prevent the points from
leaving the feasible domain, but not from going inside. For the equality constraints,
the “force” can act in two directions and there is no condition for the sign of the
multipliers.
subject to
gi (x) ≤ 0, i = 1, . . . , m. (6.78)
X m
∂2 L ∂2 f ∂gi
(x, µ) = (x) + µi (x), (6.81)
∂xj ∂xk ∂xj ∂xk ∂xj ∂xk
i=1
for j, k = 1, . . . , n.
Constrained optimization 149
Let x∗ be a local optimum of problem P1. Therefore, the first order necessary
optimality (KKT) conditions say that, under appropriate assumptions, there is a
unique µ∗ ∈ Rm , µ∗ ≥ 0, such that
X ∂gim
∂L ∗ ∗ ∂f ∗
(x , µ ) = (x ) + µ∗i (x∗ ) = 0,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
µ∗i gi (x∗ ) = 0 i = 1, . . . , m.
Assume that the first p constraints are active at x∗ , and the others not, that is
gi (x∗ ) = 0, i = 1, . . . , p, (6.83)
and
gi (x∗ ) < 0, i = p + 1, . . . , m. (6.84)
Therefore, we obtain
X ∂gi p
∂L ∗ ∗ ∂f ∗
(x , µ ) = (x ) + µ∗i (x∗ ) = 0, (6.85)
∂xj ∂xj ∂xj
i=1
and
µ∗i ≥ 0, i = 1, . . . , p,
(6.86)
µ∗i = 0, i = p + 1, . . . , m.
Moreover, for each d ∈ Rm such that, for each i = 1, . . . , p
n
X ∂gi ∗
dk (x ) = 0, (6.87)
∂xk
k=1
we have !
n X
n p
X ∂2 f X ∂g i
(x∗ ) + µ∗i (x∗ ) dj dk ≥ 0. (6.88)
∂xj ∂xk ∂xj ∂xk
j=1 k=1 i=1
Consider now problem (P2), obtained from problem (P1) by transforming the
inequality constraints into equality constraints using slack variables, as suggested in
Section 1.2.2:
min
n m
f(x) (6.89)
x∈R ,y∈R
subject to
hi (x, y) = gi (x) + y2i = 0, i = 1, . . . , m. (6.90)
For each i = 1, . . . , m, the first derivatives of the constraint are
∂hi ∂gi
= , k = 1, . . . , n, (6.91)
∂xk ∂xk
∂hi
= 2yi , (6.92)
∂yi
150 Lagrange multipliers: necessary conditions
and
∂hi
= 0, ℓ = 1, . . . , m, ℓ 6= i. (6.93)
∂yℓ
The Lagrangian of (P2) is
m
X
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
for j = 1, . . . , n, and
∂L
(x, y, λ) = 2λi yi , (6.96)
∂yi
for i = 1, . . . , m. The second derivatives are
m
∂2 L ∂2 f X ∂gi
(x, y, λ) = (x) + λi (x), (6.97)
∂xj ∂xk ∂xj ∂xk ∂xj ∂xk
i=1
for j, k = 1, . . . , n,
∂2 L
(x, y, λ) = 2λi , (6.98)
∂y2i
for i = 1, . . . , m,
∂2 L
(x, y, λ) = 0, (6.99)
∂yi ∂yℓ
for i, ℓ = 1, . . . , m, i 6= ℓ, and
∂2 L
(x, y, λ) = 0, (6.100)
∂xj ∂yi
for j = 1, . . . , n, i = 1, . . . , m.
Let x∗ and y∗ be local optima of problem P2. Therefore, the first order necessary
optimality (KKT) conditions say that there is a unique λ∗ ∈ Rm such that
X ∂gi m
∂L ∗ ∗ ∗ ∂f ∗
(x , y , λ ) = (x ) + λ∗i (x∗ ) = 0, (6.101)
∂xj ∂xj ∂xj
i=1
and
2λi y∗i = 0 i = 1, . . . , m. (6.102)
Moreover, for each
dx
d= ∈ Rn+m
dy
such that, for each i = 1, . . . , m
n
X ∂gi ∗
(dx )k (x ) + 2(dy )i y∗i = 0, (6.103)
∂xk
k=1
Constrained optimization 151
we have
n X
n m
! m
X ∂2 f X X
∗ ∗ ∂gi ∗
(x ) + λi (x ) (dx )j (dx )k + 2 λ∗i (dy )2i ≥ 0. (6.104)
∂xj ∂xk ∂xj ∂xk
j=1 k=1 i=1 i=1
Now, assume that the constraints are numbered so that y∗i = 0 for i = 1, . . . , p,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
we have
n X
n p
! p
X ∂2 f ∗
X
∗ ∂gi ∗
X
(x ) + λi (x ) (dx )j (dx )k + 2 λ∗i (dy )2i ≥ 0. (6.108)
∂xj ∂xk ∂xj ∂xk
j=1 k=1 i=1 i=1
In particular, select k between 1 and p, and set (dy )i = 0 for each i 6= k, and
(dy )k = 1. Therefore, (6.109) implies λ∗k ≥ 0, for any k = 1, . . . , p.
Based on these results, we can prove that (x∗ , µ∗ ) verifies the KKT conditions
of problem P1, if and onlyp if (x∗ , y∗ , λ∗ ) verifies the KKT conditions of problem P2,
where λ∗ = µ∗ and y∗i = −gi (x∗ ), i = 1, . . . , m.
P1 =⇒ P2 Consider (x∗ , µ∗ ) that verifies the KKT conditions of problem P1, such
that gi (x∗ ) = 0 for i = 1, . . . , p and gi (x∗ ) < 0 for i = p + 1, . . . , m. Define y∗
such that
y∗i = 0p i = 1, . . . , p,
(6.110)
y∗i = −gi (x∗ ) i = p + 1, . . . , m,
and define λ∗ = µ∗ . Then (x∗ , y∗ , λ∗ ) verifies the KKT conditions of problem P2.
152 Lagrange multipliers: sufficient conditions
n X n p
!
X ∂2 f X
∗ ∗ ∂gi ∗
(x ) + λi (x ) (dx )j (dx )k ≥ 0. (6.111)
∂xj ∂xk ∂xj ∂xk
j=1 k=1 i=1
Now, (6.108) results from (6.111) and (6.86), which says that λ∗i ≥ 0, for each
i.
P2 =⇒ P1 Consider (x∗ , y∗ , λ∗ ) that verifies the KKT conditions of problem P2, such
that y∗ = 0 for i = 1, . . . , p and y∗i 6= 0 for i = p + 1, . . . , m. Then (x∗ , µ∗ ), where
µ∗ = λ∗ , verifies the KKT conditions of problem P1.
• The constraints (6.78) are direct consequences of (6.90).
• The first order conditions (6.105) are exactly the same as (6.85).
• The conditions (6.86) on the Lagrange multipliers are verified, as for P2, λ∗i ≥ 0,
for i = 1, . . . , p and λ∗i = 0, i = p + 1, . . . , m (see the discussion above).
• Consider d that verifies (6.87). Define dx = d, and define dy such that (dy )i =
0, i = 1, . . . , p, and
n
1 X ∂gi ∗
(dy )i = − ∗ (dx )k (x ) (6.112)
2yi ∂xk
k=1
h(x) .
2
The idea of the objective function (6.113) is to penalize points x that violate the
constraints, hence the name penalty parameter for c .
Proof. We first note that any solution to the augmented problem (6.113) is also a
solution to the original problem. We go back to a problem of unconstrained opti-
mization thanks to the augmented Lagrangian function, by showing that x∗ is a strict
local minimum of the problem
minn Lc (x, λ∗ ) (6.117)
x∈R
Similarly, we obtain
T
∇2xx Lc (x∗ , λ∗ ) = ∇2xx L(x∗ , λ∗ ) + c∇h(x∗ )∇h x∗ . (6.118)
By applying the theorem for the formation of a positive definite matrix (Theorem
C.18), there exists b
c such that (6.118) is positive definite for all c > b
c. According to
154 Lagrange multipliers: sufficient conditions
Theorem 5.7, x∗ is a strict local minimum of the unconstrained problem (6.117) for
sufficiently large c.
According to Definition 1.6, there exists ε > 0 such that
Notes
• Theorem 6.10 can be demonstrated by using the same constraint elimination tech-
nique as for Theorem 6.8. The logic behind the demonstration is the same, but
the proof is more technical (see Bertsekas, 1999).
• No constraint qualifications appear in the sufficient optimality conditions, neither
linear independence nor any other.
∇x L(x∗ , λ∗ , µ∗ ) = 0 (6.121)
∗
h(x ) = 0 (6.122)
∗
g(x ) ≤ 0 (6.123)
∗
µ ≥0 (6.124)
µ∗j gj (x∗ ) = 0, j = 1, . . . , p (6.125)
µ∗j > 0, ∀j ∈ A(x ) ∗
(6.126)
Proof. We use slack variables (Definition 1.4) to obtain the following optimization
problem with equality constraints
subject to
hi (x) = 0 , i = 1, . . . , m
(6.129)
gi (x) + z2i = 0, i = 1, . . . , p ,
and let us define p
z∗i = −gi (x∗ ) (6.130)
2
such that gi (x∗ ) + z∗i = 0 is trivially satisfied.
The Lagrangian function of this problem is
m p
X X
b z, λ, µ) = f(x) +
L(x, λi hi (x) + µi gi (x) + z2i (6.131)
i=1 i=1
and
m
X p
X
∇x b
L(x, z, λ, µ) = ∇f(x) + λi ∇hi (x) + µi ∇gi (x) = ∇x L(x, λ, µ) (6.132)
i=1 i=1
and
∂b
L(x, z, λ, µ)
= 2µi zi , i = 1, . . . , p . (6.133)
∂zi
x
Moreover, by expressing b
x= , we have
z
∇2xx L(x, λ, µ) 0
2µ1 0 ··· 0
∇2bxbx b
L(x, z, λ, µ) = 0 2µ2 ··· 0 . (6.134)
.. .. ..
..
0 . . . .
0 0 · · · 2µp
From the hypothesis (6.125) and as per (6.130), we have µ∗i z∗i = 0. Moreover,
from the hypothesis (6.121), we have
∇b
Lbx (x∗ , z∗ , λ∗ , µ∗ ) = 0 . (6.135)
and
yT ∇gi (x∗ ) + 2z∗i wi = 0 ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
i = 1, . . . , p . (6.137)
Note that if i ∈ A(x∗ ), then zi = 0 and (6.137) is written as yT ∇gi (x∗ ) = 0. The
vector y always corresponds to the conditions of the hypothesis (6.127). We have
y
yT wT b ∗ , z∗ , λ∗ , µ∗ )
∇bxbx L(x
w
p
X
= yT ∇L2xx (x∗ , λ∗ , µ∗ )y + 2 µ∗i w2i from (6.134)
i=1
X
= yT ∇2xx L(x∗ , λ∗ , µ∗ )y + 2 µ∗i w2i from (6.125) .
i∈A(x∗ )
From the hypothesis (6.127), the first term is positive if y 6= 0. From the hypothesis
(6.124), each term of the sum of the second term is non negative. If y = 0, there is
necessarily an i such that wi 6= 0. In order for (6.137) to be satisfied, we have that
z∗i = 0 and then i ∈ A(x∗ ). From (6.126), the corresponding term µ∗i w2i is positive.
The sufficient optimality conditions of Theorem 6.19 are satisfied for x∗ , z∗ , λ∗
and µ∗ and ∗
x
z∗
is a strict local minimum of (6.128)–(6.129). Consequently, x∗ is a strict local mini-
mum of the initial problem.
The condition (6.126) is called the strict complementarity condition. The fol-
lowing example illustrates its importance.
Example 6.21 (Importance of the strict complementarity condition). Consider the
problem
1
min (x21 − x22 ) (6.138)
x∈R 2
2
subject to
x2 ≤ 0 (6.139)
for which the objective function is illustrated in Figure 6.7. We demonstrate that
T all
sufficient optimality conditions except (6.126) are satisfied for x∗ = 0 0 and
∗
µ = 0. We have
1
L(x, µ) = (x21 − x22 ) + µx2 . (6.140)
2
Then,
x1
∇Lx (x, µ) =
−x2 + µ
Constrained optimization 157
T
and (6.121) is satisfied when x∗ = 0 0 and µ∗ = 0. The other conditions are
trivially satisfied and (6.126) is not satisfied because the constraint is active in x∗ and
µ∗ = 0.
We now consider the point (0, −α), with α > 0. It is feasible and the objective
function is − 21 α2 , which is strictly smaller than the value in x∗ , which is therefore
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
b 1
L(x, z, µ) = (x21 − x22 ) + µ(x2 + z2 ) . (6.144)
2
The Hessian ∇2bxxb b
L(x∗ , z∗ , µ∗ ) used in the proof is
1 0 0
2 b
∇bxbx L(x, z, µ) = 0 −1 0
0 0 2µ
and
1 0 0
∇2bxbx b
L(x∗ , z∗ , µ∗ ) = 0 −1 0 ,
0 0 0
and it is singular. As in the proof, let us take a vector belonging to the linearized
cone at ∗
x
z∗
of the problem with equality constraints, i.e.,
0
y
= 0 .
w
γ
For all γ, we have
1 0 0 0
( 0 0 γ ) 0 −1 0 0 = 0
0 0 0 γ
and the sufficient condition for the problem with equality constraints is not satisfied,
which prevents us from proving Theorem 6.20.
158 Lagrange multipliers: sufficient conditions
We conclude this section with two examples of the use of optimality conditions
to identify critical points. They both lead to the resolution of a system of equations,
the topic of the next section of this book.
Example 6.22 (Identification of critical points – I). Consider the problem
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
2x1 + x2 = 1
6x1 + 2λ = 0
2x2 + λ = 0
2x1 + x2 − 1 = 0 .
This is a system with three linear equations, with three unknowns, for which the
solution is
2
x∗1 =
7
3
x∗2 =
7
6
λ∗ = − .
7
We now need only ensure that this point satisfies the sufficient second-order conditions
in order to determine that it is indeed a solution.
• x∗ = ( 27 , 73 )
x2
x1
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x21 + 4x1 − x2 + 3 = 0
illustrated in Figure 6.10. The necessary optimality condition (6.23) is expressed as
6x1 + 2λx1 + 4λ = 0
2x2 − λ = 0
x21 + 4x1 + 3 = 0 .
This is a system of three non linear equations, with three unknowns. One solution is
x1 = −1, x2 = 1.5, and λ = 3. It is not necessarily straightforward to calculate it.
3
2
• x∗ 1
0 x2
-1
-2
-3
-3 -2 -1 0 1 2 3
x1
Figure 6.10: Problem of Example 6.23
min f(x)
x∈Rn
160 Sensitivity analysis
subject to
h(x) = 0 .
Moreover, let x∗ be a local minimum and let λ∗ satisfy the sufficient optimality
conditions (6.115) and (6.116), such that the constraints are linearly indepen-
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
min f(x)
x∈Rn
subject to
h(x) = δ.
There thus exists a sphere S ⊂ Rm centered in 0 such that if δ ∈ S, there exist x(δ)
and λ(δ) satisfying the sufficient optimality conditions of the perturbed problem.
The functions x : Rm → Rn : δ x(δ) and λ : Rm → Rm : δ λ(δ) are
∗ ∗
continuously differentiable in S, with x(0) = x and λ(0) = λ . Moreover, for all
δ ∈ S, we have
∇p(δ) = −λ(δ) , (6.145)
where
p(δ) = f x(δ) . (6.146)
is non singular. We assume by contradiction that this is not the case. There then
exist y ∈ Rn and z ∈ Rm , non zero, such that
∗ y
∇γ F(δ, γ ) = 0,
z
i.e.,
We have
Since the sufficient optimality condition (6.116) is satisfied, ∇2xx L(x∗ , λ∗ ) is positive
definite and y = 0. Then, according to (6.148), ∇h(x∗ )z = 0. By assumption, the
constraints are linearly independent at x∗ and the matrix ∇h(x∗ ) is of full rank.
Then, z = 0, which contradicts the fact that y and z are non zero. The matrix
∇γ F(δ, γ∗ ) is indeed non singular and we can apply the theorem of implicit functions
(Theorem C.6): there exist neighborhoods V0 ⊆ Rm around δ+ = 0 and Vγ∗ ⊆ Rn+m
around γ+ = γ∗ , as well as a continuous function
x(δ)
φ : V0 → Vγ ∗ : δ γ(δ) =
λ(δ)
such that
F δ, γ(δ) = 0 , ∀δ ∈ V0 ,
i.e., !
∇f x(δ) + ∇h x(δ) λ(δ)
= 0. (6.150)
h x(δ) − δ
We now demonstrate that, for δ sufficiently close to 0, the sufficient optimality
conditions of the perturbed problem are satisfied. Assuming (by contradiction) that
this is not the case, there exists a sequence δk k , such that limk→∞ δk = 0 and a
T
sequence (yk )k , with yk ∈ Rm , kyk k = 1 and ∇h x(δk ) yk = 0, for all k, such that
yTk ∇2xx L x(δk ), λ(δk ) yk ≤ 0 , ∀k .
df
x(δ) = 2δ + 2 = −λ(δ) .
dδ
The quantity ∇f x(δ) represents the marginal modification of the objective func-
tion for a perturbation δ of the constraints. When δ is small, we use Taylor’s theorem
(Theorem C.1) to obtain
p(δ) = p(0) + δT ∇p(0) + o kdk .
subject to
2x1 + x2 ≤ 10
x1 + 3x2 ≤ 15
x1 , x2 ≥ 0 .
We omit the non negativity constraints to maintain a simple formulation (these con-
straints are inactive at the solution). We first express the problem in the form (1.71)–
(1.72) by changing the maximization problem into a minimization problem, and by
including slack variables (see Section 1.2):
subject to
h1 (x) = 2x1 + x2 + x23 − 10 = 0
h2 (x) = x1 + 3x2 + x24 − 15 = 0 ,
∗
where x3 and x4 are the slack variables.
T The solution to the problem is x =
T ∗
and λ = 13/5 4/5 , enabling the company to bring in e 38,000
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3 4 0 0
per day.
x2
∗ ∗
4 •x = (3, 4) 4 •x = (3, 4)
2 2
0 0
0 2 4 6 8 10 12 14 16 0 2 4 6 8 10 12 14 16
x1 x1
(a) δ = 5 (b) δ = 16
to obtain
4
f x(δ) = f(x∗ ) − δT λ∗ = −38 − δ . (6.153)
5
Therefore, the purchase of 5 tons of raw material per day would enable the company
to bring in e 4,000. If this purchase costs less than e 4,000, it is worth going through
with the investment. Otherwise, the investment is of no use.
Note that this result is only valid for small values of δ. If δ = 16, such that
31 tons of raw material are available each day, the company no longer has enough
machine-hours to use up all of the raw material. Therefore, the second constraint
is no longer active (here, x4 is positive). The company should thus produce only
the second product, which consumes half as many machine-hours. In this case, the
164 Sensitivity analysis
purchase of additional raw material would not enable the company to earn more, and
the company should thus rather invest in new machines.
The inspiration for this example came from de Werra et al. (2003).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
h(x) = 0
g(x) ≤ 0 .
Moreover, let x be a local minimum and let λ∗ , µ∗ satisfy the sufficient optimality
∗
min f(x)
x∈Rn
subject to
h(x) = δh
g(x) ≤ δg .
T
Then, there exists a sphere S ⊂ Rm+p centered in 0 such that if δ = δTh δTg ∈
S, there are x(δ), λ(δ) and µ(δ) are satisfying the sufficient optimality conditions
of the perturbed problem. The functions x : Rm+p → Rn , λ : Rm+p → Rm and
µ : Rm+p → Rp are continuously differentiable in S, with x(0, 0) = x∗ , λ(0, 0) = λ∗
and µ(0, 0) = µ∗ . Moreover, for all δ ∈ S, we have
with
p(δ) = f x(δ) . (6.155)
Proof. From Theorem 3.5, x∗ , λ∗ and µ∗ satisfy the optimality conditions of the
problem
min f(x)
x∈Rn
subject to
h(x) = 0
gi (x) = 0 , ∀i ∈ A(x∗ ) .
Constrained optimization 165
From Theorem 6.24, there exist x(δ), λ(δ) and µ(δ) satisfying the sufficient optimality
conditions of the problem
minn f(x) (6.156)
x∈R
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
h(x) = δh (6.157)
∗
gi (x) = δg i
, ∀i ∈ A(x ) . (6.158)
We now need only verify the result for inequality constraints that are inactive in
x∗ , i.e.,
gi (x∗ ) < 0 .
In this case, if δi is sufficiently close to 0, gi x(δ) < δi , and the constraint i is also in-
active on the solution to the perturbed problem (by continuity of gi ). Then, according
to Theorem 3.5, the perturbed problem is equivalent to the problem (6.156)–(6.158).
If we take µi (δ) = 0 for all i 6∈ A(x∗ ), x(δ), λ(δ) and µ(δ) satisfying the sufficient
optimality conditions. Moreover, regardless of the value of δi (small enough for the
constraint of the problem to remain inactive), the value of x(λ) remains constant,
since it is determined by the problem (6.156)–(6.158), which does not depend on δi ,
if i 6∈ A(x∗ ). Therefore,
n
X ∂f ∂xj
∂p
= = 0 = −µi (δ) ,
∂δi ∂xj ∂δi
j=1
subject to
Ax = b
(6.160)
x ≥ 0,
where A ∈ Rm×n , b ∈ Rm , c ∈ Rn , for which the Lagrangian function is
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∇L(x, λ, µ) = c − AT λ − µ = 0
(6.162)
µ ≥ 0.
These conditions represent exactly the constraints (4.23) of the dual problem de-
scribed in Section 4.2. The second-order conditions are trivial, because ∇2xx L(x, λ, µ) =
0, for all (x, λ, µ). The complementarity condition (6.57) is simply written as
µi xi = 0 , i = 1, . . . , n, (6.163)
or, equivalently,
m
X
(ci − aji λj )xi = 0 , i = 1, . . . , n. (6.164)
j=1
We show below that this condition happens to also be sufficient for optimality.
We can also utilize the necessary conditions of Theorem 5.1. In particular, if we
consider the jth basic direction dj (Definition 3.42), the directional derivative of the
objective function in the direction dj is given by
In the context of linear optimization, this quantity is often called reduced cost.
Definition 6.28 (Reduced costs). Consider the linear optimization problem (6.159)–
(6.160) and let x be a feasible basic solution of the constraint polyhedron. The reduced
cost of xj is
c̄j = cj − cTB B−1 Aj , j = 1, . . . , n . (6.166)
In matrix form, we have
c̄ = c − AT B−T cB . (6.167)
The reduced costs can be decomposed into their basic and non basic components,
as follows:
c̄B = cB − BT B−T cB = 0, (6.168)
and
c̄N = cN − NT B−T cB . (6.169)
Constrained optimization 167
Therefore, for any basis B, the basic components of the reduced costs is always
0. This, together with the geometric interpretation of the non basic components, is
formalized in the next theorem.
and let x be a basic solution of the constraint polyhedron. When j is the index
of a non basic variable, the jth reduced cost is the directional derivative of the
objective function in the jth basic direction. When j is the index of a basic
variable, the jth reduced cost is zero.
Proof. In the case where j is non basic, the proof can be found above (see (6.165)).
For basic j, we see that B−1 B = I and B−1 Aj is the jth column of the identity matrix.
Then, cTB B−1 Aj = cj and the reduced cost is zero.
The concept of reduced costs now enables us to state the optimality conditions
for linear optimization.
Proof. Consider the basic direction dk . According to Theorem 3.44, the non degen-
eracy of x∗ ensures that dk is feasible. Therefore, given the convexity of the set of
constraints, the necessary condition of Theorem 6.3 applies and
T
∇f x∗ dk = c̄ ≥ 0 ,
by using (6.166) and Theorem 6.29.
Proof. Let y be an arbitrary feasible point and w = y − x∗ . Since the feasible set
is convex, w is a feasible direction (Theorem 3.11). If dj is the jth basic direction2
(Definition 3.42), we have
X
cT w = (w)j cT dj from Theorem 3.45
j∈N
X
= (w)j (−cTB B−1 Aj + cj ) from Definition 3.42
j∈N
X
= (w)j c̄j from Definition 6.28.
j∈N
2 In this proof, dj is a vector of Rn , while (w)j is a scalar, representing the jth entry of the vector
w.
168 Linear optimization
X
cT y − cT x∗ = cT w = (w)j c̄j ≥ 0 ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
j∈N
Note that the sufficient conditions do not assume that x∗ is non degenerate. To
understand why the necessary conditions may not hold when x∗ is degenerate, we go
back to the example illustrated in Figure 3.16. In this example, the vertex number
2 corresponds to a degenerate solution, and the basic direction d b3 is not feasible.
Therefore, if this vertex happens to be the optimal solution of an optimization prob-
b3 to correspond to an ascent direction.
lem, it is not necessary for the basic direction d
It does not matter if it is a descent direction, as the direction is not feasible anyway.
If it happens to be a descent direction, the reduced cost is negative, and the necessary
condition is not verified although we are at the optimal solution.
We now characterize the optimal solution of the dual problem given the optimal
solution of the primal. We obtain an important result for linear optimization, called
strong duality, that the optimal value of the primal coincides with the optimal value
of the dual. Moreover, this result provides a direct link between the reduced costs
and the dual variables.
Corollary 6.32 (Optimality of the dual). Consider the primal linear problem
(6.159)–(6.160) and let B be a basis such that B−1 b ≥ 0 and c̄ ≥ 0. Consider
also the dual problem
maxm
λT b (6.170)
λ∈R
subject to
AT λ ≤ c. (6.171)
Then, the primal vector x∗ with basic variables
and non basic variables x∗N = 0, is optimal for the primal problem, the dual
vector
λ∗ = B−T cB (6.173)
is optimal for the dual problem, and the objective functions are equal, that is
(λ∗ )T b = cT x∗ . (6.174)
Constrained optimization 169
proving (6.174).
The vector λ∗ is feasible for the dual. Indeed, from (6.167), we have
AT λ∗ = AT B−T cB = c − c̄.
As c̄ ≥ 0, we obtain (6.171).
Consider now any dual feasible λ. By the weak duality theorem (Theorem 4.9),
λT b ≤ cT x∗ = (λ∗ )T b,
min cT x
x∈Rn
subject to
Ax = b
x ≥ 0,
where A ∈ Rm×n , b ∈ Rn , c ∈ Rn , and the dual problem
max λT b
λ∈Rm
subject to
AT λ ≤ c.
If either the primal or the dual problem has an optimal solution, so does the
other, and the optimal objective values are equal.
Proof. From the discussion above, if x∗ is a solution to the primal problem, there
exists a basis B such that x∗B = B−1 b ≥ 0 and c̄ = c − AT B−T cB ≥ 0. Therefore,
Corollary 6.32 applies, the optimal solution of the dual is B−T cB , and the objective
functions are equal.
170 Linear optimization
If λ∗ is a solution to the dual problem, the fact that the primal problem is the
dual of the dual (Theorem 4.15) is used to prove the result.
Note that another proof of this result, exploiting Farkas’ lemma, is presented in
Theorem 4.17. Finally, we show that the complementarity condition (6.164) is a
sufficient and necessary optimality condition.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
min cT x
x∈Rn
subject to
Ax = b
x ≥ 0,
where A ∈ Rm×n , b ∈ Rn , c ∈ Rn , and the dual problem
max λT b
λ∈Rm
subject to
AT λ ≤ c.
Consider x∗ primal feasible and λ∗ dual feasible. x∗ is optimal for the primal
and λ∗ is optimal for the dual if and only if
m
X
(ci − aji λj )xi = 0 , i = 1, . . . , n. (6.175)
j=1
Proof. Conditions (6.175) are KKT necessary optimality conditions (see Theorem 6.13
and the discussion at the beginning of the section). To show that they are sufficient,
consider the equation
n
X m
X
(c − AT λ∗ )T x∗ = (ci − aji λj )xi = 0.
i=1 j=1
Therefore,
cT x∗ = (λ∗ )T Ax∗ .
As x∗ is primal feasible, we have Ax∗ = b and
cT x∗ = (λ∗ )T b.
Consequently, the objective function of the primal at x∗ equals the objective function
of the dual at λ∗ . We apply Theorem 4.11 to prove the optimality of x∗ and λ∗ .
Conditions (6.175) are called complementarity slackness conditions because the
activity of the constraints must be complementary. At the optimal solution, if a
Constrained optimization 171
primal variable is positive, that is if xi > 0, the corresponding dual constraint must
Pm
be active, that is ci − j=1 aji λj . Symmetrically, if a dual constraint is inactive, that
Pm
is if ci > j=1 aji λj , the corresponding primal variable must be equal to 0.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 T
min x Qx + cT x (6.176)
x∈Rn 2
subject to
Ax = b , (6.177)
where Q ∈ Rn×n , c ∈ Rn , A ∈ Rm×n and b ∈ Rm . The Lagrangian function is
1 T
L(x, λ) = x Qx + cT x + λT (b − Ax) , (6.178)
2
with λ ∈ Rm . By directly applying Theorem 6.13, the necessary first-order optimality
condition is written as
∇x L(x, λ) = Qx + c − AT λ = 0 . (6.179)
yT ZT QZy = 0 .
equation is written as
Qx − AT λ = −AT λ = 0 .
Since A is of full rank, then λ = 0.
We calculate the analytical solution to this problem.
x∗ − AT λ∗ = −c , (6.183)
by A, we obtain
Ax∗ − AAT λ∗ = −Ac .
Since Ax∗ = 0 and A is of full rank, we obtain (6.182). We now need only introduce
(6.182) in (6.183) to obtain (6.181).
1 T
min x x + cT x
x 2
subject to
Ax = b
Constrained optimization 173
subject to
Ay = 0 .
According to Theorem 6.36, the solution to this problem is
−1
y∗ = AT AAT A(c + x0 ) − (c + x0 )
−1
λ∗ = AAT A(c + x0 ) .
We now need only use Ax0 = b and y∗ = x∗ − x0 to obtain the result.
and −1
λ∗ = AQ−1 AT (AQ−1 c + b) . (6.187)
Proof. Let Z ∈ Rn×(n−m) be a matrix where the columns form a basis of the null
space of A, i.e., such that AZ = 0. Since Q is positive definite, then so is ZT QZ,
and Theorem 6.35 applies to demonstrate the non singularity of the system and the
unicity of the solution. Let L be an lower triangular matrix such that Q = LLT and
let us take y = LT x. The problem (6.176)–(6.177) is thus written as
1 T −1 T −T 1
min y L LL L y + cT L−T y = yT y + cT L−T y
y 2 2
174 Exercises
subject to
AL−T y = b .
The solution to this problem is given by Theorem 6.37, by replacing c with L−1 c and
A with AL−T . Then,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
−1
λ∗ = AL−T L−1 AT (AL−T L−1 c + b) = (AQ−1 AT )−1 (AQ−1 c + b)
and
y∗ = L−1 AT λ∗ − L−1 c .
We now need only take y∗ = LT x∗ to obtain the result.
The presentation of the proof of Theorems 6.10, 6.13, 6.19, 6.20, and 6.24 was
inspired by Bertsekas (1999). That of the proof of Theorem 6.31 was inspired by
Bertsimas and Tsitsiklis (1997).
6.7 Exercises
Exercise 6.1.
Identify the local optima of the following optimization problems, and verify the op-
timality conditions.
n
X
1. minn kxk22 , subject to xi = 1.
x∈R
i=1
n
X
2. minn xi , subject to kxk22 = 1.
x∈R
i=1
3. min −x21 − x22 , subject to (x1 /2)2 + (x2 /2)2 ≤ 1 (Hint: plot the level curves and
x∈R2
the constraints).
4. min −x21 − x22 , subject to −x21 + x22 ≤ 1, and −5 ≤ x1 ≤ 5 (Hint: plot the level
x∈R2
curves and the constraints).
5. The Indiana Jones problem (Section 1.1.6): min x21 + x22 , subject to x1 x2 − hx1 −
x∈R2
ℓx2 = 0, x1 ≥ ℓ, x2 ≥ h.
Exercise 6.2.
An electricity company must supply a town that consumes 100 MWh daily. Three
plants are used to generate the energy: a gas plant, producing at the cost of e 800/MWh,
a coal plant, producing at the cost of e 1,500/MWh, and a hydroelectric plant produc-
ing at the cost of e 300/MWh. The amount of available water limits the production
of the latter plant to 40 MWh per day. Moreover, due to ecological concerns, the two
other plants are limited to produce no more than 80 MWh per day each.
1. Formulate a linear optimization problem that would optimize the costs of the
company.
2. Formulate the dual problem.
Constrained optimization 175
3. Prove, using the optimality conditions, that the optimal solution is to produce 60
MWh per day with the gas plant, 40 MWh per day with the hydroelectric plant,
and not to use the coal plant.
4. Deduce the optimal values of the dual variables.
5. Use sensitivity analysis to propose profitable investments to the company.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∂f(x∗ ) ∂f(x∗ )
≤ ∀j. (6.188)
∂xi ∂xj
subject to
gi (x) ≤ 0, i = 1, . . . , m,
and problem (P2)
min f(x)
x∈Rn ,y∈Rm
subject to
gi (x) + yi = 0, i = 1, . . . , m,
yi ≥ 0, i = 1, . . . , m.
1. Write the necessary optimality conditions (KKT) for problem (P1), both first and
second order.
2. Write the necessary optimality conditions (KKT) for problem (P2), both first and
second order.
3. Prove that (x∗ , µ∗ ) verifies the KKT conditions of problem P1, if and only if
(x∗ , y∗ , λ∗ ) verifies the KKT conditions of problem P2, where λ∗ = µ∗ and y∗i =
−gi (x∗ ), i = 1, . . . , m (Hint: refer to Example 6.16).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part III
Solving equations
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Albert Einstein
We have seen that the necessary optimality conditions enable us to identify the critical
points (Definition 5.6) that are candidates for the solution to an optimization problem.
In the case of optimization without constraint, we use condition (5.1). For constrained
optimization, we use conditions (6.11), (6.23), and (6.55)–(6.57). One way to address
the problem is to solve the system of equations defined by these conditions. This
is how the problem in Example 5.8 was solved, as well as Example 6.22. In these
two cases, the system of equations is easily solved. This is not always the case, as
illustrated in Example 6.23.
We now consider numerical methods enabling us to solve such systems of non
linear equations. Even though these are not directly utilized for optimization, they
are the basis for the main algorithms.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 7
Newton’s method
Contents
Newton’s method plays a crucial role in the context of solving non linear equations
and, by extension, in that of non linear optimization. Isaac Newton was inspired
by a method from Vieta, and the method was later on improved by Raphson (and
sometimes called “Newton-Raphson.”) We refer the reader to Deuflhard (2012) for
a historical perspective of the method. We introduce it for the simple problem of
solving one equation of one unknown, i.e., by deriving numerical methods to find
x ∈ R such that F(x) = 0.
F(x) = x2 − 2
x + d) = 2 + 4d .
m(b
Defining x = b
x + d, we get
m(x) = 2 + 4(x − 2) = 4x − 6 .
The function and the model are presented in Figure 7.2(a). The zoom in Figure 7.2(b)
illustrates the good agreement between the model and the function around b x = 2.
Newton’s method 183
15 2.5
f(x) 2.4 f(x)
10 m(x) 2.3 m(x)
2.2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
5 2.1
2
0 1.9
1.8
-5 1.7
1.6
-10 1.5
0 0.5 1 1.5 2 2.5 3 3.5 4 1.9 1.95 2 2.05 2.1
x x
(a) b
x=2 (b) Zoom
We can now provide a general definition of the linear model of a non linear func-
tion.
From a first approximation b x, the main idea of Newton’s method in order to find
the root of the function f consists in
1. calculating the linear model in b
x,
2. calculating the root x+ of this linear model,
3. if x+ is not the root of f, considering x+ as a new approximation and starting
over.
According to Definition 7.2, the root of the linear model is the solution to
F(b x)F ′ (b
x) + (x − b x) = 0 , (7.2)
i.e., if F ′ (b
x) 6= 0,
F(b x)
x+ = b
x− , (7.3)
F ′ (b
x)
which summarizes the first two steps presented above.
184 Equation with one unknown
We also need to specify the third step. How do we conclude that x+ is a root
of the function, i.e., F(x+ ) = 0, and that we can stop the iterations? Seemingly
innocuous, this question is far from simple to answer. Indeed, computers operating
in finite arithmetic are not capable of representing all real numbers (that represent an
uncountable infinity). Therefore, it is possible, and even common, that the method
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
never generates a point x+ such that F(x+ ) = 0 exactly. Then, we must often settle for
a solution x+ such that F(x+ ) is “sufficiently close” to 0. In practice, the user provides
a measure of this desired proximity, denoted by ε and the algorithm is interrupted
when
F(x+ ) ≤ ε . (7.4)
√
A typical value for ε is εM , where εM is the machine epsilon, that is, an upper
bound on the relative error due to rounding in floating point arithmetic. A simple
way to compute εM is Algorithm 7.1. The loop stops when εM is so small that, when
added to 1, the result is also 1.
We now have all the elements in order to write Newton’s algorithm to solve an
equation with one unknown (Algorithm 7.2).
Newton’s method 185
in the Baghdad area. Al Khwarizmi was an astronomer in the House of Wisdom (Dar
al-Hikma) of caliph Abd Allah al Mahmoun. He is primarily known for his treatise al
Kitab almukhtasar fi hisab al-jabr w’al muqabala (that can be translated as “The
Compendious Book on Calculation by Completion and Balancing”), which provides
the origin of the word algebra (al-Jabr, used in the sense of transposition, became
algebra). He explained in Arabic the system of Indian decimal digits applied to
arithmetic operations. The Latin translation of this work, entitled Algoritmi de
numero Indorum gave rise to the word algorithm. Al Khwarizmi died after AD 847.
Figure 7.3: Al Khwarizmi
Example 7.3 (Newton’s method: one variable – I). Take the equation
F(x) = x2 − 2 = 0 .
k xk F(xk ) F ′ (xk )
0 +2.00000000E+00 +2.00000000E+00 +4.00000000E+00
1 +1.50000000E+00 +2.50000000E-01 +3.00000000E+00
2 +1.41666667E+00 +6.94444444E-03 +2.83333333E+00
3 +1.41421569E+00 +6.00730488E-06 +2.82843137E+00
4 +1.41421356E+00 +4.51061410E-12 +2.82842712E+00
5 +1.41421356E+00 +4.44089210E-16 +2.82842712E+00
2 • 0.3
0.25 •
1.5
0.2
1 0.15
0.5 0.1
• 0.05
0
0 •
-0.5 -0.05
1.41.51.61.71.81.9 2 2.1 1.42 1.44 1.46 1.48 1.5
x x
(a) First iteration (b) Second iteration
According to Example 7.3, Newton’s method seems quite fast, as only 5 iterations
were necessary to converge. We characterize this speed below. Before that, however,
we illustrate by other examples that the method does not always work that well.
Example 7.4 (Newton’s method: one variable – II). Take the equation
F(x) = x − sin x = 0 .
We have F ′ (x) = 1 − cos x. We apply Newton’s method (Algorithm 7.2) with x0 = 1
and ε = 10−15 . The iterations are listed in Table 7.2. The number of iterations is
much larger than for the previous example. Note how the derivative F ′ (xk ) is getting
closer and closer to 0 as the iterations proceed. Actually, the root of this equation is
x∗ = 0, and the value of the derivative at the root is 0. As Newton’s method divides
by F ′ (xk ) at each iteration, the fact that F ′ (x∗ ) = 0 is the source of the slow behavior
of the method. The first two iterations are portrayed in Figure 7.5(a). The linear
model at the starting point x0 = 1 is represented by a dotted line and intersects the
x-axis at 0.65, which is the first iterate.
Newton’s method 187
0.25
0.2
0.15 •
0.1
0.05 •
0 • •
-0.05
-0.1
0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1
x
(a) Two iterations
0.06
•
0.04
0.02
0 • •
-0.02
-0.04
0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7
x
(b) Zoom
The linear model at that point is also represented by a dotted line, and intersects
the x-axis at 0.43, which is the second iterate. Figure 7.5(b) is a zoom on the same
figure.
188 Equation with one unknown
Even though Newton’s method has managed to provide the desired precision in
5 iterations for Example 7.3, more than 5 times as many iterations are necessary for
Example 7.4. In the following Example, we see that the method may sometimes not
work at all.
Example 7.5 (Newton’s method: one variable – III). Take equation
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
F(x) = arctan x = 0 .
Table 7.3: The ten first iterations with Newton’s method for Example 7.5
k xk F(xk ) F ′ (xk )
0 +1.50000000E+00 +9.82793723E-01 +3.07692308E-01
1 -1.69407960E+00 -1.03754636E+00 +2.58404230E-01
2 +2.32112696E+00 +1.16400204E+00 +1.56552578E-01
3 -5.11408784E+00 -1.37769453E+00 +3.68271300E-02
4 +3.22956839E+01 +1.53984233E+00 +9.57844131E-04
5 -1.57531695E+03 -1.57016153E+00 +4.02961851E-07
6 +3.89497601E+06 +1.57079607E+00 +6.59159364E-14
7 -2.38302890E+13 -1.57079633E+00 +1.76092712E-27
8 +8.92028016E+26 +1.57079633E+00 +1.25673298E-54
9 -1.24990460E+54 -1.57079633E+00 +6.40097701E-109
10 +2.45399464E+108 +1.57079633E+00 +1.66055315E-217
We now analyze in detail the aspects that influence the efficiency of the method.
The main result can be stated as follows:
• if the function is not too non linear,
• if the derivative of F at the solution is not too close to 0,
• if x0 is not too far from the root,
• then Newton’s method converges quickly toward the solution.
The central idea of the analysis is to measure the error that is committed when
the non linear function is replaced by the linear model. Intuitively, if the function
is almost linear, the error is small. While if the function is highly non linear, the
error is more significant. We use here the Lipschitz continuity of the derivative of
F to characterize the non linearity, as discussed in Section 2.4 (Definition 2.27).
Theorem 7.6 considers a linear model at b x, and provides an upper bound on the error
Newton’s method 189
1.5
0.5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0 x x1 x0 x2
3
-0.5
-1
-1.5
-4 -2 0 2 4
x
Figure 7.6: Newton’s method for Example 7.5
at a point x+ . This bound depends on the distance between b x and x+ , and on the
Lipschitz constant that characterizes the nonlinearity of the function.
Theorem 7.6 (Error of the linear model: one variable). Consider an open interval
X ⊆ R and a function F for which the derivative is Lipschitz continuous over X,
x, x+ ∈ X,
where M is the Lipschitz constant. So, for all b
(x+ − b
x)2
F(x+ ) − mbx (x+ ) ≤ M . (7.5)
2
Proof. We have
Z x+ Z x+ Z x+
F ′ (z) − F ′ (b
x) dz = F ′ (z) dz − F ′ (b
x) dz linearity of the integral
b
x b
x b
x
x) − F ′ (b
= F(x+ ) − F(b x)(x+ − b
x)
x + t(x+ − b
We take z = b x) and dz = (x+ − b
x) dt to obtain
Z1
F(x+ ) − mbx (x+ ) = F′ b x) − F ′ (b
x + t(x+ − b x) (x+ − b
x) dt .
0
190 Equation with one unknown
Therefore,
0
Z1
≤ F′ b x) − F ′ (b
x + t(x+ − b x) |x+ − b
x| dt from Theorem C.12
0
Z1
= |x+ − b
x| F′ b x) − F ′ (b
x + t(x+ − b x) dt
0
Z1
+
≤ |x − b
x| M t(x+ − b
x) dt from Definition 2.27
0
Z1
+ 2
= M x −b
x t dt
0
M + 2
= x −b
x .
2
We now use this bound on the error to demonstrate the convergence of Newton’s
method.
F ′ (x) ≥ ρ , ∀x ∈ X . (7.6)
Assume that there exists x∗ ∈ X such that F(x∗ ) = 0. There then exists η > 0
such that, if
|x0 − x∗ | < η (7.7)
with x0 ∈ X, the sequence xk k defined by
F(xk )
xk+1 = xk − , k = 0, 1, . . . , (7.8)
F ′ (xk )
F(x0 )
x1 − x∗ = x0 − − x∗ from (7.8)
F ′ (x0 )
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
F(x0 ) − F(x∗ )
= x0 − x∗ − because F(x∗ ) = 0
F ′ (x0 )
1
= ′ F(x∗ ) − mx0 (x∗ ) from (7.1) .
F (x0 )
Then
1
x1 − x∗ ≤ F(x∗ ) − mx0 (x∗ )
F ′ (x0 )
M 2
≤ ′
x0 − x∗ from (7.5)
2 F (x0 )
M
≤ |x0 − x∗ |2 from (7.6) ,
2ρ
2ρ
|x0 − x∗ | ≤ η ≤ τ (7.11)
M
and
M 2 M 2ρ
|x1 − x∗ | ≤ x0 − x∗ ≤ τ |x0 − x∗ | = τ|x0 − x∗ | < η ,
2ρ 2ρ M
where the last inequality is the result of the fact that τ < 1 and |x0 − x∗ | < η. Since
|x1 − x∗ | < η, we also have that |x1 − x∗ | < r (according to (7.10)) and x1 ∈ X. x1
thus satisfies the same assumptions as x0 . We can now apply the recurrence using
the same arguments for x2 , x3 , and so forth.
We now comment a summarized version of the result of Theorem 7.6:
If the function is not too non linear This assumption is related to the Lipschitz
continuity. The closer M is to 0, the less non linear is the function.
If the derivative of F is not too close to 0 This is hypothesis (7.6). If this as-
sumption is not satisfied, the method may not be well defined (division by zero),
may not converge, or may converge slowly, as illustrated by Example 7.4.
If x0 is not too far from the root This is hypothesis (7.7). If x0 is too far from
the root, the method may not converge, as shown in Example 7.5. It is interesting
192 Systems of equations with multiple unknowns
Definition 7.8 (q-quadratic convergence). Take a sequence xk k in Rn that con-
verges toward x∗ . The sequence is said to converge q-quadratically toward x∗ if there
exists c ≥ 0 and b
k ∈ N such that
2
xk+1 − x∗ ≤ c xk − x∗ , ∀k ≥ b
k. (7.12)
In Definition 7.8, the prefix q signifies quotient. In practice, the other types of
convergence are rarely used, and the prefix could be omitted. More details can be
found in Ortega and Rheinboldt (1970).
As in the case with one variable, we determine a bound for the error committed
when replacing the function F by the linear model and finding a result similar to that
of Theorem 7.6. The proof is essentially the same.
Proof. The structure of the proof is identical to that of Theorem 7.6. We have
Then,
Newton’s method for systems of equations is also essentially the same as for a
single variable. It is described by Algorithm 7.3. System (7.16) solved at step 13 of
the algorithm is often called the Newton equations. Note that we have intentionally
not written this step as
dk+1 = −J(xk )−1 F(xk ).
Indeed, from a numerical point of view, the calculation of dk+1 must be performed
by solving the system of linear equations, not by inverting the Jacobian matrix.
194 Systems of equations with multiple unknowns
F(x) = 0 . (7.15)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3 Input
4 The function F : Rn → Rn .
5 The Jacobian matrix of the function J : Rn → Rn×n .
6 A first approximation of the solution x0 ∈ Rn .
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation x∗ ∈ Rn of the solution.
10 Initialization
11 k = 0.
12 Repeat
13 Calculate dk+1 solution of
xk+1 := xk + dk+1 .
14 k := k + 1.
15 Until F(xk ) ≤ ε
16 x∗ = xk
and
4 2
J(x0 ) = .
e 3
Newton’s method 195
The iterations of Newton’s method are described in Table 7.4, with ε = 10−15 , where
the first column reports the iteration number, the second column the current iterate,
the third the value of the function at the current iterate, and the last its norm. The
quadratic convergence of the method is well illustrated in this example. Indeed, the
value of xk converges rapidly to the solution (0, 1)T , and the values of kF(xk )k decrease
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We now analyze the impact of the starting point on the solution of Newton’s
method.
Example 7.12 (Newton fractal). Consider the system of equations
!
x31 − 3x1 x22 − 1
F(x) = = 0.
x32 − 3x21 x2
Figure 7.7: Newton’s method: relation between the starting point and the solution
The result is presented in Figure 7.7(a), where the three roots are represented
by a + sign. We see that there is no direct relationship between the position of
the starting point and the root identified by the method. For example, look at the
gray areas at the bottom right of Figure 7.7(a). Although these starting points are
closer to the roots x∗ (b) and x∗ (w), Newton’s method converges towards x∗ (g) when
started from these areas. But the most noticeable feature of this figure is the shape
of the borders between each region. This type of configuration is called a fractal
(see Mandelbrot, 1982). The zoom presented in Figure 7.7(b) shows that two points
that are very close may be colored differently. This is an illustration of a chaotic
system, which exhibits a significantly different outcome when the starting conditions
are perturbed just a little bit.
We now generalize Theorem 7.7 for the case of n equations and n variables.
x0 ∈ B(x∗ , η) , (7.19)
Newton’s method 197
M 2
xk+1 − x∗ ≤ xk − x∗ . (7.21)
ρ
Proof. In order for the sequence to be well defined, the matrix J(xk ) always has to
be invertible. By assumption, it is the case at x∗ . We choose η such that J(x) is
invertible for all x in a sphere B(x∗ , η) of radius η around x∗ . We take
ρ
η = min r, . (7.22)
2M
We first demonstrate that J(x0 ) is invertible, by using the theorem about the inverse
of a perturbed matrix (Theorem C.16), with A = J(x∗ ) and B = J(x0 ). The hypothesis
(C.28) on which the theorem is based is satisfied. Indeed,
−1 −1
J x∗ J(x0 ) − J(x∗ ) ≤ J x∗ J(x0 ) − J(x∗ )
1
≤ J(x0 ) − J(x∗ ) from (7.18)
ρ
M
≤ kx0 − x∗ k Lipschitz
ρ
M
≤ η from (7.19)
ρ
1
≤ from (7.22) .
2
Therefore, J(x0 ) is invertible, and x1 given by (7.20) is well defined. By using this
result, Theorem C.16 and by noting that if y ≤ 1/2, then 1/(1 − y) ≤ 2, we obtain
−1
−1 J x∗
J x0 ≤ −1
1 − J x∗ J(x0 ) − J(x∗ ) (7.23)
∗ −1 2
≤2 J x ≤ .
ρ
We have
Consequently,
2
2 x0 − x∗
≤ M from (7.14) ,
ρ 2
7.3 Project
The general organization of the projects is described in Appendix D.
Objective
To analyze the impact of the starting point on the convergence of Newton’s method,
with inspiration taken from Example 7.12.
Newton’s method 199
Approach
To create drawings similar to those of Figure 7.7, we use the following convention:
• Associate a specific color for each solution. For instance, when we have three
solutions, the RGB codes (255, 0, 0), (0, 255, 0) and (0, 0, 255) could be utilized.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Algorithm
Algorithm 7.3.
Problems
Exercise 7.1. The system
x2 = x21
x21 + (x2 − 2)2 = 4
T √ T √ T
has three roots: 0 0 , − 3 3 , 3 3 . Note that there are three
intersections between a circle and a parabola (draw the sketch). Note also that the
Jacobian is singular when x1 = 0.
Exercise 7.2. The system
3x21 + 2x22 = 35
4x21 − 3x22 = 24
T T T T
has four solutions: −3 −2 , −3 2 , 3 −2 , 3 2 . Note that
there are three intersections between an ellipse and a hyperbole (draw the sketch).
Exercise 7.3. The system
x21 − x1 x2 + x22 = 21
x21 + 2x1 x2 − 8x22 = 0
√ √ T √ √ T T T
has four solutions: −2 7 − 7 , 2 7 7 , −4 1 , 4 −1 .
Warning: when implementing these systems, one must not confuse the Jacobian
and the gradient matrix. Each row of the Jacobian corresponds to an equation and
each column to a variable.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 8
Quasi-Newton methods
“You cannot have your cake and eat it too,” says a popular proverb. In this chapter,
however, we try! The method developed here has an effectiveness close to that of
Newton’s method, without requiring the calculation of derivatives.
Contents
8.1 Equation with one unknown . . . . . . . . . . . . . . . . . 201
8.2 Systems of equations with multiple unknowns . . . . . . 208
8.3 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Sister Caasi Newton, or Quasi Newton, is the twin sister of Sir Isaac
Newton. Caasi Newton tried to follow in the footsteps of her illustri-
ous brother, but was never able to understand the complex concept of
derivatives. Her striking resemblance to her brother and the complete
absence of any writings cast doubt on her existence.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
F(x + s) − F(x)
as (x) = . (8.2)
s
Geometrically, the derivative at x is the slope of the tangent to the function at x. The
above approximation replaces the tangent by a secant intersecting the function at x
and x + s, as illustrated in Figure 8.2. The model obtained from this approximation
is therefore called the secant linear model of the function.
F(x)
mbx;s
s
b
x b
x+s
Definition 8.1 (Secant linear model of a function with one variable). Let F : R → R
be a differentiable function. The secant linear model of F in b
x is a function mbx;s :
R → R defined by
x + s) − F(b
F(b x)
mbx;s (x) = F(b
x) + (x − b
x) , (8.3)
s
where s 6= 0.
Quasi-Newton methods 203
We can now utilize the same principle as in Newton’s method, replacing the deriva-
tive in (7.3) by its secant approximation and obtain
F(bx)
x+ = b
x− . (8.4)
as (b
x)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
To obtain an algorithm, we now need only define the value of s. As said above, a
natural idea is to choose s small so as to obtain a good approximation of the derivative.
For example, s can be defined as
τb x| ≥ 1
x if |b
s= (8.5)
τ otherwise ,
where τ is small, for instance equal to 10−7 . For a more sophisticated calculation of τ,
taking into account the epsilon machine and the precision obtained when calculating F,
we refer the reader to Dennis and Schnabel (1996, Algorithm A5.6.3). The algorithm
based on this definition of s is called the finite difference Newton’s method and is
presented as Algorithm 8.1.
F(x) = 0 .
3 Input
4 The function F : R → R.
5 A first approximation of the solution x0 ∈ R.
6 A parameter τ > 0.
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ R.
10 Initialization
11 k := 0.
12 Repeat
13 if |xk | ≥ 1 then
14 s := τxk
15 else
16 s := τ
sF(xk )
17 xk+1 := xk − .
F(xk + s) − F(xk )
18 k := k + 1.
19 Until F(xk ) ≤ ε
20 x∗ = xk .
204 Equation with one unknown
The iterations of this algorithm applied to Example 7.3, with τ = 10−7 , are
described in Table 8.1. The difference with the iterations of Newton’s method (Ta-
ble 7.1) are almost imperceptible. What is even more interesting is that a higher value
of τ may still enable the algorithm to converge, even if this convergence is slow. Ta-
ble 8.2 contains the iterations of the algorithm applied to Example 7.3, with τ = 0.1.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The first two iterations of this algorithm are illustrated in Figure 8.3. Intuitively, we
expect it to work well, with a relatively large s, when the function is not too linear.
•
2.5
2 •
1.5 x1 x1 + s x0 x0 + s
1
×
0.5
×
0
1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3
x
Figure 8.3: Finite difference Newton’s method for Example 7.3
Table 8.1: Iterations for finite difference Newton’s method (τ = 10−7 ) for Example
7.3
k xk F(xk )
0 +2.00000000E+00 +2.00000000E+00
1 +1.50000003E+00 +2.50000076E-01
2 +1.41666667E+00 +6.94446047E-03
3 +1.41421569E+00 +6.00768206E-06
4 +1.41421356E+00 +4.81081841E-12
5 +1.41421356E+00 +4.44089210E-16
In practice, there is no reason to take τ = 0.1 because, even if this choice provides
results, it slows down the convergence. The only motivation to take a larger s would
be to save on function evaluations. This is the idea of the secant method, that uses
a step based on the last two iterates, that is
s = xk−1 − xk ,
in such a way that (8.2) is written as
F(xk−1 ) − F(xk )
as (xk ) = .
xk−1 − xk
Therefore, no additional evaluation of the function is required, because F(xk−1 ) has
already been calculated during the previous iteration. The secant method is described
Quasi-Newton methods 205
Table 8.2: Iterations for finite difference Newton’s method (τ = 0.1) for Example 7.3
k xk F(xk )
0 +2.00000000E+00 +2.00000000E+00
1 +1.52380952E+00 +3.21995465E-01
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2 +1.42318594E+00 +2.54582228E-02
3 +1.41466775E+00 +1.28485582E-03
4 +1.41423526E+00 +6.13706622E-05
5 +1.41421460E+00 +2.92283950E-06
6 +1.41421361E+00 +1.39183802E-07
7 +1.41421356E+00 +6.62780186E-09
8 +1.41421356E+00 +3.15609761E-10
9 +1.41421356E+00 +1.50284230E-11
10 +1.41421356E+00 +7.15427717E-13
11 +1.41421356E+00 +3.41948692E-14
12 +1.41421356E+00 +1.33226763E-15
13 +1.41421356E+00 +4.44089210E-16
as Algorithm 8.2. Note that this technique does not work at the first iteration (k = 0),
as xk−1 is not defined. For the first iteration, an arbitrary value for a0 is therefore
selected.
Table 8.3 shows the iterations of the secant method, with a0 = 1. Figure 8.4
illustrates the first two iterations of the method for this example. At the iterate
x0 = 2, a first arbitrary linear model, with slope 1, is first considered. It intersects
the x-axis at 0, which becomes the next iterate x1 . Then the secant method can start.
The secant intersecting the function at x0 and x1 is considered. It intersects the x-
axis at 1, which becomes iterate x2 . The next iteration is illustrated in Figure 8.5.
The secant intersecting the function at x1 and x2 , crosses the x-axis at x3 = 2.
Interestingly, by coincidence, it happens to be the same value as x0 . But it does
not mean that iteration 3 is the same as iteration 0. Indeed, between the two, the
algorithm has collected information about the function, and accumulated it into ak .
If a0 = 1 is an arbitrary value, not containing information about F, the value a3 = 3
used for the next secant model has been calculated using explicit measures of the
function F. As a consequence, the secant intersecting the function at x2 and x3
crosses the x-axis at x4 , that happens not to be too far from the zero of the function.
Therefore, the convergence of the method from iteration 4 is pretty fast, as can be
seen in Table 8.3. Indeed, during the last iterations, xk and xk−1 are closer and closer
and s = xk−1 − xk is smaller and smaller. Geometrically, it means that the secant is
closer and closer to the actual tangent, and the method becomes similar to the finite
difference Newton’s method. The rate of convergence is fast, and is characterized as
superlinear.
206 Equation with one unknown
F(x) = 0 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3 Input
4 The function F : R → R.
5 A first approximation of the solution x0 ∈ R.
6 A first approximation of the derivative a0 (by default: a0 = 1).
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ R.
10 Initialization
11 k := 0.
12 Repeat
13 Update the current iterate
F(xk )
xk+1 := xk − .
ak
F(xk ) − F(xk+1 )
ak+1 := .
xk − xk+1
15 k := k + 1.
16 Until F(xk ) ≤ ε
17 x∗ = xk
Definition 8.2 (Superlinear convergence). Consider a sequence xk k in Rn that
converges toward x∗ . The sequence is said to converge superlinearly toward x∗ if
xk+1 − x∗
lim = 0. (8.6)
k→∞ xk − x∗
Quasi-Newton methods 207
Table 8.3: Iterations for the secant method (a0 = 1) for Example 7.3
k xk F(xk ) as (xk )
0 +2.00000000E+00 +2.00000000E+00 +1.00000000E+00
1 +0.00000000E+00 -2.00000000E+00 +2.00000000E+00
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-1
-2
x1 x2 x0
-3
-0.5 0 0.5 1 1.5 2
x
Figure 8.4: Iterations 0 and 1 of the secant method for Example 7.3
-1
-2
x1 x2 x4 x3
-3
-0.5 0 0.5 1 1.5 2
x
Figure 8.5: Iterations 2 and 3 of the secant method for Example 7.3
208 Systems of equations with multiple unknowns
F(x) = 0 . (8.7)
3 Input
4 The function F : Rn → Rn .
5 A first approximation of the solution x0 ∈ Rn .
6 A parameter τ > 0.
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ Rn .
10 Initialization
11 k := 0.
12 Repeat
13 for j = 1, . . . , n do
14 if |(xk )j | ≥ 1 then
15 sj := τ(xk )j
16 else if 0 ≤ (xk )j ≤ 1
17 then
18 sj := τ
19 else
20 sj := −τ
F(xk + sj ej ) − F(xk )
Ak j
:= , j = 1, . . . , n ,
sj
where Ak j
is the jth column of Ak , and ej ∈ Rn is the jth canonical
vector, composed of 0, except at the jth place containing 1 instead.
22 Calculate dk+1 solution of Ak dk+1 = −F(xk ).
23 xk+1 := xk + dk+1 .
24 k := k + 1.
25 Until F(xk ) ≤ ε
26 x∗ = xk .
Quasi-Newton methods 209
Definition 8.3 (Linear secant model for a function with n variables). Let F : Rn →
Rm be a Lipschitz continuous function and A ∈ Rm×n a matrix. The linear secant
x is a function mbx;A : Rn → Rm defined by
model of F in b
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x) + A(x − b
mbx;A (x) = F(b x) . (8.8)
Table 8.4: Iterations for the finite difference Newton’s method for Example 7.11
(τ = 10−7 )
k xk F(xk ) F(xk )
0 +1.00000000e+00 +3.00000000e+00 +3.45723769e+00
+1.00000000e+00 +1.71828183e+00
1 +1.52359228e-01 +7.56629845e-01 +1.15470878e+00
+1.19528158e+00 +8.72274977e-01
2 -1.08376852e-02 +5.19684806e-02 +1.14042632e-01
+1.03611119e+00 +1.01513541e-01
3 -8.89667761e-04 +1.29445824e-03 +3.94234579e-03
+1.00153532e+00 +3.72377069e-03
4 -1.37016733e-06 +3.13751967e-06 +8.08060994e-06
+1.00000294e+00 +7.44662523e-06
5 -5.68344146e-12 +1.09472431e-11 +2.98662028e-11
+1.00000000e+00 +2.77875500e-11
6 -9.93522913e-17 +0.00000000e+00 +4.44089210e-16
+1.00000000e+00 +4.44089210e-16
Table 8.5: Iterations for the finite difference Newton’s method for Example 7.11
(τ = 0.1)
k xk F(xk ) F(xk )
0 +1.00000000e+00 +3.00000000e+00 +3.45723769e+00
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
+1.00000000e+00 +1.71828183e+00
1 +1.64629659e-01 +8.02103265e-01 +1.21852778e+00
+1.20238971e+00 +9.17300554e-01
2 -1.45741083e-02 +8.85985792e-02 +1.88972898e-01
+1.05713499e+00 +1.66916290e-01
3 -5.72356301e-03 +8.21459268e-03 +2.52536228e-02
+1.00976678e+00 +2.38802414e-02
4 -4.76896360e-04 +1.48824845e-03 +3.51842725e-03
+1.00122016e+00 +3.18817297e-03
..
.
14 -2.17152295e-13 +5.45341550e-13 +1.36591792e-12
+1.00000000e+00 +1.25233157e-12
15 -2.49137961e-14 +6.26165786e-14 +1.56919411e-13
+1.00000000e+00 +1.43884904e-13
16 -2.79620466e-15 +7.10542736e-15 +1.79018084e-14
+1.00000000e+00 +1.64313008e-14
17 -2.35536342e-16 +8.88178420e-16 +1.98602732e-15
+1.00000000e+00 +1.77635684e-15
18 -5.13007076e-17 +0.00000000e+00 +0.00000000e+00
+1.00000000e+00 +0.00000000e+00
or
Ak (xk − xk−1 ) = F(xk ) − F(xk−1 ) .
Definition 8.4 (Secant equation). A linear model satisfies the secant equation in xk
and xk−1 if the matrix A defining it is such that
By taking
dk−1 = xk − xk−1
(8.11)
yk−1 = F(xk ) − F(xk−1 ) ,
it is written as
Adk−1 = yk−1 . (8.12)
Given xk , xk−1 , F(xk ) and F(xk−1 ), the linear secant model is based on a ma-
trix A satisfying the system of equations (8.10) or (8.12). This system of n linear
Quasi-Newton methods 211
equations has n2 unknowns (the elements of A). Therefore, when n > 1, it is always
underdetermined and has an infinite number of solutions. From a geometrical point
of view, there are infinitely many hyperplanes passing through the two points.
The idea proposed by Broyden (1965) is to choose, among the infinite number of
linear models verifying the secant equation, the one that is the closest to the model
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
established during the previous iteration, thereby conserving to the largest possible
extent what has already been calculated. We now calculate the difference between two
successive models, that is mxk−1 ;Ak−1 (x), the model of the function in the previous
iterate xk−1 , and mxk ;Ak (x), the model of the function in the current iterate xk .
Lemma 8.5. Let mxk ;Ak (x) and mxk−1 ;Ak−1 (x) be linear secant models of a func-
tion F : Rn → Rn in xk and xk−1 , respectively. If these models satisfy the secant
equation, we can characterize the difference between the two models by
mxk ;Ak (x) − mxk−1 ;Ak−1 (x) = (Ak − Ak−1 )(x − xk−1 ) . (8.13)
Proof. The proof exploits the definition (8.8) of the secant model, and the secant
equation (8.10).
mxk ;Ak (x) − mxk−1 ;Ak−1 (x) = F(xk ) + Ak (x − xk )
− F(xk−1 ) − Ak−1 (x − xk−1 ) from (8.8)
= F(xk ) + Ak (x − xk )
− F(xk−1 ) − Ak−1 (x − xk−1 )
+ Ak xk−1 − Ak xk−1
= F(xk ) − F(xk−1 ) − Ak (xk − xk−1 )
+ (Ak − Ak−1 )(x − xk−1 )
= (Ak − Ak−1 )(x − xk−1 ) from (8.10) .
Theorem 8.6 (Broyden update). Let mxk−1 ;Ak−1 (x) be the linear secant model of
a function F : Rn → Rn in xk−1 and let us take xk ∈ Rn , xk 6= xk−1 . The linear
secant model of F in xk that satisfies the secant equation (8.10) and is as close
as possible to mxk−1 ;Ak−1 (x) is
with
(yk−1 − Ak−1 dk−1 )dTk−1
Ak = Ak−1 + , (8.15)
dTk−1 dk−1
where dk−1 = xk − xk−1 and yk−1 = F(xk ) − F(xk−1 ).
212 Systems of equations with multiple unknowns
Proof. According to Lemma 8.5, the difference between the two linear models is
(Ak − Ak−1 )(x − xk−1 ) . (8.16)
The secant equation imposes the behavior of the linear model solely in the direction
dk−1 . Therefore, the degrees of freedom should be explored in the directions that are
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
min A − Ak−1 F
.
A∈S
Quasi-Newton methods 213
= because A ∈ S
dTk−1 dk−1 2
(A − Ak−1 )dk−1 dTk−1
=
dTk−1 dk−1 2
dk−1 dTk−1
≤ A − Ak−1 from (C.22)
2 dTk−1 dk−1 2
= A − Ak−1 2
from (C.25) .
Similarly, we have
The uniqueness follows from the strict convexity of the Frobenius norm and the
convexity of the set S.
Algorithm 8.4 describes the secant method for n variables. Table 8.6 describes the
iterations for the secant method for Example 7.11. It is noteworthy that the method
converges, but toward another solution than that of Newton’s method. Table 8.7
compares matrix Ak for some iterations with the corresponding Jacobian matrix.
Clearly, these matrices are different for the first iterations of the algorithm. We
can see, even for the last iterations, that matrix Ak is a poor approximation of the
Jacobian matrix. This is one of the strengths of the secant method: it is not necessary
to have an asymptotically good approximation of the Jacobian matrix for the method
to work well.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 214 Systems of equations with multiple unknowns
F(x) = 0 . (8.21)
3 Input
4 The function F : Rn → Rn .
5 A first approximation of the solution x0 ∈ Rn .
6 A first approximation of the Jacobian matrix A0 (by default A0 = I).
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ Rn .
10 Initialization
11 x1 := x0 − A−10 F(x0 ).
12 d0 := x1 − x0 .
13 y0 := F(x1 ) − F(x0 ).
14 k := 1.
15 Repeat
16 Broyden update:
Table 8.6: Iterations for the secant method for Example 7.11
k xk F(xk ) F(xk )
0 1.00000000e+00 3.00000000e+00 3.45723768e+00
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1.00000000e+00 1.71828182e+00
1 -2.00000000e+00 -4.84071214e-01 2.28706231e+00
-7.18281828e-01 -2.23524698e+00
2 -1.66450025e+00 -8.68008706e-01 1.51117836e+00
8.30921595e-01 -1.23702099e+00
3 -2.42562564e-01 2.72598221e+00 7.74156513e+00
2.03771213e+00 7.24574714e+00
4 -1.24155582e+00 -1.34676047e+00 1.83898030e+00
7.71291329e-01 -1.25223192e+00
5 -5.80521668e-01 -1.64577514e+00 2.13825933e+00
4.22211781e-01 -1.36512898e+00
..
.
15 -1.71374738e+00 -1.15696833e-07 1.85422885e-07
1.22088678e+00 -1.44899582e-07
16 -1.71374741e+00 -2.43091768e-10 3.89249065e-10
1.22088682e+00 -3.04008596e-10
17 -1.71374741e+00 8.17124146e-14 1.30803685e-13
1.22088682e+00 1.02140518e-13
18 -1.71374741e+00 -2.22044604e-16 2.22044604e-16
1.22088682e+00 0.00000000e+00
Table 8.7: Jacobian matrix and Broyden matrix for the secant method for Example
7.11
k J(xk ) Ak
0 4.00000000e+00 2.00000000e+00 1.00000000e+00 0.00000000e+00
2.71828182e+00 3.00000000e+00 0.00000000e+00 1.00000000e+00
1 -2.00000000e+00 -1.43656365e+00 1.12149881e+00 6.95897342e-02
1.35335283e-01 1.54778635e+00 5.61032855e-01 1.32133752e+00
2 -1.32900051e+00 1.66184319e+00 1.00559588e+00 -4.65603572e-01
1.89285227e-01 2.07129209e+00 3.95856681e-01 5.58620104e-01
3 1.51487487e+00 4.07542427e+00 2.12000014e+00 4.80185068e-01
7.84614657e-01 1.24568122e+01 3.35797853e+00 3.07255629e+00
4 -4.83111643e-01 1.54258265e+00 2.63710364e+00 1.13571564e+00
2.88934337e-01 1.78467094e+00 3.83878676e+00 3.68207545e+00
..
.
17 -1.42749482e+00 2.44177364e+00 -1.06423011e+00 2.70386672e+00
1.80189282e-01 4.47169389e+00 6.34731480e-01 4.79964153e+00
18 -1.42749482e+00 2.44177364e+00 -1.06870996e+00 2.71006685e+00
1.80189282e-01 4.47169389e+00 6.34731480e-01 4.79964153e+00
216 Project
8.3 Project
The general organization of the projects is described in Appendix D.
Objective
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The aim of the present project is to solve a fixed point problem, i.e., given a function
T : Rn → Rn , to identify x ∈ Rn such that T (x) = x. This is of course equivalent
to solving the system of equations F(x) = 0 defined by F(x) = T (x) − x. Even if
the example that we consider is relatively simple, we assume that the derivatives are
unavailable.
Approach
• Implement the Banach fixed-point algorithm xk+1 = T (xk ), as well as the secant
method (Algorithm 8.4).
T
• From the starting point x = 1 1 1 1 1 1 1 , solve the problem with
the fixed-point algorithm.
• Solve the system of equations T (x)−x = 0 by using the secant method (Algorithm
8.4) from the same starting point.
• Solve the system of equations x −T (x) = 0 by using the secant method (Algorithm
8.4) from the same starting point.
• Compare the obtained solutions.
• Compare the number of iterations required to obtain the solution.
Algorithms
The simplest algorithm to solve fixed-point problems consists in applying Banach
iterations, i.e., xk+1 = T (xk ). The secant method is used to solve F(x) = T (x)−x = 0.
Problem
Exercise 8.1. Find x∗ ∈ R7 such that T (x∗ ) = x∗ , with
1 + x1 − (x21 /4)
(1/2)x2 + (3/10)x4 + (1/2)x6
1 + x3 − (x23 /3)
T (x) =
(1/4)x2 + (2/5)x 4 + (1/5)x6
.
√
2x5
(1/4)x + (3/10)x + (3/10)x
2 4 6
8/(2 + x7 )
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part IV
Unconstrained optimization
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
William Cowper
Chapter 9
Quadratic problems
Contents
9.1 Direct solution . . . . . . . . . . . . . . . . . . . . . . . . . 221
9.2 Conjugate gradient method . . . . . . . . . . . . . . . . . 222
9.3 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Before developing algorithms for general non linear problems, let us study the case of
quadratic problems (Definition 2.28). These indeed turn up regularly as subproblems
in the algorithms. In this chapter, we solve the problem
1 T
min f(x) = x Qx + bT x + c , (9.1)
x∈Rn 2
where Q is a symmetric n × n matrix, positive definite, b ∈ Rn and c ∈ R. According
to Theorem 5.10, if Q is not positive definite or semidefinite, the problem has no
solution. The case where Q is positive semidefinite and singular is discussed in
Theorem 5.10, but is not dealt with here. One should immediately note that the
value of c has no impact on the solution to the problem (9.1). Therefore, we focus
on the problem
1
min f(x) = xT Qx + bT x . (9.2)
x∈Rn 2
The value of c is added to the optimal value of the objective function of (9.2) to
obtain the optimal value of the objective function of (9.1).
By employing Theorem 5.10, the unique global minimum of (9.2) can be easily
obtained by solving the system of linear equations
Qx = −b . (9.3)
We refer the reader to Higham (1996) for a discussion about the numerical issues
associated with the direct method. Note that the above algorithm does not preserve
the sparsity of the matrix. Indeed, if n is large, and the number of non zero entries
of the matrix Q is significantly less than n2 , it is convenient to adopt data structures
that store only those elements (see, for instance, Dongarra, 2000 and Montagne and
Ekambaram, 2004). Unfortunately, even if Q is sparse1, the matrix L resulting from
the factorization is not, and these data structures cannot be used. The algorithm
presented in the next section is able to exploit the sparsity of the matrix.
Note that if Q is the identity matrix I, the conjugate directions are orthogonal. If
not, we may define the inner product:
Proof. We assume by contradiction that there exist λ1 , . . . , λk−1 , not all zero, such
that
dk = λ1 d1 + · · · + λk−1 dk−1 .
Therefore,
dTk Qdk = λ1 dTk Qd1 + · · · + λk−1 dTk Qdk−1 = 0 ,
because the directions are Q-conjugate. This is impossible because dk is non zero
and Q is positive definite.
An immediate corollary is that, in Rn , the maximum number of Q-conjugate
directions is n.
The idea behind the conjugate directions method is to define an iterative algorithm
using n conjugate directions d1 , . . . , dn , with the following structure:
xk+1 = xk + αk dk , k = 1, . . . , n ,
∇f(xk )T di = 0 , i = 1, . . . , k − 1 ; (9.7)
224 Conjugate gradient method
3. ∇f(xn+1 ) = 0;
4. let us take k such that ∇f(xk ) = 0 ; then,
∇f(xi ) = 0 , i = k, . . . , n + 1 . (9.8)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Proof. 1. Since αk is the minimum of the function in the direction dk , its value
corresponds to a zero directional derivative of f in the direction dk (Definition 2.7),
i.e.,
dTk ∇f(xk + αk dk ) = dTk ∇f(xk+1 ) = 0 (9.9)
and, applying the formula (2.42) of the gradient of a quadratic function, we obtain
0 = dTk ∇f(xk + αk dk )
= dTk Q(xk + αk dk ) + b
= dTk Qxk + αk dTk Qdk + dTk b
to obtain (9.6).
2. Since xk+1 = xk + αk dk , we have for any i = 1, . . . , k − 1,
Therefore, for i = 1, . . . , k − 1,
Therefore
n
X
T
∇f(xn+1 ) d = λi ∇f(xn+1 )T di = 0
i=1
The most important result related to the conjugate direction methods is that they
identify the global minimum of a problem in, at most, n iterations. In fact, they are
able to solve the problem of increasing dimension in subspaces.
with
dTk (Qxk + b)
αk = argminα f(xk + αdk ) = − . (9.13)
dTk Qdk
ℓ
!
X
g : Rℓ −→ R : λ g(λ) = f x1 + λi di
i=1
min g(λ)
λ∈Rℓ
such that
ℓ
X
∂g
(λ) = dTi ∇fx1 + λj dj .
∂λi
j=1
226 Conjugate gradient method
According to Lemma 9.3, when the coefficients λ are replaced by the steps αk defined
by (9.13) (that is, (9.6)), we have
∂g
(α1 , . . . , αℓ ) = dTi ∇f(xℓ+1 ) = 0 , ∀i .
∂λi
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∂2 g
(α1 , . . . , αℓ ) = dTi Qdj .
∂λi λj
xk+1 = xk + αk dk
with
dTk (Qxk + b)
αk = −
dTk Qdk
identifies the global minimum of the problem
1 T
minn f(x) = x Qx + bT x
x∈R 2
in at most n iterations.
Proof. We apply Theorem 9.4 with ℓ = n to demonstrate that xℓ+1 is the global
minimum. As the conjugate directions are linearly independent (Theorem 9.2), n
directions span the entire space Rn , that is Mℓ = Mn = Rn .
This result makes the conjugate directions methods particularly attractive. It
remains to show how to obtain Q-conjugate directions. We proceed in two steps.
First, we start from an arbitrary set of linearly independent vectors and apply the
Gram-Schmidt orthogonalization procedure to obtain Q-conjugate directions. Indeed,
as discussed above, two directions are Q-conjugate if they are orthogonal with respect
to the inner product h·iQ defined by (9.5). Second, we identify a specific set of linearly
independent vectors, which simplifies considerably the formulation.
Consider the set of ℓ vectors ξ1 , . . . ξℓ , that are linearly independent. The Q-
conjugate vectors are defined by induction in such a way that, at each step i of the
Quadratic problems 227
The calculation of di is well-defined. Indeed, the denominator dTk Qdk is non zero be-
cause Q is positive definite. Since the vectors ξ1 , . . . , ξi are linearly independent, ξi is
linearly independent from any direction in the subspace hξ1 , . . . ξi−1 i. From (9.14), it
is also independent from any direction in the subspace hd1 , . . . , di−1 i. Consequently,
i−1
X dTk Qξi
ξi 6= dk ,
dT Qdk
k=1 k
X dk Q∇f(xi )
di = −∇f(xi ) + dk . (9.17)
k=1
dTk Qdk
Then,
∇f(x1 ), . . . , ∇f(xi ) = hd1 , . . . , di i (9.18)
and
∇f(xi )T ∇f(xk ) = 0 , k = 1, . . . , i − 1 . (9.19)
Proof. i = 1 : (9.18) is trivially satisfied because d1 = −∇f(x1 ) and (9.19) does not
apply.
i = 2: We have
dT Q∇f(x2 )
d2 = −∇f(x2 ) + 1 T d1
d1 Qd1
and (9.18) is satisfied. Moreover, according to Lemma 9.3,
∇f(xi )T dk = 0 , k = 1, . . . , i − 1 , (9.20)
and ∇f(xi ) is orthogonal to the subspace hd1 , . . . , di−1 i. Since (9.18) is satisfied for
i − 1, ∇f(xi ) is orthogonal to the subspace ∇f(x1 ), . . ., ∇f(xi−1 ) , and (9.19) is
satisfied for i.
We now demonstrate a proposition that enables us to simplify the conjugate gra-
dient method.
with
∇f(xi )T ∇f(xi )
βi = . (9.22)
∇f(xi−1 )T ∇f(xi−1 )
Quadratic problems 229
1
Qdk = ∇f(xk+1 ) − ∇f(xk ) .
αk
Then, from the orthogonality of the gradients (Theorem 9.6), we have
1
∇f(xi )T Qdk = ∇f(xi )T ∇f(xk+1 ) − ∇f(xk )
αk
1 ∇f(xi )T ∇f(xi ) if k = i − 1
= αi
0 if k = 1, . . . , i − 2 .
Similarly, we have
1 T
dTk Qdk = dk ∇f(xk+1 ) − ∇f(xk ) .
αk
Therefore, (9.17) simplifies into
dTi−1 Q∇f(xi )
di = −∇f(xi ) + di−1 = −∇f(xi ) + βi di−1 (9.23)
dTi−1 Qdi−1
with
dTi−1 Q∇f(xi ) ∇f(xi )T ∇f(xi )
βi = = . (9.24)
dTi−1 Qdi−1 dTi−1 ∇f(xi ) − ∇f(xi−1 )
Since
di−1 = −∇f(xi−1 ) + βi−1 di−2 ,
the denominator is written as
dTi−1 ∇f(xi ) − ∇f(xi−1 ) = −∇f(xi−1 )T ∇f(xi ) − ∇f(xi−1 )
+ βi−1 dTi−2 ∇f(xi ) − ∇f(xi−1 )
= −∇f(xi−1 )T ∇f(xi ) (= 0)
T
+ ∇f(xi−1 ) ∇f(xi−1 )
+ βi−1 dTi−2 ∇f(xi ) (= 0)
− βi−1 dTi−2 ∇f(xi−1 ) (= 0) ,
where the three indicated terms are zero according to (9.7) and (9.19). And we obtain
(9.22) from (9.24).
All these results are combined to obtain Algorithm 9.2, the conjugate gradient
method. An important characteristic of the conjugate gradient algorithm is that the
matrix Q defining the problem is never needed as such. There is not even the need
to store it. It is used exclusively to calculate the matrix-vector products Qxk or
Qdk . This is particularly interesting for problems of large size, for which the matrix
Q is generally sparse. In this case, the matrix-vector products can be efficiently
implemented without ever explicitly forming the matrix Q.
230 Conjugate gradient method
Example 9.8 (Conjugate gradient method). We apply Algorithm 9.2 to the quadratic
problem (9.2) defined by
1 1 1 1 −4
1 2 2 2 −7
Q=
1
, b=
−9 .
2 3 3
1 2 3 4 −10
The iterations are detailed in Table 9.1. The algorithm converges after having gener-
ated 4 directions, as predicted by Corollary 9.5. It is easy to verify that the directions
generated by the algorithm are well conjugated and that the gradients are orthogonal
to each other, as stated in Theorem 9.6.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 9.1: Iterations for the conjugate gradient method for Example 9.8
k xk ∇f(xk ) dk αk βk
1 +5.00000e+00 +1.60000e+01 -1.60000e+01 +1.20766e-01
+5.00000e+00 +2.80000e+01 -2.80000e+01
+5.00000e+00 +3.60000e+01 -3.60000e+01
+5.00000e+00 +4.00000e+01 -4.00000e+01
2 +3.06775e+00 +1.50810e+00 -1.52579e+00 +1.02953e+00 +1.10547e-03
+1.61856e+00 +9.48454e-01 -9.79407e-01
+6.52430e-01 -2.29750e-01 +1.89953e-01
+1.69367e-01 -1.06038e+00 +1.01616e+00
3 +1.49690e+00 +1.70656e-01 -1.97676e-01 +2.37172e+00 +1.77089e-02
+6.10224e-01 -1.55585e-01 +1.38241e-01
+8.47993e-01 -9.20500e-02 +9.54138e-02
Quadratic problems
9.3 Project
The general organization of the projects is described in Appendix D.
Objective
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The aim of the present project is to solve several quadratic problems and compare
the direct solution with the conjugate gradient method for ill-conditioned problems.
Approach
Algorithms
Problems
Exercise 9.1. Use the following procedure to generate quadratic problems for which
the solution and conditioning are known.
a) Consider any randomly defined matrix A ∈ Rn×n , for instance
0.071744 0.039717 0.868964 0.880528 0.969800
0.085895 0.145339 0.832277 0.691063 0.621372
A=
0.857871 0.357765 0.151824 0.396765 0.258813 .
0.412037 0.521116 0.348378 0.632816 0.416459
0.806180 0.110585 0.332506 0.986633 0.476912
Quadratic problems 233
Then, x∗ is the solution to min 12 xT Qx + bT x and the eigenvalues of Q are the same
as those of D. The same goes for the conditioning.
Exercise 9.2. We also consider the matrix Hn ∈ Rn for which the elements Hn (i, j)
are defined by
1
Hn (i, j) = .
i+j−1
This matrix is called the Hilbert matrix of dimension n. It is symmetric, positive
definite, but extremely ill-conditioned (calculate its eigenvalues).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 10
Contents
10.1 Solving the necessary optimality conditions . . . . . . . 235
10.2 Geometric interpretation . . . . . . . . . . . . . . . . . . . 236
10.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
which defines the necessary optimality conditions. The algorithm, applied to F(x) =
∇f(x) and J(x) = ∇2 f(x), is described as Algorithm 10.1.
It inherits all the properties of Algorithm 7.3. In particular,
1. the method converges q-quadratically under favorable conditions (Theorem 7.13),
2. the method can diverge if the starting point is too far from the solution,
3. the method is not defined if the matrix ∇2 f(xk ) is singular.
When employed in the context of optimization, Newton’s local method presents
a further disadvantage. Indeed, solving the necessary optimality conditions of the
first degree does not guarantee that the identified solution is a minimum. Newton’s
method has no mechanism enabling it to discern minima from maxima and saddle
236 Geometric interpretation
∇f(x) = 0 . (10.1)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3 Input
4 The gradient of the function ∇f : Rn → Rn .
5 The Hessian of the function ∇2 f : Rn → Rn×n .
6 A first approximation of the solution x0 ∈ Rn .
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ Rn .
10 Initialization
11 k := 0.
12 Repeat
13 Calculate dk solution of ∇2 f(xk )dk = −∇f(xk ).
14 xk+1 := xk + dk .
15 k := k + 1.
16 Until ∇f(xk ) ≤ ε
17 x∗ = xk .
which does not satisfy the second-order necessary optimality conditions (Theorem 5.1)
and is consequently not a local minimum. It is actually a saddle point. The iterations
of the method are illustrated in Figure 10.1 and in Table 10.1.
Since Newton’s local method cannot be used as is, we develop alternative methods
in the following chapters. However, the fast rate of convergence of Newton’s method
prompts us to use it when appropriate. We conclude this chapter with a geometric
interpretation of Newton’s local method in the context of optimization.
Table 10.1: Newton’s local method for the minimization of Example 5.8
k xk ∇f(xk ) ∇f(xk ) f(xk )
0 1.00000000e+00 1.54030230e+00 1.75516512e+00 1.04030231e+00
1.00000000e+00 -8.41470984e-01
1 -2.33845128e-01 -2.87077027e-02 2.30665381e-01 7.53121618e-02
1.36419220e+00 2.28871986e-01
2 1.08143752e-02 -3.22524807e-03 1.12840544e-02 -9.33543838e-05
1.58483641e+00 -1.08133094e-02
3 -2.13237666e-06 9.22828706e-07 2.32349801e-06 8.79175320e-12
Newton’s local method
1.57079327e+00 2.13237666e-06
4 1.99044272e-17 8.11347449e-17 8.35406072e-17 1.35248527e-25
1.57079632e+00 -1.99044272e-17
237
238 Geometric interpretation
6 2
4 1.8
x∗
2 1.6
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0 x2 x∗
x0 1.4 x2
-2 x0
1.2
-4
1
-6
-2 -1 0 1 2 -0.5 0 0.5 1
x1 x1
(a) Iterates (b) Zoom
1 T 2
mbx (b x) + dT ∇f(b
x + d) = f(b x) + d ∇ f(b
x)d . (10.3)
2
Note that Definition 10.1 is consistent with Definition 2.28, with Q = ∇2 f(bx),
g = ∇f(bx) and c = f(b
x). If we minimize the model instead of the function, we get
the problem
1
minn mbx (b x) + dT ∇f(b
x + d) = f(b x) + dT ∇2 f(b
x)d . (10.4)
d∈R 2
The sufficient first-order optimality condition (Theorem 5.7) for (10.4) is written as:
∇mbx (b x) + ∇2 f(b
x + d) = ∇f(b x)d = 0 , (10.5)
i.e.,
x)−1 ∇f(b
d = −∇2 f(b x) (10.6)
or
x=b x)−1 ∇f(b
x − ∇2 f(b x) . (10.7)
Newton’s local method 239
The sufficient second-order optimality condition requires that the matrix ∇2 f(b
x) be
positive definite.
Note also that (10.7) is exactly the main formula of Newton’s local method (Al-
gorithm 10.1).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∇f(x) = 0 . (10.9)
3 Input
4 The gradient of the function ∇f : Rn → Rn .
5 The hessian of the function ∇2 f : Rn → Rn×n .
6 A first approximation of the solution x0 ∈ Rn .
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the solution x∗ ∈ Rn .
10 Initialization
11 k := 0.
12 Repeat
13 Create the quadratic model
1 T 2
mxk (xk + d) = f(xk ) + dT ∇f(xk ) + d ∇ f(xk )d . (10.10)
2
14 Calculate
dk = argmind mxk (xk + d) (10.11)
using the direct method (Algorithm 9.1) or the conjugate gradient
algorithm (Algorithm 9.2).
15 xk+1 := xk + dk .
16 k := k + 1.
17 Until ∇f(xk ) ≤ ε
18 x∗ = xk .
240 Geometric interpretation
Algorithm 10.2 is the version of Algorithm 10.1 using the quadratic model. It is
important to note that Algorithms 10.1 and 10.2 are equivalent only when the hessian
matrix at the current iterate is positive definite, that is when the function is locally
convex at the current iterate. When solving Example 5.8, illustrated in Table 10.1,
this interpretation is not valid. Indeed, we have
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1.00000000e+00 -8.41470984e-01
∇2 f(x0 ) = ,
-8.41470984e-01 -5.40302305e-01
for which the eigenvalues are -9.10855416e-01 and 1.37055311e+00. This matrix is
not positive definite. Therefore, the necessary optimality condition for the quadratic
problem is never satisfied, and there exists no solution to the minimization problem of
the quadratic model in x0 . The model is shown in Figure 10.2(b). It is not bounded
from below. Therefore, Algorithm 10.2 cannot be applied.
40
20
f(x1 , x2 ) 0
-20
-4
-2
0
x2 2
4 -2 -4
6 6 4 2 x 0
1
40
20
mx0 (x1 , x2 ) 0
-20
-4
-2
0
x2 2
4 -2 -4
6 6 4 2 x 0
1
We illustrate with Example 10.2 the limitations of Newton’s local method by using
the geometric interpretation (Algorithm 10.2).
Newton’s local method 241
m3 (x) = 7x2 − 48 x + 81 ,
for which the minimum is xk+1 = 24/7 ≈ 3.4286. Moreover, f(xk ) = 0 and
f(xk+1 ) ≈ -1.32 and then f(xk+1 ) < f(xk ). This is a favorable case. The model
is shown in Figure 10.3. It can be seen that there is a good adequacy between the
model and the function in the neighborhood of the iterates xk and xk+1 .
m4 (x) = x2 − 4x ,
for which the minimum is xk+1 = 2. In this case, f(xk ) = 0 and f(xk+1 ) = 12. The
iterate generated by the method is worse (in terms of the value of the objective
function) than the current iterate. The model is illustrated in Figure 10.4. It can
be seen that the iterate xk+1 lies in a region where the model is a poor approxi-
mation of the function. Recall that Taylor’s theorem guarantees a good adequacy
only in a neighborhood of xk , without mentioning the size of that neighborhood.
Here, the iterate xk+1 clearly lies outside it.
25
f(x)
20 m3 (x)
15
10
5
f(xk )
0 • •
-5 f(xk+1 )
-10
-15
1 2 3 4 5
x
Figure 10.3: Illustration of Example 10.2 with xk = 3
242 Geometric interpretation
25
f(x)
20 m4 (x)
15 f(x )
• k+1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10
5
f(xk )
0 •
-5
-10
-15
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
x
Figure 10.4: Illustration of Example 10.2 with xk = 4
25
f(x)
20 m5 (x)
15
10
5 f(xk+1 )
•
0 •
f(xk )
-5
-10
-15
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
x
Figure 10.5: Illustration of Example 10.2 with xk = 5
We conclude this chapter by defining two particular points that play a role later
on. On the one hand, the point obtained during the iteration of Newton’s local
method is often called Newton’s point.
Newton’s local method 243
xC = xk − αC ∇f(xk ) , (10.15)
where
αC ∈ argminα∈R+
0
mxk xk − α∇f(xk ) . (10.16)
1 We here refer to Dennis and Schnabel (1996, page 139). Other references (particularly Conn
et al., 2000, page 124) define Cauchy’s point as the minimum of the quadratic model along the
arc obtained by projecting the steepest descent direction onto the trust region.
244 Exercises
It is well defined if f is convex in the direction of the gradient. In this case, there is
only one minimizer. Using (10.3), we obtain
∇f(xk )T ∇f(xk )
αC = . (10.17)
∇f(xk )T ∇2 f(xk )∇f(xk )
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10.3 Exercises
For each of the following problems, determine Cauchy’s point xC and Newton’s point
xN in x̄. Each time, compare the value of the objective function at these three points.
n
X T
Exercise 10.1. minn ix2i , x̄ = 1 ... 1 .
x∈R
i=1
n
X
Exercise 10.2. minn x2i , any x̄.
x∈R
i=1
2 T
Exercise 10.3. min 2x1 x2 e−(4x1 +x2 )/8 , x̄ = 0 1 .
x∈R2
2 T
Exercise 10.4. min 2x1 x2 e−(4x1 +x2 )/8 , x̄ = 4 4 .
x∈R2
2 2 T
Exercise 10.5. min 100 x2 − x21 + 1 − x1 , x̄ = −1 −1 .
x∈R2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 11
Newton’s local method may be fast, but it fails regularly. We address the problem in
a different manner. Intuitively, in order to identify iterates with a lower value of the
objective function, we choose to follow the direction with the steepest descent given
by the opposite of the gradient. This idea turns out to be functional, but disastrously
slow. We demonstrate in this chapter how to correct this shortcoming, and how to
combine the two approaches in order to obtain a method that is both fast and robust.
Contents
11.1 Preconditioned steepest descent . . . . . . . . . . . . . . 246
11.2 Exact line search . . . . . . . . . . . . . . . . . . . . . . . . 251
11.2.1 Quadratic interpolation . . . . . . . . . . . . . . . . . . . 252
11.2.2 Golden section . . . . . . . . . . . . . . . . . . . . . . . . 257
11.3 Inexact line search . . . . . . . . . . . . . . . . . . . . . . . 263
11.4 Steepest descent method . . . . . . . . . . . . . . . . . . . 277
11.5 Newton method with line search . . . . . . . . . . . . . . 277
11.6 The Rosenbrock problem . . . . . . . . . . . . . . . . . . . 281
11.7 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . 284
11.8 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
We leave Newton’s method aside for now (we return to it in Section 11.5) and focus
on specific methods for an optimization problem. The main idea is simple. Since we
seek the minimum
of a function, we attempt to descend, i.e., to generate a sequence
of iterates xk k such that
f(xk+1 ) ≤ f(xk ) , k = 1, 2, . . .
Theorem 2.11 ensures that such an iterate can be found in a direction d such that
∇f(xk )T d < 0. The methods presented here, often called descent methods, consist
of a process involving three main steps:
1. Find a direction dk such that ∇f(xk )T dk < 0.
246 Preconditioned steepest descent
The first idea that comes to mind to define a concrete descent method is to invoke
the theorem of the steepest descent (Theorem 2.13) and to choose dk = −∇f(xk ).
Indeed, it is in this direction that the function has its steepest descent. We often refer
to this method as the steepest descent method. An iteration of this method consists
in
xk+1 = xk − αk ∇f(xk ) . (11.1)
When it comes to the step αk , we choose for the moment one that gives the largest
reduction of the function in the direction dk , i.e.,
αk ∈ argminα∈R+
0
f(xk + αdk ) . (11.2)
In the presence of multiple minima, it is common to use the first one, that is αk is
the small element of argminα∈R+0
f(xk + αdk ). Example 11.1 illustrates this method
for a simple case.
Example 11.1 (Steepest descent method). We minimize the function f : R2 → R
defined by
1 9
f(x) = x21 + x22 , (11.3)
2 2
by using the steepest descent method. Let xk be the current iterate. The direction
of the steepest descent is
!
− xk 1
dk = −∇f(xk ) = .
−9 xk 2
To calculate the step αk , we solve the problem in one dimension
1 2 9 2
min f xk − α∇f(xk ) = min xk 1
− α xk 1
+ xk 2
− 9α xk 2
,
α α 2 2
for which the optimal solution is
2 2
xk 1 + 81 xk 2
α= 2 2 .
xk 1 + 729 xk 2
At each iteration, the steepest descent method generates the point
2 2 !
xk 1 + 81 xk 2 − xk 1
xk+1 = xk + 2 2 .
xk 1 + 729 xk 2 −9 xk 2
T
By applying this algorithm, starting from the point x0 = 9 1 , we obtain the
iterations illustrated in Figure 11.1 and listed (in part) in Table 11.1.
Descent methods and line search 247
1.5
x0
1
0.5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x∗
0 x2
-0.5
-1
-1.5
-10 -5 0 5 10
x1
(a) Iterations
0.15
0.1
0.05
x∗
0 x2
-0.05
-0.1
-0.15
-1 -0.5 0 0.5 1
x1
(b) Zoom
In Example 11.1, it is remarkable how slow the steepest descent method is, even
though the function to minimize is simple. The zigzag behavior illustrated in Fig-
ure 11.1 is characteristic. We show next that the performance can be improved by
preconditioning the function (the concepts of conditioning and preconditioning are
discussed in Section 2.5).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 248
..
.
50 +1.284523E-04 +1.427248E-05 +1.284523E-04 +1.284523E-04 0.2 +9.166662E-09
51 +1.027618E-04 -1.141798E-05 +1.027618E-04 -1.027618E-04 0.2 +5.866664E-09
52 +8.220947E-05 +9.134385E-06 +8.220947E-05 +8.220947E-05 0.2 +3.754665E-09
53 +6.576757E-05 -7.307508E-06 +6.576757E-05 -6.576757E-05 0.2 +2.402985E-09
54 +5.261406E-05 +5.846007E-06 +5.261406E-05 +5.261406E-05 0.2 +1.537911E-09
55 +4.209125E-05 -4.676805E-06 +4.209125E-05 -4.209125E-05 0.2 +9.842628E-10
Descent methods and line search 249
We use the equations (2.53) and (2.54) to define the change of variables
x1′ = x1
x2′ = 3x2
which is the optimal solution to the problem. In this case, the method identifies the
minimum of the function in a single iteration.
Clearly, the performance of the steepest descent method can be significantly im-
proved when the function is preconditioned. We can generalize this idea. Let Hk be
a symmetric positive definite matrix such that Hk = Lk LTk . We use Lk to define a
change of variables, according to Definition 2.32, i.e.,
x ′ = LTk x . (11.5)
′
xk+1 = xk′ − αk L−1 −T ′
k ∇f(Lk xk ) . (11.7)
xk+1 = xk − αk L−T −1
k Lk ∇f(xk )
(11.9)
= xk − αk H−1
k ∇f(xk ) .
xk+1 = xk + αk dk (11.10)
with
dk = −H−1
k ∇f(xk ) . (11.11)
If we denote Dk = H−1
k , we obtain in a similar manner
However, it is not necessary to select a step αk that minimizes the function along dk .
In order to save computing time, we propose in Section 11.3 a characterization of steps
that are “acceptable.” Section 11.3 proposes an inexact line search algorithm based
on this characterization. After including the line search approach into the steepest
descent algorithm in Section 11.4, we propose in Section 11.5 a way to define the
preconditioning matrices Dk , inspired by Newton’s method.
Descent methods and line search 251
x∈Rn
3 Input
4 The differentiable function f : Rn → R.
5 The gradient of the function ∇f: Rn → Rn .
6 A family of preconditioners Dk k such that Dk is positive definite for all k.
7 An initial solution x0 ∈ Rn .
8 The required precision ε ∈ R, ε > 0.
9 Output
10 An approximation of the optimal solution x∗ ∈ Rn .
11 Initialization
12 k := 0.
13 Repeat
14 dk := −Dk ∇f(xk ).
15 Determine αk , for instance αk ∈ argminα≥0 f(xk + αdk ).
16 xk+1 := xk + αk dk .
17 k := k + 1.
18 Until ∇f(xk ) ≤ ε
19 x∗ := xk .
where xk is the current iterate and dk is a descent direction. From Theorem 2.11, we
know that α = 0 is not a local minimum of this function. Therefore, the constraint
α ≥ 0 is inactive at the optimal solution and can be ignored (see Theorem 3.5).
Clearly, Newton’s method can be used to solve the problem, if a good approxima-
tion of the local optimum is known. The derivatives of h are
dh(α)
h ′ (α) = = ∇f(xk + αdk )T dk , (11.16)
dα
252 Exact line search
and
d2 h(α)
h ′′ (α) = = dTk ∇2 f(xk + αdk )T dk . (11.17)
dα2
We describe two other techniques: the quadratic interpolation method and the golden
section method.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
such that q(a) = h(a), q(b) = h(b) and q(c) = h(c). As q(a) = h(a), we obtain
immediately that
h(a)
β3 = . (11.19)
a−b
Descent methods and line search 253
h(b)
β2 = . (11.20)
b−a
From the last interpolation condition, q(c) = h(c), we obtain after some straightfor-
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
ward derivation,
As q(a) > q(b) and q(c) > q(b), the quadratic q is convex, and its minimum x∗
corresponds to the point where the derivative is 0. As
we have
β1 (a + b) − β2 − β3
x∗ = . (11.23)
2β1
The numerator β1 (a + b) − β2 − β3 is equal to
so that
1 h(a)(b2 − c2 ) + h(b)(c2 − a2 ) + h(c)(a2 − b2 )
x∗ = . (11.24)
2 h(a)(b − c) + h(b)(c − a) + h(c)(a − b)
Now, we need to generate a new set of 3 points a+ , b+ , c+ , with the same properties
(a+ < b+ < c+ , h(a+ ) > h(b+ ), h(c+ ) > h(b+ )), and such that the interval [a+ , c+ ]
is strictly smaller than [a, c]. We assume that h(x∗ ) 6= h(b). If it happens not to be
the case, perturb x∗ by a small amount to enforce h(x∗ ) 6= h(b). Note that assuming
h(x∗ ) 6= h(b) implies that x∗ 6= b.
Suppose first that x∗ lies between b and c, that is a < b < x∗ < c.
• If h(x∗ ) > h(b), we set a+ = a, b+ = b, and c+ = x∗ . The condition a+ < b+ <
c+ is trivially verified. The condition h(a+ ) > h(b+ ) is h(a) > h(b), which is
verified by assumption, and the condition h(c+ ) > h(b+ ) is h(x∗ ) > h(b), which
is the condition of the case that is treated.
• If h(x∗ ) < h(b), we set a+ = b, b+ = x∗ , and c+ = c. The condition a+ < b+ <
c+ is trivially verified. The condition h(a+ ) > h(b+ ) is h(b) > h(x∗ ), which is the
condition of the case being treated. The condition h(c+ ) > h(b+ ) is h(c) > h(x∗ ),
which is verified because h(c) > h(b) > h(x∗ ).
Suppose next that x∗ lies between a and b, that is a < x∗ < b < c.
• If h(x∗ ) > h(b), we set a+ = x∗ , b+ = b, and c+ = c. The condition a+ < b+ <
c+ is trivially verified. The condition h(a+ ) > h(b+ ) is h(x∗ ) > h(b), which is
the condition being treated. The condition h(c+ ) > h(b+ ) is h(c) > h(b), verified
by assumption.
254 Exact line search
17 if x∗ > b then
18 if h(x∗ ) > h(b) then the new triplet is a, b, x∗
19 c := x∗
20 else the new triplet is b, x∗ , c
21 a := b
22 b := x∗
Example 11.3 (Exact line search with quadratic interpolation). Consider the func-
tion
20
h(x) = (2 + x) cos(2 + x)
15 q(x)
10
5 x∗
a+ c
0 a b c+
b+
-5
-10
-15
-20
0 2 4 6 8 10 12
20
h(x) = (2 + x) cos(2 + x)
15 q(x)
10
5 a
c
0 b c+
a+
-5 x∗
-10 b+
-15
-20
0 2 4 6 8 10 12
20
h(x) = (2 + x) cos(2 + x)
15 q(x)
10
5 c
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0 a ∗
a+ x
-5 +
bc
+
-10 b
-15
-20
4 5 6 7 8 9 10 11 12 13
20
h(x) = (2 + x) cos(2 + x)
15 q(x)
10
5
0 a
a+ c
-5 b
x∗ c+
-10 b+
-15
-20
4 5 6 7 8 9 10 11 12 13
in Figure 11.6. If it happens that h(αk1 ) = h(αk2 ), then the strict unimodularity of h
guarantees that α∗ ∈ [αk1 , αk2 ], so that it becomes the next interval, and ℓk+1 = αk1
and uk+1 = αk2 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
h(α)
ℓk α1 = ℓk+1 α∗ α2 uk = uk+1
h(α)
ℓk = ℓk+1 α∗ α1 uk
α2 = uk+1
We now define specific rules to choose αk1 and αk2 . First, we impose a symmetric
reduction of the intervals, that is
where ρ < 1/2 is the shrinking factor of the interval, which is constant across itera-
tions. Second, we choose ρ in order to save on function evaluations. At each iteration
where only one of the two values becomes the bound of the next interval, we recycle
the other value for the next reduction, as illustrated in Figure 11.7.
During iteration k, the next interval happens to be [ℓk+1 , uk+1 ] = [ℓk , αk2 ]. We
select αk+1
2 to be equal to αk1 , so that there is no need to recalculate the value of the
Descent methods and line search 259
ℓk αk1 αk2 uk
ℓk+1 αk+1
1 αk+1
2
uk+1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
function in αk+1
2 . Denote λ the length of the interval:
λ = uk − ℓk . (11.27)
By symmetry (11.26), we have
αk1 − ℓk = uk − αk2 = ρ(uk − ℓk ) = ρλ, (11.28)
and for the next iteration
αk+1
1 − ℓk+1 = uk+1 − αk+1
2 = ρ(uk+1 − ℓk+1 ). (11.29)
We now exploit the fact that ℓk+1 = ℓk , αk+1
2 = αk1 , and uk+1 = αk2 (see Figure 11.7)
to obtain
αk+1
1 − ℓk = αk2 − αk1 = ρ(αk2 − ℓk ). (11.30)
We first derive
αk2 − αk1 = αk2 − αk1 + ℓk − ℓk + uk − uk
= −(αk1 − ℓk ) − (uk − αk2 ) + uk − ℓk
= −ρλ − ρλ + λ from (11.27) and (11.28)
= λ(1 − 2ρ). (11.31)
Then, we derive
αk2 − ℓk = αk2 − ℓk + uk − uk
= −(uk − αk2 ) + (uk − ℓk )
= −ρλ + λ from (11.27) and (11.28)
= λ(1 − ρ). (11.32)
Using (11.31) and (11.32) into (11.30), we obtain
λ(1 − 2ρ) = ρλ(1 − ρ), (11.33)
or equivalently,
ρ2 − 3ρ + 1 = 0. (11.34)
This equation has two solutions:
√ √
3+ 5 3− 5
and . (11.35)
2 2
As the shrinking factor ρ has to be less than 1/2, we select
√
3− 5
ρ= . (11.36)
2
260 Exact line search
Example 11.4 (Exact line search with golden section). Consider the function
The function is strictly unimodular in the interval [5, 10]. We apply Algorithm 11.4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The intervals generated during the first iterations are represented in Figure 11.8.
The details of each iteration is reported in Table 11.3.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
ℓ α∗ u
Figure 11.8: Intervals of the first iterations of the golden section method on Exam-
ple 11.4
The name of the method comes from the golden ratio. Two quantities a and b
262 Exact line search
2
is the golden ratio. In geometry, a golden rectangle is a rectangle that can be cut
into a square and a rectangle similar to the original one (see Figure 11.9). Its side
lengths are in the golden ratio. The golden rectangle has been used in architecture,
for its aesthetical properties.
a b
In Algorithm 11.4, the distance of the two points α1 and α2 to the lower bound
of the interval, that is α1 − ℓ and α2 − ℓ, are in the golden ratio. Indeed,
α2 − ℓ α2 − α1 + α1 − ℓ
=
α1 − ℓ α1 − ℓ
λ(1 − 2ρ) + ρλ
= from (11.31)
ρλ
1−ρ
=
ρ
√
1+ 5
= from (11.36)
2
=φ from (11.39).
Descent methods and line search 263
We want to spend as little effort as possible calculating the step. Instead of trying to
solve a one-dimensional optimization problem as in the previous section, we consider
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
here a trial-and-error approach, where various values are tested for the step α, and
the first one that is suitable is accepted. It means that we need formal conditions that
distinguish acceptable from unacceptable steps. In principle, to maintain consistency
with theory, small steps should be used. Indeed, Taylor’s theorem guarantees that
performing a small step along a descent direction decreases the value of the function.
However, we would also like our algorithm to progress rapidly, which would encourage
to consider large steps. In order to reconcile these two contradictory objectives, we
establish a kind of contract: large steps are acceptable provided that the reduction
that is achieved is substantial. If not, they are rejected, and smaller steps should be
considered. In order to formally characterize this “contract,” we introduce the notion
of sufficient decrease of the function.
f(x) = x2 .
1 sgn(xk )
Dk = =
2|xk | 2xk
αk = 2 + 3(2−k−1 ) .
Note that Dk is positive (definite) for all k. Since ∇f(xk ) = 2xk , we have dk =
−Dk ∇f(xk ) = − sgn(xk ). In this case, the method is written as
xk − 2 − 3(2−k−1 ) if xk ≥ 0
xk+1 = (11.41)
xk + 2 + 3(2−k−1 ) if xk < 0,
264 Inexact line search
which gives the sequence of iterates listed in Table 11.4 and illustrated in Figure 11.10.
We show by induction that, in this case,
and
|xk+1 | < |xk | . (11.43)
4.5
4
3.5
3
2.5
f(x)
2
1.5
1
0.5
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x
Figure 11.10: Iterates of Example 11.5
The cases k = 0 and k = 1 are verified numerically (Table 11.4). We now assume
that k is even and that (11.42) and (11.43) are verified for k. We note that the parity
Descent methods and line search 265
= 1 + 21−(k+1) − 2 − 3(2−(k+1) )
= −1 − 2−(k+1)
= (−1)k+1 (1 + 2−(k+1) ) because k is even .
The reason that the presented algorithm fails in Example 11.5 is the disproportion
between the length of the step and the resulting decrease of the objective function.
Indeed, the notion of a descent direction (Definition 2.10) is based on Taylor’s the-
orem, which is valid only in a neighborhood of the current iterate. As soon as we
select a larger step than η of Theorem 2.11, the fact that the direction is a descent
direction is no longer relevant, and the fact that the new iterate happens to be better
is coincidental. This is the case with Example 11.5, where the next iterate actually
lies in a region where the function is increasing along the followed direction.
To avoid this inconvenience, it is necessary to impose a condition characterizing
the notion of sufficient decrease of the function. One idea is to consider a decrease
of the function to be sufficient if the improvement of the objective function is pro-
portional to the length of the step. Concretely, we select γ > 0, and consider a step
αk to be acceptable if
f(xk ) − f(xk + αk dk ) ≥ αk γ ,
or
f(xk + αk dk ) ≤ f(xk ) − αk γ . (11.44)
266 Inexact line search
The factor γ cannot be chosen arbitrarily. In particular, it should vary from one
direction to another. Returning to Example 11.2, Figure 11.11 illustrates the shape of
T
the function f(x0 +αd) when going from x0 = 10 1 in two different normalized
directions, as well as the straight line f(x0 ) − αγ, with γ = 6.
According to Figure 11.11(a), a sufficient decrease of the function in the direction
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
√ √ T
d = −10/ 181 −9/ 181 is obtained for several values of α, especially between
0 and 3.25478. However, it can be seen in Figure 11.11(b) that no value of α allows
√ √ T
a sufficient decrease in the direction d = −2/ 5 1/ 5 with regard to the
condition (11.44). Indeed, the straight line is too steep, while the function is relatively
flat in this direction. The requirement associated with this value of γ is too strong.
Instead of using an arbitrary fixed value for γ, it is more appropriate to define it
proportional to the slope of the function in xk in the direction dk :
γ = −β∇f(xk )T dk ,
with 0 < β < 1. Then, the closer the directional derivative ∇f(xk )T dk is to zero, the
smaller the slope of the line, and vice versa. Note that, if β = 0, (11.44) would collapse
to f(xk + αk dk ) ≤ f(xk ), that we have shown to be inappropriate. Geometrically, the
line setting the threshold for the objective function value is horizontal in this case.
So the value β = 0 is excluded. The value β = 1 corresponds to the tangent line. If
the function happens to be convex at xk (which is the case close to a local minimum),
the tangent lies entirely below the function (see Theorem 2.16), and no value of αk
verifies (11.44). Again, this value of β is excluded, justifying the condition 0 < β < 1.
Definition 11.6 (Sufficient decrease: the first Wolfe condition). Consider the differ-
entiable function f : Rn → R, a point xk ∈ Rn , a (descent) direction dk ∈ Rn such
that ∇f(xk )T dk < 0 and a step αk ∈ R, αk > 0. We say that the function f decreases
sufficiently in xk + αk dk compared with xk if
with 0 < β1 < 1. The condition (11.45) is called the first Wolfe condition after Wolfe
(1969), or the Armijo condition, after Armijo (1966).
65
f(xk + αdk )
f(xk ) − αγ
60
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
55
50
45
40
35
0 1 2 3 4 5
α
√ √
(a) dk = (−10/ 181 − 9/ 181)T
65
f(xk + αdk )
f(xk ) − αγ
60
55
50
45
40
35
0 1 2 3 4 5
α
√ √ T
(b) dk = −2/ 5 1/ 5
65
f(xk + αdk )
f(xk ) + αβ1 ∇f(xk )T dk
60
f(xk ) + α∇f(xk )T dk
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
55
50
45
40
35
0 1 2 3 4 5
α
√ √
(a) dk = (−10/ 181 − 9/ 181)T
65
f(xk + αdk )
f(xk ) + αβ1 ∇f(xk )T dk
60
f(xk ) + α∇f(xk )T dk
55
50
45
40
35
0 1 2 3 4 5
α
√ √ T
(b) dk = −2/ 5 1/ 5
65
f(xk + αdk )
f(xk ) + αβ1 ∇f(xk )T dk
60
f(xk ) + α∇f(xk )T dk
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
55
50
45
40
35
0 1 2 3 4 5
α
√ √
(a) dk = (−10/ 181 − 9/ 181)T
65
f(xk + αdk )
f(xk ) + αβ1 ∇f(xk )T dk
60
f(xk ) + α∇f(xk )T dk
55
50
45
40
35
0 1 2 3 4 5
α
√ √ T
(b) dk = −2/ 5 1/ 5
Example 11.7 (Descent method: too small steps). Consider the one-variable func-
tion
f(x) = x2 .
We apply Algorithm 11.1 with x0 = 2 and
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1
Dk =
2xk
αk = 2−k−1 .
Note that Dk is positive (definite) for all k if xk > 0, which is the case in this example.
Since ∇f(xk ) = 2xk , we have dk = −Dk ∇f(xk ) = −1. In this case, the method is
written as
xk+1 = xk − 2−k−1 .
The sequence of iterates xk k is listed in Table 11.5. We show by induction that it
is defined by
xk = 1 + 2−k . (11.46)
The cases k = 0 and k = 1 are numerically verified (Table 11.5). If we assume that
(11.46) is verified for k, then
and the recurrence is verified. From Equation (11.46), we immediately deduce xk+1 <
xk and, consequently, f(xk+1 ) < f(xk ). We thus have a descent method. However,
the sequence (xk )k converges toward 1, which is not a local minimum of the function.
Descent methods and line search 271
In this case, the reason the method fails is due to the degeneracy of the steps αk .
Although these steps are positive, they are closer and closer to 0 and at some point,
the method can no longer progress. A technique aiming to prevent this again exploits
the derivative of the function in the direction dk . At the point xk , the directional
derivative ∇f(xk )T dk is negative, because dk is a descent direction. If we were per-
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
forming an exact line search (see Section 11.2) where the step α∗ corresponds to a local
minimum of the function in the direction k, we would have ∇f(xk + α∗ dk )T dk = 0.
Then, between xk and xk + α∗ dk , the derivative of the function increases compared
to its initial negative value. To ensure sufficiently large steps, the idea is to obtain a
step such that the directional derivative increases sufficiently.
with 0 < β2 < 1. The condition (11.47) is called the second Wolfe condition, after
Wolfe (1969).
∇f(xk + αk dk )T dk
≤ β2 . (11.48)
∇f(xk )T dk
This is illustrated in Figure 11.14, where the straight dotted lines represent the ratio
of the left term of (11.48). By choosing, for instance, β2 = 0.5, the step α should be
such that α ≥ 1.4687 in Figure 11.14(a) and α ≥ 0.94603 in Figure 11.14(b).
The conditions (11.45) and (11.47) are called the Wolfe conditions, after Wolfe
(1969) and Wolfe (1971). They are sometimes called Armijo-Goldstein conditions,
making reference to the work of Armijo (1966), and Goldstein and Price (1967).
As the two conditions have conflicting goals (one forbidding long steps, one for-
bidding short steps), it may happen that they are incompatible, and that no step
verifies both. The next theorem shows that if the parameter β1 of the first condition,
and the parameter β2 of the second are chosen such that 0 < β1 < β2 < 1, the two
conditions are compatible.
56 1
54
52 0.5
50 ∇f(xk +αdk )T dk
48 ∇f(xk )T dk 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
46
-0.5
44
42 -1
40 f(xk + αdk )
38 -1.5
36
34 -2
0 1 2 3 4 5
α
√ √
(a) dk = (−10/ 181 − 9/ 181)T
64 1
62
0.5
60
0
58
56 -0.5
54
-1
52
-1.5
50
48 -2
0 1 2 3 4 5
α
√ √ T
(b) dk = −2/ 5 1/ 5
Figure 11.14: Sufficient progress of the function of Example 11.2 (β2 = 0.5)
f0 − f(xk )
α> , (11.49)
β1 ∇f(xk )T dk
Descent methods and line search 273
i.e., such that the straight line f(xk ) + αβ1 ∇f(xk )T dk intersects the function.
6
f(xk + αdk )
5 f(xk ) + α∇f(xk )T dk
0
α2 α1
α
Figure 11.15: Validity of the Wolfe conditions: illustration of the proof
We invoke the mean value theorem (Theorem C.1) that says that there is a step
α2 between 0 and α1 such that the function has the same slope in xk + α2 dk as the
line (see Figure 11.15). Formally, we use Equation (C.2) with d = α1 dk . There exists
0 ≤ α ′ ≤ 1 such that
or
dTk ∇f(xk + α2 dk )
β1 = .
∇f(xk )T dk
Then, since β2 > β1 , we have
dTk ∇f(xk + α2 dk )
β2 >
∇f(xk )T dk
An inexact line search method enables us to identify a step that satisfies the Wolfe
conditions (11.45) and (11.47). Algorithm 11.5 is attributed to Fletcher (1980) and
Lemaréchal (1981). The idea is simple: a trial step is tested. If it is too long, that is,
if it violates the first Wolfe condition, it is shortened. If it is too short, that is, if it
violates the second Wolfe condition, it is made longer. This process is repeated until
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
a step verifying both conditions is found. Theorem 11.9 guarantees that such a step
exists when 0 < β1 < β2 < 1.
27 i := i + 1.
28 Until αi satisfies the conditions (11.45) and (11.47)
29 α∗ := αi
Descent methods and line search 275
Table 11.6 lists the steps of the algorithm applied to the function of Example 11.2,
with √
10 −2/√ 5
x= , d=
1 1/ 5
α0 = 10−3 , β1 = 0.3 , β2 = 0.7 , λ = 20 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Theorem 11.10 (Finiteness of the line search algorithm). Following the same as-
sumptions as those of Theorem 11.9, the line search (Algorithm 11.5) ends after
a finite number of iterations.
Proof. We first assume, by contradiction, that limi→∞ αi = +∞. This signifies that
αr permanently keeps its initial value αr = ∞, and that condition on line 21 of the
algorithm is always verified. Therefore, αi never violates (11.45). This is impossible,
as was discussed in the proof of Theorem 11.9. Indeed, the condition (11.45) is
violated as soon as αi is sufficiently large, i.e., as soon as (11.49) is satisfied. Then,
after a finite number of iterations, αr < ∞, and the following iterations all consist in
a reduction of the step
αℓ + αr
αi+1 = ,
2
either at line 20 or 24 of the algorithm.
We now assume (by contradiction) that the algorithm performs an infinite number
of iterations. In this case,
lim αir − αiℓ = 0 ,
i→∞
where αir and αiℓ are values of αr and αℓ , respectively, at iteration i. Indeed, regardless
of the case that applies, the interval is divided by two at each iteration, and we always
have
αi − αiℓ
αri+1 − αℓi+1 = r .
2
276 Inexact line search
3 Input
4 The differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 An initial solution x0 ∈ Rn .
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the optimal solution x∗ ∈ R.
10 Initialization
11 k := 0.
12 Repeat
13 dk := −∇f(xk ).
14 Determine αk by applying the line search (Algorithm 11.5) with α0 = 1.
15 xk+1 := xk + αk dk .
16 k := k + 1.
17 Until k∇f(xk )k ≤ ε
18 x∗ = xk .
where Dk is positive definite. Therefore, if ∇2 f(xk ) is positive definite and the step
αk = 1 is acceptable (according to the Wolfe conditions), an iteration of the local
Newton method represents exactly an iteration of the preconditioned steepest descent
method with Dk = ∇2 f(xk )−1 .
If the step αk = 1 is not acceptable, it suffices to apply Algorithm 11.5 to obtain
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
a step satisfying the Wolfe conditions. However, when the Hessian matrix ∇2 f(xk )
is not positive definite, it is necessary to choose another preconditioner Dk . Several
possibilities exist.
One of them involves choosing Dk diagonal, with entries
−1
∂2 f
Dk (i, i) = max ε, (xk ) , (11.61)
∂(x)2i
with ε > 0. Then, each diagonal element (i.e., each eigenvalue) is greater than or
equal to ε, which guarantees the positive definiteness of the matrix, all the while
incorporating into it information related to the second derivative.
14 Repeat
15 Calculate the Cholesky factorization LLT of A + τI.
16 if the factorization is not successful
then
17 τk+1 := max 2τk , 12 kAkF .
18 k := k + 1.
19 Until the factorization is successful
Descent methods and line search 279
In general, the most widely used technique consists in generating a matrix E such
that −1
Dk = ∇2 f(xk ) + E
is positive definite. In particular, this is always possible if E is a multiple of the
identity.1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3 Input
4 The twice differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 The Hessian of the function ∇2 f : Rn → Rn×n .
7 An initial solution x0 ∈ Rn .
8 The required precision ε ∈ R, ε > 0.
9 Output
10 An approximation of the optimal solution x∗ ∈ R.
11 Initialization
12 k := 0.
13 Repeat
14 Calculate a lower triangular matrix Lk and τ such that
Lk LTk = ∇2 f(xk ) + τI ,
This algorithm is operational in the sense that all steps are well defined. To
compare with the local Newton method from Chapter 10, we apply the Newton
method with line search (Algorithm 11.8) to Example 5.8 starting from the same
T
point x0 = 1 1 . In this case, it converges to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 0 1 0
x∗ = , ∇f(x∗ ) = , ∇2 f(x∗ ) =
π 0 0 1
which is a local minimum since it satisfies the sufficient optimality conditions (see
Theorem 5.7 and the discussions for Example 5.8). The iterations are illustrated in
Figure 11.16, and it is interesting to compare with Figure 10.1.
6
4
x∗
2
x0
0 x2
-2
-4
-6
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x1
(a) Iterates
3.5
x∗
3
2.5
x2
2
1.5
x0 1
0.2 0.4 0.6 0.8 1
x1
(b) Zoom
Figure 11.16: Iterates of the Newton method with line search for Example 5.8
Descent methods and line search 281
Table 11.7 lists the values of αk and of τ employed in each iteration. Note that,
starting from iteration 4, the algorithm performs the exact same steps as the local
Newton method, as αk = 1 and τ = 0, and it achieves quadratic convergence.
Table 11.7: Illustration of the Newton method with line search (Algorithm 11.8) for
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Example 5.8
k f(xk ) ∇f(xk ) αk τ
0 1.04030231e+00 1.75516512e+00
1 2.34942031e-01 8.88574897e-01 1 1.64562250e+00
2 4.21849003e-02 4.80063696e-01 1 1.72091923e+00
3 -4.52738278e-01 2.67168927e-01 3 8.64490594e-01
4 -4.93913638e-01 1.14762780e-01 1 0.00000000e+00
5 -4.99982955e-01 5.85174623e-03 1 0.00000000e+00
6 -5.00000000e-01 1.94633135e-05 1 0.00000000e+00
7 -5.00000000e-01 2.18521663e-10 1 0.00000000e+00
8 -5.00000000e-01 1.22460635e-16 1 0.00000000e+00
It is actually the function used in Example 5.3 to illustrate the necessary optimality
conditions. It has a valley that follows the parabola x2 = x21 , which forces all descent
methods to follow a curved trajectory. Figure 11.17 plots the function for x1 between
−2 and 2, and x2 between −4 and 4.
x1 x2
Figure 11.17: The Rosenbrock function
282 The Rosenbrock problem
4
3.5
3
2.5
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x2
x0 1.5
∗
x 1
0.5
0
2
x0 Zoom 1.5
x∗ 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) Stopped at 200 iterations
0.66
0.64
0.62
0.6
0.58 x2
0.56
0.54
0.52
0.5
0.72 0.74 0.76 0.78 0.8
x1
(b) Zoom
Figure 11.19: Steepest descent method
Descent methods and line search 283
Figure 11.18 represents the level curves 0 to 6 of the function, as well as the
T
location of the starting point x0 = −1.5 1.5 and the location of the optimal
∗
T
solution x = 1 1 .
The steepest descent algorithm (Algorithm 11.6) has a hard time solving this
problem. The zigzag trajectory of the iterates, already illustrated in Example 11.1, is
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
unacceptable here (Figure 11.19). With two exceptions, the steps made by the method
are small, which hinders the algorithm from progressing. This one was interrupted
after 200 iterations, without having converged. A large step could be taken after
two iterations thanks to the line search strategy (Algorithm 11.5), which starts by
attempting large steps and sometimes succeeds.
The superiority of the Newton method with line search (Algorithm 11.8) is illus-
trated in Figure 11.20. The algorithm exploits pretty well the information about the
curvature of the function provided by the second derivatives. The iterations follow
the valley pretty smoothly, along the parabola that defines it.
2
x0 1.5
∗
x 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) 23 iterations
x∗ 1
0.8
0.6
x2
0.4
0.2
0
11.7 Convergence
The local Newton method (Algorithm 10.1) has a quadratic convergence rate (Theo-
rem 7.13). However, it only works when the starting point is sufficiently close to the
optimal solution. In practice, it is clearly not possible to guarantee that this hypoth-
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
esis is verified. Moreover, the more non linear and ill-conditioned the function is, the
closer the starting point needs to be to the optimal solution (Eq. (7.21)). The main
motivation for developing the Newton method with line search (Algorithm 11.8) is to
obtain an algorithm that converges regardless of the starting point given by the user.
We call such an algorithm globally convergent.
Care should be taken not to confuse “global convergence” and “global minimum.”
An algorithm can be globally convergent and converge toward a local minimum.
As line search guarantees sufficient decrease and sufficient progress along a descent
direction, the only way to stall a descent direction algorithm is for the directions
to become asymptotically orthogonal to the gradient. Then, even if the algorithm
guarantees that
∇f(xk )T dk < 0 ,
it is necessary to also guarantee that
lim inf ∇f(xk )T dk < 0 .
k
In other words, the cosine of the angle between the descent direction and the direction
of the steepest slope cannot approach 0. We denote this angle θk , i.e.,
−∇f(xk )T dk
cos θk = . (11.65)
∇f(xk ) kdk k
In order to demonstrate this, we need the following theorem, attributed to Zoutendijk.
Consider an algorithm generating the sequence xk k
, defined by the iterations
xk+1 = xk + αk dk , k = 0, 1, . . . , (11.67)
with dk a descent direction (i.e., ∇f(xk )T dk < 0) and αk that satisfies the Wolfe
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
where
−∇f(xk )T dk
cos θk = (11.69)
∇f(xk ) kdk k
is convergent.
Moreover, we have
T
∇f(xk+1 ) − ∇f(xk ) dk ≤ ∇f(xk+1 ) − ∇f(xk ) kdk k
≤ Mkxk+1 − xk k kdk k from (11.66)
2
≤ Mαk kdk k from (11.67) .
or
β2 − 1 ∇f(xk )T dk
αk ≥ . (11.70)
M kdk k2
The first Wolfe condition (11.45) ensures that
K
X K
X
b cos2 θk ∇f(xk ) 2
f(xk + αk dk ) − f(xk ) ≤ − β
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
k=0 k=0
K
X
b 2
f(xK+1 ) − f(x0 ) ≤ −β cos2 θk ∇f(xk ) .
k=0
K
X
b 2
β cos2 θk ∇f(xk ) ≤ f(x0 ) − f(xK+1 ) .
k=0
Since f is bounded from below, there exists f0 such that f(x) ≥ f0 , for all x. Therefore,
and then
K
X
b 2
β cos2 θk ∇f(xk ) ≤ f(x0 ) − f0 , ∀K .
k=0
2
lim ∇f(xk ) = 0.
k→∞
This would be the case if the sequence cos2 θk did not approach zero, i.e., if there
exists δ > 0 such that
∇f(xk )T dk
− ≥ δ , ∀k .
∇f(xk ) kdk k
A sequence of directions dk k satisfying
this property is said to be gradient related
with the sequence of iterates xk k .
Descent methods and line search 287
xk+1 = xk + αk dk , k = 0, 1, . . .
The sequence dk k is said to be gradient related with the sequence xk k if, for all
subsequences xk k∈K converging toward a non stationary point, i.e., all subsequences
such that
∇f lim xk 6= 0 ,
k∈K
the corresponding subsequence dk k∈K
is bounded and satisfies
Then, if the sequence dk k is gradient related with the sequence xk k , the angle
between dk and ∇f(xk ) does not come too close to 90 degrees.
In the context of the preconditioned steepest descent method, in order for the
sequence of Newton directions to be gradient related with the iterates, it suffices that
the conditioning of the matrices Dk is bounded, i.e., that there exists C > 0 such
that
kDk k2 D−1
k 2
≤ C, ∀k .
288 Project
Since
kdk k ≤ Dk 2
∇f(xk ) ,
we get
1 1
cos θk ≥ ≥ > 0.
Dk 2 D−1
k 2
C
Then, the cosine of the angle is bounded by a positive constant, and the directions
do not degenerate by becoming asymptotically orthogonal to the gradient.
The presentation of the proof of Theorem 11.12 was inspired by Nocedal and
Wright (1999). Examples 11.5 and 11.7 were inspired by Dennis and Schnabel (1996).
11.8 Project
The general organization of the projects is described in Appendix D.
Objective
The objective of the present project is to analyze the behavior of the descent methods,
and to understand the role of the preconditioner and the role of the line search
parameters.
Approach
1. Implement the preconditioned steepest descent method (Algorithm 11.1) with line
search (Algorithm 11.5) and the following preconditioners:
(a) Dk = I, to obtain the steepest descent method.
−1
∂2 f(xk )
(b) Dk diagonal matrix, with Dk (i, i) = max 1, .
∂x2i
−1
∂2 f(x0 )
(c) Dk diagonal matrix, with Dk (i, i) = max 1, .
∂x2i
1
(d) Dk diagonal matrix, with Dk (i, i) = .
max 1, xk i
Descent methods and line search 289
1
(e) Dk diagonal matrix, with Dk (i, i) = .
max 1, x0 i
Utilize several starting points. Each time, verify that the optimality conditions
are satisfied at the final solution and compare the number of iterations.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2. In the line search (Algorithm 11.5), vary the parameters, by using (for instance)
the following values:
α0 = 0.1 ; 1.0 ; 10.0.
β1 = 0.1 ; 0.5 ; 0.9.
β2 = 0.1(β1 − 1) + 1 ; 0.5(β1 − 1) + 1 ; 0.9(β1 − 1) + 1.
Algorithms
Problems
Advice: draw the function and the level curves with a software such as Gnuplot,
visually identify the stationary points, and then choose the starting points, either
close to or far from the stationary points.
Exercise 11.3. The problem
n
X
minn iαx2i ,
x∈R
i=1
T
x̄ = 1 ... 1 , with various values of n and α.
Exercise 11.4. The problem
min 3x21 + x42 .
x∈R2
T
Recommended starting point: 1 −2 .
Exercise 11.5. The Rosenbrock problem
2 2
min 100 x2 − x21 + 1 − x1 (Section 11.6) .
x∈R2
T T
Recommended starting points: 1.2 1.2 and −1.2 1 .
290 Project
Chapter 12
Trust region
Contents
12.1 Solving the trust region subproblem . . . . . . . . . . . . 294
12.1.1 The dogleg method . . . . . . . . . . . . . . . . . . . . . . 294
12.1.2 Steihaug-Toint method . . . . . . . . . . . . . . . . . . . 298
12.2 Calculation of the radius of the trust region . . . . . . . 300
12.3 The Rosenbrock problem . . . . . . . . . . . . . . . . . . . 308
12.4 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
kxk − xk ≤ ∆k , (12.1)
where k · k is a norm on Rn .
Assuming that we knew the value of ∆k , the wisest thing to do would be to
minimize the quadratic model within this region, rather than over all of Rn . The
minimization problem (10.11) in Algorithm 10.2 can be replaced by the following
problem, called the trust region subproblem.
292
25
20
15
10
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
5
f(x )
0 • k+1 •
-5 f(xk )
f(x)
-10 x2 − 4x
-15
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
x
(a) Trust region
25
20
15
10
5
f(x )
0 • k+1 •
-5 f(xk )
f(x)
-10 2x2 − 12x + 16
-15
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
x
(b) Perturbed quadratic model
2x2 − 12 x + c ,
294 Solving the trust region subproblem
where c is a constant and obtain the same result. By choosing c = 16, the quadratic
function interpolates f in xk . This is illustrated in Figure 12.1(b). It shows that im-
posing a trust region constraint can be equivalent to modifying the quadratic model,
and optimize it without constraint.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
In order to render the trust region method operational, we need only clarify two
things:
1. How to solve the trust region subproblem (12.2)–(12.3).
2. How to determine the value of ∆k .
where
∇f(bx)T ∇f(b
x)
dC = − ∇f(b
x) ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x)T ∇2 f(b
∇f(b x)∇f(b
x)
• xC = b
x + dC is the Cauchy point,
• the Newton direction (Definition 10.3) is defined by
−1
dN = −∇2 f b
x ∇f(b
x) ,
if ∇2 f(b
x) is positive definite,
• the dogleg point is defined by
xd = b
x + ηdN ,
where η ≤ 1 defines the position of the dogleg point in the Newton direction; the
recommended value in the literature is η = 0.8kdC k/kdN k + 0.2.
1 2 9 2
x + x
2 1 2 2
T
from Example 11.1 as well as the point b x = 9 1 . The Cauchy point (xC ),
the Newton point (xN ), and the dogleg point (xd ), where the path joins the Newton
direction, are
7.2 0 4.608
xC = , xN = , xd = ,
−0.8 0 0.512
4 4
2 2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
• xb
• x8
• •
• xd
0 • x4 x1 0
xN
•
xC
-2 -2
-4 -4
0 2 4 6 8 10 0 2 4 6 8 10
(a) Definition of the path (b) Intersections with the trust regions
We need to calculate the intersection of the trajectory with the radius of the trust
region. In the steepest descent direction, we have
∆k
− ∇f(xk ) = ∆k ,
∇f(xk )
and the point
∆k
b
x− ∇f(xk )
∇f(xk )
is located at the border of the trust region. The technique is identical in the Newton
direction, where the point
∆k
b
x+ dN
kdN k
is located at the border of the trust region. To find where the segment xd − xC
intersects with the trust region, we need to find the value of λ that solves the equation
xC + λ(xd − xC ) − b
x 2
= ∆k .
Lemma 12.4. Consider ∆ > 0, xC located in the trust region centered in b x, i.e.,
such that kdC k = kxC − b
xk ≤ ∆, and xd outside the trust region, i.e., such that
kdd k = kxd − b
xk > ∆. The step λ such that
dC + λ(dd − dC ) 2
= xC − b
x + λ(xd − xC ) 2
=∆ (12.11)
is given by √
−b + b2 − 4ac
λ= (12.12)
2a
Trust region 297
with
2
a = dd − dC 2
b = 2dTC (dd − dC )
2
c = dC − ∆2 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Therefore, p
−b − b2 − 4ac ≤ −2dTC d + 2dTC d = 0,
and the second root is negative.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
For the method to work, we have to define the safeguards when the matrix ∇2 f(b
x)
is not positive definite. This is simple. If the function is concave in the steepest
descent direction, i.e., if
∇f(bx)T ∇2 f(b x) ≤ 0 ,
x)∇f(b
then the quadratic function is unbounded from below in this direction, and decreases
towards −∞. It can therefore be followed until the border of the trust region. If the
function is concave in the Newton direction, then it is ignored and the Cauchy point
is selected. Algorithm 12.2 describes the dogleg method to solve approximately the
trust region subproblem.
3 Input
4 The gradient at the current point: ∇f(bx) ∈ Rn 6= 0.
2
5 The Hessian at the current point: ∇ f(bx) ∈ Rn×n .
6 The radius of the trust region: ∆ > 0.
7 Output
8 Approximate solution d∗ .
9 Cauchy point
10 x)T ∇2 f(b
β := ∇f(b x)∇f(b
x) . Curvature in the steepest descent
direction
11
12 if β ≤ 0 then the model is not convex
∆
13 STOP with d∗ = − ∇f(b
x) .
∇f(b x)
14 x)T ∇f(b
α := ∇f(b x) .
α
15 dC := − ∇f(b x) using (10.17)
β
16
17 if kdC k ≥ ∆ then Cauchy point outside the trust region
∆
18 STOP with d∗ := dC .
kdC k
19 Newton point
20 Calculate dN by solving ∇2 f(b
x)dN = −∇f(b x).
21 if dTN ∇2 f(b
x)dN ≤ 0 then the model is not convex
22 STOP with the Cauchy point, d∗ = dC .
23 if kdN k ≤ ∆ then Newton point within the trust region
24 STOP with d∗ = dN .
25 Dogleg point !
0.8α2
26 Calculate dd := 0.2 + dn .
x)T dN
β ∇f(b
27 if kdd k ≤ ∆ then dogleg point within the trust region
∆
28 STOP with d∗ = dN .
kdN k
29 Between Cauchy and dogleg
30 Use Algorithm 12.1 to calculate λ∗ such that dC + λ∗ (dd − dC ) is the
intersection point between the segment connecting the Cauchy point and
the dogleg point, with the border of the trust region.
31 STOP with d∗ = dC + λ∗ (dd − dC ).
300 Calculation of the radius of the trust region
3 Input
4 Q ∈ Rn×n
5 b ∈ Rn
6 Radius of the trust region ∆
7 Output
8 The approximate solution x∗ ∈ Rn
9 Initialization
10 k := 1
11 x1 := 0
12 d1 := −b
13 Repeat
14 if dTk Qdk ≤ 0 then the function is not convex along dk
15 x∗ = xk + λdk where λ is obtained by Algorithm 12.1
dTk (Qxk + b)
16 Calculate the step αk := −
dTk Qdk
17 Calculate the next iterate: xk+1 := xk + αk dk .
18 if kxk+1 k > ∆ then
19 x∗ = xk + λdk where λ is obtained by Algorithm 12.1
∇f(xk+1 )T ∇f(xk+1 ) (Qxk+1 + b)T (Qxk+1 + b)
20 Calculate βk+1 := = .
∇f(xk )T ∇f(xk ) (Qxk + b)T (Qxk + b)
Calculate the new direction dk+1 := −Qxk+1 − b + βk+1 dk . k := k + 1.
21 Until ∇f(xk ) = 0 or k = n + 1
22 x∗ := xk
We assume that the optimal solution (possibly approximate) to the trust region
subproblem is d∗ . In this case, we can compare the reduction of the model
mbx (b x + d∗ )
x) − mbx (b
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x + d∗ ) .
x) − f(b
f(b
If the model is reliable, these two quantities should be close. We calculate the ratio
f(b x + d∗ )
x) − f(b
ρ= . (12.13)
mbx (b x + d∗ )
x) − mbx (b
Putting everything together, we obtain Newton’s method with trust region (Algo-
rithm 12.4).
302 Calculation of the radius of the trust region
3 Input
4 The twice differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 The Hessian of the function ∇2 f : Rn → Rn×n .
7 An initial solution x0 ∈ Rn .
8 The radius of the first trust region ∆0 (by default, ∆0 = 10).
9 The required precision ε ∈ R, ε > 0.
10 The parameters 0 < η1 ≤ η2 < 1 (by default, η1 = 0.01 and η2 = 0.9).
11 Output
12 An approximation of the optimal solution x∗ ∈ R.
13 Initialization
14 k := 0.
15 Repeat
16 Calculate dk by solving (approximately) the trust region subproblem
(12.2)–(12.3), with the dogleg method (Algorithm 12.2) or the
Steihaug-Toint truncated conjugate gradient method (Algorithm 12.3).
f(xk ) − f(xk + dk )
17 Calculate ρ = .
mxk (xk ) − mxk (xk + dk )
18 if ρ < η1 then failure
19 xk+1 := xk
20 ∆k+1 := 12 kdk k
21 else success
22 xk+1 = xk + dk
23 if ρ ≥ η2 then very good
24 ∆k+1 = 2∆k
25 else just good
26 ∆k+1 = ∆k
27 k := k + 1.
28 Until ∇f(xk ) ≤ ε
29 x∗ := xk .
6 2
4 1.5
2 x0 1
x0
x∗ 0 x2 0.5 x2
∗
-2 x 0
-4 -0.5
-6 -1
-2 -1 0 1 2 -1 -0.5 0 0.5 1
x1 x1
(a) Iterates (b) Zoom
Figure 12.3: Iterates of Newton’s method with trust region and dogleg for Example
5.8 (∆0 = 10)
To further illustrate the trust region method, it is worth trying the same algorithm
with a smaller initial radius (∆0 = 1). The iterations are illustrated in Figure 12.4.
Table 12.2 is similar to Table 12.1. We note that the iterations 3 to 11 are actually
equivalent to the steepest descent method. Indeed, since the curvature of the function
is negative in the Newton direction, the dogleg method could not be applied. At
iteration 13, the dogleg method generated a point located on the arc between the
Cauchy point and the dogleg point. As of iteration 14, the iterations are those of
Newton’s local method, and a rapid convergence is achieved.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 304
Table 12.1: Newton’s method with trust region for the minimization of Example 5.8 (∆0 = 10)
k xk f(xk ) ∇f(xk ) ∆k ρ
0 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +1.00000e+01
1 -2.33845e-01 +1.36419e+00 -2.06286e-02 +2.30665e-01 +2.00000e+01 +9.61445e-01 2 ++
2 -1.39549e-01 +6.12415e-01 -1.04451e-01 +6.83438e-01 +4.00000e+01 +9.59237e-01 -2 ++
3 -9.34497e-01 +5.18458e-01 -3.75047e-01 +4.67749e-01 +8.00000e+01 +9.89241e-01 -2 ++
4 -1.24534e+00 -2.41828e-01 -4.33668e-01 +4.05285e-01 +8.00000e+01 +3.53577e-01 2 +
5 -1.01925e+00 -3.99531e-02 -4.99001e-01 +4.53782e-02 +1.60000e+02 +1.06883e+00 2 ++
6 -1.00077e+00 -7.03374e-04 -4.99999e-01 +1.04323e-03 +3.20000e+02 +1.01414e+00 2 ++
7 -1.00000e+00 -5.40691e-07 -5.00000e-01 +5.94432e-07 +6.40000e+02 +1.00035e+00 2 ++
Calculation of the radius of the trust region
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 12.2: Newton’s method with trust region for the minimization of Example 5.8 (∆0 = 1)
k xk f(xk ) k∇f(xk )k ∆k ρ
0 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +1.00000e+00
1 +1.22417e-01 +1.47943e+00 +1.86628e-02 +2.45993e-01 +2.00000e+00 +9.47588e-01 1 ++
2 -1.01629e-03 +1.57003e+00 -2.61464e-07 +1.04679e-03 +4.00000e+00 +9.97536e-01 2 ++
3 -5.36408e-04 +1.56809e+00 -1.30949e-06 +2.23824e-03 +8.00000e+00 +1.00000e+00 -2 ++
4 -5.08985e-03 +1.56696e+00 -6.55830e-06 +5.24259e-03 +1.60000e+01 +9.99998e-01 -2 ++
5 -2.68657e-03 +1.55723e+00 -3.28448e-05 +1.12089e-02 +3.20000e+01 +1.00000e+00 -2 ++
6 -2.54882e-02 +1.55160e+00 -1.64466e-04 +2.62487e-02 +6.40000e+01 +9.99957e-01 -2 ++
7 -1.34638e-02 +1.50289e+00 -8.22887e-04 +5.60207e-02 +1.28000e+02 +1.00002e+00 -2 ++
8 -1.27230e-01 +1.47480e+00 -4.10176e-03 +1.30473e-01 +2.56000e+02 +9.98929e-01 -2 ++
9 -6.84750e-02 +1.23764e+00 -2.00488e-02 +2.66527e-01 +5.12000e+02 +1.00051e+00 -2 ++
Trust region
Table 12.3: Newton’s method with trust region and Algorithm 12.3 for the minimization of Example 5.8 (∆0 = 10)
k xk f(xk ) k∇f(xk )k ∆k ρ
0 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +1.00000e+01
1 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +5.00000e+00 -7.51975e-02 3 -
2 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +2.50000e+00 -1.23991e-01 3 -
3 +5.50230e-01 +3.45921e+00 -3.71332e-01 +4.35121e-01 +2.50000e+00 +4.19624e-01 3 +
4 +1.16790e+00 +2.76142e+00 -4.02518e-01 +4.95063e-01 +2.50000e+00 +1.70028e-01 1 +
5 +1.06365e+00 +3.12536e+00 -4.97834e-01 +6.60783e-02 +5.00000e+00 +1.04357e+00 1 ++
6 +1.00012e+00 +3.14062e+00 -5.00000e-01 +9.75276e-04 +1.00000e+01 +1.00343e+00 1 ++
7 +1.00000e+00 +3.14159e+00 -5.00000e-01 +4.81675e-07 +2.00000e+01 +1.00011e+00 1 ++
Calculation of the radius of the trust region
Trust region 307
6 2
4 1.5
2 x0 1
∗
x0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x 0 x2 0.5 x2
∗
-2 x 0
-4 -0.5
-6 -1
-2 -1 0 1 2 -1 -0.5 0 0.5 1
x1 x1
(a) Iterates (b) Zoom
Figure 12.4: Iterates of Newton’s method with trust region and dogleg for Example
5.8 (∆0 = 1)
6 4
4 3.5
x∗ x∗
3
2
x0 2.5
0 x2 x2
2
-2
1.5
-4 x0 1
-6 0.5
-2 -1 0 1 2 0.5 0.75 1
x1 x1
(a) Iterates (b) Zoom
Figure 12.5: Iterates of Newton’s method with trust region and Steihaug-Toint for
Example 5.8 (∆0 = 10)
Finally, we apply the trust region method by using the truncated conjugate gradi-
ent method (Algorithm 12.3) to solve the trust region subproblem. Table 12.3 lists the
iterations. The penultimate column gives the reasons why Algorithm 12.3 is stopped.
Either it converges toward the unconstrained minimum of the quadratic model (1),
or it generates an iterate outside the trust region (2), or it detects a direction in
which the model has a negative curvature (3). We notice that, as of iteration 4, the
constraint of the trust region subproblem no longer plays a role. In this case, the
iterations are those of Newton’s local method, and a rapid convergence is achieved.
308 The Rosenbrock problem
with trust region) makes it significantly superior to the steepest descent algorithm,
as illustrated in Figure 12.6. Compared to the line search approach, the number of
iterations is roughly the same (23 for line search, 29 for trust region).
2
x0 1.5
∗
x 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) 29 iterations
x∗ 1
0.8
0.6
x2
0.4
0.2
0
12.4 Project
The general organization of the projects is described in Appendix D.
Objective
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The aim of the present project is to analyze the behavior of trust region methods
when solving the following problems and to compare it with that of descent methods.
Approach
Implement Algorithm 12.4, once with the dogleg method (Algorithm 12.2) and once
with the Steihaug-Toint truncated conjugate gradient method (Algorithm 12.3), in
order to solve the trust region subproblem. Test several variations by varying the
following parameters:
• ∆0 = 0.1 ; 1.0 ; 10.0 ; 100.0 ;
• η1 = 0.1 ; 0.5 ; 0.9 ;
• η2 = 0.1 (η1 − 1) + 1 ; 0.5 (η1 − 1) + 1 ; 0.9 (η1 − 1) + 1.
Compare these algorithms with the descent method in Chapter 11. Analyze the
results by using the method described in Section D.2.
Algorithms
Algorithms 12.2, 12.3, and 12.4.
Problems
Exercise 12.1. The James Bond problem, described in Section 1.1.5.
Exercise 12.2. The problem
2
min 2x1 x2 e−(4x1 +x2 )/8 .
x∈R2
Advice: draw the function and the level curves with a software such as Gnuplot,
visually identify the stationary points, and then choose the starting points, either
close to or far from the stationary points.
Exercise 12.3. The problem
n
X T
minn iαx2i , x̄ = 1 ... 1 ,
x∈R
i=1
T T
Recommended starting point: 1.2 1.2 and −1.2 1 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 13
Quasi-Newton methods
Contents
13.1 BFGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
13.2 Symmetric update of rank 1 (SR1) . . . . . . . . . . . . . 317
13.3 The Rosenbrock problem . . . . . . . . . . . . . . . . . . . 320
13.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
13.5 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Newton’s method, either with line search (Algorithm 11.8) or with trust region (Al-
gorithm 12.4), requires the use of the Hessian matrix of the function at each iteration.
This matrix poses some practical problems. First, the analytical calculation of the
second derivatives, as well as their implementation, is often tedious and error-prone.
Moreover, once the work has been done, the calculation of this matrix at each itera-
tion of the algorithm is time-consuming and can be detrimental to the effectiveness
of the algorithms. We therefore adapt the quasi-Newton methods of Chapter 8 to
optimization problems in order to maintain the structure of the algorithm without
using the Hessian matrix.
13.1 BFGS
Keeping in mind that Newton’s method aims at solving the system of equations
∇f(x) = 0, it is natural to be directly inspired by the secant methods for systems of
equations presented in Chapter 8 and to propose to approximate the matrix ∇2 f(b x)
by using the Broyden update (8.15), i.e., with a matrix Hk defined by
with
dk−1 = xk − xk−1
(13.2)
yk−1 = ∇f(xk ) − ∇f(xk−1 ) ,
which is (8.11) where F has been replaced by ∇f.
312 BFGS
This matrix satisfies the secant equation (8.10), i.e., the quadratic model formed
from Hk has the same gradient as the function in xk−1 and in xk . The main problem
with this method is that the matrix Hk is generally not symmetric nor positive
definite, as can be seen for iteration 18 in Table 8.7.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ak x = yk−1 (13.4)
T
Ak dk−1 = x. (13.5)
(8.15). In order to simplify the notations, we temporarily abandon the indices k and
k − 1, to obtain
(y − Lx)xT
A=L+ . (13.6)
xT x
We must now establish the value of x in order for Equation (13.5) to also be satisfied.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
(y − Lx)T d
x = AT d = LT d + x. (13.7)
xT x
The latter equation can only have a solution if LT d is a multiple of x, i.e., if there
exists α ∈ R such that
x = αLT d . (13.8)
We immediately note that
xT x = α2 dT LLT d = α2 dT Hd . (13.9)
This update formula was discovered independently in the late 1960s by the math-
ematicians C. G. Broyden, R. Fletcher, D. Goldfarb, and D. F. Shanno (Figure 13.2),
and is now called the “BFGS” update, which is the acronym of their names.
It is important to emphasize that the symmetric and positive definite secant equa-
tion (13.3) does not always have a solution.
Proof. Necessary condition. The above development, and in particular the equations
(13.6), (13.8), and (13.10), ensure that if dT y > 0, the following matrix is a solution
to the secant equation:
1 yT d
A=L+ T αydT L − T HddT L
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
y d d Hd
If dk−1 is a descent direction, then ∇f(xk−1 )T dk−1 < 0 (Definition 2.10). Since
β2 < 1 (Definition 11.8), we have
We can thus adapt Newton’s method with line search (Algorithm 11.8), by replac-
ing the Hessian of f by the BFGS approximation. Note that, unlike the Hessian of f,
we are certain that the matrix Hk is positive definite, which significantly simplifies
the algorithm. The direction dk of the algorithm is calculated by solving the system
of equations
Hk dk = −∇f(xk ) .
dk = −H−1
k ∇f(xk ) .
3 Input
4 The continuously differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 An initial solution x0 ∈ Rn .
7 A first approximation of the inverse of the Hessian H−1
0 ∈R
n×n
which is
−1
symmetric positive definite. By default, H0 = I.
8 The required precision ε ∈ R, ε > 0.
9 Output
10 An approximation of the optimal solution x∗ ∈ R
11 Initialization
12 k := 0
13 Repeat
14 dk := −H−1k ∇f(xk )
15 Determine αk by applying a line search (Algorithm 11.5) with α0 = 1
16 xk+1 := xk + αk dk
17 k := k + 1
18 Update H−1k
! !
d̄k−1 yTk−1 ȳk−1 dTk−1 d̄k−1 d̄Tk−1
H−1
k := I− H−1
k−1 I− +
d̄Tk−1 yk−1 d̄Tk−1 yk−1 d̄Tk−1 yk−1
6 4
4 3.5
x∗ x∗
2 3
x0
0 x2 2.5 x2
-2 2
-4 1.5
-6 x0 1
-2 -1 0 1 2 0 0.5 1
x1 x1
(a) Iterates (b) Zoom
Figure 13.3: Iterates of the quasi-Newton BFGS method for Example 5.8
Quasi-Newton methods 317
Table 13.1: Iterates of the BFGS method (Algorithm 13.1) of Example 5.8
k xk f(xk ) ∇f(xk ) 2
0 1.00000000e+00 1.00000000e+00 1.04030231e+00 1.75516512e+00
1 2.29848847e-01 1.42073549e+00 6.07772543e-02 4.42214869e-01
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 13.2: Secant approximation of the BFGS method (Algorithm 13.1) for Exam-
ple 5.8
k H−1
k 1,1
H−1
k 2,2
H−1
k 1,2
dTk−1 yk−1
1 7.33361383e-01 9.35044922e-01 1.32282407e-01 1.15252889e+00
2 6.98321680e-01 9.20088043e-01 1.55175319e-01 1.41567951e-01
3 7.00564006e-01 9.15084679e-01 1.58271872e-01 7.89012355e-04
4 2.08781169e+00 1.16981556e+02 1.47289281e+01 1.31040555e-01
5 4.60491698e-01 1.26014080e+01 -1.44703795e+00 1.49596079e-02
6 5.06374127e-01 3.75733536e+00 -4.72552140e-01 2.41674525e-01
7 1.42353095e+00 2.34847423e+00 -1.43694279e-01 3.27748268e-01
8 1.33482497e+00 1.62667185e+00 2.40692428e-01 5.31426899e-02
9 1.00323127e+00 1.58983802e+00 -5.30801141e-02 9.74843071e-03
10 1.17686642e+00 1.17697397e+00 -1.85946123e-01 1.00256605e-03
11 1.08720063e+00 1.00549956e+00 2.39576346e-02 8.75212743e-05
12 1.02776154e+00 1.03763150e+00 3.12543311e-02 4.81635307e-06
13 1.00185313e+00 1.01535053e+00 -5.35546070e-03 1.19529543e-08
14 1.00741129e+00 1.00546900e+00 -6.36327477e-03 3.28322670e-11
1
yk−1 − Hk−1 dk−1 = βvT dk−1 v = v, (13.15)
γ
or
v = γ(yk−1 − Hk−1 dk−1 ) (13.16)
with
1
= βvT dk−1 . (13.17)
γ
By replacing (13.16) in (13.17), we obtain
1
dTk−1 (yk−1 − Hk−1 dk−1 ) = . (13.18)
βγ2
Note that this update is well defined only if dTk−1 (yk−1 − Hk−1 dk−1 ) 6= 0. Also,
it does not necessarily generate a positive definite matrix, even if Hk−1 is one. For
this reason, it is preferable to use BFGS when dealing with algorithms based on line
search. However, in the context of trust region methods, the SR1 update has proven
effective. We use the SR1 update in Newton’s method with trust region to obtain
Algorithm 13.2.
The iterations of Algorithm 13.2 applied to Example 5.8 are listed in Table 13.4
and shown in Figure 13.4. The values of Hk at each iteration, as well as its two
eigenvalues, are given in Table 13.3.
We notice that the matrix is not positive definite during some iterations (3, 5, 7,
etc.).
Quasi-Newton methods 319
3 Input
4 The continuously differentiable function f : Rn → R
5 The gradient of the function ∇f : Rn → Rn
6 An initial solution x0 ∈ Rn
7 A first approximation of the symmetric Hessian H0 ∈ Rn×n (by default,
H0 = I)
8 The radius of the first trust region ∆0 (by default, ∆0 = 10)
9 The required precision ε ∈ R, ε > 0
10 The parameters 0 < η1 ≤ η2 < 1 (by default η1 = 0.01 and η2 = 0.9)
11 Output
12 An approximation of the optimal solution x∗ ∈ R
13 Initialization
14 k := 0
15 Repeat
16 Calculate dk by solving (approximately) the trust region subproblem by
using the Steihaug-Toint truncated conjugate gradient method (Algorithm
12.3)
f(xk ) − f(xk + dk )
17 ρ := .
mxk (xk ) − mxk (xk + dk )
18 if ρ < η1 then failure
19 xk+1 := xk
20 ∆k+1 := 12 kdk k
21 else success
22 xk+1 := xk + dk .
23 if ρ ≥ η2 then very good
24 ∆k+1 := 2∆k
25 else just good
26 ∆k+1 := ∆k .
27 k := k + 1
28 Define d̄k−1 := xk − xk−1 and yk−1 := ∇f(xk ) − ∇f(xk−1 ).
29 if |d̄k−1 (yk−1 − Hk−1 dk−1 )| ≥ 10−8 kd̄k−1 kkyk−1 − Hk−1 dk−1 k then the
denominator is non zero
30
6
4 1.5
2 x0 1
x0
x∗ 0 x2 0.5 x2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-2
x∗ 0
-4
-6 -0.5
-2 -1 0 1 2 -1 -0.5 0 0.5 1
x1 x1
(a) Iterates (b) Zoom
Figure 13.4: Iterates from the quasi-Newton SR1 method for Example 5.8
13.4 Comments
We conclude this chapter with a few comments.
• The BFGS update can also be combined with a trust region algorithm. In this
case, we cannot guarantee that the condition of Theorem 13.2 is satisfied. The
technique that consists in not performing an update in this case can be ineffective.
We refer the reader to Powell (1977), and Nocedal and Wright (1999, page 540)
for a description of an alternative update.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 13.3: Secant approximation of the SR1 method (Algorithm 13.2) for Example 5.8
k (Hk )1,1 (Hk )2,2 (Hk )1,2 λ1 λ2
1 +1.38780e+00 +1.16113e+00 -2.49977e-01 +1.00000e+00 +1.54894e+00
2 +1.50852e+00 +1.18087e+00 -2.01166e-01 +1.08526e+00 +1.60413e+00
3 +9.92963e-01 -1.42553e-02 -9.86122e-01 -6.17922e-01 +1.59663e+00
4 +1.56592e+00 +5.95949e-01 -3.94837e-01 +4.55548e-01 +1.70632e+00
5 +9.81728e-01 +8.85544e-03 -9.80476e-01 -5.99219e-01 +1.58980e+00
6 +1.33046e+00 +1.28506e+00 -3.13357e-01 +9.93580e-01 +1.62194e+00
7 +9.95038e-01 +3.68905e-02 -9.60395e-01 -5.57287e-01 +1.58922e+00
8 +1.87015e+00 +3.76238e-01 -4.15446e-01 +2.68479e-01 +1.97791e+00
9 +1.07848e+00 +2.20504e-01 -7.66576e-01 -2.28956e-01 +1.52794e+00
10 +1.86165e+00 +2.21270e-01 -7.42082e-01 -6.46135e-02 +2.14753e+00
11 +5.29518e-01 -4.83122e-01 +2.26599e-01 -5.31516e-01 +5.77911e-01
12 +5.29604e-01 -2.67251e-03 +2.20180e-01 -8.19450e-02 +6.08876e-01
Quasi-Newton methods
Table 13.4: Quasi-Newton SR1 method for the minimization of Example 5.8 (∆0 = 10)
k xk f(xk ) k∇f(xk )k ∆k
0 +1.00000e+00 +1.00000e+00 +1.04030e+00 +1.75517e+00 +1.00000e+01
1 -5.40302e-01 +1.84147e+00 +2.90430e-01 +9.60942e-01 +1.00000e+01 +
2 -1.88588e-02 +1.50535e+00 -1.05553e-03 +5.02012e-02 +2.00000e+01 ++
3 -5.26023e-02 +1.48367e+00 -3.19396e-03 +6.26948e-02 +4.00000e+01 ++
4 -5.26023e-02 +1.48367e+00 -3.19396e-03 +6.26948e-02 +2.00000e+01 -
5 -1.05608e-01 +1.36062e+00 -1.64571e-02 +1.45885e-01 +4.00000e+01 ++
6 -1.05608e-01 +1.36062e+00 -1.64571e-02 +1.45885e-01 +2.00000e+01 -
7 -2.07848e-01 +1.25531e+00 -4.28899e-02 +2.22561e-01 +4.00000e+01 ++
8 -2.07848e-01 +1.25531e+00 -4.28899e-02 +2.22561e-01 +2.00000e+01 -
9 -4.35002e-01 +4.79315e-01 -2.91369e-01 +4.94801e-01 +4.00000e+01 ++
10 -4.35002e-01 +4.79315e-01 -2.91369e-01 +4.94801e-01 +2.00000e+01 -
Comments
• The SR1 update can also be combined with a line search algorithm. In this
case, the matrix is not necessarily positive definite, and a modified Cholesky
factorization is necessary, just as for Newton’s method with line search (Algorithm
11.8).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
• Other update formulas have been proposed, including that of Davidon, studied by
Fletcher and Powell. It is called DFP, after the initials of the names of the three
researchers. The subject is vast and, in this book, we have chosen to include only
the two formulas that seem the most effective in practice.
2
x0 1.5
∗
x 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) 34 iterations
x∗ 1
0.8
0.6
x2
0.4
0.2
0
2
x0 1.5
∗
x 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) 97 iterations
x∗ 1
0.8
0.6
x2
0.4
0.2
0
(b) Zoom
2
x0 1.5
∗
x 1
0.5 x2
0
-0.5
-1
-1.5 -1 -0.5 0 0.5 1
x1
(a) 28 iterations
x∗ 1
0.8
0.6
x2
0.4
0.2
0
(b) Zoom
10
1
0.1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∆k
0.01
0.001
0.0001
1e-05
0 10 20 30 40 50 60 70 80 90 100
Iteration k
Figure 13.8: Evolution of the radius of the trust region for SR1
13.5 Project
The general organization of the projects is described in Appendix D.
Objective
The aim of the present project is to analyze the behavior of quasi-Newton methods
and compare them to descent methods and trust region methods.
Approach
Implement the BFGS method (Algorithm 13.1) and the SR1 method (Algorithm
13.2). Also implement a version of BFGS with trust region and a version of SR1 with
line search, by taking into account the comments in Section 13.4.
Compare these algorithms with the descent methods and the trust region methods.
Analyze the results by means of the method described in Section D.2. Choose as
performance index on the one hand the resolution time and on the other hand the
number #f + n#g, i.e., the number of evaluations of the function plus n times the
number of gradient evaluations.
Algorithms
Problems
Advice: draw the function and the level curves with a software such as Gnuplot,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
visually identify the stationary points, and then choose the starting points, either
close to or far from the stationary points.
Exercise 13.3. The problem
n
X T
minn iαx2i , x̄ = 1 ... 1 ,
x∈R
i=1
T T
Recommended starting points: 1.2 1.2 and −1.2 1 .
Exercise 13.6. The problem
m
X
min −e−0.1 i + 5 e−i − 3 e−0.4 i
x∈R6
i=1
2
+ x3 e−0.1 ix1 − x4 e−0.1 ix2 + x6 e−0.1 ix5 ,
T
Recommended starting point: 1 2 1 1 4 3 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 14
Contents
14.1 The Gauss-Newton method . . . . . . . . . . . . . . . . . 334
14.2 Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . 337
14.3 Orthogonal regression . . . . . . . . . . . . . . . . . . . . . 341
14.4 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
β = m(α; x1 , x2 ) = x1 α + x2 , (14.2)
where x1 and x2 are unknown parameters to be determined.1 Data in Table 14.1
reports for each month t the pair (αt , βt ) of observed number of men and women
who were unemployed at time t. Note that it is impossible to find parameters x1
1 In statistics, the quantity α is called an explanatory or independent variable, and the quantity
β is the dependent variable. Note that in the statistics literature, it is common to denote by
y the dependent variable, by x the independent variable, and by Greek letters the parameters.
However, in this textbook, we focus on the optimization problem that identifies the values of
the parameters such that the model fits the data well. To be consistent with the rest of the
book, we use x to denote the variables of this optimization problem, which are the unknown
parameters of the model.
330
and x2 such that (14.2) is verified for each data point. The model (14.2) is only an
approximation of the real relationship between the two quantities. Moreover, errors
are always presents in any measurement. Therefore, it is assumed that the model is
β = m(α; x1 , x2 ) = x1 α + x2 + ε, (14.3)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The optimal solution is x∗1 = 0.253 and x∗2 = 39,982. The fitted model and the data
are presented in Figure 14.1.
Least squares problem 331
59000
58000
57000
56000
55000
Linear model
54000
Data
53000
60000 65000 70000 75000 80000 85000 90000
Number of unemployed men
βi + εi = m(αi ; x) , (14.5)
where x represents the parameters of the model and εi is a random variable with
mean zero and variance σ2 corresponding to the modeling and measurement errors.
Formally, the least squares problem can be derived from the theory of maximum like-
lihood estimation, assuming that the error terms εi are normally distributed. Here,
we prefer to interpret it using an optimization argument, that is as the identification
of the parameters x that minimize the error, i.e.,
X
min ε2i
x,ε
i
with constraint
βi + εi = m(αi ; x) , i = 1, . . . ,
Example 14.2 (Neural networks). The training of neural networks can also be viewed
as a least squares problem. We here provide a brief introduction to the concept of
neural networks. The reader is referred to the abundant literature on the subject
for more details such as Haykin (2008) or Iovine (2012). A neural network, in the
mathematical sense of the term, is inspired by its biological analog. The idea is to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
eα − e−α
φ(α) = . (14.9)
eα + e−α
Note that these functions are continuous approximations of “switches,” that is, of a
function with discrete output: 0 and 1 for (14.8) (see Figure 14.2(a)) and -1 and 1
for (14.9) (see Figure 14.2(b)).
1 1
φ(α)
φ(α)
0 -1
-10 -5 0 5 10 -10 -5 0 5 10
α α
(a) Sigmoid (b) Hyperbolic tangent
The first layer uses information from the exterior of the system, denoted by νj,0 ,
j = 1, . . . , n0 . The neural network can be seen as a model (14.5), where the input pa-
rameters αi correspond to the information νj,0 , j = 1, . . . , n0 , the output parameters
βi correspond to the information produced by the last layer, i.e., νj,N , j = 1, . . . , nN ,
and the unknown parameters of the model are all the weightings xjk , j = 1, . . . , nk−1 ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
It is important to note that this least squares problem is significantly more complex
to solve than that of Example 14.1. Bertsekas (1999) uses the following example to
illustrate that complexity:
5
1X 2
min βi − φ(x1 αi + x2 ) ,
x0 ,x1 2
i=1
where φ is the hyperbolic tangent function (14.9). The five pairs (αi , βi ) are listed
in Table 14.2. The resulting objective function is shown in Figure 14.3.
6
5
4
3
2
-10
-5
x1 0 10
5 5
0
10 -5 x2
-10
Figure 14.3: Example of an objective function for the training of a neural network
Now that we have defined and illustrated the problem, we present an algorithm
that exploits its specific structure.
334 The Gauss-Newton method
We derive
1
f(x) = g(x)T g(x)
2
to obtain
Xm
∇f(x) = ∇g(x)g(x) = ∇gi (x)gi (x) ,
i=1
where ∇g(x) ∈ Rn×m is the gradient matrix of g (Definition 2.17) and ∇gi (x) ∈ Rn
is the gradient of gi . By differentiating again, we get
m
X
∇2 f(x) = ∇gi (x)∇gi (x)T + ∇2 gi (x)gi (x)
i=1
m
X
= ∇g(x)∇g(x)T + ∇2 gi (x)gi (x) .
i=1
The second term used for calculating the Hessian matrix is generally computation-
ally demanding in practice, since it involves the second derivatives of the functions
gi . It is therefore wise to ignore it and approximate the Hessian matrix using only the
first term, i.e., ∇g(x)∇g(x)T . Note that this matrix is always positive semidefinite.
We obtain the Gauss-Newton method presented as Algorithm 14.1, that uses only
the first derivatives of g, not the second.
Note that, if ∇g(xk )∇g(xk )T is non singular, it is positive definite and we have
a descent method. If this is not the case, the technique presented in Section 11.5,
based on a modified Cholesky factorization (Algorithm 11.7) is appropriate. The
name Levenberg-Marquardt is often used in this context, in reference to the work of
Levenberg (1944) and Marquardt (1963). Moreover, the method is locally convergent,
i.e., it converges if x0 is not too far from x∗ . The adaptations that enable the global
convergence of Newton’s local method, namely linear search (Algorithm 11.8) and
trust region (Algorithm 12.4), can of course be used to render the Gauss-Newton
method globally convergent.
In the case where the function g is linear, i.e.,
g(x) = Ax − b
with A ∈ Rm×n , we have ∇g(x) = AT and the Gauss-Newton equation (14.10) is
written as
AT Adk+1 = −AT (Axk − b) .
Since dk+1 = xk+1 − xk , we obtain
AT Axk+1 = AT b ,
and this, regardless of xk . This system of equations is called the system of normal
equations of the linear least squares problem.
Least squares problem 335
3 Input
4 The differentiable function g : Rn → Rm .
5 The gradient matrix of g: ∇g : Rn → Rn×m .
6 An initial solution x0 ∈ Rn .
7 The required precision ε ∈ R, ε > 0.
8 Output
9 An approximation of the optimal solution x∗ ∈ Rn .
10 Initialization
11 k := 0.
12 Repeat
13 Calculate dk+1 that solves
14 xk+1 := xk + dk+1
15 k=k+1
16 Until ∇g(xk )g(xk ) ≤ ε
17 x∗ := xk
Definition 14.3 (Normal equations). Consider the linear least squares problem
1
min kAx − bk22 , (14.11)
x∈Rn 2
AT Ax = AT b (14.12)
and
∇2 f(x) = AT A .
The normal equations are therefore equivalent to the first order optimality conditions
∇f(x∗ ) = 0, and are necessary (Theorem 5.1). The eigenvalues of AT A are the
singular values of A squared. Therefore, ∇2 f(x) is positive semidefinite for all x
and f is convex. Moreover, if A is of full rank, ∇2 f(x) is positive definite and f is
strictly convex. The sufficient global optimality conditions are therefore verified, and
Theorem 5.9 applies to prove the result.
From this result, it appears that the Gauss-Newton method identifies the optimal
solution in a single iteration when the function g is linear. We now give another
interpretation of the method that supports this observation.
To do this, we use a simple model of the function at each iteration. We already
used this idea when presenting Newton’s local method, where a quadratic model was
used (Algorithm 10.2). Here, we model g and not f, and we utilize a linear model
(Definition 7.9).
Consider the least squares problem (14.1) and an iterate xk . Replace g(x) by the
linear model in xk
mxk (x) = g(xk ) + ∇g(xk )T (x − xk ) .
The problem then becomes
1 2 1
min M(x) = min mxk (x) 2
= min mxk (x)T mxk (x) .
x x 2 x 2
We have
1 1
M(x) = mxk (x)T mxk (x) = g(xk )T g(xk )
2 2
+ (x − xk )T ∇g(xk )g(xk )
1
+ (x − xk )T ∇g(xk )∇g(xk )T (x − xk ) .
2
The gradient of this expression is
∇M(x) = ∇g(xk )∇g(xk )T (x − xk ) + ∇g(xk )g(xk ) .
It is zero for −1
xk+1 = xk − ∇g(xk )∇g(xk )T ∇g(xk )g(xk ) ,
T
if ∇g(xk )∇g(xk ) is invertible. This equation is equivalent to (14.10). Then, an
iteration of the Gauss-Newton method is a matter of linearizing the function g around
xk and solving the least squares problem thus obtained. It is therefore evident that, if
g is already linear, the method converges in one iteration (if ∇g(xk )∇g(xk )T = AT A
is invertible).
Least squares problem 337
of problem (14.11) can be huge. More precisely, m may be much larger than the
number of parameters n. As a consequence, it may happen that the matrix A cannot
be stored as such in memory, and has to be split into blocks just to be handled.
Another context is when data is collected by different sources. In this case, it
is convenient not to wait until data is available from all sources to start solving
the problem. Suppose that a couple of sources have not reported yet, and that the
problem is solved with the available data. When the last pieces of data are finally
made available, it is desirable to update the previous solution, rather than solving
the whole problem from the beginning. In this context, each block of data would
correspond to one of the sources.
The situation is similar when data is available over time, such as in real-time
applications. In this case, each time period corresponds to a block of data. And,
again, it is desirable to calculate a solution with the available data, and update it
when more data is made available.
The matrices involved in the least squares problem (14.11) are represented in
Figure 14.4. The matrix A and the vector b are sliced into J blocks, possibly of
different sizes m1 ,. . . ,mJ .
We want to obtain a first approximation of the calibrated parameters with the
first block of data and subsequently update it as other blocks become available. We
write the least squares problem
as
J
X 2
minn Aj x − bj 2
,
x∈R
j=1
where Aj ∈ Rmj ×n and bj ∈ Rmj . The optimal solution to this problem is generated
incrementally, starting with the optimal solution to the subproblem corresponding to
the first block of data:
2
minn A1 x − b1 2 .
x∈R
We call x1 ∈ Rn the solution of this problem. Assume that the matrix A1 is of full
rank. In this case, according to Theorem 14.4, x1 is given by the normal equations
m1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
m2
m
n
mJ mJ−1
A x b
Figure 14.4: Structures of the matrix and vectors involved in the least squares problem
organized by blocks
xj = xj−1 + H−1 T
j Aj (bj − Aj xj−1 ), (14.14)
where
Hj = Hj−1 + ATj Aj . (14.15)
Note that only data from block j, that is Aj and bj , is used here, irrespectively of the
number of blocks already treated. This is the Kalman filter algorithm, presented as
Algorithm 14.2.
3 Input
4 The matrices Aj ∈ Rmj ×n , j = 1, . . . , J.
5 The vectors bj ∈ Rmj , j = 1, . . . , J.
6 An initial solution x0 ∈ Rn (default: x0 = 0).
7 An initial matrix H0 ∈ Rn×n (default: H0 = 0).
8 Output
9 The optimal solution x∗ ∈ Rn .
10 Initialization
11 j := 0.
12 Repeat
13 j := j + 1
14 Hj := Hj−1 + ATj Aj
15 Calculate dj solving Hj dj = ATj (bj − Aj xj−1 )
16 xj := xj−1 + dj
17 Until j = J
18 x∗ = xJ
340 Kalman filter
Example 14.5 (Kalman filter). We consider again the unemployment data of Ex-
ample 14.1 (Table 14.1). At the end of 2012, a model is calibrated using the 2012
data. Then, as a new piece of data arrives every month, the estimated value of the
parameters is updated with the new information. The estimated parameters at each
stage of this process are reported in Table 14.3.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Block x1 x2
1 0.210758 41998.1
2 0.23963 40074.4
3 0.249038 39451.5
4 0.249355 39431.6
5 0.255092 39122.6
6 0.255453 39157.6
7 0.254998 39200.6
8 0.251087 39579.7
9 0.24501 40172.3
10 0.24095 40617.4
11 0.241631 40726.7
12 0.253012 40011.7
13 0.253436 39982.5
Figure 14.5 compares the model estimated on data from 2012 only with the model
estimated on the entire data set, 2012 and 2013.
63000
Number of unemployed women
62000
61000
60000
59000
58000
57000
56000 Model (2012)
55000 Model (2012-2013)
Data (2012)
54000
Data (2013)
53000
60000 65000 70000 75000 80000 85000 90000
Number of unemployed men
The Kalman filter method only works if the matrix defining the first block is of full
rank. To achieve this, it usually suffices to put enough data in the first block, in order
for a first model to be estimated. Indeed, if n parameters have to be estimated, at
least n pieces of data are necessary, and even more if there is colinearity. Where this is
not possible, one must define H0 such that the matrix H1 = H0 + AT1 A1 is invertible.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
J
X 2
min λJ−j Aj x − bj 2
x∈Rn
j=1
where J is the current time interval. We apply the Kalman filter update in this
context, and obtain Algorithm 14.3. Note that the whole memory of the process is
accumulated in the matrix HJ−1 and the vector xJ−1 , irrespectively of the number of
past iterations.
J
X 2
minn λJ−j Aj x − bj 2
. (14.17)
x∈R
j=1
3 Input
4 The matrix AJ ∈ RmJ ×n .
5 The vector bJ ∈ RmJ .
6 The previous solution xJ−1 ∈ Rn .
7 The previous matrix HJ−1 ∈ Rn×n .
8 A discount factor λ such that 0 < λ ≤ 1.
9 Output
10 xJ and HJ
11 Update
12 HJ := λHJ−1 + ATJ AJ
13 Calculate dJ solving HJ dJ = ATJ (bJ − AJ xJ−1 )
14 xJ := xJ−1 + dJ
βi + εi = m(αi + ξi ; x) , i = 1, . . . ,
the observations (αi , βi ) and the point predicted by the model αi +ξi , m(αi +ξi ; x) ,
as illustrated in Figure 14.6.
(αi , βi )
14.4 Project
The general organization of the projects is described in Appendix D.
Objectives
To compare the Gauss-Newton method with the quasi-Newton methods, analyze the
Kalman filter method, and understand the role of orthogonal regression.
Approach
1. Compare the performances of the quasi-Newton methods (BFGS and SR1) and
the Gauss-Newton method for several non linear problems. Utilize the technique
described in Chapter D to analyze the results.
344 Project
2. Generate a large sample with a linear model and apply the Kalman filter method.
After how many iterations does the approximation of the optimal solution be-
come stabilized? If synthetic data is used, compare with the “real” value of the
parameters. Perform this analysis with samples combining data of varying quality.
3. Generate a sample by introducing perturbations for α and β. Solve the classic least
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
squares problem and compare with the optimal solution obtained by orthogonal
regression and with the “real” value.
Algorithms
Problems
As part of this project, we recommend working with real data to test the algorithms.
If such data is unavailable, here is how to generate synthetic data.
Apply a model : choose a mathematical model m(α, x), with α ∈ Rp and x ∈ Rn .
For instance, a simple linear model
m(α, x) = αx , p = 1, n = 1 ,
β = m(α, x) + r .
T
In our example, by taking m(α, x) = 1/(1 + e−α x
) and σ = 0.05, we get
Least squares problem 345
Obs. α1 α2 m(α, x) r β
1 0.007021 6.760832 1.351E-06 0.072012 0.072013
2 0.017676 4.377047 0.0001606 -0.06527 -0.06511
3 0.866839 0.883049 0.28920265 0.032485 0.321687
4 3.235088 0.329827 0.92926373 0.022983 0.952247
5 4.699759 0.186086 0.9869726 -0.02112 0.965848
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
β = m(α + q, x) + r .
to obtain
Obs. α1 α2 q1 q2
1 0.007021 6.760832 0.020367 0.003594
2 0.017676 4.377047 0.015533 0.004155
3 0.866839 0.883049 -0.01972 0.000366
4 3.235088 0.329827 -0.03204 0.007443
5 4.699759 0.186086 -0.0363 -0.01052
6 1.080447 0.275139 0.038858 -0.01315
7 2.482403 0.492628 0.026068 0.006862
8 3.544106 1.038803 0.008163 0.002044
and
Obs. m(α + q, x) r β
1 1.36895E-06 0.072012 0.072013
2 0.000161766 -0.06527 -0.06511
3 0.285016732 0.032485 0.317501
4 0.926116236 0.022983 0.949099
5 0.986775082 -0.02112 0.96565
6 0.644587833 0.051388 0.695976
7 0.818985987 0.012699 0.831685
8 0.813144895 -0.03009 0.783055
Variants: it is interesting to combine, in a single sample, several samples, generated
with different variances. This simulates a process of data collection for which one
subsample is more accurate than another.
The problem to solve is
1X 2
minn β(j) − m α(j), x .
x∈R 2
j
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 15
Contents
Several methodologies have been proposed that require only the value of the objec-
tive function calculated at the requested iterates, and do not attempt to approximate
the derivatives. Derivative-free methods utilize models of the objective function
generated from interpolation techniques. We refer the reader to Conn et al. (2009)
for an introduction. In this chapter, we introduce direct search methods that use
geometrical objects to investigate the solution space.
348 Nelder-Mead
15.1 Nelder-Mead
The best known of these approaches is the simplex method1 by Nelder and Mead
(1965).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and consider the direction pointing from xn+1 towards xc , that is,
d = xc − xn+1 .
The method then tries several iterates in this direction,
x(α) = xn+1 + αd = (1 − α)xn+1 + αxc .
Note that x(1) = xc . If 0 < α < 1, x(λ) lies between xn+1 and xc , and if α > 1,
x(α) is beyond xc . The values of α tested by the algorithm are 21 , 1, 23 , 2 and 3, as
illustrated in Figure 15.1.
xe = x(3)
x1 xr = x(2)
xm = x( 32 )
xc = x(1)
✒
x− = x( 12 )
x3 x2
1 Not to be confused with the simplex algorithm in linear optimization, described in Chapter 16.
Direct search methods 349
The best of these five vectors is then chosen to replace xn+1 , which thus forms a
new simplex. The method is described as Algorithm 15.1.
3 Input
4 The continuously differentiable function f : Rn → R.
5 The affinely independent vectors x01 , . . . , x0n+1 of Rn , such that
f(x0i ) ≤ f(x0i+1 ), i = 1, . . . , n.
6 The required precision ε ∈ R, ε > 0.
7 Output
8 An approximation of the optimal solution x∗ ∈ R.
9 Initialization
10 k := 0
11 Repeat
n
1X k
12 xc := xi
n
i=1
13 Define dk := xc − xkn+1
14 xr := xkn+1 + 2dk = 2xc − xkn+1
15 if f(xr ) < f(xk1 ) then search beyond xr
16 xe := xkn+1 + 3dk = 2xr − xc
17 if f(xe ) < f(xr ) then
18 b
x := xe
19 else
20 b
x := xr
28 xk+1
n+1 := bx
29 xk+1
i = x k
i , i = 1, . . . , n.
30 k := k + 1.
31 Renumber to get f(xki ) ≤ f(xki+1 ), i = 1, . . . , n.
32 Until kdk k ≤ ε
33 x∗ = xk1
350 Nelder-Mead
Example 15.2 (Nelder-Mead method). Apply the Nelder-Mead method to the prob-
lem
1 9
min f(x) = x21 + x22 ,
x∈R2 2 2
by using as a starting simplex the one generated by the points
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 2 1.1
, , .
1 1.1 2
The first four iterations are illustrated in Figure 15.2 and all of the generated simplices
are shown in Figure 15.3(a). The details of the first four and the last two iterations
are listed in Table 15.1, where the 3 points of the simplex, the point xr and the new
point bx are given, in addition to the value of the associated function.
2 2
1.5 1.5
1 x2 1 x2
0.5 0.5
0 0
0 0.5 1 1.5 2 0 0.5 1 1.5 2
x1 x1
(a) k = 0 (b) k = 1
2 2
1.5 1.5
1 x2 1 x2
0.5 0.5
0 0
0 0.5 1 1.5 2 0 0.5 1 1.5 2
x1 x1
(c) k = 2 (d) k = 3
Figure 15.2: First four iterations of the Nelder-Mead method for Example 15.2
Direct search methods 351
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1.5
1 x2
0.5
(a) All
0.1
0.05
0 x2
-0.05
-0.1
-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2
x1
(b) Zoom
T
for which the minimum is 0 21 . Apply the Nelder-Mead algorithm with the
initial simplex formed with the points
√
1+ 33
1 8 0
1
, 1 − √33 , 0
.
T
In this case, the algorithm converges toward the point 0 0 (which is not sta-
tionary), as shown in Figure 15.4.
Direct search methods 353
1
0.8
0.6
0.4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.2 x2
0
-0.2
-0.4
-0.6
-0.2 0 0.2 0.4 0.6 0.8 1 1.2
x1
Figure 15.4: Iterations of the Nelder-Mead method for the McKinnon example
Table 15.2: Iterations of the Nelder-Mead method for the McKinnon example
Simplex xr b
x
1 1.0000e+00 8.4307e-01 0.0000e+00 -1.5693e-01 7.1077e-01
1.0000e+00 -5.9307e-01 0.0000e+00 -1.5931e+00 3.5173e-01
f 8.0000e+00 4.0233e+00 0.0000e+00 9.8105e+00 3.5066e+00
2 7.1077e-01 8.4307e-01 0.0000e+00 -1.3230e-01 5.9923e-01
3.5173e-01 -5.9307e-01 0.0000e+00 9.4480e-01 -2.0860e-01
f 3.5066e+00 4.0233e+00 0.0000e+00 8.1389e+00 1.9894e+00
3 7.1077e-01 5.9923e-01 0.0000e+00 -1.1154e-01 5.0519e-01
3.5173e-01 -2.0860e-01 0.0000e+00 -5.6033e-01 1.2372e-01
f 3.5066e+00 1.9894e+00 0.0000e+00 4.2325e+00 1.6703e+00
4 5.0519e-01 5.9923e-01 0.0000e+00 -9.4037e-02 4.2591e-01
1.2372e-01 -2.0860e-01 0.0000e+00 3.3232e-01 -7.3372e-02
f 1.6703e+00 1.9894e+00 0.0000e+00 3.6262e+00 1.0204e+00
..
.
63 2.5325e-05 2.1351e-05 0.0000e+00 -3.9743e-06 1.8000e-05
8.5622e-15 -5.0780e-15 0.0000e+00 -1.3640e-14 3.0116e-15
f 3.8483e-09 2.7352e-09 0.0000e+00 5.6862e-09 1.9441e-09
64 1.8000e-05 2.1351e-05 0.0000e+00 -3.3506e-06 1.5176e-05
3.0116e-15 -5.0780e-15 0.0000e+00 8.0896e-15 -1.7861e-15
f 1.9441e-09 2.7352e-09 0.0000e+00 4.0416e-09 1.3818e-09
65 1.8000e-05 1.5176e-05 0.0000e+00 -2.8248e-06 1.2794e-05
3.0116e-15 -1.7861e-15 0.0000e+00 -4.7977e-15 1.0593e-15
f 1.9441e-09 1.3818e-09 0.0000e+00 2.8726e-09 9.8214e-10
66 1.2794e-05 1.5176e-05 0.0000e+00 -2.3815e-06 1.0786e-05
1.0593e-15 -1.7861e-15 0.0000e+00 2.8454e-15 -6.2823e-16
f 9.8214e-10 1.3818e-09 0.0000e+00 2.0418e-09 6.9807e-10
354 Torczon’s multi-directional search
2 0.1
1.5
1 0.05
0.5
0 x2 0 x2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-0.5
-1 -0.05
-1.5
-2 -0.1
-0.5 0 0.5 1 1.5 -0.1 -0.05 0 0.05 0.1
x1 x1
(a) First four iterations (b) Iteration 20
Figure 15.5: Iterations of the Nelder-Mead method for the McKinnon example
We assume, without loss of generality, that the minimum is achieved with the first
point, that is f(S) = f(x1 ). The main idea is to consider the simplex obtained by
reflection around the best point x1 , i.e., the simplex generated by Sr = {xr1 , . . . , xrn+1 },
with xr1 = x1 , and xri = 2x1 − xi , i = 2, . . . , n + 1 (see the illustration in Figure 15.6).
• If the best point of Sr is not x1 , i.e., if f(Sr ) < f(S), then Sr is better than S. In
this case, we try to go further and expand the search even more by considering
the simplex generated by Se = xe1 , . . . , xen+1 , with xe1 = x1 and xei = 3x1 − 2xi ,
i = 2, . . . , n + 1 (e for “expansion”). If the expansion provides a better result,
that is, if f(Se ) < f(Sr ), then we choose Se for the next iteration. Otherwise, we
choose Sr .
• In the case where Sr is not better than S, i.e., if f(Sr ) ≥ f(S), then we have
to contract the simplex and use in the next iteration Sc = xc1 , . . . , xcn+1 , with
xc1 = x1 and xci = 21 (x1 + xi ), i = 2, . . . , n + 1.
These different simplices are illustrated in Figure 15.6, and Algorithm 15.2 describes
the method.
Direct search methods 355
x2
xc2
xr2
xe2
3 Input
4 The function f : Rn → R.
5 The set of affinely independent vectors of Rn S0 = {x1 , . . ., xn+1 } such that
f(x1 ) ≤ f(xi+1 ) and f(xn+1 ) ≥ f(xi ), i = 1, . . . , n.
6 The required precision ε ∈ R, ε > 0.
7 Output
8 An approximation of the optimal solution x∗ ∈ R.
9 Initialization
10 k := 0.
11 Repeat
12 Calculate Sr composed of x1 and xri = 2x1 − xi , i = 2, . . . , n + 1
13 if f(Sr ) < f(x1 ) then
14 Calculate Se composed of x1 and xei = 3x1 − 2xi = 2xri − x1 ,
i = 2, . . . , n + 1.
15 if f(Se ) < f(Sr ) then
16 Sk+1 := Se
17 else
18 Sk+1 := Sr
19 else
20 Calculate Sk+1 composed of x1 and xci = (x1 + xi )/2, i = 2, . . . , n + 1.
21 k := k + 1
22 Renumber such that x1 is the best point and xn+1 is the least good in the
new simplex
23 Until kxn+1 − x1 k ≤ ε
24 x∗ = x1
356 Torczon’s multi-directional search
the first direct search method that is associated with a proof of convergence (Torczon,
1991).
Table 15.3: Iterations for Torczon’s method for the McKinnon example
(x1 )1 (x1 )2 f(x1 )
0.0000e+00 0.0000e+00 0.0000e+00 C
0.0000e+00 0.0000e+00 0.0000e+00 C
0.0000e+00 0.0000e+00 0.0000e+00 C
1.0538e-01 -7.4134e-02 -2.0035e-03 E
6.6151e-02 -4.7240e-01 -2.2298e-01 C
6.6151e-02 -4.7240e-01 -2.2298e-01 C
6.6151e-02 -4.7240e-01 -2.2298e-01 R
3.6514e-03 -5.3490e-01 -2.4870e-01 C
3.6514e-03 -5.3490e-01 -2.4870e-01 C
3.6514e-03 -5.3490e-01 -2.4870e-01 C
3.6514e-03 -5.3490e-01 -2.4870e-01 C
3.6514e-03 -5.3490e-01 -2.4870e-01 R
3.5813e-04 -5.3258e-01 -2.4894e-01 E
1.5841e-03 -5.2014e-01 -2.4958e-01 R
2.8102e-03 -5.0769e-01 -2.4989e-01 C
2.8102e-03 -5.0769e-01 -2.4989e-01 R
3.4232e-03 -5.0147e-01 -2.4993e-01 C
1.4700e-03 -5.0342e-01 -2.4998e-01 R
-1.7658e-04 -5.0226e-01 -2.4998e-01 R
1.2992e-04 -4.9915e-01 -2.5000e-01 C
-2.3332e-05 -5.0071e-01 -2.5000e-01 C
5.3294e-05 -4.9993e-01 -2.5000e-01 C
5.3294e-05 -4.9993e-01 -2.5000e-01 C
5.3294e-05 -4.9993e-01 -2.5000e-01 C
4.3716e-05 -5.0003e-01 -2.5000e-01 C
1.7987e-05 -5.0001e-01 -2.5000e-01 C
1.7987e-05 -5.0001e-01 -2.5000e-01 R
5.1230e-06 -5.0000e-01 -2.5000e-01 C
5.1230e-06 -5.0000e-01 -2.5000e-01 C
Since the doctoral work of V. Torczon in 1989, numerous researchers have shown
interest in direct search methods. The interested reader is in particular referred to
Wright (1996) or Lewis et al. (2000).
Direct search methods 357
0.5
0 x2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-0.5
-1
-0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1.2
x1
15.3 Project
The general organization of the projects is described in Appendix D.
Objective
The aim of this project is to compare the quasi-Newton algorithms with nonderivative
algorithms.
Approach
Each problem is to be solved with each algorithm. The gradient used by the quasi-
Newton methods should be calculated by finite differences, in order for the contexts
to be comparable. The performance indices are the execution time on the one hand,
and the number of evaluations of the function on the other hand. The latter index
is particularly important when the function to be optimized requires much computa-
tional effort to be evaluated. The method described in Section D.2 is to be used to
analyze the results.
Algorithms
Problems
Advice: draw the function and the level curves with a software such as Gnuplot,
visually identify the stationary points, and then choose the starting points, either
close to or far from the stationary points.
Exercise 15.2. The problem
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
n
X T
minn iαx2i , x̄ = 1 ... 1 ,
x∈R
i=1
T
Recommended starting point: 1 −2 .
Exercise 15.4. The Rosenbrock problem
2 2
min 100 x2 − x21 + 1 − x1
x∈R2
T T
(Section 11.6). Recommended starting points: 1.2 1.2 and −1.2 1 .
Exercise 15.5. The problem
m
X
min −e−0.1 i + 5 e−i − 3 e−0.4 i
x∈R6
i=1
2
+ x3 e−0.1 ix1 − x4 e−0.1 ix2 + x6 e−0.1 ix5 .
T
Recommended starting point: 1 2 1 1 4 3 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part V
Constrained optimization
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Igor Stravinsky
Chapter 16
Contents
16.1 The simplex algorithm . . . . . . . . . . . . . . . . . . . . 363
16.2 The simplex tableau . . . . . . . . . . . . . . . . . . . . . . 376
16.3 The initial tableau . . . . . . . . . . . . . . . . . . . . . . . 385
16.4 The revised simplex algorithm . . . . . . . . . . . . . . . 394
16.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
16.6 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
subject to
Ax = b
x ≥ 0,
where A ∈ Rm×n , b ∈ Rm , c ∈ Rn . A central idea of the method is based on the fact
that if an optimal solution exists, then there is one that is a vertex (Definition 3.34)
of the constraint polyhedron.1 This property is trivial when n = 1. For instance,
the linear optimization problem in one variable minx∈R cx subject to x ≥ 0 has an
optimal solution if and only if c ≥ 0, because the problem is unbounded if c < 0.
When c > 0, x∗ = 0 is the only optimal solution to the problem. If c = 0, then
any x ∈ R is optimal, in particular x∗ = 0. Note that we have used this property
in Chapter 4 when deriving the conditions for the dual function to be bounded. We
formalize this result for general bound constraints on x.
1 We suggest that the reader carefully reads Sections 3.5 and 6.5 before proceeding with this
chapter.
364 The simplex algorithm
min ax + b
x∈R, xℓ ≤x≤xu
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Proof. If a > 0 (respectively a < 0), the function is strictly increasing (respectively
decreasing), and the minimum is reached for the smallest (respectively largest) feasible
value of x.
x∗ x∗
xℓ xu xℓ xu
(a) a > 0 (b) a < 0
x∗
xℓ xu
(c) a = 0
The set Q is also a polyhedron represented in standard form. It is non empty (x∗ ∈ Q)
and contains at least one vertex y∗ (Theorem 3.37). We assume by contradiction that
y∗ is not a vertex of P. Therefore, from the definition of a vertex (Definition 3.34),
there exist y and z, y 6= z, in P and 0 < λ∗ < 1 such that
y∗ = λ∗ y + (1 − λ∗ )z . (16.1)
Before proposing algorithms, let us see how to solve the problem graphically for
a simple example.
Example 16.3 (Graphical method). Consider the optimization problem
x∈R2
subject to
x1 + x2 ≤ 1
x1 − x2 ≤ 1
x1 ≥ 0
x2 ≥ 0 .
Put in standard form, the constraint polyhedron of this problem is identical to the
polyhedron in Example 3.39. Figure 16.3 represents the feasible domain in the space
of variables (x1 , x2 ).
x2 ✻
✕
✕ f = −2.5
f = −2.0
f = −1.5
✲
f = −1 x1
f = −0.5
Figure 16.3: Graphical method to find the optimal solution to a linear optimization
problem
The simplex method 367
The level lines corresponding to the different values of the objective function are also
shown. The steepest descent direction, i.e.,
1
−∇f(x) = −c =
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
is displayed with an arrow on each level line. In order to graphically identify the
optimal solution to the problem, one must
2. move this line parallel to itself as far as possible in the direction of the vector −c,
as long as it intersects the feasible domain.
All the points at the intersection of this line and the feasible domain are optimal.
In Example 16.3, the optimal solution is (0, 1), with an optimal value of −2.
The result of Theorem 16.2 enables us to propose a quite simple algorithm. To find
the optimal solution to the problem, we need only go through all the vertices of
the constraint polyhedron and choose the best one. This algorithm can be easily
implemented thanks to Theorem 3.40, that says that the choice of a vertex of the
constraint polyhedron amounts to the choice of the n − m inequality constraints that
are active at this vertex, that is to choose n − m variables that are set to 0 (indeed,
as the polyhedron is represented in standard form, the inequality constraints are
non negativity constraints). These variables are said to be non basic. The m other
variables are said to be basic. If the m × m matrix B gathering the columns of A
corresponding to basic variables is non singular, xB = B−1 b provides the value of the
basic variables at the considered vertex, if xB ≥ 0 (see the discussions in Section 3.5
for more details). The vertex enumeration method detailed in Algorithm 16.1 exploits
this characterization.
−1
1 1 1 0 1 −2
A= , b= , c=
0 .
1 −1 0 1 1
0
The vertex enumeration for this problem is carried out in the description of Example
3.39. We now need only calculate the values of the objective function to find the
optimal solution.
368 The simplex algorithm
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 Output
8 The set J∗ of basic variables indices of the optimal solution
9 Initialization
10 C := Cm (1, . . . , n), set of all combinations of m indices among n.
11 k := 1
12 f∗ := +∞
13 Repeat
14 Choose a potential basis, that is a set of m indices Jk = (jk1 , . . . , jkm ) ∈ C
15 Let B = (Ajk1 , . . . , Ajkm ) be the matrix formed by the columns of A
corresponding to the indices of Jk
16 if B is invertible and B−1 b ≥ 0 then
17 fk := cTB B−1 b where cB contains the basic components of c
18 else
19 fk = +∞
20 if fk < f∗ then
21 J∗ = Jk
22 f∗ = fk
23 C := C \ Jk
24 k := k + 1
25 Until C = ∅
k xk fk
T
1 1 0 0 0 −1
T
2 1 0 0 0 −1
T
3 1 0 0 0 −1
T
4 0 −1 2
0 B−1 b 6≥ 0
T
5 0 1 0 2 −2
T
6 0 0 1 1 0
T
The optimal solution is x∗ = 0 1 0 2 .
The simplex method 369
This number becomes prohibitively large when n and m are large, and the algorithm
is then inapplicable. We are facing a combinatorial optimization problem2 (see
Definition 25.5). We refer the reader to Avis and Fukuda (1992) for an algorithm
enumerating the vertices of a polyhedron in arbitrary dimension.
The simplex method, which we now describe, also goes through the vertices of the
constraint polyhedron, but does it intelligently, to avoid having to enumerate them
all. It uses a strategy similar to the descent methods presented in Chapter 11: at
each iteration, a descent direction is identified, and a step is calculated. As discussed
below, the step may happen to be zero, so that several iterations may not produce
any progress, and special care needs to be taken to avoid the algorithm being stalled.
The algorithm exploits the equivalence between vertices of the constraint polyhedron
and feasible basic solutions (Theorem 3.40).
The geometric interpretation of the simplex algorithm can be summarized as fol-
lows:
• The algorithm starts from a vertex of the constraint polyhedron.
• An edge of the polyhedron along which the objective function decreases is identi-
fied. If no such edge exists, the current vertex is an optimal solution.
• The edge is followed until the next vertex is reached.
A simple illustration is provided in Figure 16.4.
x0
x1 x2
x∗
Figure 16.4: Geometric illustration of the simplex algorithm
2 Linear optimization combines the features of continuous optimization and combinatorial opti-
mization. In addition to its important role in many concrete applications, these features are
exploited a lot in theoretical developments.
370 The simplex algorithm
The analysis provided in Sections 3.5 and 6.5 allows the geometrical concepts to
be translated into algebraic concepts that are combined to Algorithm 16.2.
• The vertices of the polyhedron are basic feasible solutions, characterized by the
set of indices corresponding to the basic variables (Theorem 3.40). Note that one
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Comments
• The algorithm must be initialized with an arbitrary feasible basic solution. For
problems in standard form, such a feasible solution always exists if the polyhedron
is non empty (Theorems 3.37 and 3.40). However, it is not necessarily simple to
find such a feasible solution. We address this problem in Section 16.3, where
such a basic feasible solution, or proof there is none, is furnished by the simplex
algorithm applied to an auxiliary problem.
• According to Theorem 6.29, the reduced costs for the basic indices are zero. For
this reason, in step 15, only the non basic indices are considered.
• In practice, the dN part of the direction is never formed.
• Step 22 calculates the maximum step αq that can be taken along the basic direc-
tion dp , while remaining feasible. Geometrically, it is the step that corresponds
to the first constraint activated along the basic direction. Therefore, the corre-
sponding variable becomes 0 and becomes non basic (see Lemma 16.5).
• The reduced cost represents the directional derivative of the (linear) function in
the basic direction. When it is negative, the basic direction is a descent direction
and the new value of the objective function is
• Step 18 identifies the index of the non basic variable that is entering the basis,
and step 22 identifies the index of the basic variable that is leaving the basis.
In the presence of a degenerate basic feasible solution, several candidates may
be possible. The algorithm then suggests selection of the smallest index among
those that verify the condition. It allows for a systematic enumeration of the basic
feasible solutions corresponding to the same vertex of the constraint polyhedron,
and avoids the algorithm being stalled in an endless cycle. This guarantees that
the algorithm terminates after a finite number of iterations. This choice is called
Bland’s rule, from the work of Bland (1977). Other strategies are suggested in the
projects of Section 16.6.
The simplex method 371
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 J0 = (j01 , . . . , j0m ) the set of indices of the basic variables corresponding to a
basic feasible solution.
8 Output
9 A Boolean indicator U detecting an unbounded problem.
10 If U is false, J∗ = (j∗1 , . . . , j∗m ) is the set of indices of an optimal basic
feasible solution.
11 Initialization
12 k := 0.
13 Repeat
14 Let B = Ajk1 , . . . , Ajkm be the matrix formed by the columns of A
corresponding to the indices of Jk .
15 if c̄j = cj − cTB B−1 Aj ≥ 0 ∀j 6∈ Jk then optimal solution
16 J∗ = Jk , U=FALSE, STOP.
17 else
18 p := smallest index such that c̄p < 0.
19 Calculate the basic variables xB = B−1 b .
20 Calculate the basic components of the pth basic direction dB = −B−1 Ap .
21 For each i = 1, . . . , m , calculate the distance to the non negativity
constraint, i.e.,
− xB i if d < 0
B i
αi := dB i (16.3)
+∞ otherwise .
• At each iteration, if the basic feasible solution is not degenerate, the basic direction
is feasible (Theorem 3.44). Then, no αi in (16.3) is zero. Therefore, the step αq
is positive and (16.2) guarantees that
cT xk+1 < cT xk .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
• For the algorithm to be valid, we need to demonstrate that xk+1 is again a basic
feasible solution and that the matrix B̄, obtained by replacing column jq by Ap ,
is non singular.
Lemma 16.5. After one iteration of the simplex method (Algorithm 16.2), the
new set of indices defines a basic feasible solution.
Proof. We assume without loss of generality that the numbering is such that the basic
variables come first, that is, jki = i for all i. We consider the matrix B̄ corresponding to
the new set of indices and let us first demonstrate that it is non singular. We assume,
by contradiction, that this is not the case. There exist coefficients λ1 , . . . , λm , not all
zero, such that
m
X m
X m
X
λi B̄i = λi B̄i + λq B̄q = λi Ai + λq Ap = 0 ,
i=1 i=1 i=1
i6=q i6=q
and these vectors are linearly dependent. However, for all i 6= q, Bi = Ai and
B−1 Ai = B−1 Bi = ei ,
where ei is the ith column of the identity matrix. These vectors are linearly indepen-
dent and their qth component is zero. The vector B−1 Ap is exactly −dB (see step 20
or (3.88)). The qth component
of −dB is not zero, as the index q is chosen among
the indices for which dp i < 0 (step 21). Therefore, B−1 Ap is linearly independent
from all B−1 Ai , creating the contradiction.
So, the first part of Definition 3.38 is satisfied. We now demonstrate that all the
non basic variables are zero. As a basic direction is followed during the iteration, only
the non basic variable p is modified by the iteration (see Definition 3.42). It enters
the basis and may become positive. All the others remain at zero, out of the basis.
We analyze the qth variable, that exits the basis during the iteration. Its value at the
end of the iteration is
xk q
xk+1 q = xk q + αq dp q = xk q − dp q = 0 .
dp q
The simplex method 373
The new iterate is therefore indeed a basic solution. We demonstrate that it is feasible.
• All the non basic variables are non negative, because they are zero.
• Let i be a basic index. We have
xk+1 i = xk i + αq dp i .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Since xk is feasible and xk i ≥ 0, only the indices i such that dp i < 0 may
cause problems. However, according to step 22 of the algorithm we have αq ≤ αi
for such indices. Therefore,
xk+1 i = xk i +αq dp i
≥ xk i + αi dp i
xk i
= xk i − dp i = 0
dp i
and xk+1 is feasible.
Example 16.6 (The simplex method – I). We apply the simplex method to the same
problem as in Example 16.4, with
−1
1 1 1 0 1 −2
A= , b= , c= 0 .
1 −1 0 1 1
0
Iteration 1
0 1 0
1. Consider J = {3, 4} and B = .
0 1
2. Current iterate:
0
0
x0 =
1 , cT x0 = 0 .
1
3. Reduced costs:
c̄1 = −1
c̄2 = −2
c̄3 = 0
c̄4 = 0 .
The index p = 1 is chosen to enter in the basis. Indeed, it is the smallest index
corresponding to a negative reduced cost.
4. Basic direction:
1
−1 0
dB1 = , d1 =
−1 ,
p = 1.
−1
−1
374 The simplex algorithm
x2 ✻ x2 ✻
x1 + x2 = 1 ■ x1 + x2 = 1
✠ ✠
✲ ✲ ✲
x1 x1
■x1 − x2 = 1 ■x1 − x2 = 1
Iteration 2
1 0
1. J1 = {1, 4} and B = .
1 1
2. Current iterate :
1
0
x1 =
0 , cT x1 = −1 .
0
3. Reduced costs:
c̄1 = 0
c̄2 = −1
c̄3 = 1
c̄4 = 0 .
The index p = 2 is chosen to enter in the basis.
The simplex method 375
4. Basic direction:
−1
−1 1
dB2 = , d2 =
0 , p = 2.
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Iteration 3
1 0
1. J2 = {2, 4} and B = .
−1 1
2. Reduced costs:
c̄1 = 1
c̄2 = 0
c̄3 = 2
c̄4 = 0 .
Example 16.7 (The simplex method – II). We apply the simplex method to the
following problem:
min −10 x1 − 12 x2 − 12 x3
subject to
x1 + 2x2 + 2x3 ≤ 20
2x1 + x2 + 2x3 ≤ 20
2x1 + 2x2 + x3 ≤ 20 ,
and
x1 , x2 , x3 ≥ 0.
376 The simplex tableau
A = 2 1 2 0 1 0 , b = 20 , c = .
0
2 2 1 0 0 1 20
0
0
The choice of J0 = {4, 5, 6} produces an initial feasible basic solution, from which we
can apply the simplex method. The details of the iterations are given in Table 16.1.
Table 16.1: Iterations with the simplex method for Example 16.7
k Jk c̄ x1 x2 x3 x4 x5 x6 dB αq p q cT x
0 4 5 6 −10 −12 −12 0 0 0 20 20 20 −1 −2 −2 10 1 5 0
1 1 4 6 −7 −2 5 10 0 0 10 0 0 −1.5 −0.5 −1 0 2 6 −100
2 1 2 4 −9 −2 7 10 0 0 10 0 0 −2.5 −1.5 1 4 3 4 −100
3 1 2 3 3.6 1.6 1.6 4 4 4 0 0 0 −136
Note that the basic feasible solution for iteration 1 is degenerate. Indeed, x6 is
zero even though it is in the basis. We also note that at this iteration, the method
cannot progress. The step αq is zero. However, the algorithm still performs a change
of basis (the variable 6 is replaced by the variable 2). During iteration 2, the feasible
basic solution is also degenerate (x2 is zero in the basis), but the algorithm can now
progress (αq = 4).
is called the simplex tableau corresponding to this basic feasible solution. In more detail,
we have
e
xj1
−1 −1
..
B A1 · · · B An . (16.5)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
e
xjm
c̄1 ··· c̄n −cT e
x
where c̄i is the reduced cost of the variable i.
To illustrate the concept, let us consider the table corresponding to the optimal
solution of Example 16.6:
x1 x2 x3 x4
1 1 1 0 1 x2
2 0 1 1 2 x4
1 0 2 0 2 −cT x
Basic variables
• Each column to the left side of the tableau corresponds to a variable of the prob-
lem.
• The columns with the basic variables contain the columns of the identity matrix.
• Each row corresponds to a basic variable. The correspondence is defined by the
specific structure of the column corresponding to this basic variable: it is a column
of the identity matrix, that is, all its elements are 0, except one which is 1. The
row where element 1 is situated is the row corresponding to the basic variable.
In the example, the only 1 in the column corresponding to x2 is in the first
row. Therefore, the first row is associated with variable x2 . Following the same
reasoning, we see that the second row is associated with variable x4 .
• The m first rows of the last column contain the values of the basic variables. The
other variables, that is, the non basic variables, are always zero.
• The last element of the last column contains the value of the objective function,
with opposite sign. Indeed,
not expect the tableau in the next iteration to be too different from the tableau in
the current iteration.
Let B be the basic matrix at the start of the iteration and let B̄ be this matrix at
the end of the iteration, obtained by replacing one column of B by another column
from A. In Example 16.7, we have
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 2 2 1 0 0
A= 2 1 2 0 1 0 .
2 2 1 0 0 1
After the first iteration, the variable 5 is replaced by variable 1 in the basis, so that
1 1 0
B̄ = (A4 A1 A6 ) = 0 2 0 .
0 2 1
We would like to find a simple transformation of B−1 to obtain B̄−1 , i.e., a matrix
Q such that
QB−1 = B̄−1
or, equivalently,
QB−1 B̄ = I .
It means that the matrix Q transforms the matrix B−1 B̄ into the identity matrix.
Since B−1 B = I, and B and B̄ have the same columns except one, the matrix B−1 B̄ is
already “almost” the identity matrix, i.e.,
1 0 u1 0
0 1 u2 0
.. .. .. .. ..
.
. . . .
B B̄ =
−1
.. .. .. ,
(16.6)
. . uq .
.. .. .. .. ..
. . . . .
0 0 um 1
where the vector u is defined by u = −dp = B−1 Ap . We must transform (16.6) into
an identity matrix. The application Q that takes care of this is the composition of
elementary row operations.
The simplex method 379
where ai denotes the ith row of A. This operation consists in multiplying A by the
matrix Qij , which is the identity matrix (row dimension of A), of which element (i, j)
is replaced by β.
In order to transform the matrix (16.6) into an identity matrix, we must apply to
it the following elementary row operations:
• For each row i 6= q, we add the row q multiplied by −ui /uq to the ith row. Note
that uq = −(dp )q is not zero (see the proof of Theorem 16.5).
• The row q is divided by uq .
Example 16.11 (Basis change). Consider again Example 16.7. At the first iteration,
we have
1 0 0
B−1 = 0 1 0 .
0 0 1
The second row of B (corresponding to the variable 5) is replaced by A1 . Since
T
B−1 A1 = 1 2 2 , we have
1 1 0
B−1 B̄ = 0 2 0 .
0 2 1
In order for this matrix to be an identity matrix, we must apply elementary row
operations to the following rows:
380 The simplex tableau
Indeed,
B̄−1 = QB−1 = Q22 Q12 Q32 B−1 = Q22 Q12 Q32
where
1 0 0 1 −0.5 0 1 0 0
Q22 = 0 0.5 0 , Q12 = 0 1 0 , Q32 = 0 1 0 .
0 0 1 0 0 1 0 −1 1
We now see that the same operations can be applied to the simplex tableau. In-
deed, for the first part of the tableau, since the elementary operations are represented
by the matrix Q = B̄−1 B, we have
We show later on that the same is true for the last row. We use the following update
procedure, called pivoting.
Example 16.12 (Pivoting). Consider the following simplex tableau. We want to
extract the variable x6 from the basis (line 3 of the tableau) and enter the variable
x2 (column 2 of the tableau).
x1 x2 x3 x4 x5 x6
0 1.5 1 1 −0.5 0 10 x4
1 0.5 1 0 0.5 0 10 x1
T =
0 1 −1 0 −1 1 0 x6
0 −7 −2 0 5 0 100
Basic variables
The simplex method 381
12 for i = 1, . . . , m + 1, i 6= q do
13 T (i, k) := T (i, k) − T (i, p)T (q, k)/T (q, p) k = 1, . . . , n + 1
T (q, k)
14 T (q, k) := k = 1, . . . , n + 1
T (q, p)
x1 x2 x3 x4 x5 x6
0 0 2.5 1 1 −1.5 10 x4
1 0 1.5 0 1 −0.5 10 x1
T̄ =
0 1 −1 0 −1 1 0 x2
0 0 −9 0 −2 7 100
Basic variables
We now need only demonstrate that the last row of the new tableau corresponds
to Definition 16.8. In the tableau T , this last row is of the type
where gT is the qth row of B−1 . During the elementary operation on the last row, we
have
T̄m+1 = Tm+1 + βTq
382 The simplex tableau
T (m + 1, p)
T̄ (m + 1, k) = T (m + 1, k) − T (q, k) . (16.8)
T (q, p)
By definition of the tableau, T (m+1, k) is the reduced cost associated with the variable
k. Assume first that k was in the basis before the pivoting, so that T (m + 1, k) = 0.
The column k of T contains zero values, except in the row corresponding to the basic
variable k. As k remains in the basis, it does not correspond to the pivot row q and
T (q, k) = 0. Therefore, T̄ (m + 1, k) = T (m + 1, k) = 0.
Assume now that k is the column of the pivot, that is k = p. It therefore corre-
sponds to a basic variable in the tableau T̄ . By replacing k by p in (16.8), we obtain
that the reduced cost is
T (m + 1, p)
T̄ (m + 1, p) = T (m + 1, p) − T (q, p) = 0 .
T (q, p)
Then, all the elements of the last row of T̄ corresponding to the basic variables B̄ are
zero. Consequently, by taking only these columns in (16.7),
cTB̄ + hT B̄ = 0 ,
which gives
hT = −cTB̄ B̄−1 .
Including it into (16.7), we obtain
1 2 2 1 0 0 20 α4 = 20
2 1 2 0 1 0 20 α5 = 10
2 2 1 0 0 1 20 α6 = 10
−10 −12 −12 0 0 0 0
We start examining the last row from left to right until we identify a negative
reduced cost. There is one in the first column, so that it is selected as the pivot
column, and x1 is scheduled to enter the basis. The value of α is calculated for
each row of the upper part of the tableau such that the entry in the pivot column is
positive.
The simplex method 383
3 Input
4 T0 , the simplex tableau corresponding to a basic feasible solution.
5 Output
6 Boolean indicator U identifying the unbounded problem.
7 If U is false, T ∗ , the simplex tableau corresponding to an optimal basic
feasible solution.
8 Initialization
9 k := 0.
10 Repeat
11 Examine the reduced costs in the last row of Tk . If they are all non
negative, then the tableau is optimal. T ∗ = Tk , U=FALSE. STOP.
12 Let p be the index of the column corresponding to the negative reduced
cost that is the furthest to the left in the tableau.
13 For each i, calculate the distance to the constraint xi ≥ 0, i.e.,
T (i, n + 1) if T (i, p) > 0
αi = T (i, p)
+∞ otherwise .
In this case, the three entries are positive. The smallest α is 10, so that both rows
2 and 3 are candidates to be the pivot row. Applying Bland’s rule, we select row 2,
corresponding to x5 . The pivot (circled) is therefore in column 1 and row 2. After
pivoting, we obtain the following tableau.
x1 x2 x3 x4 x5 x6
The first column of the tableau is now a column of the identity matrix. As the 1
is at the second row, the second row of the tableau corresponds to the variable x1 .
Note that the reduced cost of the variable x1 was −10. Remember that it is the slope
of the objective function in the corresponding basic direction. As a step of length
α = 10 is performed, the value of the objective function decreases by 100 units during
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
this first iteration. This is reflected in the rightmost cell of the last row, that contains
the value of the objective function with the opposite sign. We indeed observe that
the objective function moved from 0 to −100.
Applying the same procedure to the new tableau, we obtain a pivot in column 2
and row 3 (circled), so that x2 enters the basis and x6 leaves it. Note that we have
here a degenerate basic feasible solution, and the basic direction happens not to be
feasible. The maximum step that can be performed is the smallest value of α, that
is α6 = 0. After pivoting, we obtain the following tableau.
x1 x2 x3 x4 x5 x6
0 0 2.5 1 1 −1.5 10 α4 = 4
Note that the value of the objective function is still −100. Indeed, the algorithm
has performed a step of length 0. Even if the tableau is different, it corresponds to
the same vertex of the constraint polyhedron.
The leftmost negative reduced cost is in column 3, so that x3 enters the basis.
Note that there are only two positive entries in the column, so that only two α’s are
calculated. The smallest one is in row 1, corresponding to x4 , that leaves the basis.
After pivoting, we obtain the following tableau.
x1 x2 x3 x4 x5 x6
For instance, the identification of a first tableau is simple when the linear opti-
mization problem is given in the form
min cT x
subject to
Ax ≤ b
x≥0
and when the vector b only contains non negative elements. In this case, we
transform the problem into standard form by adding slack variables.
The problem then becomes
min cT x + 0T xs
subject to
Ax + Ixs = b
x≥0
xs ≥ 0 ,
where xs ∈ Rm is the vector of slack variables. The point x = 0, xs = b is a basic
feasible solution (because b ≥ 0), where the slack variables xs are in the basis and
the associated basic matrix is the identity matrix. As B = I and cB = 0, the tableau
(16.4) simplifies into
A b
(16.9)
cT 0
min −2x1 − x2
subject to
x1 − x2 ≤ 2
x1 + x2 ≤ 6
x1 , x2 ≥ 0 .
The problem in standard form is obtained after including the slack variables xs1 = x3
and xs2 = x4 .
min −2x1 − x2
386 The initial tableau
subject to
x1 − x2 + x3 = 2
x1 + x2 + x4 = 6
x1 , x2 , x3 , x4 ≥ 0 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The slack variables are selected to be in the basis, and the first tableau is
x1 x2 x3 x4
1 −1 1 0 2 α3 = 2
A b 1 1 0 1 6 α4 = 6
=
cT 0 −2 −1 0 0 0
Basic variables
We can now apply the simplex algorithm. During the first iteration, x1 enters the
basis, replacing x3 .
x1 x2 x3 x4
1 −1 1 0 2 α1 = +∞
0 2 −1 1 4 α4 = 2
0 −3 2 0 4
During the second iteration, x2 enters the basis instead of x4 .
x1 x2 x3 x4
1 0 0.5 0.5 4 x1
0 1 −0.5 0.5 2 x2
0 0 0.5 1.5 10
Basic variables
The final tableau is optimal as all reduced costs (in the last row) are non negative.
The optimal value of
T the basic variables are available in the last column, so that
∗ T ∗
x = 4 2 0 0 and c x = −10.
x1 − x2 ≤ 2
x1 + x2 ≤ −6
x1 , x2 ≥ 0 .
The simplex method 387
In order to identify an initial tableau for any problem, that is, a feasible basic
solution, we consider an auxiliary optimization problem. We design it in a way that
its initial tableau is easy to construct. We consider the problem in standard form
min cT x
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
Ax = b
x ≥ 0,
and call it problem (P). Here, as we have equality constraints, we can assume without
loss of generality that b ≥ 0. If one of the components of b happens to be negative,
we need only multiply the corresponding constraint by −1.
We now create the auxiliary problem. In order to easily obtain a first tableau, we
need to select basic variables corresponding to the column of the identity matrix, so
that B = B−1 = I. As such columns may not be present in problem (P), we enforce
it and introduce an auxiliary variable for each constraint. We obtain the following
constraints for the auxiliary problem, where the identity matrix appears explicitly:
Ax + Ixa = b
(16.10)
x, xa ≥ 0 ,
where the variables of problem (P) play no role. The objective is to give the smallest
possible value (that is, 0) to all auxiliary variables. The auxiliary problem with
objective function (16.11) and constraints (16.10) is called problem (A). Note that, by
construction, the value of the objective function is the sum of the auxiliary variables
and is thus always non negative.
We consider x0 , a feasible point of problem (P). As Ax0 = b, it is easy to check
that the point x = x0 and xa = 0 is a feasible point of the auxiliary problem (A).
The value of the objective function of this point in (A) is the sum of the variables
xa , that is 0. Since zero is also the smallest possible value of the objective function
of (A), we are dealing with an optimal solution of problem (A).
If x0 is a feasible point of (P), then x = x0 , xa = 0 is an optimal solution to
(A) with a zero value of the objective function. The contrapositive statement is as
follows. If the optimal solution to (A) corresponds to a nonzero, positive, value
of the objective function, then (P) has no feasible solution. As discussed later,
this provides us with a convenient way to detect an infeasible problem.
388 The initial tableau
T
where ecB = 1 1 ... 1 = e is the vector of the coefficients of the basic
variables (here, the auxiliary variables xa ) in the objective function of (A). The last
row of the tableau is simply the sum of the elements of the corresponding column,
with the sign changed.
Problem (A) can be solved by the simplex algorithm (Algorithm 16.4). The
algorithm cannot detect an unbounded problem at step 15, as the objective function
of (A) is bounded below by 0. It always produces an optimal solution x∗ , xa∗ .
Consequently, one of the following two possibilities occurs:
1. The optimal value of (A) is zero. As it is the sum of the auxiliary variables, which
are non negative, each of them have to be zero: xa∗ = 0. As Ax∗ +xa∗ = Ax∗ = b,
x∗ is a feasible solution of (P).
2. The optimal value of (A) is positive. This signifies that there is no feasible solution
for (P).
Note that the auxiliary problem (A) is always feasible and bounded, with 0 as a lower
bound.
In summary, solving the auxiliary problem (A) either provides a feasible solution
of (P), or provides a certificate of infeasibility. We illustrate this in an example.
Example 16.15 (Initial point). Consider the problem
min x1 + x2 + x3
subject to
x1 + 2x2 + 3x3 = 3
−x1 + 2x2 + 6x3 = 2
4x2 + 9x3 = 5
3x3 + x4 = 1
x1 , x2 , x3 , x4 ≥ 0 .
The auxiliary problem is written as
min xa a a a
1 + x2 + x3 + x4
subject to
x1 + 2x2 + 3x3 + xa
1 =3
−x1 + 2x2 + 6x3 + xa
2 =2
4x2 + 9x3 + xa
3 =5
3x3 + x4 + xa
4 =1
x1 , x2 , x3 , x4 , xa a a a
1 , x2 , x3 , x4 ≥ 0 .
The simplex method 389
The initial tableau for the auxiliary problem and the iterations of the simplex algo-
rithm (Algorithm 16.4) are listed below.
x1 x2 x3 x4 xa1 xa2 xa3 xa4
1 2 3 0 1 0 0 0 3 3/2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
−1 2 6 0 0 1 0 0 2 1
0 4 9 0 0 0 1 0 5 5/4
0 0 3 1 0 0 0 1 1 +∞
0 −8 −21 −1 0 0 0 0 −11
2 0 −3 0 1 −1 0 0 1 1/2
−1/2 1 3 0 0 1/2 0 0 1 +∞
2 0 −3 0 0 −2 1 0 1 1/2
0 0 3 1 0 0 0 1 1 +∞
−4 0 3 −1 0 4 0 0 −3
Basic variables
The last tableau is optimal since all the reduced costs are non negative. The
optimal solution is x1 = 1, x2 = 1/2, x3 = 1/3, x4 = 0, xa a a a
1 = x2 = x3 = x4 = 0. The
optimal value of the objective function and all the auxiliary variables are zero. It is
easy to verify that (x1 , x2 , x3 , x4 ) is a feasible point of the initial problem.
because this (auxiliary) basic variable is zero. Therefore, it can be exchanged with
a variable of the original problem that is non basic and, therefore, equal to zero as
well. To do so, we choose a column corresponding to a variable from the original
problem such that the pivot is non zero and carry out the pivoting which exchanges
the two variables in the basis. Since the auxiliary basic variable is zero, the pivoting
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
does not affect the values of the last column of the tableau. Then, the new tableau
corresponds exactly to the same feasible solution as the former. Only the basis has
changed.
In the case where the matrix A of the initial problem is of full rank, such pivoting
is always possible. In Example 16.15, this hypothesis is not satisfied. The third
constraint is the sum of the first two and is redundant. If we want to remove the
variable xa3 from the basis, the only possible candidate to take its place in the basis
is x4 , the only variable of the original problem that is out of the basis. But the
corresponding pivot is zero and the procedure cannot be applied.
When there are no longer any auxiliary variables in the basis, the corresponding
columns can be removed to obtain a tableau.
x1 x2 x3 x4
1 0 0 1/2 1 x1
0 1 0 −3/4 1/2 x2
0 0 1 1/3 1/3 x3
− − − − −
To obtain a feasible tableau from the initial problem, we need to calculate the
elements of the last row. These are reduced costs, defined by (6.166) and the value
of the objective function with the opposite sign. We thus obtain an algorithm in two
phases (Algorithm 16.5).
The simplex method 391
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 Output
8 Boolean indicator U identifying an unbounded problem.
9 Boolean indicator F identifying an infeasible problem.
10 If U and F are false, T ∗ , the simplex tableau corresponding to an optimal
basic feasible solution.
11 Phase I
12 By multiplying the relevant constraints by −1, modify the problem such
that b ≥ 0.
13 Introduce the auxiliary variables xa a
1 , . . . , xm and define
x1 . . . xn xa
1 . . . xa
m
T0 = A I b
−eT A 0 −eT b
subject to
x1 + 3x2 + 4x4 + x5 = 2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x1 + 2x2 − 3x4 + x5 = 2
−x1 − 4x2 + 3x3 = 1
x1 , x2 , x3 , x4 , x5 ≥ 0.
We apply the simplex algorithm in two phases (Algorithm 16.5) with
2
1 3 0 4 1 2
3
A= 1 2 0 −3 1 , b = 2 , c = 3
.
−1 −4 3 0 0 1 1
−2
Phase I
1. Initial tableau of the auxiliary problem:
x1 x1.5 x3 x4 x5 xa1 xa2 xa3
1 3 0 4 1 1 0 0 2 2
1 2 0 −3 1 0 1 0 2 2
−1 −4 3 0 0 0 0 1 1
−1 −1 −3 −1 −2 0 0 0 −5
2. The simplex algorithm is applied to solve the auxiliary problem:
x1 x2 x3 x4 x5 xa1 xa2 xa3
1 3 0 4 1 1 0 0 2
0 −1 0 −7 0 −1 1 0 0
0 −1 3 4 1 1 0 1 3 1
0 2 −3 3 −1 1 0 0 −3
x1 x2 x3 x4 x5 xa1 xa2 xa3
1 3 0 4 1 1 0 0 2 x1
0 −1 0 −7 0 −1 1 0 0 xa2
0 −1/3 1 4/3 1/3 1/3 0 1/3 1 x3
0 1 0 7 0 2 0 1 0
The last tableau is optimal, and the optimal value is zero. We have identified a
basic feasible solution: x1 = 2, x2 = 0, x3 = 1, x4 = 0, x5 = 0.
3. The auxiliary variable xa 2 is basic. It is exchanged with x2 .
x1 x2 x3 x4 x5 xa1 xa2 xa3
1 3 0 4 1 1 0 0 2
0 −1 0 −7 0 −1 1 0 0
0 −1/3 1 4/3 1/3 1/3 0 1/3 1
0 1 0 7 0 2 0 1 0
The simplex method 393
Phase II
1. Calculate the last row of the tableau. The vector c is reported above the tableau
to facilitate the calculations:
1 0 0 −17 1 2 2
0 1 0 7 0 0
0 0 1 3.67 1/3 1 3
0 0 0 3 −5 −7
x1 x2 x3 x4 x5
1 0 0 −17 1 2
0 1 0 7 0 0 0
−1/3 0 1 9.33 0 1/3 0.04
5 0 0 −82 0 3
x1 x2 x3 x4 x5
1 2.43 0 0 1 2 x5
0 0.14 0 1 0 0 x4
−1/3 −1.33 1 0 0 1/3 x3
5 11.71 0 0 0 3
394 The revised simplex algorithm
The last tableau is optimal, because all the reduced costs are non negative. The
optimal solution is
1
x1 = 0 , x2 = 0 , x3 = , x4 = 0 , x5 = 2
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and the optimal value is −3. Note that the optimal solution was already reached at
the previous iteration, illustrating that the non negative reduced costs are sufficient
but not necessary for optimality (see Theorems 6.30 and 6.31).
The presentation of the proof of Theorems 16.1 and 16.2 is inspired by Bertsimas
and Tsitsiklis (1997).
c̄N = cN − NT B−T cB .
UT z = cB .
LT yP = z.
y = PT yP .
4. Then,
c̄N = cN − NT y.
Step 19 Calculation of the current iterate xB = B−1 b. Using the LU factorization of
B, the procedure is as follows.
The simplex method 395
Ly = Pb.
UxB = y.
Step 20 Calculation of the basic component of the pth basic direction dB = −B−1 Ap .
Using the LU factorization of B, the procedure is as follows.
1. Define y ∈ Rm as the solution of the triangular system
Ly = −PAp .
UdB = y.
16.5 Exercises
Exercise 16.1. Consider the following optimization problem
subject to
x1 − x2 ≥ −2
2x1 + x2 ≤8
x1 + x2 ≤5
x1 + 2x2 ≤ 10
x1 ≥0
x2 ≥ 0.
1. Provide a graphic representation of the feasible set (see Exercise 3.5).
2. Solve the problem graphically.
3. Solve the problem using Algorithm 16.5.
4. Reformulate the same problem with a minimum number of constraints (see Exer-
cise 3.5).
5. Solve the new formulation using Algorithm 16.5.
396 Project
Exercise 16.2. Solve the following optimization problem using Algorithm 16.5.
5x1 + 2x2 ≤ 31
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
−3x1 + 2x2 ≤ 5
−2x1 − 3x2 ≤ −1
x1 ≥ 0
x2 ≥ 0.
cT = (µ ρ 0 0 0),
16.6 Project
The general organization of the projects is described in Appendix D.
Objective
The objective of this project is to implement the simplex algorithm in two phases
and test the various pivoting rules.
The simplex method 397
Approach
Apply the algorithms to the problem described below, for different values of n, and
compare the number of iterations. For the algorithms comprising random decisions,
run the same problem several times to obtain an average performance index.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Algorithms
Algorithms 16.3, 16.4, and 16.5. The following versions of phase 2 of Algorithm 16.4
are tested.
1. Choose an index of the column corresponding to the negative reduced cost that is
the furthest to the left in the tableau (rule already described in Algorithm 16.4).
2. Choose the index of the column corresponding to the most negative reduced cost.
3. Carry out a pivoting for each variable corresponding to a negative reduced cost
and select the one that generates the most significant reduction in the objective
function.
4. Randomly select an index corresponding to a negative reduced cost, by attributing
the same probability to each of these indexes.
5. Randomly select an index corresponding to a negative reduced cost, for which the
probability of selecting index j is
−c̄j
X if c̄j < 0
−c̄k
{k|c̄k <0}
0 otherwise .
Problems
The following problems are inspired by the ideas of Klee and Minty (1972) to demon-
strate that the complexity of the simplex algorithm cannot be polynomial.
Exercise 16.4. The problem
n
X
min − 2n−i xi
i=1
subject to
x1 ≤ 5
4x1 + x2 ≤ 25
8x1 + 4x2 + x3 ≤ 125
..
.
2n x1 + 2n−1 x2 + · · · + 4xn−1 + xn ≤ 5n
x1 , x2 ≥ 0 .
T
The optimal solution to this problem is 0 0 . . . 0 5n .
398 Project
εxi−1 ≤ xi ≤ 1 − εxi−1 , i = 2, . . . , n ,
where 0 < ε < 1/2.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 17
Contents
17.1 Projected gradient method . . . . . . . . . . . . . . . . . . 399
17.2 Preconditioned projected gradient . . . . . . . . . . . . . 405
17.3 Dikin’s method . . . . . . . . . . . . . . . . . . . . . . . . . 407
17.4 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
P T P
x(γ) − x(γ) x − x(γ) ≥ 0, ∀x ∈ X .
Since xk ∈ X, we have
P T P P T
x(γ) − x(γ) xk − x(γ) = − x(γ) − xk + γ∇f(xk ) d(γ)
T
= − d(γ) + γ∇f(xk ) d(γ)
= −d(γ)T d(γ) − γd(γ)T ∇f(xk )
≥ 0.
Then, as γ > 0,
d(γ)T d(γ)
d(γ)T ∇f(xk ) ≤ − ≤ 0.
γ
x∈X⊆Rn
1 T
min z z + γ∇f(xk )T z .
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
z|Az=b−Axk
−1
z∗ = AT AAT b − A xk − γ∇f(xk ) − γ∇f(xk )
−1
yk = xk − γ∇f(xk ) + AT AAT b − A xk − γ∇f(xk ) . (17.4)
1 2 9 2
min x + x
x∈R2 2 1 2 2
subject to
−x1 + x2 = −1 .
Table 17.1 lists the iterates of the method. The first column contains the iteration
number. The second contains the (infeasible) point obtained by following the steepest
descent direction (except for iteration 0, for which the point (5, 1) was arbitrarily
chosen and where the starting point x0 is obtained by projecting the former on the
constraint). The third column contains the current iterate (always feasible). Finally,
the last column lists the norm of dk , which is used in the stopping criterion.
In order to be able to draw the iterates, the algorithm was also run with γ = 0.1.
The iterates are shown in Table 17.2. Figure 17.1 illustrates the iterations. The
typical zigzagging of the steepest descent method clearly appears on this example,
justifying the need for preconditioning, as discussed in the next section.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3
2.5
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1.5
x2
1
x0
0.5
0
x∗ -0.5
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
x1
(a) Iterations
0.3
0.2
0.1
x2
0
-0.1
x∗
-0.2
0.8 0.9 1 1.1 1.2 1.3
x1
(b) Zoom
Figure 17.1: Projected gradient algorithm: illustration for Example 17.2 with γ = 0.1
and a positive definite matrix H and its Cholesky factorization is LLT (Definition
B.18). We define
x ′ = LT x ⇐⇒ x = L−T x ′ .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
with X ′ = x ′ | L−T x ′ ∈ X . By using Equation (17.3), step 15 of Algorithm 17.1 is
written as
1 ′ 2 T
yk′ = argminx ′ ∈X ′ x − xk′ + γ∇g xk′ x ′ − xk′ .
2
which gives
1 T T
yk = argminx∈X L x − LT xk (LT x − LT xk ) + γ∇f(xk )T L−T (LT x − LT xk )
2
or
1
yk = argminx∈X (x − xk )T H(x − xk ) + γ∇f(xk )T (x − xk ) . (17.5)
2
Table 17.3: Newton’s method for constrained optimization applied to Example 17.2
(γ = 1)
k yk xk kdk k
0 5.0 1.0 3.5 2.5
1 0.0 -20.0 0.9 -0.1 3.67695526e+00
2 0.0 0.8 0.9 -0.1 3.46944695e-16
Newton’s method for constrained optimization 407
x∈X⊆Rn
1
yk = argminx∈X (x − xk )T Hk (x − xk ) + γ∇f(xk )T (x − xk ) .
2
16 dk := yk − xk .
17 Determine αk by applying a line search (Algorithm 11.5) with α0 = 1.
18 xk+1 := xk + αk dk .
19 k := k + 1.
20 Until kdk k ≤ ε
21 x∗ := xk .
min cT x
x
subject to
Ax = b
x≥0
408 Dikin’s method
and let us assume that the problem is bounded, and there there exists a feasible vector
x such that x > 0. It is possible to apply the ideas of the preconditioned projected
gradient method to this problem. It is important to note that the constraint x ≥ 0
complicates the problem giving it a combinatorial dimension. Contrary to the simplex
method that tries to identify which variables are zero at the optimal solution, we here
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
work solely with strictly feasible iterates, i.e., such that x > 0.
Take xk feasible and positive, and a positive definite matrix H. We apply an itera-
tion of the preconditioned projected gradient method. We use (17.5) with ∇f(xk ) = c,
and obtain
1
yk = argminx|Ax=b (x − xk )T H(x − xk ) + γcT (x − xk ) ,
2
yk = xk − γH−1 (c − AT λ)
with
−1
λ = AH−1 AT AH−1 c .
The step length γ is chosen sufficiently small so that yk > 0 and yk is then strictly fea-
sible. An iteration of the preconditioned projected gradient proceeds in the direction
yk − xk with a step of length ᾱ, that is,
where αk = ᾱk γ.
In order to guarantee that xk+1 > 0, we choose αk = βαmax , with 0 < β < 1 and
αmax = max α | xk − αH−1 (c − AT λ) ≥ 0 .
In practice, β is often selected between 0.9 and 0.999, but other values are also
possible. Below, we illustrate the algorithm with β = 0.9 and β = 0.5.
For the method to work, we need to select the matrix H. Since the objective
function is linear, the choice H = ∇2 f(xk ) is not appropriate, as ∇2 f(xk ) = 0. The
method proposed by Dikin (1967) consists in choosing
2
xk 1
0
..
H−1 = diag(xk )2 = . .
2
0 xk n
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 An initial solution x0 such that Ax0 = b and x0 > 0.
8 A parameter β such that 0 < β < 1 (by default, β = 0.9).
9 The required precision ε ∈ R .
10 Output
11 A Boolean indicator U identifying an unbounded problem.
12 If U is false, an approximation of the optimal solution x∗ .
13 Initialization
14 k := 0.
15 Repeat
16 H−1 := diag(xk )2 .
−1
17 λ := AH−1 AT AH−1 c .
−1 T
18 d := −H (c − A λ).
19 For each i = 1, . . . , n, calculate
− xk i
if di < 0
αi := di
+∞ otherwise .
20 αmax := mini αi .
21 if αmax = ∞ then
22 the problem is unbounded. U = TRUE. STOP.
23 xk+1 := xk + βαmax d.
24 k := k + 1.
25 Until kdk ≤ ε
26 x∗ := xk .
subject to
x1 + x2 + x3 = 1
x ≥ 0.
410 Dikin’s method
T
The optimal solution is x∗ = 1 0 0 . The iterations of Dikin’s method starting
T
from x0 = 1/3 1/3 1/3 are shown in Figure 17.2 for β = 0.9 and Figure 17.3
for β = 0.5.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1
0.8
x3 0.6
0.4 0
0.2
0 0.2
0.4
0.6 x1
0 0.2 0.8
0.4 0.6 0.8 1
x2 1
Figure 17.2: Dikin’s method for Example 17.3 (β = 0.9)
1
0.8
x3 0.6
0.4 0
0.2
0 0.2
0.4
0.6 x1
0 0.2 0.8
0.4 0.6 0.8 1
x2 1
Figure 17.3: Dikin’s method for Example 17.3 (β = 0.5)
Finally, Table 17.4 represents the iterations of Dikin’s method for Example 16.7.
Dikin’s method is a precursor for interior point methods. In fact, all the iterates
of this method are interior points (Definition 1.15) in the subspace defined by Ax = b.
Then, the directions obtained are automatically feasible for the constraints x ≥ 0. In
the following chapter, we study these methods in more detail.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
17.4 Project
The general organization of the projects is described in Appendix D.
Objective
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The aim of this project is, first, to implement and analyze the preconditioned gradient
method and, second, to implement Dikin’s method and compare it with the simplex
method.
Approach
It is interesting to modify the value of the step γ and test, for instance, γ = 0.1, 1, 10.
Algorithms
Problems
subject to
x1 ≤5
4x1 + x2 ≤ 25
8x1 + 4x2 + x3 ≤ 125
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
..
.
2n x1 + 2n−1 x2 + · · · + 4xn−1 + xn ≤ 5n
x1 , x2 , . . . , xn ≥ 0 .
T
Use the starting point 1 1 ... 1 . The optimal solution to this problem is
T
0 0 . . . 0 5n .
Exercise 17.3. Linear (ii):
min −xn
subject to
ε ≤ x1 ≤ 1
εxi−1 ≤ xi ≤ 1 − εxi−1 , i = 2, . . . , n .
Use the starting point
1+ε
x1 =
2
1
xi = , i = 2, . . . , n ,
2
with 0 < ε < 1/2.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 18
Contents
18.1 Barrier methods . . . . . . . . . . . . . . . . . . . . . . . . 415
18.2 Linear optimization . . . . . . . . . . . . . . . . . . . . . . 422
18.3 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
and we assume that it is not empty. Note that the points in S are not interior points
of the set F (in the sense of Definition 1.15). They are interior within the set X, with
respect to the constraint g(x) ≤ 0.
We assume that
• S 6= ∅,
• any feasible point can be arbitrarily well approximated by an interior point, i.e.,
for any x ∈ F and any ε > 0, there exists ex ∈ S such that
e
x − x ≤ ε.
If X is a convex set and g is a convex function, this hypothesis is always satisfied.
e
x − x ≤ ε.
The interior point methods employ functions known as barrier functions in order
to force the algorithms to remain in S. A barrier function is defined on S and is going
to infinity as x approaches the border of the set.
Example 18.3 (Barrier function). The most used barrier functions are the logarith-
mic function
m
X
B(x) = − ln −gj (x) (18.5)
j=1
A barrier method consists in combining the objective function of the problem with
the barrier function and progressively decreasing the height of the latter. We define
a set of parameters εk k such that
• 0 < εk+1 < εk , k = 0, 1, . . .,
• limk εk = 0.
At each iteration, the following problem is solved:
At first glance, this technique seems ineffective. In fact, we need to solve a non linear
constrained problem at each iteration. However, the structure of this problem, and
418 Barrier methods
30
25 ε = 100
20
εB(x)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
15 ε = 10
10
5
ε=1
0
1 1.5 2 2.5 3
x
300
250 ε = 100
200
εB(x)
150
100
50 ε = 10
0 ε =1
1 1.5 2 2.5 3
x
especially the presence of the barrier function, enable us to employ effective methods.
For instance, if X = Rn , the problem to solve is written as
the barrier. If it is reduced too fast, an unconstrained algorithm (or an algorithm for
convex constraints) may generate a point outside of S. Good interior point methods
are based on a reduction of εk that is neither too large, to avoid generating infeasible
iterates, nor too small, to avoid a slow convergence of the method.
Example 18.4 (Barrier method). Consider the problem
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 2
min f(x) = (x + x22 )
2 1
with the constraint
x1 ≥ 2 ,
T
for which the optimal solution is x∗ = 2 0 . By taking the logarithmic barrier,
(18.7) is written as
1 2
xk ∈ argminx1 >2 (x + x22 ) − εk ln(x1 − 2) . (18.9)
2 1
We zero the gradient of the objective function
εk
x1 −
x1 − 2 = 0 .
x2
Only the first value is feasible. The second component is zero if x2 = 0. Therefore,
the minimum is unique and we obtain
√ !
1 + 1 + εk
xk = .
0
The function to minimize in (18.9) is shown in Figure 18.3 for ε = 0.3. We can follow
the evolution of the level curves of this function for different values of ε, as well as
the value of the first component of xk :
ε (xk )1 Figure
0.300 2.140175425 18.4(a)
0.150 2.072380529 18.4(b)
0.095 2.046422477 18.4(c)
0.030 2.014889157 18.4(d)
0.003 2.001498877 18.4(e)
0.000 2.000000000 18.4(f)
420 Barrier methods
5
4.5
4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
3.5
3
2.5
2 1
0.5
2.2 0
x1 2.4 -0.5 x2
-1
ke
x − xk ≤ ε .
Consider the set xk k
such that
min f(x)
subject to
x∈F.
Interior point methods 421
1 1
0.5 0.5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0 x2 0 x2
-0.5 -0.5
-1 -1
2 2.1 2.2 2.3 2 2.1 2.2 2.3
x1 x1
(a) ε = 0.3 (b) ε = 0.15
1 1
0.5 0.5
0 x2 0 x2
-0.5 -0.5
-1 -1
2 2.1 2.2 2.3 2 2.1 2.2 2.3
x1 x1
(c) ε = 0.095 (d) ε = 0.03
1 1
0.5 0.5
0 x2 0 x2
-0.5 -0.5
-1 -1
2 2.1 2.2 2.3 2 2.1 2.2 2.3
x1 x1
(e) ε = 0.003 (f) ε = 0
Proof. Let x̄ be the limit of a convergent subsequence xk and then a limit point
k∈K
of the sequence xk k . If x̄ ∈ S, then B(x̄) < ∞ and
lim εk B(xk ) = 0 .
k∈K
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Then,
lim inf f(xk ) + εk B(xk ) = f(x̄) + lim inf εk B(xk ) ≥ f(x̄) .
k∈K k∈K
When k → ∞, k ∈ K, we obtain
When ε tends toward infinity, the objective function cT x plays no role and only
the barrier on the constraints is minimized. We then obtain a point x∞ called the
analytical center of the constraint polyhedron.
subject to
x1 + x2 + x3 = 1
xi ≥ 0 , i = 1, 2, 3 .
x∞ = argminx>0 − ln x1 − ln x2 − ln(1 − x1 − x2 ) .
which is zero at x1 = 1/3 and x2 = 1/3. Since x3 = 1−x1 −x2 , we also have x3 = 1/3.
Since all the components are positive, we have an analytical center. It is shown in
Figure 18.5.
Then, from Theorem 18.5, when ε decreases towards 0, the point xε approaches
the optimal solution to the linear problem. The trajectory followed by point xε is
called a central path. We note that this concept is used in the following in a broader
context, involving dual problems. Therefore, we call it here the primal central path.
For Example 18.7, the primal central path is shown in Figure 18.6.
424 Linear optimization
x3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x∞
x2
x1
x3
•x∞
x2
•x∗
x1
min cT x
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ax = b
x ≥ 0.
The primal central path is the curve described by
n
X
T
xε = argminx∈S c x − ε ln xi (18.13)
i=1
and parameterized by ε ≥ 0.
Ax − b = 0 primal constraint
x≥0 primal constraint
T
A λ+µ−c=0 dual constraint (Eq. (6.162))
µ≥0 dual constraint (Eq. (6.162))
xi µi = 0 complementarity constraint (Eq. (6.163)) .
T
If we denote e = 1 1 ... 1 and
x1 0 ··· 0 0 µ1 0 · · · 0 0
0 x2 · · · 0 0 0 µ2 · · · 0 0
.. . .
X= . , S= . , (18.14)
0 0 · · · xn−1 0 0 0 · · · µn−1 0
0 0 ··· 0 xn 0 0 · · · 0 µn
426 Linear optimization
we obtain
Ax − b = 0
T
A λ+µ−c=0
XSe = 0 (18.15)
x≥0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
µ ≥ 0.
We now write the optimality conditions for the problem
n
X
min cT x − ε ln xi
i=1
subject to
Ax = b
x ≥ 0.
The Lagrangian is
n
X
L(x, λ, µ) = cT x − ε ln xi + λT (Ax − b) − µT x .
i=1
We note the similarities between the optimality conditions for the original problem
(18.15) and those of the barrier problem (18.19). The conditions are the same, except
for the third one, where the right hand side is εe instead of 0. In the following, we
abandon the notation µ̄ and S̄ and use µ and S.
We can thus characterize the optimal solution to the barrier problem which uses
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
dual variables. We consider the primal and dual variables together and work in the
space Rn+m+n with the variables (x, λ, µ). In this space, the feasible set is
F = (x, λ, µ) | Ax = b , AT λ + µ = c , x ≥ 0 , µ ≥ 0 (18.20)
and the set of interior points is
S = (x, λ, µ) | Ax = b , AT λ + µ = c , x > 0 , µ > 0 , (18.21)
again assumed to be non empty. The central path concept is also extended.
min cT x
subject to
Ax = b
x ≥ 0.
The primal-dual central path is the curve described by (xε , λε , µε ) with ε ≥ 0, where
(xε , λε , µε ) solves (18.19), that is such that
Axε − b = 0
T
A λε + µε − c = 0
Xε Sε e = εe
xε ≥ 0
µε ≥ 0 .
Some elements of the primal-dual central path for Example 18.7 are listed in Table
18.1.
The system (18.19) includes two sets of linear equations, a set of slightly non
linear equations (XSe = εe), and two sets of inequations. Based on the same idea as
Dikin’s method (Algorithm 17.3), we proceed in the following manner:
1. Consider only the iterates in S.
2. Ignore the inequalities and apply (partially) Newton’s method (Algorithm 7.3) to
the following system of equations, in order to identify a direction for the algorithm
to follow.
Ax − b
F(x, λ, µ) = AT λ + µ − c = 0 . (18.22)
XSe − εe
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 428
Table 18.1: Elements of the primal-dual central path for Example 18.7
ε x1 x2 x3 µ1 µ2 µ3 λ
10000 3.3335e-01 3.3333e-01 3.3332e-01 2.9999e+04 3.0000e+04 3.0001e+04 -2.9998e+04
1000 3.3344e-01 3.3333e-01 3.3322e-01 2.9990e+03 3.0000e+03 3.0010e+03 -2.9980e+03
100 3.3445e-01 3.3333e-01 3.3222e-01 2.9900e+02 3.0000e+02 3.0100e+02 -2.9800e+02
10 3.4457e-01 3.3309e-01 3.2235e-01 2.9022e+01 3.0022e+01 3.1022e+01 -2.8022e+01
1 4.5157e-01 3.1118e-01 2.3724e-01 2.2146e+00 3.2149e+00 4.2147e+00 -1.2146e+00
0.1 8.6295e-01 8.9598e-02 4.7454e-02 1.1585e-01 1.1156e+00 2.1158e+00 8.8426e-01
Linear optimization
3. Calculate the step along the direction such that no iterate leaves S.
The Jacobian matrix of the system (18.22) is
A 0 0
J(x, λ, µ) = ∇F(x, λ, µ)T = 0 AT I .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
S 0 X
Therefore, the Newton equations (7.16) for an iterate (x, λ, µ) are written as
A 0 0 dx 0
0 AT I dλ = 0 (18.24)
S 0 X dµ −XSe + εe
and an iteration consists in
x+ x dx
λ+ = λ + α dλ , (18.25)
µ+ µ dµ
T
where 0 < α ≤ 1 is chosen such that x+ , λ+ , µ+ ∈ S.
For a given value of ε, i.e., for a given barrier height, the Newton iterations can
be applied until convergence. In this case, we identify the (primal-dual) central path
element corresponding to this value of ε.
We can thus present a generic primal-dual algorithm of interior points to solve a
linear optimization problem: Algorithm 18.1.
For the algorithm to be well defined, we need to specify two more things:
1. the calculation of the step αk (step 16) and
2. the handling of the barrier height εk (step 17).
These two things are actually closely related, as explained below. But first, we an-
alyze the stopping criterion and the distance to the central path. The necessary
and sufficient condition for (xk , λk , µk ) to be an optimal solution to the initial prob-
lem is that it solves the system (18.15). As all the iterates are in S, Axk − b = 0,
AT λk + µk − c = 0, xk > 0, µk > 0 for any k. Therefore, the algorithm identifies an
optimal solution when xk i µk i = 0, for i = 1, . . . , n. The stopping criterion is in
a sense based on the average distance to optimality
n
1X 1
νk = xk i µk i = xTk µk ,
n n
i=1
as every term is positive (as all the iterates are in the interior set S), and zero at the
optimal solution. We call this quantity the duality measure.
430 Linear optimization
min cT x subject to Ax = b , x ≥ 0 .
x∈Rn
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 An initial feasible solution (x0 , λ0 , µ0 )T such that Ax0 = b, AT λ0 + µ0 = c,
x0 > 0 and µ0 > 0.
8 An initial value for the height of the barrier ε0 > 0.
9 The required precision ε̄ ∈ R.
10 Output
11 An approximation of the optimal solution x∗ .
12 Initialization
13 k := 0.
14 Repeat
15 Calculate (dx , dλ , dµ ) by solving
A 0 0 dx 0
0 AT I dλ = 0 , (18.26)
Sk 0 Xk dµ −Xk Sk e + εk e
In order to discuss the choice of the barrier parameter ε, we note that it is wise
to have high barriers when we are far from the optimal solution, while they should
be lower when we are close to it. It is appropriate to define the height of the barrier
as a function of the duality measure, used as a stopping criterion in the algorithm.
Then, we define
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
ε = σν , (18.28)
Example 18.10 (Centering parameter). Consider Example 18.7 again and calculate
the direction (dx , dλ , dµ ) in several points, with two values for σ. For each point, the
values of the dual variables are λ = 0 and µ = c.
The results are presented in Tables 18.2, 18.3, and 18.4, and illustrated in Figures
18.9, 18.7, and 18.8. The case presented in Figure 18.8 illustrates particularly well the
difference between the two extreme values of the σ parameter. While the direction
generated with σ = 0 points more or less in the direction of the optimal solution of
the problem, the direction generated with σ = 1 points toward the central path.
T
Table 18.2: Primal-dual directions at x0 = 0.6 0.2 0.2
ν = 0.53333
σ=1 σ=0
dx dµ dλ dx dµ dλ
-0.049275 -0.028986 0.069739 -0.498138
0.069565 -0.028986 0.028986 -0.026567 -0.498138 0.498138
-0.020290 -0.028986 -0.043172 -0.498138
432 Linear optimization
T
Table 18.3: Primal-dual directions at x0 = 0.2 0.6 0.2
ν = 0.66667
σ=1 σ=0
dx dµ dλ dx dµ dλ
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
T
Table 18.4: Primal-dual directions at x0 = 0.2 0.2 0.6
ν = 0.8
σ=1 σ=0
dx dµ dλ dx dµ dλ
0.208312 0.470382 0.2 -2
0.053758 0.470382 -0.470382 0.2 -2
-0.262070 0.470382 0 -2
2 -0.2 -2
x3 σ=1
0
σ=0
0
x1
0
x2 1 1
T
Figure 18.7: Newton directions for the point 0.2 0.6 0.2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Interior point methods 433
x3 σ=1
σ=0 0
0
x1
0
x2 1 1
T
Figure 18.8: Newton directions for the point 0.2 0.2 0.6
1
σ=1
x3
0
0
σ=0
x1
0
x2 1 1
T
Figure 18.9: Newton directions for the point 0.6 0.2 0.2
434 Linear optimization
In order to “follow” the central path, the algorithm needs a measure of the distance
from one iterate to the path. For ε > 0, the point on the central path corresponding
to ε is such that each product xi µi is equal to the barrier parameter, i.e., that x1 µ1 =
x2 µ2 = . . . = xn µn = ε (see Eq. (18.19)). Therefore, an indicator of the proximity to
the central path is the difference between each individual product and their average
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
value ν:
x1 µ1 ν
1 .. .. 1
. − . = XSe − νe , (18.29)
ν ν
xn µn ν
1
V2 (θ) = (x, λ, µ) ∈ S XSe − νe 2
≤θ , (18.30)
ν
We can define a large neighborhood using the norm ∞. In this case, we obtain
It is possible to extend this interval even further, in order to give the algorithms more
flexibility. Indeed, the fact that the product xi µi takes large values is not important.
However, we wish to avoid too small values of these products in relation to their
average value ν and that xi and µi approach 0 too rapidly. Indeed, it this case, the
iterate would be too close to the constraints, and the algorithm would not benefit from
being in the interior anymore. We define a large neighborhood ignoring the upper
bound and defining γ = 1 − θ. As θ is between 0 and 1, so is γ. The designation
V−∞ is used here to highlight the fact that, contrary to V∞ , only the lower bound is
taken into account.
Interior point methods 435
Definition 18.12 (Large neighborhood of the central path). Consider the linear
problem
min cT x
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ax = b
x ≥ 0.
The γ-large neighborhood of the primal-dual central path is the set
V−∞ (γ) = (x, λ, µ) ∈ S | xi µi ≥ γν , i = 1, . . . , n , (18.31)
where S is the set of primal-dual interior points (18.21) and 0 < γ < 1.
Many variants of this algorithm have been proposed in the literature. We present
here three algorithms that follow the primal-dual central path, using different strate-
gies.
• the prediction step investigates where the optimal solution can be, by setting
the centering parameter σ to 0. Still, the step length is calculated so that the
next iterate lies in the restricted neighborhood of the central path;
• the correction step is an iteration of the restricted step algorithm (Algo-
rithm 18.2), that focuses on moving the iterations back toward the central
path using the value σ = 1 for the centering parameter.
Long step algorithm This algorithm fixes the centering parameter to an interme-
diary value (not 0, not 1) and selects the step αk in Algorithm 18.1 so that each
iterate is situated in the large neighborhood of the central path.
The theoretical foundation of these algorithms is technical and beyond the scope
of this book. We refer the interested reader to the excellent presentation proposed by
Wright (1997). We present an illustration of these algorithms on Example 18.7. On
such small examples, the interior point methods are definitely not efficient. But the
iterations can be represented on a figure, in order to have some insight on their general
behavior. Comparing the three versions, the flexibility of the long step algorithm
seems to pay off on this example. Although it cannot be formally generalized, it is
the version that should be preferred in general.
436 Linear optimization
min cT x subject to Ax = b , x ≥ 0 .
x∈Rn
3 Input
4 The matrix A ∈ Rm×n .
5 The vector b ∈ Rm .
6 The vector c ∈ Rn .
7 θ = 0.4.
8 An initial feasible solution (x0 , λ0 , µ0 ) ∈ V2 (θ).
√
9 σ = 1 − θ/ n.
10 The required precision ε̄ ∈ R.
11 Output
12 An approximation of the optimal solution (x∗ , λ∗ , µ∗ ).
13 Initialization
14 k := 0.
15 Repeat
1 T
16 νk = x µk .
n k
17 Calculate (dx , dλ , dµ )T by solving
A 0 0 dx 0
0 AT I dλ = 0 , (18.32)
Sk 0 Xk dµ −Xk Sk e + νk σe
3 Input
4 A ∈ Rm×n , b ∈ Rm , c ∈ Rn .
5 θpred = 0.5, θcorr = 0.25.
6 An initial feasible solution (x0 , λ0 , µ0 ) ∈ V2 (θcorr ).
7 The required precision ε̄ ∈ R.
8 Output
9 An approximation of the optimal solution (x∗ , λ∗ , µ∗ ).
10 Initialization
11 k := 0.
12 Repeat
13 Prediction: σk = 0, no barrier.
1
14 νk = xTk µk .
n
15 Calculate (dx , dλ , dµ )T by solving
A 0 0 dx 0
0 AT I dλ = 0 ,
Sk 0 Xk dµ −Xk Sk e
Example 18.13 (Restricted step algorithm). Consider Example 18.7 again and apply
T
Algorithm 18.2 from the starting point x = 0.6 0.2 02 , λ = 0 and µ = c. A
few iterations are listed in Table 18.5. We observe how slow the method is, due to its
inability to take large steps.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 18.5: Iterations for the interior point algorithm with restricted steps (Algorithm
18.2) for Example 18.7
k Xk Sk e − νk e 2 /νk kdk k νk
0 3.061862e-01 5.333333e-01
1 4.433431e-02 6.494725e-01 4.101653e-01
2 3.892141e-02 4.203992e-01 3.154417e-01
3 3.940146e-02 2.830158e-01 2.425935e-01
4 3.305109e-02 1.976729e-01 1.865690e-01
5 2.615063e-02 1.416567e-01 1.434827e-01
..
.
20 4.730746e-04 2.303030e-03 2.793843e-03
21 3.635129e-04 1.770192e-03 2.148633e-03
22 2.793793e-04 1.360809e-03 1.652427e-03
23 2.147504e-04 1.046205e-03 1.270815e-03
24 1.650912e-04 8.043948e-04 9.773332e-04
25 1.269267e-04 6.185101e-04 7.516277e-04
..
.
35 9.178012e-06 4.473980e-05 5.440069e-05
36 7.058322e-06 3.440722e-05 4.183739e-05
37 5.428202e-06 2.646100e-05 3.217546e-05
38 4.174570e-06 2.034997e-05 2.474486e-05
39 3.210470e-06 1.565027e-05 1.903028e-05
..
.
55 4.807511e-08 2.343568e-07 2.849756e-07
56 3.697263e-08 1.802344e-07 2.191633e-07
57 2.843417e-08 1.386111e-07 1.685497e-07
58 2.186758e-08 1.066002e-07 1.296248e-07
59 1.681748e-08 8.198194e-08 9.968925e-08
Interior point methods 439
the iterates further from the central path, which requires a correction iteration.
1
T
The starting point x = 0.6 0.2 0.2 , used in the previous example, does not belong to
V2 (0.25).
440 Linear optimization
Example 18.15 (Long step algorithm). Consider Example 18.7 again and apply
T
Algorithm 18.4 from the starting point x = 0.6 0.2 0.2 , λ = 0 and µ = c.
The iterations are listed in Table 18.7 and illustrated in Figures 18.10, 18.11 and
18.12. This algorithm clearly performs better than the two others on this example.
The fact that it only loosely follows the central path provides it with more flexibility
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 18.7: Iterations of the long step interior point algorithm (Algorithm 18.4) for
Example 18.7
k (maxi=1,...,n µi xi )/νk kαdk k νk α
0 1.125000e+00 5.333333e-01
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x3
•x∞
x2
•
x1
Figure 18.10: Iterations of the long step interior point algorithm (Algorithm 18.4) for
Example 18.7
442 Linear optimization
x3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
•x∞
x2
•
x1
Figure 18.11: Iterations of the long step interior point algorithm (Algorithm 18.4) for
T
Example 18.7, with x0 = 0.1 0.1 0.8
x3
•x∞
x2
•
x1
Figure 18.12: Iterations of the long step interior point algorithm (Algorithm 18.4) for
T
Example 18.7, with x0 = 0.1 0.8 0.1
Interior point methods 443
techniques in the context of interior point methods). Note that some implementations
do not require beginning with a feasible starting point. These so called infeasible
interior point methods are more complex, but may be quite effective in practice (see
for instance Zhang, 1994).
18.3 Project
The general organization of the projects is described in Appendix D.
Objective
The aim of this project is to implement interior point algorithms and compare them
with the simplex method (Chapter 16) and Dikin’s method (Section 17.3).
Approach
Apply the algorithms to the problems described below, for different values of n. Cau-
tion! If the starting point is not in the neighborhood corresponding to the algorithm,
first apply centering iterations (σ = 1) to obtain a point in the neighborhood.
The following variations of the algorithms can be tested.
Algorithm 18.2. Vary the value of θ = 0.1, 0.4, 0.8.
Algorithm 18.3. θpred = 0.1, 0.5, 0.9 and θcorr = θpred /2.
Algorithm 18.4. γ = 10−5 , 10−3 , 1, σ = 0.1, 0.5, 0.9.
Algorithms
Problems
n
X
min − 2n−i xi
i=1
444 Project
subject to
x1 ≤5
4x1 + x2 ≤ 25
8x1 + 4x2 + x3 ≤ 125
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
..
.
2n x1 + 2n−1 x2 + · · · + 4xn−1 + xn ≤ 5n
x1 , x2 , . . . , xn ≥ 0 .
T
Use the starting point 1 1 ... 1 . The optimal solution to this problem is
T
0 0 . . . 0 5n .
Exercise 18.2. The problem
min −xn
subject to
ε ≤ x1 ≤ 1
εxi−1 ≤ xi ≤ 1 − εxi−1 , i = 2, . . . , n ,
where 0 < ε < 1/2. Use the starting point
1+ε
x1 =
2
1
xi = , i = 2, . . . , n .
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 19
Contents
19.1 Lagrangian penalty . . . . . . . . . . . . . . . . . . . . . . 447
19.2 Quadratic penalty . . . . . . . . . . . . . . . . . . . . . . . 449
19.3 Double penalty . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.4 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
In this chapter, and in the next, we consider the optimization problem (1.71)–(1.72),
i.e.,
minn f(x) (19.1)
x∈R
subject to
h(x) = 0 , (19.2)
gi (x) ≤ 0
446
gi (x) + z2i = 0 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and
m
X
∇2xx Lc (x, λ) 2
= ∇ f(x) + λi ∇2 hi (x)
i=1
m
(19.5)
X
T 2
+ c∇h(x)∇h(x) + c hi (x)∇ hi (x) .
i=1
and (6.116)
yT ∇2xx L(x∗ , λ∗ )y > 0 , ∀y ∈ D(x∗ ) , y 6= 0,
where D(x∗ ) is the linearized cone in x∗ (Definition 3.23), then x∗ is a strict local
minimum of the problem
minn Lc (x, λ∗ ) (19.6)
x∈R
x= c−1
0
448 Lagrangian penalty
and
c−1 0
∇2xx Lc (x, λ) = . (19.7)
0 1
We immediately note that x is not defined if c = 1. Moreover, if c < 1, the second
derivatives matrix is not positive semidefinite, the necessary optimality conditions are
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
not satisfied and the point x is not a local minimum of the augmented Lagrangian. If
c > 1, then x is a strict local minimum of the augmented Lagrangian. Now, consider
λ = λ∗ = 1. For any c 6= 1, we get
c − λ∗ c − 1
1
x= c−1 = c−1 = = x∗ .
0
0 0
This illustrates that if the optimal value of the dual variable λ∗ is known, and if the
parameter c is large enough, minimizing the augmented Lagrangian identifies also a
local minimum of the constrained problem. The constrained problem is represented in
Figure 19.1(a). Figures 19.1(b) and 19.2(b) display the level curves of the augmented
Lagrangian (with λ = λ∗ ) for values of c above 1. We note that the minimum without
constraint is x∗ . However, when c < 1 (Figure 19.2(a)), x∗ is a saddle point of the
augmented Lagrangian and not a minimum.
2 2
1.5 1.5
1 1
0.5 0.5
x∗• 0 x2 x∗• 0 x2
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
-1 -0.5 0 0.5 1 1.5 2 2.5 3 -1 -0.5 0 0.5 1 1.5 2 2.5 3
x1 x1
(a) Constrained problem (b) Augmented Lagrangian with c = 2
2 2
1.5 1.5
1 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.5 0.5
x∗• 0 x2 x∗• 0 x2
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
-1 -0.5 0 0.5 1 1.5 2 2.5 3 -1 -0.5 0 0.5 1 1.5 2 2.5 3
x1 x1
(a) Augmented Lagrangian with c = 1/2 (b) Augmented Lagrangian with c = 10
x = c−1 .
0
T
When c tends toward infinity, x tends toward x∗ = 1 0 , and this regardless of
the value of λ. The level curves for several values of c are presented in Figure 19.3.
A possible algorithm would consist in solving a sequence of unconstrained prob-
lems
xk ∈ argminx∈Rn Lck (x, λ) , (19.8)
where λ is given and ck is a sequence of real numbers such that limk→∞ ck = +∞.
In general, the final solution to the problem at step k serves as the starting point
for the calculation of the optimal solution in step k + 1. Note that if several minima
belongs argminx∈Rn Lck (x, λ), we consider only one, that is the solution produced by
the considered unconstrained optimization algorithm.
Such an algorithm would work regardless of the value of λ (this is proved be-
low). Unfortunately, the unconstrained minimization problem becomes increasingly
ill-conditioned as ck increases. This can be seen in Example 19.1. Indeed, the level
curves become increasingly stretched (Figure 19.3(d)).
450 Double penalty
2 2
1.5 1.5
1 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.5 0.5
x∗• + 0 x2 x∗• + 0 x2
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
-1 -0.5 0 0.5 1 1.5 2 2.5 3 -1 -0.5 0 0.5 1 1.5 2 2.5 3
x1 x1
(a) Augmented Lagrangian with c = 2 (b) Augmented Lagrangian with c = 5
2 2
1.5 1.5
1 1
0.5 0.5
x∗•+ 0 x2 x∗+
• 0 x2
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
-1 -0.5 0 0.5 1 1.5 2 2.5 3 -1 -0.5 0 0.5 1 1.5 2 2.5 3
x1 x1
(c) Augmented Lagrangian with c = 10 (d) Augmented Lagrangian with c = 100
We can also see that one of the eigenvalues of the Hessian matrix (19.7) is c−1, which
tends toward infinity with c. This situation causes significant numerical difficulties
for solving the unconstrained problems. Therefore, it is necessary to combine the two
types of penalties in order to obtain an efficient algorithm.
obtained by solving (19.8), is reproduced for various values of c and λ. Clearly, when
c is increased, the value tends faster toward 1 when λ is close to λ∗ = 1.
It is therefore important to be able to obtain a good approximation of λ∗ . The
algorithm presented here is based not only on a sequence of penalty parameters ck k
∗
such that ck → ∞, but also on a set of vectors λk k approximating
λ . From a
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1.01
λ=0
1.008 λ = 0.2
λ = 0.4
1.006 λ = 0.6
(xk )1
λ = 0.8
1.004 λ=1
1.002
Proof. Let f∗ be the optimal value of the constrained problem and let k be arbitrary.
f∗ = min f(x)
h(x)=0, x∈X
ck 2
= min f(x) + λTk h(x) + h(x)
h(x)=0, x∈X 2
= min Lck (x, λk ) .
h(x)=0, x∈X
Since X is closed, x ∈ X | h(x) = 0 is non empty and f is continuous, f∗ is finite.
452 Double penalty
and this for all k. When k tends toward infinity, Lck (xk , λk ) is finite since this is also
the case for f∗ . Let
x̄ be a limit point of the sequence xk k and λ̄ a limit point of
the sequence λk k (it exists because the sequence is bounded). Then, when going
to the upper limit and taking into account the fact that the functions f and h are
continuous, we get
f(x̄) ≤ f∗ .
∗
h(x ) = 0 . (19.14)
Proof. We assume, without loss of generality, that the sequence xk k
converges to-
ward x∗ (by eliminating all terms such that k 6∈ K). We denote
ℓk = λk + ck h(xk ) . (19.15)
and −1
ℓk = ∇h(xk )T ∇h(xk ) ∇h(xk )T ∇x Lck (xk , λk ) − ∇f(xk ) .
According to (19.11), since εk → 0, we have ∇x Lck (xk , λk ) → 0. When k tends
toward infinity, we obtain
−1
λ∗ = lim ℓk = − ∇h(x∗ )T ∇h(x∗ ) ∇h(x∗ )T ∇f(x∗ ) .
k→∞
h(x∗ ) = 0 .
The arguments used in this proof are similar to those used to prove Theorem 6.10.
This result enables us to define the sequence λk k as follows:
3 Input
4 The twice differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 The Hessian of the function ∇2 f : Rn → Rn×n .
7 The twice differentiable constraint h : Rn → Rm .
8 The gradient matrix of the constraint ∇h : Rn → Rn×m .
9 The Hessian ∇2 hi : Rn → Rn×n of each constraint i = 1, . . . , m.
10 An initial feasible solution (x0 , λ0 ).
11 An initial penalty parameter c0 (by default c0 = 10).
12 The required precision ε > 0.
13 Output
14 An approximation of the optimal solution (x∗ , λ∗ ).
15 Initialization
16 k := 0.
17 b
η0 := 0.1258925. Value chosen so that η0 = 0.1.
18 τ := 10.
19 α := 0.1.
20 β := 0.9.
21 εk := 1/c0 .
22 ηk := bη0 /cα
0.
23 Repeat
24 Use Newton’s method with line search (Algorithm 11.8) or with trust
region (Algorithm 12.4) to solve
ck 2
xk+1 ∈ argminx∈Rn Lck (x, λk ) = f(x) + λk h(x) + h(x) , (19.18)
2
Example 19.4 (Lagrangian penalty – cont.). Consider Example 19.1 again and apply
the update (19.17) to obtain
ck − λk −λk + ck
λk+1 = λk + ck −1 = .
ck − 1 ck − 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
x21 + x22 = 1
shown in Figure 19.5. Table 19.1 lists the values of the iterates, as well as the norm of
the gradient of the Lagrangian. Table 19.2 lists the values of ck , ∇x Lck (xk , λk ) , εk ,
h(xk ) and ηk during the iterations. The last column gives the number of iterations
required to solve the problem (19.18). We can see that the penalty parameter is
increased during the first iteration, because the constraint satisfaction was insufficient
( h(xk ) = 1.45292e-01, while ηk = 1e-01).
At the subsequent iterations, the value of the multiplier λk has been updated. T
The path of the algorithm is presented in solid lines starting from x0 = −1 0.1
T
and in dashed lines starting from x̄0 = 0 −0.1 , in Figure 19.6. It is interesting
to note the way it approximately “follows” the constraint. Figure 19.7 shows the
evolution of the
T level curves of the augmented Lagrangian around the optimal solution
x∗ = 1 0 during the 4 first iterations.
456 Double penalty
0.5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0 x2
-0.5
-1
-1 -0.5 0 0.5 1
x1
(a) Level curves
4
3
2
1
0
-1
-2
1
-1 0 x2
x1 0 -1
1
(b) Function
Table 19.1: Iterates of the augmented Lagrangian method for Example 19.5
k x1 x2 λ ∇x L(xk , λk ) h(xk )
0 -1.00000e+00 1.00000e-01 0.00000e+00 5.01597e+00 1.00000e-02
1 9.24487e-01 5.51255e-03 0.00000e+00 2.69804e+00 1.45292e-01
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 19.2: Iterates of the augmented Lagrangian method for Example 19.5 (cont.)
k ck ∇x Lck (xk , λk ) εk h(xk ) ηk
1 10 1.30108e-02 1e-01 1.45292e-01 1.00000e-01 15
2 100 1.07375e-04 1e-02 1.49616e-02 7.94328e-02 8
3 100 5.44820e-07 1e-04 3.82637e-05 1.25892e-03 4
4 100 2.18509e-07 1e-06 9.70011e-08 1.99526e-05 1
5 100 1.36628e-12 1e-08 1.33171e-09 3.16228e-07 1
6 100 1.33227e-15 1e-10 3.32778e-12 5.01187e-09 1
x̄0
x0
x∗
x2 x2
x∗ x∗
x1 x1
x2 x2
x∗ x∗
x1 x1
Figure 19.7: Level curves for the augmented Lagrangian for Example 19.5
subject to
1
x1 − x22 −
= 0,
2
shown in Figure 19.8. The iterations are listed in Table 19.3 and the evolution of the
parameters in Table 19.4.
Augmented Lagrangian method 459
1
0.8
x∗ 0.6
0.4
0.2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
x0
-0.2
-0.4
-1.5 -1 -0.5 0 0.5 1 1.5
Table 19.3: Iterates of the augmented Lagrangian method for Example 19.6
k x1 x2 λ ∇x L(xk , λk ) h(xk )
0 -1.00000e+00 0.00000e+00 0.00000e+00 4.50795e+02 1.50000e+00
1 7.56394e-01 5.68279e-01 -6.65475e-01 1.90681e-02 6.65475e-02
2 7.23548e-01 5.17764e-01 -6.65475e-01 6.43621e-01 4.45321e-02
3 6.80054e-01 4.49567e-01 -2.87105e+00 1.41250e-04 2.20558e-02
4 6.69717e-01 4.29750e-01 -2.87105e+00 1.97370e+00 1.49681e-02
5 6.64093e-01 4.10635e-01 -7.39946e+00 1.78647e-04 4.52841e-03
6 6.63957e-01 4.06281e-01 -7.39946e+00 1.42593e+00 1.10665e-03
7 6.64017e-01 4.05166e-01 -8.82418e+00 1.44475e-08 1.42472e-04
8 6.64029e-01 4.05011e-01 -8.86988e+00 7.57362e-13 4.56917e-06
Table 19.4: Iterates of the augmented Lagrangian method for Example 19.6 cont.
k ck ∇x Lck (xk , λk ) εk h(xk ) ηk
1 10 1.90681e-02 1e-01 6.65475e-02 1.00000e-01 11
2 10 2.74456e-03 1e-02 4.45321e-02 1.25892e-02 2
3 100 1.41250e-04 1e-02 2.20558e-02 7.94328e-02 3
4 100 2.61580e-05 1e-04 1.49681e-02 1.25892e-03 2
5 1000 1.78647e-04 1e-03 4.52841e-03 6.30957e-02 3
6 1000 1.30511e-08 1e-06 1.10665e-03 1.25892e-04 3
7 10000 1.44475e-08 1e-04 1.42472e-04 5.01187e-02 3
8 10000 7.57636e-13 1e-08 4.56917e-06 1.25892e-05 3
It appears that the algorithm quickly identifies the neighborhood of the optimal so-
lution, but that it cannot satisfy the constraint with high precision. It must thus
increase ck , which affects the conditioning of the problem. The close-packed level
curves of the augmented Lagrangian, shown in Figure 19.9(b), highlight this phe-
nomenon.
460 Project
1 1
0.8 0.8
0.6 0.6
x∗
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
∗
x 0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-1.5 -1 -0.5 0 0.5 1 1.5 -1.5 -1 -0.5 0 0.5 1 1.5
Figure 19.9: Level curves of the augmented Lagrangian for Example 19.6
The presentation of the proof for Theorems 19.2 and 19.3, as well as Example
19.1, was inspired by Bertsekas (1999).
19.4 Project
The general organization of the projects are described in Appendix D.
Objective
The aim of this project is to implement the augmented Lagrangian to solve various
problems and analyze the role of different parameters on its efficiency.
Approach
Analyze the impact of the following parameters.
1. Penalty parameter: utilize the initial values c0 = 1, 10, and 100 and the augmen-
tation rates τ = 1, 2, 10 and 100. Analyze the impact of the algorithm itself and
also on the behavior of the unconstrained algorithm used to solve the subproblem
of step 11.
2. Precision of the constraints: use the values β = 0.1, 0.5, and 0.9. Analyze the
impact on the approximation of the dual variables.
Algorithm
Algorithm 19.1.
Augmented Lagrangian method 461
Problems
Exercise 19.1. The problem
min ex1 −2x2
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
sin(−x1 + x2 − 1) = 0
−2 ≤ x1 ≤ 2
−1.5 ≤ x2 ≤ 1.5 .
Exercise 19.2. The problem
10 10
!!
X X
xi xk
min e ci + xi − ln e
x∈R10
i=1 k=1
subject to
with
c1 = −6.089 c6 = −14.986
c2 = −17.164 c7 = −24.1
c3 = −34.054 c8 = −10.708
c4 = −5.914 c9 = −26.662
c5 = −24.721 c10 = −22.179 .
Solution:
x∗1 = −3.40629 x∗6 = −4.44283
x∗2 = −0.596369 x∗7 = −1.41264
x∗3 = −1.1912 x∗8 = −21.6066
x∗4 = −4.62689 x∗9 = −2.26867
x∗5 = −1.0011 x∗10 = −1.40346 .
Proposed by Hock and Schittkowski (1981).
Exercise 19.3. The problem
subject to
2
1 + x21 + x22 = 4
−4 ≤ x1 ≤ 4
−4 ≤ x2 ≤ 4 .
Please note: do not forget to transform the formulation of the problems so that
they are compatible with (19.1)–(19.2).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 20
Sequential quadratic
programming
Contents
20.1 Local sequential quadratic programming . . . . . . . . . 464
20.2 Globally convergent algorithm . . . . . . . . . . . . . . . 471
20.3 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
subject to
h(x) = 0 , (20.2)
gi (x) ≤ 0
gi (x) + z2i = 0 .
The basic idea of the algorithm that we develop is simple. Just as for uncon-
strained optimization, the necessary optimality conditions (6.23) constitute a system
of non linear equations (Theorem 6.10). The methods presented in Chapters 7 and 8
are relevant in this context. We start by applying Newton’s local method.
464 Local sequential quadratic programming
∇L(x∗ , λ∗ ) = 0 ,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
with
L(x, λ) = f(x) + λT h(x) .
We have
∇f(x) + ∇h(x)λ ∇x L(x, λ)
∇L(x, λ) = = (20.3)
h(x) h(x)
m
X
2 2
∇ f(x) + λ i ∇ h i (x) ∇h(x)
∇2 L(x, λ) = i=1
∇h(x)T 0
!
∇2xx L(x, λ) ∇h(x)
= T
.
∇h(x) 0
We now simplify the formulation somewhat. By using (20.3), the Newton equa-
tions (20.4) can be written as
bλ = dλ + λk to obtain
Define d
bλ = −∇f(xk )
∇2xx L(xk , λk )dx + ∇h(xk )d (20.7)
T
∇h(xk ) dx = −h(xk ) . (20.8)
We are here also dealing with optimality conditions for a quadratic problem
1 T 2
min ∇f(xk )T d + d ∇xx L(xk , λk )d (20.9)
d 2
subject to
∇h(xk )T d + h(xk ) = 0 . (20.10)
According to Theorem 6.38, the optimal solution to this quadratic problem is
λ∗ = H−1 h(xk ) − ∇h(xk )T ∇2xx L(xk , λk )−1 ∇f(xk ) , (20.11)
min f(x) = x1 + x2
subject to
h(x) = x21 + (x2 − 1)2 − 1 = 0 .
The Lagrangian is
L(x, λ) = x1 + x2 + λx21 + λx22 − 2λx2 .
1 We refer the interested reader to more detailed discussion on SQP methods in the literature,
such as Gould and Toint (2000), and Gill and Wong (2012).
466 Local sequential quadratic programming
x∈Rn
3 Input
4 The twice differentiable function f : Rn → R.
5 The gradient of the function ∇f : Rn → Rn .
6 The Hessian of the function ∇2 f : Rn → Rn×n .
7 The differentiable constraint h : Rn → Rm .
8 The gradient matrix of the constraint ∇h : Rn → Rn×m .
9 The Hessian ∇2 hi : Rn → Rn×n of each constraint i = 1, . . . , m.
10 An initial solution (x0 , λ0 ).
11 The required precision ε > 0.
12 Output
13 An approximation of the optimal solution (x∗ , λ∗ ).
14 Initialization
15 k := 0.
16 Repeat
m
X
17 Calculate ∇2xx L(xk , λk ) = ∇2 f(xk ) + λk i ∇2 hi (xk ) .
i=1
18 Obtain dx and dλ by solving the quadratic problem
1
min ∇f(xk )T d + dT ∇2xx L(xk , λk )d
d 2
subject to
∇h(xk )T d + h(xk ) = 0 ,
with an appropriate algorithm. To illustrate the algorithm, we can use
(20.11) and (20.12).
19 xk+1 := xk + dx .
20 λk+1 := dλ .
21 k := k + 1.
22 Until ∇L(xk , λk ) ≤ ε.
Then,
1 + 2λx1
∇L(x, λ) = 1 + 2λx2 − 2λ
x21 + x22 − 2x2
2λ 0 2x1
∇2 L(x, λ) = 0 2λ 2x2 − λ .
2x1 2x2 − 2 0
Sequential quadratic programming 467
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2
2x1 d1 + (2x2 − 2) d2 + x21 + (x2 − 1) − 1 = 0 .
min f(x) = x1 + x2
subject to
h(x) = x21 + (x2 − 1)2 − 1 = 0 .
Figure 20.1 and Tables 20.1 and 20.2 demonstrate the application of the local SQP
algorithm to this problem. We note that the algorithm quickly finds an optimal
solution. It has the speed of convergence of Newton’s method. The algorithm also
suffers from the drawbacks of this method.
2 x0 2
1.5 1.5
1 1
0.5 0.5
x∗ x∗
0 0
-0.5 -0.5
x0 -1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
T T
(a) x0 = 1 − 1 (b) x0 = −3/2 2
Figure 20.1: Illustrations of the local SQP algorithm for Example 20.2
468 Local sequential quadratic programming
T
Table 20.1: Illustration of the local SQP algorithm for Example 20.2; x0 = 1 − 1
k x1 x2 λ ∇Lxx
0 1.00000e+00 -1.00000e+00 1.00000e+00 5.83095e+00
1 0.00000e+00 -5.00000e-01 5.00000e-01 1.67705e+00
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2 2
1.5 1.5
x0 1 x0 1
0.5 0.5
x∗ x∗
0 0
-0.5 -0.5
-1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
T T
(a) x0 = −0.1 1 (b) x0 = 0.1 1
Figure 20.2: Illustrations of the local SQP algorithm for Example 20.2
T
Table 20.2: Illustration of the local SQP algorithm for Example 20.2; x0 = −3/2 2
k x1 x2 λ ∇Lxx
0 -1.50000e+00 2.00000e+00 1.00000e+00 4.25000e+00
1 -1.36538e+00 1.07692e+00 4.23077e-01 1.38412e+00
2 -1.11784e+00 -1.85423e-01 4.42901e-01 1.65558e+00
3 -8.03520e-01 2.16153e-01 5.71828e-01 2.91415e-01
4 -7.09901e-01 2.86072e-01 6.88886e-01 3.05735e-02
5 -7.07179e-01 2.92927e-01 7.06965e-01 2.72185e-04
6 -7.07107e-01 2.92893e-01 7.07107e-01 2.34061e-08
Sequential quadratic programming 469
For instance, in the center of the circle of constraints, i.e., at the point (0, 1), the
matrix ∇h(x) is zero. Then, the matrix H in (20.11) is zero and consequently not
invertible. Note that, when we start the algorithm from a point close to (0, 1), it
has a tendency to take big steps (Figure 20.2(a) and Table 20.3). Finally, note that
there is no guarantee that a minimum can be found, as shown in Figure 20.2(b) and
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 20.4. Indeed, the only objective of the algorithm is to zero the gradient of the
Lagrangian.
T
Table 20.3: Illustration of the local SQP algorithm for Example 20.2; x0 = −0.1 1
k x1 x2 λ ∇Lxx
0 -1.00000e-01 1.00000e+00 1.00000e+00 1.61867e+00
1 -5.05000e+00 5.00000e-01 -4.45000e+01 4.53418e+02
2 -2.62404e+00 7.50317e-01 -2.12782e+01 1.13424e+02
3 -1.50286e+00 8.78262e-01 -8.90106e+00 2.79633e+01
4 -1.08612e+00 9.63643e-01 -2.13558e+00 5.75895e+00
5 -1.01047e+00 1.19247e+00 3.11609e-01 1.18100e+00
6 -1.33383e+00 -6.56144e-01 3.95100e-01 3.53584e+00
7 -9.63788e-01 1.09118e-01 4.84472e-01 7.38361e-01
8 -7.22734e-01 2.53867e-01 6.39958e-01 1.17880e-01
9 -7.08899e-01 2.93445e-01 7.04068e-01 5.65591e-03
10 -7.07103e-01 2.92887e-01 7.07103e-01 1.19518e-05
11 -7.07107e-01 2.92893e-01 7.07107e-01 7.90184e-11
T
Table 20.4: Illustration of the local SQP algorithm for Example 20.2; x0 = 0.1 1
k x1 x2 λ ∇Lxx
0 1.00000e-01 1.00000e+00 1.00000e+00 1.84935e+00
1 5.05000e+00 5.00000e-01 -5.45000e+01 5.52800e+02
2 2.62404e+00 7.50277e-01 -2.62802e+01 1.37776e+02
3 1.50282e+00 8.77817e-01 -1.14197e+01 3.35627e+01
4 1.08576e+00 9.59069e-01 -3.50192e+00 6.73105e+00
5 1.00831e+00 1.11015e+00 -7.10297e-01 9.48330e-01
6 9.26496e-01 1.72824e+00 -5.53513e-01 4.35129e-01
7 7.02912e-01 1.74580e+00 -6.73242e-01 7.35796e-02
8 7.08697e-01 1.70662e+00 -7.05786e-01 3.01674e-03
9 7.07106e-01 1.70711e+00 -7.07105e-01 5.18652e-06
10 7.07107e-01 1.70711e+00 -7.07107e-01 1.55080e-11
470 Local sequential quadratic programming
Example 20.3 (Local SQP algorithm – II). We apply the local SQP algorithm to
the problem in Example 19.5, i.e.,
min 2(x21 + x22 − 1) − x1
x∈R2
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x21 + x22 = 1
shown in Figure 19.5. The iterations are listed in Table 20.5 and presented in Fig-
ure 20.3(a). It is interesting to compare the iterations with those of the augmented
Lagrangian method (Figure 20.3(b)).
x0 x0
x∗ x∗
Figure 20.3: SQP and augmented Lagrangian: iterations for Example 20.3
T
Table 20.5: Illustration of the local SQP algorithm for Example 20.3; x0 = 0.5 1.3
k x1 x2 λ ∇Lxx
0 5.00000e-01 1.30000e+00 1.00000e+00 8.10701e+00
1 5.24055e-01 9.29210e-01 -1.14433e+00 1.59951e+00
2 9.35594e-01 6.22819e-01 -1.71786e+00 6.44709e-01
3 1.38229e+00 -2.59531e-01 -1.60029e+00 1.00534e+00
4 1.08314e+00 3.14974e-02 -1.55178e+00 1.78831e-01
5 1.00374e+00 -3.25035e-03 -1.50552e+00 1.09864e-02
6 1.00001e+00 3.61321e-05 -1.50003e+00 5.99917e-05
7 1.00000e+00 -1.92868e-09 -1.50000e+00 2.50640e-09
8 1.00000e+00 2.67876e-18 -1.50000e+00 2.67876e-18
We note that the latter attempts to follow the constraint, thereby requiring more
iterations. The SQP method is much faster in this case. However, let us keep in mind
that the local SQP method is not globally convergent.
Sequential quadratic programming 471
Example 20.4 (SQP with the constrained Rosenbrock problem). Consider again the
problem of Example 19.6, i.e.,
2 2
min 100 x2 − x21 + 1 − x1
x∈R2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
1
x1 − x22 −
= 0,
2
and use the SQP method to solve it. The iterations are listed in Table 20.6 and
illustrated in Figure 20.4.
T
Table 20.6: Illustration of the local SQP algorithm for Example 20.4; x0 = −1 0 ,
λ0 = 1
k x1 x2 λ ∇Lxx
0 -1.00000e+00 0.00000e+00 1.00000e+00 4.49901e+02
1 5.00000e-01 -2.02020e+00 -5.90919e+02 2.84494e+03
2 4.86136e-01 -1.00667e+00 -2.34944e+02 7.21646e+02
3 3.95205e-01 -4.51284e-01 -7.00969e+01 1.86409e+02
4 3.54255e-01 -6.41642e-02 -1.84751e+01 4.09255e+01
5 4.73514e-01 1.74309e-01 -1.30510e+01 7.15123e+00
6 5.71075e-01 2.91031e-01 -5.93423e+00 3.76956e+00
7 6.39843e-01 3.85770e-01 -4.56241e+00 1.42789e+00
8 6.76129e-01 4.21168e-01 -8.56764e+00 5.16695e-01
9 6.63972e-01 4.05248e-01 -8.74417e+00 5.46174e-02
10 6.64028e-01 4.05004e-01 -8.87130e+00 6.31475e-05
11 6.64029e-01 4.05006e-01 -8.87139e+00 7.79619e-10
12 6.64029e-01 4.05006e-01 -8.87139e+00 8.88178e-15
13 6.64029e-01 4.05006e-01 -8.87139e+00 0.00000e+00
•x
∗ 0.5
x0 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-0.5
-1
-1.5
-2
-1.5 -1 -0.5 0 0.5 1 1.5
value of the objective function in order to satisfy the constraints. To identify whether
an iterate is “significantly better,” we have to combine the two aspects in a function
called the merit function. This is similar to the idea developed in the context of the
augmented Lagrangian algorithm. It is referred to as exact if the optimal solution to
the constrained optimization problem (20.1)–(20.2) is a local minimum of the merit
function.
For the problem (20.1)-(20.2), the exact merit function that is used the most is
m
X
φc (x) = f(x) + c h(x) 1
= f(x) + c hi (x) . (20.13)
i=1
Proof. Take ε > 0 such that f(x∗ ) ≤ f(x) for all x such that h(x) = 0 and kx−x∗ k ≤ ε.
We define the following optimization problems:
Perturbed problem. Take δ ∈ Rm . The perturbed problem is
min f(x)
x∈Rn
subject to
h(x) = δ
kx − x∗ k ≤ ε ,
for which the optimal value is denoted by p(δ). According to the sensitivity theorem
(Theorem 6.24), we have
∇p(0) = −λ∗ . (20.15)
subject to
h(x) = δ
kx − x∗ k ≤ ε ,
for which the optimal value is denoted by pc (δ). We can also write the objective
function
m
X
minn f(x) + c |δi | .
x∈R
i=1
Pm
As c i=1 |δi | does not depend on x, the relaxed problem is equivalent to the per-
turbed problem, up to a shift of the objective function. Therefore,
m
X
pc (δ) = p(δ) + c |δi |. (20.16)
i=1
In particular, we have
pc (0) = p(0). (20.17)
474 Globally convergent algorithm
Auxiliary problem. Take c > 0 and ∆(ε) = δ | ∃x such that h(x) = δ and kx−x∗k <
ε . The auxiliary problem is
minm pc (δ)
δ∈R
subject to δ ∈ ∆(ε).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Then,
1 T 2 X
pc (δ) ≥ p(0) − δT λ∗ + δ ∇ p(ᾱδ)δ + δT λ∗ + γ |δi |
2
i
or
1 T 2 X
pc (δ) ≥ p(0) + δ ∇ p(ᾱδ)δ + γ |δi | .
2
i
P 1
We can make δ sufficiently close to 0, so that γ i |δi | dominates 2 δT ∇2 p(ᾱδ)δ, so
that
1 T 2 X
δ ∇ p(ᾱδ)δ + γ |δi | > 0,
2
i
and
pc (δ) > p(0).
We assume that δ 6= 0, but sufficiently close to 0, and x such that h(x) = δ (then,
x is infeasible for the initial problem) and satisfying kx − x∗ k < ε. Since pc (δ) is the
optimal value of the relaxed problem, we have
m
X
pc (δ) ≤ f(x) + c hi (x) .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
i=1
The level curves of the merit function for the problem in Example 20.3 are shown in
Figure 20.6. When c > |λ∗ | = 1.5, the minimum of the merit function corresponds to
T
the optimal solution of the initial problem x∗ = 1 0 .
In order to render Algorithm 20.1 globally convergent, we use the same ideas as
in the unconstrained case, where the merit function plays the role of the objective
function when the notion of “significantly better” is required. The line search methods
(Chapter 11) based on the Wolfe conditions and the trust region methods (Chapter
12) can be used in this context. We give a detailed description of the algorithm based
on line search.
The Wolfe conditions (11.45) and (11.47) should here be translated as
and
∇φc (xk + αk dk )T dk ≥ β2 ∇φc (xk )T dk
with 0 < β1 < β2 < 1. Unfortunately, the merit function (20.13) is not differentiable,
especially when x is feasible. It is not permitted to use ∇φc (xk ), which does not exist
everywhere. However, we do not need the gradient itself, but only the directional
derivative. And it is important that the latter is negative, in order for dk to be a
descent direction for the merit function.
476 Globally convergent algorithm
2 2
1.5 1.5
1 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.5 0.5
x∗ x∗
0 0
-0.5 xm -0.5
-1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
2 2
1.5 1.5
1 1
∗ 0.5 0.5
xxm x∗ = xm
0 0
-0.5 -0.5
-1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
2 2
1.5 1.5
1 1
0.5 0.5
x∗ = xm x∗ = xm
0 0
-0.5 -0.5
-1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
xm x∗ xm x∗
xm x∗ x∗ = xm
x∗ = xm x∗ = xm
Theorem 20.7 (Directional derivative of the merit function). Let dx and dλ satisfy
the conditions (20.7) and (20.8). Then, the directional derivative of φc in the
direction dx is
φc′ (xk ; dx ) = ∇f(xk )T dx − c h(xk ) 1 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Proof. According to Taylor’s theorem (Theorem C.2), there exist αf and αhi such
that
1
f(xk + αdx ) = f(xk ) + αdTx ∇f(xk ) + α2 dTx ∇2 f(xk + ααf d)dx
2
and, for all i = 1, . . . , m,
1 2 T 2
hi (xk + αdx ) = hi (xk ) + αdTx ∇hi (xk ) + α dx ∇ hi (x + ααhi d)dx .
2
Let M be an upper bound on the eigenvalues of ∇2 f(xk +ααf d) and ∇2 hi (x+ααhi d),
i = 1, . . . , m, such that
and
−Mkdx k2 ≤ dTx ∇2 hi (xk + ααhi d)dx ≤ Mkdx k2 . (20.20)
Then,
By using the lower bounds of (20.19) and (20.20) instead of the upper bounds, we
similarly obtain
φc (xk + αdx ) − φc (xk ) ≥ α ∇f(xk )T dx − c h(xk ) 1 − Mα2 kdx k2 .
Sequential quadratic programming 479
Therefore,
2
∇f(xk )T dx − c h(xk ) 1
− Mα dx
φc (xk + αdx ) − φc (xk )
≤
α
T 2
≤ ∇f(xk ) dx − c h(xk ) 1 + Mα dx .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
When α → 0, we obtain
∇f(xk )T dx
c> ,
h(xk ) 1
the direction dx is a descent direction for the merit function. Unfortunately, this
condition may generate large values for c. We perform a detailed analysis of this
directional derivative in order to find another value of c that ensures that dx is a
descent direction for φc .
Theorem 20.8 (Descent direction for the merit function). Let dx and dλ satisfy
the conditions (20.7) and (20.8). Then, the directional derivative of φc in the
direction dx , denoted by φc′ (xk ; dx ) is such that
φc′ (xk ; dx ) ≤ −dTx ∇2 L(xk , λk )dx − c − dλ ∞ h(xk ) 1 .
and
φc′ (xk ; dx ) = −dTx ∇2xx L(xk , λk )dx + h(xk )T dλ − c h(xk ) 1
.
Applying the Cauchy-Schwartz inequality (C.20):
h(xk )T dλ ≤ h(xk ) 1
dλ ∞
3 Input
4 f : Rn → R, ∇f : Rn → Rn , ∇2 f : Rn → Rn×n .
5 h : Rn → Rm , ∇h : Rn → Rn×m , ∇2 hi : Rn → Rn×n , i = 1, . . . , m.
6 A parameter 0 < β1 < 1 (by default: β1 = 0.3).
7 A parameter c̄ > 0 (by default: c̄ = 0.1).
8 An initial solution (x0 , λ0 ).
9 The required precision ε > 0.
10 Output
11 An approximation of the optimal solution (x∗ , λ∗ ).
12 Initialization
13 k := 0.
14 c0 := λ0 ∞ + c̄.
15 Repeat
m
X
16 Calculate ∇2xx L(xk , λk ) = ∇2 f(xk ) + (λk )i ∇2 hi (xk ) .
i=1
17 Find an positive definite approximation Hk of ∇2xx L(xk , λk ) (e.g. using
Algorithm 11.7).
18 Obtain dx and dλ by solving the quadratic problem
mind ∇f(xk )T d + 21 dT Hk d subject to ∇h(xk )T d + h(xk ) = 0 with an
appropriate algorithm (to illustrate the method, we may use (20.11) and
(20.12)).
+
19 c := dλ ∞ + c̄.
20 Update the penalty parameter
21 If ck ≥ 1.1 c+ , ck+1 := 12 (ck + c+ ).
22 If c+ ≤ ck < 1.1 c+ , ck+1 := ck .
23 If ck < c+ , ck+1 := max(1.5 ck , c+ ).
24 φc′ k (xk ; dx ) := ∇f(xk )T dx − ck h(xk ) 1 .
25 Calculate the step
26 i = 0, αi = 1.
27 while φck (xk + αi dk ) > φck (xk ) + αi β1 φc′ k (xk ; dx ) do
28 αi+1 := αi /2
29 i := i + 1
30 α := αi .
31 xk+1 := xk + αdx .
32 λk+1 := dλ .
33 k := k + 1.
34 Until ∇L(xk , λk ) ≤ ε.
Sequential quadratic programming 481
c > dλ ∞
. (20.22)
This condition is consistent with (20.14).
In practice, the matrix ∇2xx L(xk , λk ) is not always positive definite. Therefore, as
presented in Chapter 11, we replace this matrix with a positive definite approxima-
tion, using for instance a modified Cholesky factorization (Algorithm 11.7).
In practice, the choice of c is delicate. We here adopt the procedure presented
by Bonnans et al. (1997), where the parameter ck is updated at each iteration. Take
c+ = dλ ∞ + c̄, where c̄ is a positive constant. The value of the parameter is chosen
in line with (20.22).
• If ck−1 ≥ 1.1 c+ , then the parameter is too large, and is reduced to the average
value between ck−1 and c+ , i.e.,
1
ck = (ck−1 + c+ ) .
2
• If 1.1 c+ ≥ ck−1 ≥ c+ , then the value of the parameter is good, and we leave it as
it is, i.e.,
ck = ck−1 .
• In the other cases, the parameter has to be increased. In order to significantly
increase it, we impose a minimum augmentation of 50 %, i.e.,
ck = max(1.5 ck−1 , c+ ) .
The algorithm is described as Algorithm 20.2.
Comments
• The second Wolfe condition has not been used here, first of all in order to sim-
plify the description of the algorithm and secondly because it is not necessary in
practice. Moreover, it requires calculations of the directional derivative for each
candidate.
• The matrix Hk can also be constructed by using the update formulas defined in
Chapter 13. If the BFGS method is used, it is important to note that the condition
dT y > 0 (Theorem 13.2) is not automatically satisfied in this context.
We apply this algorithm to Example 20.2. We keep in mind that the local SQP
algorithm does not always converge toward a local minimum, as illustrated in Fig-
ure 20.2. The globalized algorithm, on the other hand, converges toward a local
minimum for the two starting points (Figure 20.7). Tables 20.7 and 20.8 provide a
detailed list of the iterations, where the parameter τ indicates the multiple of the
identity that had to be added to the matrix ∇2xx L for it to be positive definite. It
is interesting to note that, during the last iterations, τ = 0 and α = 1 and these
iterations are thus equivalent to those of the local SQP method.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 482
Table 20.7: Illustration of the globalized SQP algorithm for Example 20.2; x0 = −0.1 1
k x1 x2 λ c α τ k∇Lxx k
T
Table 20.8: Illustration of the globalized SQP algorithm for Example 20.2; x0 = 0.1 1
k x1 x2 λ c α τ k∇Lxx k
T
2 2
1.5 1.5
x0 1 x0 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0.5 0.5
x∗ x∗
0 0
-0.5 -0.5
-1 -1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
T T
(a) x0 = −0.1 1 (b) x0 = 0.1 1
Figure 20.7: Illustrations of the globalized SQP algorithm for Example 20.2
20.3 Project
The general organization of the projects is described in Appendix D.
Objective
The aim of this project is to implement the SQP algorithm, to test it on several
problems, and to compare the local version with its globalized counterpart.
Approach
1. Solve the problems with Algorithm 20.2. Let x∗ be a local optimum.
2. Randomly generate several starting points in a central ball x∗ of radius ε with,
for instance, ε = 1, 10, 100, 1,000.
3. For each value of ε, perform statistics on the number of times that the local
algorithm converges.
4. For each starting point from which the local algorithm converges, compare the
number of iterations for the two algorithms. What is the impact of the globaliza-
tion on the efficiency of the method?
Algorithms
Algorithms 20.1 and 20.2.
Problems
Exercise 20.1. The problem
min ex1 −2x2
Sequential quadratic programming 485
subject to
sin(−x1 + x2 − 1) = 0
−2 ≤ x1 ≤ 2
−1.5 ≤ x2 ≤ 1.5 .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
with
c1 = −6.089 c6 = −14.986
c2 = −17.164 c7 = −24.1
c3 = −34.054 c8 = −10.708
c4 = −5.914 c9 = −26.662
c5 = −24.721 c10 = −22.179 .
Solution:
x∗1 = −3.40629 x∗6 = −4.44283
x∗2 = −0.596369 x∗7 = −1.41264
x∗3 = −1.1912 x∗8 = −21.6066
x∗4 = −4.62689 x∗9 = −2.26867
x∗5 = −1.0011 x∗10 = −1.40346 .
Proposed by Hock and Schittkowski (1981).
Exercise 20.3. The problem
subject to
2
1 + x21 + x22 = 4
−4 ≤ x1 ≤ 4
−4 ≤ x2 ≤ 4 .
Please note: do not forget to transform the formulation of the problems so that
they are compatible with (20.1)–(20.2).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part VI
Networks
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Robert Kiyosaki
Our daily life is full of networks. We drive on a network of roads and highways. We
receive water and electricity at home through the corresponding supply networks.
Our houses are connected to a network of sewers for the evacuation of waste water.
Our computers communicate over the internet, and our wireless phones are connected
through a network of antennas. We exchange messages and pictures with our friends
on social networks. We participate in professional meetings for the sake of “network-
ing.” Our brain is generating ideas and emotions from a network of neurons. In this
book, we define a network as a mathematical object, with interesting properties that
are exploited to solve optimization problems. The analogy with “real” networks allows
us to develop intuitions about these properties. But the mathematical abstraction is
also useful for applications that have nothing to do with networks in real life.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 21
Contents
21.1 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
21.2 Cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
21.3 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
21.4 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
21.5 Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
21.5.1 Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
21.5.2 Capacities . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
21.5.3 Supply and demand . . . . . . . . . . . . . . . . . . . . . 504
21.5.4 Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
21.5.5 Network representation . . . . . . . . . . . . . . . . . . . 508
21.6 Flow decomposition . . . . . . . . . . . . . . . . . . . . . . 510
21.7 Minimum spanning trees . . . . . . . . . . . . . . . . . . . 520
21.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
21.1 Graphs
The element defining the structure of a network is called a graph , composed of ver-
tices, or nodes and edges, or arcs. The vertices are the entities that are intercon-
nected, and the edges represent the connections. For instance, in the water supply
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
network, the vertices are the houses of the customers, the tanks where the water
is stored, the water treatment plants, the pumping stations, and so on. The edges
are the physical pipes connecting these entities. On Facebook, the vertices are the
registered individuals, and an edge represents a friendship connection between two
persons. The relationship between the edges and the vertices that they connect is
captured by a function called the incidence function. A graph is defined by a set of
vertices, a set of edges, and an incidence function.
Definition 21.1 (Graph). A graph is a triple (V, E, φ), where V is a finite set of
elements called vertices, E is a finite set of elements called edges, and φ : E → P2 (V)
is the incidence function, mapping the set of edges into the set P2 (V) of all 2-element
subsets of vertices.
In the definition 21.1 of a graph, an edge connects two vertices, and their order is
not specified. The names “arc” and “node,” used instead of “edge” and “vertex,” imply
Introduction and definitions 493
e5
v2 v4
e6
e1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
v1 e2 e8 e7
e3
e4
v3 v5
that the underlying connection is directed, meaning that the arc connecting node i to
node j is different from the arc that connects node j to node i (if there is one). The
graph is then said to be directed. In this book, we consider mainly directed graphs,
with the exception of Section 21.7 on minimum spanning trees, where undirected
graphs are considered.
Note that this definition potentially allows several arcs to connect the same pair
of nodes. In this book, we focus on networks such that the incidence function is
injective.1 It means that if we select two distinct arcs a1 , a2 ∈ A, a1 6= a2 , then the
pairs of nodes incident to these two arcs must be different, that is φ(a1 ) 6= φ(a2 ).
In other words, when the incidence function is injective, each ordered pair of nodes
is connected by either 0 or 1 arc. In this case, we can use the notation (i, j) without
ambiguity to identify the arc representing the connection between node i and node
j. When we mention the arc (i, j), we refer to the arc a such that φ(a) = (i, j). As
φ is injective, if such an arc exists, it is unique. We say that i is the upstream node
of arc (i, j), and j its downstream node. It is said that the arc (i, j) is incident to
node i and to node j, irrespectively of the orientation of the arc. The degree di of
node i is the number of incident arcs. The indegree d− i of node i is the number of
arcs incident to i such that i is their downstream node. The outdegree d+ i of node
i is the number of arcs incident to i such that i is their upstream node. For each
node i, we have di = d− +
i + di . Also, if the arc (i, j) exists, nodes i and j are said
1 The incidence function of the graph represented in Figure 21.1 is not injective, as there are two
edges connecting the vertices v2 and v4 , as well as the vertices v3 and v5 .
494 Cuts
to be adjacent to each other, irrespectively of the orientation of the arc. Figure 21.2
represents a directed graph with 8 nodes and 10 arcs. The indegree, outdegree, and
degree of each node are:
d− −
1 =1, d2 =2, d− −
3 =1, d4 =2, d− −
5 =2, d6 =1, d− −
7 =1, d8 =0,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
+ + + + + + + +
d1 =1, d2 =2, d3 =2, d4 =2, d5 =1, d6 =1, d7 =1, d8 =0,
d1 =2, d2 =4, d3 =3, d4 =4, d5 =3, d6 =2, d7 =2, d8 =0.
2 4 6
1 8
3 5 7
21.2 Cuts
Just as cities can be separated into two banks by a river, it may be convenient to
separate a directed graph into two sets of nodes. Such a separation is called a cut.
Definition 21.4 (Cut). Consider a directed graph where N is the set of nodes. A
cut Γ is an ordered partition of the nodes into two non empty subsets:
We say that the cut Γ separates i from j if i ∈ M and j 6∈ M. Using the analogy
of a city divided by a river, M can be considered as the left bank and N \ M as the
right bank of the river. The arcs with their upstream node in the left bank, and their
downstream node in the right bank may represent bridges on the river. The bridges
connecting the left bank to the right bank constitute the set of forward arcs of the
cut:
Γ → = {(i, j) ∈ A|i ∈ M, j 6∈ M}. (21.2)
Introduction and definitions 495
Similarly, the bridges connecting the right bank to the left form the set of backward
arcs of the cut:
Γ ← = {(i, j) ∈ A|i 6∈ M, j ∈ M}. (21.3)
Note that one or both of these sets may happen to be empty. When convenient to do
so, we say that (i, j) ∈ Γ if (i, j) ∈ Γ → ∪ Γ ← .
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Note from these definitions that the cut based on the partition (M, N \ M) is
different from the cut based on the partition (N \ M, M). This is what is meant by
ordered partition in Definition 21.4. Using the bridge analogy again, it means that
we explicitly distinguish the left bank from the right bank of the river.
To illustrate the concept, Figure 21.3 represents the cut based on the subset of
nodes M = {1, 2, 3, 5, 7}, and the cut is
2 4 6
N \M
1 M 8
3 5 7
21.3 Paths
A path in a graph (V, E, φ) is a finite sequence of edges e1 , . . . , ep−1 for which there
is a sequence v1 , . . . , vp of vertices such that φ(ek ) = {vk , vk+1 }, for k = 1, . . . , p − 1.
Similarly, a path in a directed graph (N , A, φ) is a sequence of arcs a1 , . . . , ap−1
for which there is a sequence i1 , . . . , ip of nodes such that φ(ak ) = (ik , ik+1 ) or
φ(ak ) = (ik+1 , ik ), for k = 1, . . . , p − 1.
496 Paths
direction. To be a valid path, each arc in the path must belong to A. The first node
of a path P is called its origin. The last node is called its destination. A path such
that its origin coincides with its destination is called a cycle. A path is simple if it
contains no repeated nodes. A cycle is simple if it contains no repeated nodes, with
the exception of the origin and the destination that coincide. We denote P→ the set
of forward arcs of path P and P← the set of backward arcs. A path is a forward path
if its set of backward arcs is empty. Here are some examples of paths in the directed
graph represented in Figure 21.2:
• 1 → 2 → 4 → 5 is a simple forward path from node 1 to node 5 containing only
forward arcs [P→ = (1, 2), (2, 4), (4, 5), P← = ∅];
• 1 → 2 → 4 → 2 → 3 is a forward path from node 1 to node 3 (note that node
2 is repeated, so that it is not a simple path) [P→ = (1, 2), (2, 4), (4, 2), (2, 3),
P← = ∅];
• 1 → 2 ← 4 → 5 is a simple path from node 1 to node 5 that uses arc (4, 2) in the
reverse direction [P→ = (1, 2), (4, 5), P← = (4, 2) ];
• 1 → 2 ← 4 → 5 ← 3 → 1 is a simple cycle [P→ = (1, 2), (4, 5), (3, 1), P← =
(4, 2), (3, 5)];
• 4 → 6 → 7 is an invalid path as arc (4, 6) does not exist.
Lemma 21.5. [Longest simple path] Consider a directed graph with m nodes.
The number of arcs in any simple path is no more than m − 1.
Proof. A simple path that visits all the nodes of the graph has m − 1 arcs. If this
path is extended by one more arc, the downstream node of this arc would be visited
twice by the path, which would not be simple.
Lemma 21.6. [Finite number of simple paths] Consider a directed graph with
m nodes, m ≥ 2, and two nodes o and d. There is a finite number of simple
paths between o and d.
only forward arcs, the graph is said to be strongly connected . A graph containing
a single node and no arc is considered to be strongly connected, too. The graph
represented in Figure 21.2 is not connected, as there are several pairs of nodes with
no path connecting them, such as nodes 1 and 8, for instance. Actually, with respect
to connectivity, this graph appears to have three connected subgraphs, defined by the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
sets of nodes: {1, 2, 3, 4, 5}, {6, 7}, and {8}, and the arcs they are incident to. These three
connected subgraphs are called connected components. The definition of connected
components is based on equivalence classes on the set of nodes. Indeed, the relation “is
connected with” defines an equivalence relation on the set of nodes, as it is reflexive,
symmetric, and transitive (see Definition B.24). Note that the relation “is strongly
connected with” does not define an equivalence relation, as it is not symmetric.
In the second part of the definition, the existence of the arc (i, j) implies that i
and j belong to the same equivalence class. Consequently, if i ∈ N ′ then j belongs to
N ′ too.
2 4 6
1 8
3 5 7
21.4 Trees
There is a family of graphs called trees that are particularly useful both for the
algorithms that we describe in this book, and in various other applications.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Lemma 21.9. Every tree with at least one arc has at least two leaves.
Proof. Consider the path P of the tree with the largest number of arcs. Call its origin
o and its destination d. By construction, the degree of o and d is larger or equal to
1. If the degree of o is strictly larger than 1, it means that there is another arc, not in
the path, and incident to o. Therefore, a path with one more arc than P exists, which
is not possible by the definition of P. Therefore, o is a leaf. The same argument is
used to determine that d is a leaf, too.
A tree can be characterized in several different ways.
1 2
3 4 5
i=1 di 2n 2(m − 1) 2
= = =2− .
m m m m
This is strictly lower than 2 for any m. Therefore, there is at least one node with
degree strictly less than 2. Moreover, as the graph is connected, no node with
degree 0 exists. Therefore, there is at least one node i with degree 1. This node
cannot be part of a cycle. If we remove i and the incident arc, the remaining
graph has no cycle either, by induction. Therefore, the graph has no cycle.
1 2 4
6 7 3
Definition 21.11 (Spanning tree). Consider the graph (V, E, φ). The subgraph
(V, E ′ , φ ′ ), where E ′ ⊆ E, and φ ′ (e) = φ(e), for each e ∈ E ′ , is a spanning tree of
(V, E, φ) if it is a tree.
Introduction and definitions 501
21.5 Networks
It is often useful to associate quantities to nodes and arcs. For instance, in a water
network, each house may be associated with a daily consumption of water, each
treatment plant may be associated with a daily quantity of water treated, each tank
may be associated with a quantity of stored water, and each pipe has a length and a
cross section. When quantities are associated with the graph, we call it a network.
21.5.1 Flows
A network is often used to transport objects or information. The exact nature of
these items varies with the application. The definitions provided here are generic and
502 Networks
do not assume anything about the nature of what is transported. A typical quantity
associated with each arc (i, j) is the flow on the arc, denoted by xij . The quantity
xij ∈ R is the amount of “things” (water, electricity, information, etc.) that traverses
the arc during a given period of time. Note that the concept of flow presented here
is static, in the sense that we assume that it represents the total number of “things”
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
traversing the network during a time horizon that is sufficiently large so that all units
of flow depart and arrive during this horizon, and the time dimension is irrelevant.
The representation of dynamic flows, varying over time, are more complex and out
of the scope of this book.
For mathematical convenience, we allow xij to take on any real value, including
negative values. If xij < 0, the interpretation is that the arc (i, j) transports −xij
units of flow from j to i, that is in the opposite direction of the arc. The vector
x ∈ Rn such that each entry contains the flow on the corresponding arc is called the
flow vector. Figure 21.8 provides an example of a flow vector, where the flow on each
arc is shown next to it. For instance, there are 2.3 units of flow transported from
node 1 to node 2. There are 3 units of flow transported from node 4 to node 2 on arc
(4, 2), and 2.1 units of flow transported from node 4 to node to 2 on arc (2, 4).
-2.1
2 4 6
3
2.3
1 -1 -5 -5 2.5 3 8
3 5 7
0
Consider now a cut Γ = (M, N \ M). The flow through the cut Γ is defined as
X X
X(Γ ) = xij − xij , (21.4)
(i,j)∈Γ → (i,j)∈Γ ←
where Γ → is the set of forward arcs, and Γ ← the set of backward arcs of the cut (see
Section 21.2). If both Γ → and Γ ← are empty, the flow is 0.
Paths may also be associated with flows. Suppose that a flow f follows a simple
path P from its origin to its destination. The flow vector representing this flow is called
a simple path flow. It is a vector x ∈ Rn such that each component corresponding to
a forward arc of the path is equal to f, each component corresponding to a backward
Introduction and definitions 503
arc is equal to −f, and all other components are 0, that is,
f if (i, j) ∈ P
→
When the path is a cycle, we refer to a simple cycle flow. Figure 21.9 represents a
simple path flow for path 1 → 2 ← 4 → 5. It represents f units of flow transported
from origin 1 to destination 5 along P.
0
2 4 6
−f
f
1 0 0 f 0 0 8
0
3 5 7
0
21.5.2 Capacities
In many practical applications, the value of the flow cannot exceed some value deter-
mined by physical characteristics of the system represented by an arc. For example,
the maximum quantity of water per unit of time that a pipe can transport depends on
the diameter of the pipe. The maximum number of cars that a highway can transport
per unit of time depends on the number and width of lanes. The maximum value
of the flow on the arc is called its capacity. As we allow xij to take negative values,
both a lower bound ℓij and an upper bound uij on the flow are required. Therefore,
we obtain for each arc (i, j) the following constraint:
As we have defined the flow through a cut, the concept of capacity is relevant here
as well. Consider a cut Γ = (M, N \ M). The capacity of the cut Γ is
X X
U(Γ ) = uij − ℓij . (21.7)
(i,j)∈Γ → (i,j)∈Γ ←
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
If both Γ → and Γ ← are empty, the capacity is 0. For any cut Γ , we always have that
the flow through the cut is bounded from above by its capacity, that is
If X(Γ ) = U(Γ ), the cut is said to be saturated, in the sense that no more flow can be
sent from set M (the left bank) to set N \ M (the right bank).
The difference between these two quantities is called the divergence of node i.
Definition 21.13 (Divergence). Consider a network with m nodes and n arcs, and
a flow vector x ∈ Rn . For each node i, the divergence of x at node i is defined as
the total quantity of flow that leaves the node, minus the total quantity of flow that
enters the node: X X
div(x)i = xij − xki . (21.11)
j|(i,j)∈A k|(k,i)∈A
If this quantity is positive, it means that there are more units leaving the node
than units entering it. Units of flow are created at node i. This node is therefore
supplying the network with flow. It is a supply node. Similarly, if the divergence is
negative, it means that there are less units leaving the node than units entering it.
It is therefore a node where units of flow are consumed. This is a demand node. If
the divergence is zero, no flow is generated or consumed at the node. It is a transit
node. The divergence associated with the flow vector represented in Figure 21.8 is
reported in Figure 21.10, where the divergence of node i is denoted by yi . It is seen
Introduction and definitions 505
y1 = −1.7 1 -1 -5 -5 2.5 3 8 y8 = 0
4
3 5 7
y3 = 5 0 y5 = 0 y7 = −0.5
that nodes 3, 4, and 6 are supply nodes, nodes 1, 2, and 7 are demand nodes, and
nodes 5 and 8 are transit nodes.
From (21.11), we obtain that the sum of all divergences is always zero, for any
flow vector. Indeed,
P P P P P
div(x)i = x − i∈N k|(k,i)∈A xki
i∈N Pi∈N j|(i,j)∈A P ij
= (i,j)∈A xij − (k,i)∈A xki (21.12)
= 0.
In other words, every unit of flow that is generated somewhere is consumed somewhere
else. A flow vector such that its divergence at each node is zero is called a circulation,
as illustrated in Figure 21.11. In this case, no flow is generated or consumed anywhere.
y2 = 0 2 y4 = 0 y6 = 0
2 4 6
2.3 -0.2
3 5 7
y3 = 0 -2.2 y5 = 0 y7 = 0
The following result relates the flow through a cut with the divergence at the
nodes.
506 Networks
Theorem 21.14 (Flow through a cut and divergences). Consider a network with
a set N of m nodes and a set A of n arcs, a subset of nodes M ⊂ N , a cut
Γ = (M, N \ M) and a flow vector x ∈ Rn . If Γ → ∪ Γ ← 6= ∅, then
X
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Proof. From the definition of the flow through a set, and of the sets Γ → and Γ ← , we
have X X
X(Γ ) = xij − xji .
(i,j)|i∈M,j6∈M (j,i)|j6∈M,i∈M
Note that we have inverted the indices of the second term so that node i always
belongs to M in this expression. Consequently, we can also write
X X X
X(Γ ) = xij − xji . (21.14)
i∈M j|(i,j)∈A,j6∈M j|(j,i)∈A,j6∈M
Consider an arc (k, ℓ) such that both k and ℓ belong to M. In (21.15), the flow xkℓ
appears twice, once in the term corresponding to node k with a positive sign, and
once for node ℓ with a negative sign:
X X X X X
div(x)i = · · ·+ xkj − xjk +· · ·+ xℓj − xjℓ .
i∈M j|(k,j)∈A j|(j,k)∈A j|(ℓ,j)∈A j|(j,ℓ)∈A
(21.16)
Therefore, these two terms cancel out. It means that it is sufficient to consider only
j 6∈ M in (21.15). Therefore, Equation (21.16) is identical to (21.14), proving the
result.
Consider the cut presented in Figure 21.3 with the flow vector and its divergences
presented in Figures 21.8 and 21.10. The flow through the cut is
21.5.4 Costs
A quantity often associated with an arc (i, j) is a cost, which may depend on the
amount of flow that traverses the arc. In this book, we focus on linear costs, which
are proportional to the flow. The cost to move one unit of flow on arc (i, j) is denoted
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
by cij , so that the total cost of the arc is cij xij . The unit of the cost is usually
irrelevant, as long as it is the same for every arc in the network. For instance, it
can be the actual cost that has to be paid to traverse the arc, expressed in currency
units (e.g., a toll road). It can also be the time spent by a unit of flow to traverse
the arc. Sometimes, a generalized cost is needed. For instance, both the monetary
cost to traverse the arc and the time to traverse it are relevant. In this case, all
quantities involved have to be translated into the same unit, for example, a monetary
unit, so that they can be added. The valuation of non market resources such as
time is referred to by economists as contingent valuation. For instance, the value of
one hour of travel for commuting car drivers in Switzerland is (on average) CHF 30
(Axhausen et al., 2008). Using this value, if the toll on a road is CHF 10, and the
travel time 30 minutes, the total generalized cost per unit of flow would be CHF 25.
The cost of a path is defined as the sum of the costs of its arcs, that is
X X
C(P) = cij xij − cij xij . (21.17)
(i,j)∈P→ (i,j)∈P←
As an aside, note that this link-additive assumption may not always correspond to
the situation in a real network. For example, if you fly from Geneva Airport (GVA) to
Bangkok (BKK) with a transfer at Zurich Airport (ZRH), it costs CHF 2,412. If you
fly directly from ZRH to BKK, the cost is CHF 2,407. However, if you buy a ticket
from GVA to ZRH, it costs CHF 570. If we use the network representation illustrated
in Figure 21.12(a), and send one unit of flow along the path GVA → ZRH → BKK,
the associated cost is 2,977, as a consequence of the link-additivite assumption. It
does not correspond to the reality. Another way to model this situation, while keeping
the link-additive assumption, is represented in Figure 21.12(b). In this case, the path
GVA → BKK, with a cost of 2,412, represents passengers buying a ticket from GVA to
BKK (regardless of the number of transfers). The path GVA → ZRH → BKK, with a
cost of 2,977, represents passengers that have bought two separate tickets. But that
representation ignores the fact that travelers from GVA to ZRH and travelers from
GVA to BKK share the same flight (with a limited number of seats) between GVA
and ZRH, which may not be satisfactory either. This illustrates that it is important
to keep assumptions such as the link-additive assumption in mind when creating the
network representation of a real problem.
508 Networks
570 2,407
GVA ZRH BKK
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2,412
570 2,407
GVA ZRH BKK
adjacency matrix read row by row. In our example, arc 1 would be (1, 2), and arc
10 would be (7, 6). In many practical applications, as well as in our simple example,
the adjacency matrix is sparse, as it contains a large number of zero entries. There
are several techniques for an efficient storage of sparse matrices (see, for instance,
Dongarra, 2000 and Montagne and Ekambaram, 2004). A simple one consists in
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
storing adjacency lists for each node. In this configuration, each node i is associated
with a list of length equal to its outdegree d+ i . Each element of the list corresponds
to an arc (i, j) going out of i. The vector fA (i, j) ∈ Rq of values associated with the
corresponding arc may also be stored in the list. The adjacency lists of the simple
network represented in Figure 21.2, where each arc (i, j) is associated with a quantity
fA (i, j) = xij , as illustrated in Figure 21.13. Each element in list i is associated with
an arc (i, j) and contains: the number j of the downstream node of the corresponding
arc, a vector of quantities associated with this arc (here, xij ), and a pointer toward
the next element in the list. In our example, node 1 has only one outgoing arc:
(1, 2). Therefore, the list contains only one element, with three entries: the number
2 referring to node 2, the value x12 associated with the arc (1, 2), and a null pointer
(illustrated by a dot). Node 2 has two outgoing arcs: (2, 3) and (2, 4). Therefore,
the list associated with node 2 has two elements. The first one corresponds to the
arc (2, 3) and contains the number 3 referring to node 3, the value x23 , and a pointer
to the next element in the list. The second element corresponds to the arc (2, 4)
and contains the number 4 referring to node 4, the value x24 , and a null pointer
characterizing the last element of the list. As node 8 is not associated with any
outgoing arc, the associated list is empty, and the corresponding pointer is null.
1 ·
2 x12 ·
2 ·
3 x23 ·
4 x24 ·
3 ·
1 x31 ·
5 x35 ·
4 ·
2 x42 ·
5 x45 ·
5 ·
4 x54 ·
6 ·
7 x67 ·
7 ·
6 x76 ·
8 ·
Figure 21.13: Representation of the network in Figure 21.2 using adjacency lists
510 Flow decomposition
The procedure to calculate the resulting flow vector and associated divergences is
called network loading. The flow vector is obtained by simply summing up for each
arc the flow transported by paths containing the arc, and its divergence is defined
by (21.11). It is represented in Figure 21.14. There are 1.5+1.5+1 units of flows
leaving node 1 using paths 1, 2 and 3, and one unit of flow arriving at node 1 from
path 3. So there are a total of 3 units of flows leaving node 1, which corresponds to
its divergence. Note that the flow on arc (3, 5) is zero, as one unit of flow traverses
the arc in the forward direction along path 4, and one unit of flow in the backward
direction along path 3.
y2 = 0 1.5 y4 = −1 y6 = 2
2 4 6
4 -2.5
y1 = 3 1 0 1 4 0 2 8 y8 = 0
1
3 5 7
y3 = 1 0 y5 = −3 y7 = −2
The inverse procedure, consisting of reconstituting the path flows from the flow
vector is called flow decomposition. It is particularly important in applications. For
instance, consider the case where the flow represents trucks that are transporting
goods on the network. As discussed in Chapter 22, we may want to transport these
goods at minimum cost. The result of the optimization algorithm is a flow vector.
However, the instructions to the drivers of the trucks should be expressed in terms
of path flows. These are obtained from the flow decomposition procedure described
Introduction and definitions 511
next. The procedure is more complex, and composed of three steps: (i) transform the
flow vector into a circulation by adding artificial nodes and arcs, (ii) decompose the
circulation into simple cycle flows, and (iii) remove the artificial nodes and obtain the
simple path flows for the original network. We describe it first on the same example,
using the flow vector and associated divergences obtained by applying the network
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
loading procedure.
Step (i) First, we transform the flow vector into a circulation. We add an artificial
node (call it a) and for each node i such that its divergence is non zero, we add
an arc (a, i) with a flow equal to its divergence, as illustrated by Figure 21.15.
-1 2
3
1.5
2 4 6
-2.5 -2
1 -3
4
1 0 1 4 0 2 8
1
3 5 7
0
Figure 21.15: Adding an artificial node and arcs to transform a flow vector into a
circulation
using Algorithm 21.1. It means that the simple cycle flow that we generate trans-
ports the entire flow on at least one arc and part of the total flow on each arc in
a consistent way (that is, in the right direction).
512 Flow decomposition
3 Input
4 A network (N , A) of m nodes and n arcs.
5 A circulation x ∈ Rn .
6 Output
7 A simple cycle flow z ∈ Rn verifying (21.22).
8 Initialization
9 Select an arc (k, ℓ) such that xkℓ > 0 or an arc (ℓ, k) such that xℓk < 0.
10 S0 := {ℓ}, Cℓ := S0 , t := 0, P = {k}.
11 Repeat
12 St = ∅.
13 for i = 1, . . . , m, i 6∈ Cℓ do
14 if ∃(j, i) such that j ∈ St−1 and xji > 0 or ∃(i, j) such that j ∈ St−1
and xij < 0 then St := St ∪ {i}
15 Cℓ := Cℓ ∪ St .
16 t := t + 1.
17 Until St = ∅.
18 T index such that k ∈ ST , γ := k, f := +∞.
19 for t = T − 1, . . . , 0 do
20 if ∃i ∈ St such that xiγ > 0 then
21 P := {i →} ∪ P
22 if xiγ < f then f := xiγ
23 else
24 Select i ∈ St such that xγi < 0
25 P := {i ←} ∪ P
26 if −xγi < f then f := −xγi
27 γ = i.
28 for (i, j) ∈ A do
29 if (i, j) ∈ P → then zij := f
30 else if (i, j) ∈ P ← then zij := −f
31 else zij := 0
Introduction and definitions 513
The algorithm works as follows. We first select an arc (k, ℓ) transporting a positive
amount of flow, such as arc (1, 2), for example. We group the nodes into layers
using a recursive procedure. The first layer S0 = {ℓ} contains only node ℓ. Layer
St is built from layer St−1 in the following way: node i belongs to layer St if it
does not belong to any previous layer S0 , . . . , St−1 , and there is an arc carrying
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
flow between a node j in St−1 and node i, that is, at least one of the two conditions
is verified (one condition for forward flows, one for backward):
1. there is an arc (j, i) such that j ∈ St−1 and xji > 0, or
2. there is an arc (i, j) such that j ∈ St−1 and xij < 0.
Intuitively, the nodes in layer St are the next step for the flow going out of the
nodes in layer St−1 . The recursive procedure is interrupted if St is empty. The set
S
of nodes covered by the flow going out of node ℓ, that is Cℓ = t St is “isolated”
from the rest of the nodes (N \ Cℓ ), in the sense that there is no flow from one set
to the other. Consider the cut Γ = (Cℓ , N \ Cℓ ).
As we are dealing with a circulation, the flow through the cut is 0. Indeed, if some
units of flow were transferred from set Cℓ to N \ Cℓ , there would be at least one
arc (i, j) transporting positive flow such that i ∈ Cℓ and j 6∈ Cℓ . It is not possible,
as the procedure would have included j into one of the sets St and, therefore, it
would belong to Cℓ . If some units of flow were transferred from set N \ Cℓ to set
Cℓ , as we have a circulation, the same amount of flow must also be transferred
in the other direction, which is not possible according to the previous argument.
Therefore, the flow through the cut Γ is zero.
Consequently, as the arc (k, ℓ) was selected such that it transports positive flow,
it cannot be in the cut. This guarantees that node k belongs to Cℓ , and more
specifically, to one ST such that T ≥ 1, as node ℓ is the only node in S0 .
In our example where arc (1, 2) is selected, S0 = {2}. There are four arcs incident
to node 2. Only two of them are transporting flow out of node 2: arc (2, 4)
transporting 1.5 units of flow (forward), and arc (4, 2) transporting 2.5 units of
flow (backward). Therefore, S1 = {4}. From node 4, arc (a, 4) is transporting one
unit of flow in the backward direction, and arc (4, 5) is transporting 4 units of flow
in the forward direction. Therefore, S2 = {a, 5}. From a, arcs (a, 1), (a, 3), and
(a, 6) are transporting positive quantities of flows. From node 5, only arc (5, 4) is
transporting a positive flow. However, as node 4 has already been included in a
layer, it does not qualify for the next. Therefore, S3 = {1, 3, 6}. Finally, we obtain
S4 = {7} and S5 = ∅. It is seen that node 1 belongs to S3 , and that node 8 has
not been included in any set St . Indeed, there is no path from node 2 to node 8.
Starting from node k ∈ ST , we select a sequence of nodes iT −1 ∈ ST −1 , iT −2 ∈
ST −2 , . . . i0 ∈ S0 such that there is an arc transporting positive flow (either
forward or backward) between it−1 and it (note that, by construction, such arcs
always exist, and i0 = ℓ). Together with the arc (k, ℓ), the sequence of nodes
and associated arcs form a simple cycle P such that all its forward arcs have
positive flow, all its backward arcs have negative flow. Consider the minimum
514 Flow decomposition
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-1
3
S0 1.5 S1
2 4 6
-2.5 -2
1 -3
4
1 0 1 4 0 2 8
1
S3
S4
3 5 S2 7
0
1 → 2 → 4 ← a → 1. (21.25)
The minimum amount of flow transported by one arc is 1 (arc (a, 4), backward),
so that
z12 = z24 = −za4 = za1 = 1,
1.5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
4 4
-1 4
a 5
2
1
3
1 3 6
We then subtract the obtained simple cycle flow from the original flow vector:
x+ = x − z. From properties (21.21), the flow on each arc carrying flow both
for x and x+ , that is each arc (i, j) with xij x+
ij 6= 0, has the same sign for x
+
+
and x. Moreover, there is at least one arc (i, j) such that xij 6= 0 and xij = 0.
Note that this arc is not necessarily the arc (k, ℓ) that was chosen to initiate the
procedure. The procedure is repeated until x+ = 0. Note that it is guaranteed
to happen, as each time the procedure is applied, at least one arc transporting
positive flow before the identification of the simple cycle flow has zero flow after.
So the maximum number of times that the procedure is applied equals the number
of arcs with non zero flow in the original flow vector.
If we start the process again, we generate the following simple cycle flows:
Cycle Flow
1→2→4←a→1 1
1→2→4→5←a→1 0.5
1→2←4→5←a→1 1.5
1→2←4→5←a→3→1 1
4→5→4 1
6→7←a→6 2
516 Flow decomposition
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2
0.5
2 4 6
-2.5 -2
1 -3
3
1 0 1 4 0 2 8
1
3 5 7
0
Figure 21.18: New flow vector after subtracting the simple cycle flow
Step (iii) It is now sufficient to remove the artificial node a to obtain the paths from
the original network:
Path Flow
1→2→4 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1→2→4→5 0.5
1→2←4→5 1.5
3→1→2←4→5 1
4→5→4 1
6→7 2
Note that the decomposition is not unique. The above simple path flows are not
the same as the ones described in Table 21.1:
Path Flow
1→2→4→5 1.5
1→2←4→5 1.5
1→2←4→5←3→1 1
3→5→4 1
6→7 2
However, when each of them is loaded on the network, the same vector flow is gener-
ated.
We see that each of these simple path flows is either a simple cycle flow, or starts
from a supply node and ends at a demand node. Also, the flows are transported in
the same direction as the original flow on each arc. We say that they are consistent
with the original flow x.
518 Flow decomposition
Proof. Let 0 < p0 ≤ n be the number of arcs transporting a non zero amount of
flow. If we apply Algorithm 21.1, we obtain a simple cycle flow z consistent with x.
Indeed, the conditions of Definition 21.15 are directly obtained from (21.22). Now, let
us consider the flow vector x+ = x − z, and let p1 be the number of arcs transporting
a non zero amount of flow. As xij = zij for at least one arc, we have that p1 ≤ p0 − 1.
Moreover, conditions (21.22) guarantee that the non zero flows of x+ have the exact
same sign as the corresponding flow of x. If we repeat the same process several times,
at each iteration t such that pt > 0, we have pt+1 ≤ pt − 1. The process is stopped
at iteration T when no arc is transporting a non zero amount of flow, that is when
pT = 0. We have
0 = pT ≤ pT −1 − 1 ≤ pT −2 − 2 ≤ . . . ≤ pT −k − k ≤ . . .
for any 0 ≤ k ≤ T . For k = T , we have
0 ≤ p0 − T that is T ≤ p0 ≤ n.
Therefore, there are at most T simple cycle flows generated from x.
y such that yij = xij if (i, j) is an arc from the original network, and yai = div(x)i for
the newly added arcs (see Figure 21.15). This network has n+1 nodes and n+m arcs.
The flow vector y is a circulation. Indeed, for the nodes from the original network,
X X
div(y)i = yij − yki − yai
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
j|(i,j)∈A k|(k,i)∈A
X X
= xij − xki − div(x)i
j|(i,j)∈A k|(k,i)∈A
= div(x)i − div(x)i
= 0.
For node a, as all arcs are going out of the node, we have
X X
div(y)a = yaj = div(x)i = 0,
j∈N j∈N
Proof. In the decomposition of a circulation into simple cycle flows (Algorithm 21.1),
the flow on each simple cycle flow is the smallest flow transported by an arc of the
generated cycle. Therefore, if the flow on each arc is integer, the simple cycle flow
is also integer. And when it is subtracted to the original flow to generate the next
cycle, the flow obviously remains integer-valued.
The above result has important practical implications. If the flow vector represents
physical units (trucks, containers, etc.), it can be decomposed into simple paths
transporting flows of these units.
520 Minimum spanning trees
3 8
1 2 3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
7 7 2 8
3 2
4 5 6
4 4 10
4 0
7 8 9
which connections have to be built in order for all cities to be connected, at minimal
cost.
Example 21.20 (Network for the minimum spanning tree problem). A telecommuni-
cation company must connect 7 cities with optical fiber. The potential connections to
be built, together with the associated costs, are modeled by the network represented
in Figure 21.20.
3
3 5
5
5
7
7
1 6 7
2
1
4
5
6
7
2 4
Figure 21.20: Network for the minimum spanning tree (Example 21.20)
A minimum spanning tree, with a total cost of 22, is represented in Figure 21.21,
where arcs represented by a plain line are part of the tree. Note that including arc
(5,7) instead of (4,7) would give another spanning tree with the same cost.
3
3 5
1 6 7
2
5
6
2 4
in the connected component containing node i, and Nj be the set of nodes in the
other one. In the network (N , E), consider the cut Γij = (Ni , N \ Ni ) = (Ni , Nj ).
T ∗ is a minimum spanning tree if and only if T ∗ verifies the cut condition, that
is cij ≤ ckℓ , for each (i, j) ∈ T ∗ and each (k, ℓ) ∈ Γij .
i j
1 6 7
k ℓ
Proof. Figure 21.22 illustrates the edges involved in this theorem. Edge (i, j) belongs
to the spanning tree. If removed, it defines the cut Γij = (Ni , Nj ) with Ni = {1, i, k}
and Nj = {j, ℓ, 6, 7}.
Necessary condition Assume first that T ∗ is a minimum spanning tree. Assume
by contradiction that cij > ckℓ . Then removing arc (i, j) from T ∗ disconnects
the tree. As it belongs to the cut, adding arc (k, ℓ) reconnects it. And the total
cost of the new tree is lower than the cost of T ∗ , contradicting the fact that T ∗
is optimal.
Sufficient condition Assume that T ∗ verifies the cut condition. Consider a mini-
mum spanning tree Tb . From the necessary condition above, it also verifies the
cut condition. If Tb = T ∗ , the proof is finished. If not, consider (i, j) ∈ T ∗ such
that (i, j) 6∈ Tb . Adding (i, j) to Tb creates a cycle (condition 4 of Theorem 21.10).
This cycle must contain an edge (k, ℓ) ∈ Γij . Note that, by construction, the cut
obtained by removing (i, j) from T ∗ is exactly the same as the cut obtained by
removing (k, ℓ) from Tb . As T ∗ verifies the cut condition, we have cij ≤ ckℓ . As Tb
verifies the cut condition, we have that ckℓ ≤ cij . Consequently, cij = ckℓ . Now
replace edge (k, ℓ) by edge (i, j) in Tb . The new tree is also optimal, as the cost
has not changed. If this new tree is equal to T ∗ , we are done. Otherwise, we start
the process as many times as is needed to obtain T ∗ , and show that it is optimal.
Introduction and definitions 523
This can happen only a finite number of times, as each time a new arc from T ∗
is included in Tb , and there are exactly m − 1 of them.
that constructs step by step the spanning tree, making sure that the cut condition
is always verified. At each iteration of this algorithm, we have a partial tree. We
consider the set M of nodes connected by this partial tree, and the set of all other
nodes N \M. Among all edges belonging to the cut Γ = (M, N \M), we select the one
with the minimum cost, and add it to the partial tree. Such a constructive algorithm,
which considers a locally minimum strategy at each step without reconsidering any
previous decision, is called a greedy algorithm.
The greedy algorithm for the minimum spanning tree problem described above is
called the Jarnik-Prim algorithm, from the work of Jarník (1930) and Prim (1957).
It is formally defined as Algorithm 21.4.
17 T ∗ := T ∗ ∪ (ei , ej ).
18 M := M ∪ ej .
19 Until M = N .
524 Exercises
The iterations of Algorithm 21.4 applied on Example 21.20 are reported in Ta-
ble 21.2.
M T∗ (i, j) cij
1 ∅ (1,2) 6
1,2 (1,2) (2,3) 2
1,2,3 (1,2),(2,3) (3,5) 3
1,2,3,5 (1,2),(2,3),(3,5) (4,5) 1
1,2,3,4,5 (1,2),(2,3),(3,5), (4,5) (4,6) 5
1,2,3,4,5,6 (1,2),(2,3),(3,5), (4,5), (4,6) (4,7) 5
1,2,3,4,5,6,7 (1,2),(2,3),(3,5), (4,5), (4,6), (4,7) — —
The Jarnik-Prim algorithm for the minimum spanning tree problem is an example
where a greedy algorithm provides an optimal solution of a discrete optimization
problem, as shown by Theorem 21.21. For other problems, greedy algorithms may
not necessarily provide an optimal solution. Still, due to their simplicity, they can
also be used as heuristics, as described in Section 27.1.
21.8 Exercises
Exercise 21.1. Consider the network represented in Figure 21.23, where the number
associated with each arc represents the amount of flow traversing it.
1. What is the indegree, the outdegree, and the degree of each node?
2. Give the adjacency matrix of the network.
3. Represent the network using an adjacency list that also stores the flows.
4. Is the network connected?
5. Is the network strongly connected?
6. Enumerate all simple paths from node a to node g.
7. Enumerate all simple forward paths from node a to node g.
8. Give the divergence of the flow vector at each node. What are the supply nodes?
What are the demand nodes?
9. Consider the cut Γ = (M, N \ M), defined by the set M = {a, b, c}.
(a) What are the forward arcs of the cut?
(b) What are the backward arcs of the cut?
(c) What is the flow through the cut? Check that Theorem 21.14 is verified.
(d) Assume that the capacities on each arc are -3 for the lower bound and 5 for
the upper bound. What is the capacity of the cut?
10. Decompose the flow vector into consistent simple path/cycle flows.
Introduction and definitions 525
0
c e
1 -3 4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-2
a 5 2 f g
-2
3 1 1
-1
b d
Exercise 21.2. Consider the network represented in Figure 21.24, where the number
associated with each arc represents the amount of flow traversing it. Answer the same
questions as Exercise 21.1.
-2
a d f
1 c 1 -2
-1
b e g
-1
Exercise 21.3. Consider the network represented in Figure 21.25, where each arc
(i, j) is associated with its lower bound ℓij , its flow xij and its upper bound uij in the
following way: (ℓij , xij , uij ). Identify at least 4 cuts Γ = (M, N \ M) separating o
from d, such that Γ → contains exactly 4 arcs. For each of them, give the flow through
the cut and the capacity of the cut.
526 Exercises
(0, 5, 8)
4 5
(0
,0
0)
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
)
(0, 0, 4)
,5
,1
,1
,5
0)
,5
(0
(0
(0, 0, 5)
o 2 d
0)
(0
,3
(0
(0, 2, 5)
,5
0
,7 ,2
,1
,9 (0
5)
(0, 3, 6)
3 6
Figure 21.25: Network for Exercises 21.3, 22.5, and 24.2, where each arc (i, j) is
associated with (ℓij , xij , uij ), that is, lower bound, flow, and upper bound.
Exercise 21.4. Determine the minimum spanning tree for the network represented
in Figure 21.26, where the value associated with each edge is its cost. Apply Algo-
rithm 21.4 starting with M = {a}.
f
1
2
g 2 b
5
5
3 a 3 4
c e
4
3
d
Figure 21.26: Network for Exercise 21.4, with cost associated with each edge
Introduction and definitions 527
Exercise 21.5. A travel agent organizes hiking routes in the Alps for families. For
each possible origin/destination pair, he wants to identify an itinerary that avoids high
altitudes as much as possible. The network represented in Figure 21.27 represents
various locations that serve as the origin or destination of the routes. Each edge
represents a hiking trail between two of these locations. The value associated with
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
each edge represents the highest altitude along the trail. Solve the problem for the
travel agent.
1625
139
4
34
135
16
122
7
45
151
1
20
14
23
6
78
12
1619
1964
18
34
5
173
1786
37
22
1456
5 209 7
174 7 198
1349
Figure 21.27: Network of hiking trails in the Alps. The value associated with each
edge is the maximum altitude along the trail.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 22
Contents
22.1 Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
22.2 Optimality conditions . . . . . . . . . . . . . . . . . . . . . 535
22.3 Total unimodularity . . . . . . . . . . . . . . . . . . . . . . 536
22.4 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
22.4.1 The shortest path problem . . . . . . . . . . . . . . . . . 539
22.4.2 The maximum flow problem . . . . . . . . . . . . . . . . . 541
22.4.3 The transportation problem . . . . . . . . . . . . . . . . . 544
22.4.4 The assignment problem . . . . . . . . . . . . . . . . . . . 546
22.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
22.1 Formulation
We assume that we have a network (N , A) of m nodes and n arcs. The set of nodes
is partitioned into three subsets:
• a set N s of supply nodes representing the places where the flow is produced,
• a set N d of demand nodes representing the places where the flow is consumed,
• a set N t of transhipment nodes where the flow may just be transiting.
We also have access to the following data:
• a vector s ∈ Rm representing the supply/demand of flow, such that
– si > 0 for each i ∈ N s represents the quantity of flow produced at supply node
i,
530 Formulation
– si < 0 for each i ∈ N d is such that −si represents the quantity of flow
consumed at demand node i,
– si = 0 for each i ∈ N t ,
• a vector c ∈ Rn representing the cost of transporting a unit of flow on each arc,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
n
• a vector ℓ ∈ R representing the lower capacity of each arc,
n
• a vector u ∈ R representing the upper capacity of each arc.
P
Note that we assume that m i=1 si = 0, and ℓij ≤ uij , for each (i, j) ∈ A. Other-
wise, there is no feasible flow vector verifying the constraints. Note also that these
conditions are not sufficient to guarantee feasibility.
As described in Section 1.1, in order to obtain an optimization problem, we need
to define the decision variables, the objective function, and the constraints.
Decision variables The decision variables are the flow on each arc, denoted by x ∈
Rn . From Theorem 21.17, it is always possible to decompose the flow vector
into simple path flows (possibly cycle flows), so that concrete instructions can be
derived from the flow vector to transport the flow from the production sites to
the consumption sites.
Objective function The objective is to minimize the total cost, that is
X
minn cij xij .
x∈R
(i,j)∈A
div(x)i = si ∀i ∈ N ,
Second, the value of the flow on each arc must verify the capacity constraints,
that is
ℓij ≤ xij ≤ uij , ∀(i, j) ∈ A.
Therefore, we obtain the following optimization problem:
X
minn cij xij (22.1)
x∈R
(i,j)∈A
subject to X X
xij − xki = si , ∀i ∈ N , (22.2)
j|(i,j)∈A k|(k,i)∈A
It is a linear optimization problem and can be solved using the simplex method
described in Chapter 16. It is therefore appropriate to transform it into a linear
problem in standard form (6.159)–(6.160). To do this, we apply the transformation
techniques described in Section 1.2. First, in order to set the lower bounds to 0, we
define new variables
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
′
xij = xij − ℓij . (22.4)
We therefore obtain the following formulation
X X
′
minn cij xij + cij ℓij
x∈R
(i,j)∈A (i,j)∈A
subject to
X X X X
′ ′
xij − xki = si + ℓki − ℓij , ∀i ∈ C,
j|(i,j)∈A k|(k,i)∈A k|(k,i)∈A j|(i,j)∈A
and
′
0 ≤ xij ≤ uij − ℓij , ∀(i, j) ∈ A.
P
As (i,j)∈A cij ℓij is a constant, it can be omitted in the objective function. Defining
′
uij = uij − ℓij ∀(i, j) ∈ A (22.5)
X X
si′ = si + ℓki − ℓij ∀i ∈ C, (22.6)
k|(k,i)∈A j|(i,j)∈A
we obtain X
′
minn
cij xij
x ∈R
′
(i,j)∈A
subject to X X
′ ′
xij − xki = si′ , ∀i ∈ C,
j|(i,j)∈A k|(k,i)∈A
and
′ ′
0 ≤ xij ≤ uij , ∀(i, j) ∈ A.
Next, we transform the upper bound constraints into equality constraints. For each
arc (i, j) we include a slack variable yij (Definition 1.4) and the problem is written as
X
′
min n
cij xij (22.7)
′ x ∈R
(i,j)∈A
subject to X X
′ ′
xij − xki = si′ , ∀i ∈ N , (22.8)
j|(i,j)∈A k|(k,i)∈A
′ ′
xij + yij = uij , ∀(i, j) ∈ A, (22.9)
and
′
xij ≥ 0, yij ≥ 0. (22.10)
The constraint (22.9) can actually be interpreted as a supply/demand constraint and
included in the set of constraints (22.8). We illustrate this with Examples 22.1 and
22.2.
532 Formulation
si sj
xij (ℓij ,uij )
i j
cij
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Example 22.1 (Transhipment problem in standard form – I). Consider the simple
example represented in Figure 22.2(a), where we adopt the convention depicted in
Figure 22.1, and we report the flow and its bounds on the top of the arc, the cost
on the bottom, and the supply of each node is represented by a dotted line. It is
a network with two nodes and one arc. Node 1 supplies 3 units of flows that are
consumed at node 2 (equivalently, node 2 supplies −3 units of flow). Arc (1, 2) has
lower capacity −5, upper capacity 5, and cost 1. It transports 3 units of flow from
node 1 to node 2. In order to set the lower bound to 0, we perform the change of
′
variable (22.4), that is x12 = x12 − (−5) = 3 + 5 = 8. From (22.5), the upper bound
becomes now 5 − (−5) = 10. From (22.6), we obtain that s1′ = 3 − (−5) = 8 and
s2′ = −3 − 5 = −8, as illustrated in Figure 22.2(b). Figure 22.2(c) represents the
modification to the network that accounts for the slack variable.
3 -3
x12 =3(-5,5)
1 2
c12 =1
8 -8
′
x12 =8(0,10)
1 2
c12 =1
-2 10 -8
′
y31 =2(0,+∞) x32 =8(0,+∞)
1 3 2
c31 =0 c32 =1
Indeed, a new variable means a new arc transporting the corresponding flow. The
arc (1, 2) is replaced by a node (node 3) and two arcs. The supply of the new node
corresponds to the upper bound on the flow of the original arc. The new arc (3, 2)
takes the role of the original arc and transports the flow from the original problem
(here, 8) at the same cost. By design, as the supply of node 3 is equal to the upper
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
bound, the flow on arc (3, 2) never exceeds that value. If it happens to transport less,
the excess flow (that is, the slack) is transported by the new arc (3, 1), at zero cost
and exits the network at node 1. Therefore, the supply of node 1 must be decreased
by the amount of extra flow that has been injected into the network. In this example,
as the upper bound is 10, the supply of node 3 is 10, and the new supply of node 1
is 8 − 10 = −2.
Example 22.2 (Transhipment problem in standard form – II). Consider the network
represented in Figure 21.2, with the data presented in Table 22.1. The left part of the
table contains the lower bound, the upper bound, the cost of each arc, and a feasible
flow vector. The right part contains the supply for each node. Note that the values
of the supply sum up to 0 and the bounds are compatible, that is, the lower bound is
lower than the upper bound. The network representation of the transformed problem
(22.11)–(22.13) is depicted in Figure 22.3 and the corresponding data in Table 22.2.
Arcs Nodes
(i, j) ℓij uij cij xij i si
(1, 2) −1.1 2.5 1 2.2 1 −1.7
(2, 3) −2.2 2.5 1 −2.2 2 −8.4
(2, 4) −3.3 3.5 1 −3.3 3 5.0
(3, 1) −4.5 4.5 1 3.9 4 5.1
(3, 5) −5.5 5.5 1 −1.1 5 0.0
(4, 2) −6.6 6.5 1 0.7 6 0.5
(4, 5) −7.7 7.5 1 −7.7 7 −0.5
(5, 4) −8.8 8.5 1 −8.8 8 0.0
(6, 7) −9.9 9.5 1 −9.5
(7, 6) −10.0 10.5 1 −10.0
534 Formulation
24
2 4 6
42
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
12
1 23 45 54 67 76 8
31
3 35 5 7
We can assume without loss of generality that the transhipment problem is given
in standard form, that is X
minn cij xij (22.11)
x∈R
(i,j)∈A
subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
X X
xij − xki = si , ∀i ∈ N , (22.12)
j|(i,j)∈A k|(k,i)∈A
and
xij ≥ 0, ∀(i, j) ∈ A. (22.13)
In matrix form, we have
min cT x (22.14)
x∈Rn
subject to
Ax = s (22.15)
x ≥ 0, (22.16)
where A ∈ Rm×n is the incidence matrix of the network. Its columns correspond to
the arcs and the rows to the nodes of the network. The column corresponding to arc
(i, j) contains only 0, except for the entry corresponding to node i that contains 1,
and the entry corresponding to node j that contains −1.
Note that these transformations of the problem into a standard form are exactly
the same as the transformations described in Section 1.2. We have simply given a
concrete interpretation in the network context.
∂L
= cij + λi − λj − µij . (22.18)
∂xij
536 Total unimodularity
Moreover, from condition (6.57), for each arc transporting flow, we have µij = 0 and,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
therefore,
cij + λi − λj = 0, ∀(i, j) such that xij > 0. (22.20)
Conditions (22.19) and (22.20) are the complementarity slackness conditions pre-
sented in Theorem 6.34. They are therefore sufficient and necessary optimality con-
ditions for the transhipment problem. There is a dual variable λi associated with
each node i. When the complementarity slackness conditions are verified, λ is also an
optimal solution of the dual problem. Note that only differences of the dual variables
are involved in these conditions. Therefore, if λ ∈ Rm verifies conditions (22.19) and
(22.20), so does any vector such that all values of λ are shifted by a quantity σ, that
is λ + σe, where e ∈ Rm is a vector composed only of 1, for any σ ∈ R.
1
x∗B = C(B)T s, (22.22)
det(B)
where C(B) is the cofactor matrix of B (see Definition B.12). As each entry of C(B)
is a determinant of a matrix containing only 0, 1, and −1, they are all integers.
Therefore, if the supply vector s is integer, the vector C(B)T s is also integer. Now, if
the determinant of B happens to be either 1 or −1 (it cannot be 0, as B is invertible),
we obtain the nice property that x∗B (and, consequently, x∗ ) is integer. In this case,
B is said to be a unimodular matrix (see Definition B.14).
It is particularly valuable to obtain integer solutions without including explicit
integrality constraints in the optimization problem. Indeed, as discussed during the
presentation of the example in Section 1.1.7, constraining the variables to have only
integer values dramatically complicates the optimization problem, and methods such
as the simplex algorithm cannot be used anymore. Therefore, the property described
The transhipment problem 537
If the matrix A of the constraint is totally unimodular, each basis B has determi-
nant −1 or 1. Indeed, as it is non singular, the determinant cannot be 0. Therefore,
using the argument discussed above, any feasible basic solution (hence, any vertex of
the constraint polyhedron) is integer, including the optimal basic solutions.
Theorem 22.4 (Integrality of the basic solutions). Consider the polyhedron rep-
resented in standard form {x ∈ Rn |Ax = b, x ≥ 0}, where A ∈ Zm×n and b ∈ Zm .
If A is totally unimodular, then every basic solution is integer.
Proof. Assume by contradiction that A is not totally unimodular. There are, there-
fore, submatrices of A such that their determinant is not 0, 1, or −1. Among them,
consider one submatrix with minimum size k and call it B, with det(B) 6∈ {−1, 0, 1}.
As A has at most two non zero entries in each column, each column of B can have
0, 1, or 2 non zero entries.
Assume first that one column of B contains only 0. If it were the case, B would be
singular, and its determinant would be 0, which is not possible. Consequently, each
column of B contains at least one non zero entry.
Assume that one column of B contains exactly one non zero entry. Without loss
of generality, assume this entry to be b11 . It means that B is of the form
b11 b12 · · · b1k
0
B= .. .
. B′
0
Therefore,
det(B) = b11 det(B ′ ).
As b11 is either 1 or −1, then det(B ′ ) is the same as det(B), up to the sign. In
particular, det(B ′ ) is not 0, 1, or −1. As B ′ is strictly smaller than B, this is not
possible as B is the smallest submatrix with such a property. Consequently, each
column of B contains exactly two non zero entries. As they are subvectors of the
column of A, one of these entries is 1 and the other is −1.
Therefore, if we sum up all rows of the matrix B, we obtain 0, and the rows are
linearly dependent. It means that B is singular and det(B) = 0, which is not possible.
This contradicts the fact that A is not totally unimodular, and proves the result.
The transhipment problem 539
The concept of totally unimodular matrices goes beyond the transhipment prob-
lem, and plays an important role in discrete optimization. We refer the reader to
Nemhauser and Wolsey (1988), Wolsey (1998), or Bertsimas and Weismantel (2005)
for a more comprehensive description of the topic.
22.4 Modeling
The transhipment model embeds a variety of other network problems. In general,
these problems are associated with a dedicated algorithm that solves them more effi-
ciently than the simplex method applied to the transhipment formulation. However,
as they are instances of the transhipment problem, they also have its properties. In
particular, the integrality of an optimal solution is guaranteed if the supply/demand
is integer. In this section, we formulate these problems and show why they are tran-
shipment problems. Two of them are treated in greater details in later chapters,
where specific algorithms are presented.
The pervasiveness of GPS navigation systems and of online map services allows ev-
erybody to compute the fastest or the shortest itinerary between two points from
a computer or a navigation device (see Figure 22.4). The problem of finding such
itineraries is usually referred to as the shortest path problem and can be defined in
different ways. The classical definition is as follows.
From an algorithmic point of view, it is convenient to solve the problem for all
destinations at once.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 540 Modeling
Figure 22.4: The fastest path between EPFL and Zinal computed by
OpenRouteService.org
The definition 21.17 of path cost simplifies here. Indeed, we are looking only at
forward paths, and the set P← is empty. Moreover, we assume that only one unit of
flow is following the path, so that the cost of path P is
X
C(P) = cij . (22.25)
(i,j)∈P
As discussed in Section 21.5.4, the concept of cost is relatively general. Even if the
name of the problem refers to the “shortest” path, the cost does not need to be the
physical length of the arc. In the example of the online tools for itineraries, the
cost can be the travel time to traverse each arc. In this case, the solution of the
shortest path problem is actually the fastest path between o and d. As discussed in
Section 21.3, the only requirement is that the cost of a path is the sum of the cost of
its arcs.
The single origin-single destination shortest path problem is a transhipment prob-
lem where
• the cost on each arc is cij ,
• the supply for the origin is 1, that is so = 1,
The transhipment problem 541
subject to
X X
xoj − xko = 1,
j|(o,j)∈A k|(k,o)∈A
X X
xdj − xkd = −1,
j|(d,j)∈A k|(k,d)∈A
X X
xij − xki = 0, ∀i ∈ N , i 6= o, i 6= d,
j|(i,j)∈A k|(k,i)∈A
xij ≥ 0, ∀(i, j) ∈ A.
Consider the network represented in Figure 22.5, where the value of the upper
capacity of each arc is shown next to it. It may represent a railway network, with
the maximum number of trains per hour that can proceed between two cities. Or it
may represent a network of pipelines, where the capacity is the maximum number of
megaliters of oil that the pipe can transport per hour.
542 Modeling
4 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2 3 2
o 2 3 d
3
Figure 22.5: An example of a maximum flow problem. The value on each arc is its
capacity.
In this simple example, there are only 3 paths that can be used to transport the
flow:
• path 1: o → 2 → 3 → d,
• path 2: o → 3 → d,
• path 3: o → 2 → 4 → d.
Path 1 cannot transport more than 2 units of flow, which is the capacity of its first
and last arcs. If we send 2 units along path 1, path 2 cannot be used. Indeed,
path 2 includes arc (3, d), which cannot accommodate more than the 2 units already
transported along path 1. Similarly, path 3 cannot be used, as it includes arc (o, 2),
which is also at capacity. This strategy transports 2 units of flow from node o to node
d. It is possible to do better with the following reasoning. Path 2 cannot transport
more than 2 units of flow, which is the capacity of its last arc. If we send 2 units of
flow along path 2, path 1 cannot be used, as they share arc (3, d), which is at capacity.
But no arc in path 3 has been used. We can send a maximum of 1 unit along path
3, which is the capacity of its last arc. With this strategy, a total of 3 units are sent
from o to d. The associated flow vector is represented in Figure 22.6, where the flow
is shown next to each arc, together with the arc capacity (in square brackets).
1[4] 1[1]
2[3]
Figure 22.6: A solution of a maximum flow problem. The values on each arc are the
flows x and the capacities u in format x[u].
The transhipment problem 543
It happens to be the maximum possible. Indeed, all arcs arriving at node d are full
and, whatever is possible upstream, no more flow can arrive there. Clearly, such
enumerations cannot be done on real networks. Specialized algorithms are described
in Chapter 24.
The maximum flow problem can be modeled as a transhipment problem. There is
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
no cost associated with the arcs, and the quantity that is optimized is the divergence
of a node. The idea is to include in the network an artificial arc that takes the role of
a counter. This arc, connecting d to o, sends any unit of flow reaching the destination
back to the origin, with a cost of −1. This creates a circulation (the divergence of
each node is zero). As the real arcs have all zero costs, the total cost represents the
number of units of flow that are able to reach d from o through the “real” network
(with the opposite sign, as we need to maximize). This is illustrated in Figure 22.7,
where the cost on each arc and the upper capacity are shown.
[0; 4] [0; 1]
[0; 3]
[−1; +∞]
subject to
X X
xij − xki = 0, ∀i ∈ N , (22.28)
j|(i,j)∈A∪(d,o) k|(k,i)∈A∪(d,o)
where the arc (d, o) is the artificial arc added to create a circulation. In the example
presented in Figure 22.6, this arc would transport 3 units of flow.
Note that the maximum flow problem can be used to model a wide variety of
problems. An interesting example is the problem of locating n queens on a chessboard
so that they are not attacking each other (Gardner and Nicolio, 2008).
Note that a necessary condition for the problem to be feasible is that the total
P P
supply i si must equal the total demand j tj . As it appears from the definition,
this problem is not directly related to a physical network. The next example is about
the distribution of electricity.
The optimal solution, for a total cost of 173,138, suggests serving Lausanne entirely
from Mühleberg and serving Bern entirely from Leibstadt. The entire production of
Beznau is dedicated to Zürich. The rest is distributed to match the demand and
supply constraints, as described on the following table:
Zürich Geneva Lausanne Bern
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Bern
5
7
Leibstadt
16
9 Lausanne
10
13
Beznau
16 Geneva
9
6 14
Mühleberg 9
18
Zürich
subject to
md
X
xij = si , i = 1, . . . , mo ,
j=1
mo
X
xij = tj , j = 1, . . . , md ,
i=1
xij ≥ 0, i = 1, . . . , mo , j = 1, . . . , md ,
xij = 0, if i does not serve j.
-8,000 Harry
-11,000
-9,000
-9,000
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
-13,000 Ron
-14,000 -12,000
-11,000 Hermione
-12,000
-0.01
Ginny
subject to
n
X
xij = 1, i = 1, . . . , n, (22.32)
j=1
Xn
xij = 1, j = 1, . . . , n, (22.33)
i=1
xij ≥ 0, i = 1, . . . , n, j = 1, . . . , n, (22.34)
xij ≤ 1, i = 1, . . . , n, j = 1, . . . , n. (22.35)
The variable xij is to take on the value 1 if resource i is assigned to task j, and 0
otherwise. The last two constraints should be written as
However, Corollary 22.7 guarantees that there is an optimal solution that is integer,
as the supply vector is integer. Therefore, the entries of that optimal vector x are
The transhipment problem 549
22.5 Exercises
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 22.3: Best time for each swimmer and each stroke (Exercise 22.2)
Stroke Anna Eva Marija Shadi Marianne
Backstroke 37.7 32.9 33.8 37.0 35.4
Breaststroke 43.4 33.1 42.2 34.7 41.8
Butterfly 33.3 28.5 38.9 30.4 33.6
Freestyle 29.2 26.4 29.6 28.5 31.1
Transform the problem into an assignment problem (Definition 22.13) and provide
its mathematical formulation as a transhipment problem. Find an optimal solution
using the simplex algorithm (Algorithm 16.5).
Exercise 22.3. During a wedding dinner gathering p families, the guests are invited
to sit at q tables. Denote by ai the number of members of family i, and by bj the
number of seats at table j. In order to encourage social exchanges, two members of
the same family cannot sit at the same table. Moreover, the first and the second
family do not talk to each other anymore, and do not want to be seated at the same
table.
1. Formulate a network model that helps to seat all the guests and respect the above
mentioned conditions.
2. Investigate the existence of a solution.
3. Solve the problem with p = 6, q = 6, a1 = 3, a2 = 2, a3 = 5, a4 = 4, a5 = 3,
a6 = 1, bj = 3, j = 1, . . . , 6 using the simplex algorithm (Algorithm 16.5).
Exercise 22.4. After spending a weekend with friends, Aria has determined the
amount of money that they owe each other, as presented in Table 22.4.
François requests a simple solution that minimizes the sum of transfers. Model
that problem as a transhipment problem and solve it using the simplex algorithm
550 Exercises
Monia 0. -
Gabriel 8.- Monia
François 10.- Aria
François 16.- Monia
(Algorithm 16.5).
Exercise 22.5. Consider the network represented in Figure 21.25, where each arc
(i, j) is associated with its lower bound ℓij , its flow xij , and its upper bound uij in
the following way: (ℓij , xij , uij ).
1. Write the mathematical formulation of the maximum flow problem, as a tranship-
ment problem.
2. Solve it using the simplex algorithm (Algorithm 16.5).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 23
Shortest path
Contents
The shortest path problem is defined in Section 22.4.1. In this chapter, we focus on
solving the problem.
When looking at a map, it may look relatively easy to identify the shortest path.
But the shortest path problem for general networks does not inherit the intuitive
properties of a map. First, an algorithm does not benefit from the bird’s eye view
of the network. As discussed in Section 21.5.5, data structures such as adjacency
matrices or adjacency lists are used in general. They provide a myopic view of the
network topology, similar to what would be the case in a labyrinth, in the sense
that, given a node, we have direct access only to the adjacent nodes. Second, on
geographical maps, the triangle inequality is verified, so that the distance as the crow
flies between two nodes can be used as a reference to compare with the length of paths.
The path that deviates the least from the straight line is likely to be the shortest,
and the length of the detours can be roughly estimated. In general networks, the
nodes may not necessarily correspond to geographical locations, and the arc cost may
not represent the Euclidean distance. Consequently, the triangle inequality may not
necessarily hold, and the intuition inspired by geographical maps cannot be used. For
instance, consider the network represented in Figure 23.1, where the number next to
each arc is its cost, and the number associated with each node is its identifier. The
cost to go from node 9 to node 10 through nodes 13 and 14 is less then the cost of
the direct arc, violating the triangle inequality.
552 Properties
Table 23.1 enumerates all simple paths connecting node 1 and node 16 in this
network. There are 20 of them. The shortest one is represented in bold, both in
Figure 23.1 and Table 23.1. Obviously, a straight line between node 1 and node 16
does not provide any intuition about the shortest path.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
8 1 1
1 2 3 4
1 1 8 1
8 8 8
5 6 7 8
1 1 8 1
8 8 8
9 10 11 12
1 1 8 1
1 8 8
13 14 15 16
23.1 Properties
Clearly, the path enumeration is not appropriate in practice to identify the shortest
path. The number of paths between two nodes can grow exponentially with the size
of the network.
Instead, we exploit the fact that the shortest path problem is a transhipment
problem (see Section 22.4.1). The optimality conditions (22.19)–(22.20) have a nice
interpretation in that case. For each arc (i, j) in the network,
λj ≤ cij + λi . (23.1)
For each arc on the shortest path (that is, in terms of the transhipment problem, for
each arc transporting flow), we have
λj = cij + λi . (23.2)
As the optimality conditions of the shortest path problem are derived directly from
the complementarity slackness conditions, the next theorem does not need a proof.
However, we provide a proof to obtain some insight in the interpretation of the dual
variables.
Shortest path 553
Table 23.1: List of simple forward paths between node 1 and node 16 in the network
from Figure 23.1
Path Cost Sequence of nodes
1 13 1 2 3 4 8 12 16
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2 15 1 5 6 2 3 4 8 12 16
3 29 1 5 6 7 3 4 8 12 16
4 27 1 5 6 7 8 12 16
5 17 1 5 9 10 6 2 3 4 8 12 16
6 31 1 5 9 10 6 7 3 4 8 12 16
7 29 1 5 9 10 6 7 8 12 16
8 38 1 5 9 10 11 7 3 4 8 12 16
9 36 1 5 9 10 11 7 8 12 16
10 27 1 5 9 10 11 12 16
11 12 1 5 9 13 14 10 6 2 3 4 8 12 16
12 26 1 5 9 13 14 10 6 7 3 4 8 12 16
13 24 1 5 9 13 14 10 6 7 8 12 16
14 33 1 5 9 13 14 10 11 7 3 4 8 12 16
15 31 1 5 9 13 14 10 11 7 8 12 16
16 22 1 5 9 13 14 10 11 12 16
17 40 1 5 9 13 14 15 11 7 3 4 8 12 16
18 38 1 5 9 13 14 15 11 7 8 12 16
19 29 1 5 9 13 14 15 11 12 16
20 20 1 5 9 13 14 15 16
Theorem 23.1 (Optimality conditions for the shortest path problem). Consider a
network (N , A) with n arcs and m nodes, and the cost vector c ∈ Rn . Consider
a vector λ ∈ Rm such that
Q = o → j1 → j2 . . . jℓ → d.
The total cost C(Q) of Q is the sum of the cost of each arc on Q:
as for each node i different from o and d, both λi and −λi are involved in the sum,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
P = o → i1 → i2 . . . ik → d.
The total cost C(P) of P is the sum of the cost of each arc on P:
From (23.5), we obtain for any path Q that C(Q) ≥ C(P), proving that P is the path
with minimum cost.
The dual variable λi is usually called the label of node i. Equation (23.6) shows
that the length of the shortest path is the difference between the label of the des-
tination and the label of the origin. As discussed in Section 22.2, the optimality
conditions are not affected if all labels are shifted by the same constant. Therefore,
it is always possible to impose λo = 0. In that case, the label λi can be interpreted
as the cost of the shortest path from o to i.
Figure 23.2 represents the same network as Figure 23.1, where each node is asso-
ciated with a label. It can easily be verified that condition (23.3) is verified for each
arc in the network. Each arc (i, j) such that λj = λi + cij is represented in bold, and
each arc such that λj < λi + cij is represented with a dotted line. The subnetwork
consisting of all arcs in bold is a spanning tree (as discussed later, a solution of the
single origin-multiple destination shortest path problem is always a spanning tree).
Therefore, from characterization 3 of Theorem 21.10, there is a single path with
bold arcs between node o and any node i. As all arcs of this path verify the optimality
conditions, it is the shortest path.
We now prove some properties of the shortest path. The first result states that
no shortest path exists if the network contains a negative cost cycle. Intuitively, such
a cycle could be followed as many times as needed to reach any arbitrarily low value
for the cost of the path. From the point of view of the transhipment problem, the
linear optimization problem is not bounded.
8 1 1
0 7 8 9
1 1 8 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
8 8 8
1 6 14 10
1 1 8 1
8 8 8
2 5 13 11
1 1 8 1
1 8 8
3 4 12 12
Figure 23.2: Shortest path tree, with node labels and arc costs
Proof. Consider the forward path P between o and d containing a negative cost cycle.
Denote Cc < 0 the cost of the cycle, and Cr = C(P) − Cc the cost of the rest of the
path. A new path Pk between o and d can be created by including the cycle k times
instead of only once. The cost of Pk is Cr + kCc . Assume by contradiction that there
exists a shortest path Q between o and d. Select
C(Q) − Cr
k> .
Cc
Then, the cost of Pk is less than the cost of Q. Indeed, as Cc < 0, we have
C(Q) − Cr
C(Pk ) = Cr + kCc < Cr + Cc = C(Q).
Cc
Lemma 23.3. [Shorter simple paths] Consider a network (N , A), and two nodes
o and d. Consider a forward path P between o and d that does not contain a
negative cost cycle. Then there exists a simple forward path Q from o to d such
that C(Q) ≤ C(P).
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Proof. If the path P is simple, the result is immediate. Assume that path P contains
node j several times, that is
P = o → i1 → i2 . . . ik → j → ik+1 . . . iℓ → j → iℓ+1 . . . → im → d,
where the first occurrence of node j is after node ik , and the last occurrence before
node iℓ+1 . The cost of P is
C(P) = C1 + C2 + C3 ,
where
By assumption, P does not contain a negative cost cycle, and the cost C2 of the cycle
is non negative, that is C2 ≥ 0. Therefore, the path obtained by removing the cycle
is
P ′ = o → i1 → i2 . . . ik → j → iℓ+1 . . . → im → d
and has lower cost
C(P ′ ) = C1 + C3 ≤ C(P).
Note that node j appears exactly once in path P ′ . If P ′ is simple, the result is obtained.
Otherwise, P ′ contains another cycle that can be removed in the same way. Cycles
are removed until a simple path is obtained.
The lemma motivates the use of simple paths when shortest paths are considered.
Indeed, any cycle can be skipped to make the path shorter (until it becomes simple),
except if one of those cycles has a negative cost. The existence of a shortest path can
be deduced directly from this result.
Proof. The necessary condition is Theorem 23.2. For the sufficient condition, assume
that there is at least one path, and no path with a negative cycle. Consider all simple
paths from o to d. From Lemma 21.6, there is a finite number of them. As there
Shortest path 557
is at least one path between o and d, Theorem 23.3 guarantees that there is also a
simple path, so that the set of simple paths is not empty. Therefore, the simple path
with minimum cost can be identified. Call it P. Take an arbitrary path Q from o
to d. From Theorem 23.3, there is a simple path Q ′ such that C(Q ′ ) ≤ C(Q). By
definition of P, we have also C(P) ≤ C(Q ′ ). Consequently, C(P) ≤ C(Q), proving
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
As an immediate corollary of Lemma 23.3, the shortest path can be found among
the simple paths.
Proof. Let P be a shortest path from o to d. From Theorem 23.2, the path does not
contain a negative cost cycle. From Theorem 23.3, there exists a simple path Q such
that C(Q) ≤ C(P). As P is a shortest path, we must have C(Q) = C(P), proving the
result.
The next corollary gives a lower bound on the length of the shortest path. It is
used in the algorithms to detect negative cost cycles.
Corollary 23.6 (Lower bound on the length of the shortest path). Consider a
network (N , A) with n arcs and m nodes, the cost vector c ∈ Rn , two nodes o
and d, and P a simple shortest path between o and d. If c ≥ 0, C(P) ≥ 0. If
c 6≥ 0, then
C(P) ≥ (m − 1) min cij . (23.7)
(i,j)∈A
1 Dynamic programming is not covered in this book. (See Bellman, 1957, or the more recent
edition Bellman, 2010), among many references.
558 The shortest path algorithm
Proof. As there is a shortest path, there is no path with negative cost cycle. Assume
by contradiction that there exists a path Q between o and iℓ such that C(Q) < C(Poℓ ).
The path from o to d obtained by merging Q and Pℓd has cost
which contradicts the fact that P is a shortest path. The proof that Pℓd is shortest is
similar.
c ij
o i
Using the labyrinth analogy suggested in Section 21.5.5, the algorithm is like an
explorer systematically exploring all the corridors of this labyrinth (the arcs), while
recording their length. The mileage counter is set to 0 at the starting point (the
origin o). When the explorer reaches an intersection (a node), it records the current
mileage, which is the mileage reached at the previous node (λi ) plus the length of the
corridor (cij ). Now two things may happen. If it is the first time that node j is visited,
the mileage is simply recorded and written on a wall of the intersection. Otherwise,
there is already a mileage written on a wall, that is the length of a previous path
that has been used to reach j. Interestingly, it does not matter what path it is. Its
length is the only relevant information here. If the new mileage (λi + cij ) is greater or
equal to λj , nothing is done. The new path is not shorter. Otherwise, the new path
is shorter, the value of λj is erased and replaced by λi + cij . It is also convenient to
record that the predecessor of node j along the new path is node i.
The key difficulty here is to guarantee the systematic exploration of the network.
The advantage of the algorithm compared to an explorer in a labyrinth is that it
can be teleported to any location in the network. We need to identify the list of
these locations that must be visited. We maintain a set S of nodes that must be
560 The shortest path algorithm
“treated,” where the treatment consists in the label updating described above for
each arc leaving that node. Once the node has been treated, it is removed from S.
During the treatment, the label of other nodes may be updated. Such nodes are
included in the set S in order to be treated later. Before the algorithm starts, the set
S contains only the origin. All labels are initialized to +∞, except the label of the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
26 S := S \ {i}.
27 Until S = ∅.
Shortest path 561
Example 23.8 (The shortest path algorithm). We apply Algorithm 23.1 on the
network represented in Figure 23.1, where the origin is node 1. Table 23.2 reports
the set S, the treated node i and the value of all labels at each iteration. Table 23.3
reports the predecessors vector π at each iteration. During the first iteration, only
node 1 is in set S and is therefore treated. There are only two arcs originating from
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
node 1: (1, 2) and (1, 5). As the label of nodes 2 and 5 have been initialized to ∞,
condition (23.8) is trivially verified, and the labels of nodes 2 and 5 are updated to
0 + 8 and 0 + 1 respectively. Meanwhile, π2 and π5 are set to 1, as node 1 is the
predecessor in the current path that has been used to reach these two nodes.
During iteration 8, node 10 is treated. Its label is 10. The algorithm considers arc
(10, 6) with cost 1. As λ6 = 9 ≤ 10 + 1, nothing is done. The same happens for arc
(10, 11), as λ11 = 18 ≤ 10 + 8. Therefore, no label is updated during that iteration,
and node 10 is simply removed from S.
At iteration 14, node 10 is treated again. Its label is now 5. The algorithm
considers arc (10, 6) with cost 1. As λ6 = 9 > 5 + 1, the label of node 6 is updated,
π6 is set to 10, and node 6 included into S. The same happens for arc (10, 11), as
λ11 = 18 > 5 + 8. Note that, by coincidence, the value of π11 used to be 10, and is
therefore not updated.
The final labels correspond to those reported in Figure 23.2. The final value of π
allows us to reconstruct the shortest paths using a backward procedure. We illustrate
it for the shortest path from o to node 11. As π11 = 10, the predecessor of node 11
is node 10. As π10 = 14, the predecessor of node 10 is node 14, and so on. Following
this scheme, one obtains the path
o → 5 → 9 → 13 → 14 → 10 → 11.
Theorem 23.9 (Invariants of the shortest path algorithm). The following properties
hold at the end of each iteration of Algorithm 23.1:
1. If i ∈ S, then λi 6= ∞.
2. For each node i, the value of λi does not increase during the iteration.
3. If λi 6= ∞, it is the length of one path from o to i.
4. If i 6∈ S, then λi = ∞ or λj ≤ λi + cij , for all j such that (i, j) ∈ A.
Proof. 1. During the initialization, node o is included in S at step 14, and λo is set
to 0 (step 12). Any other node in S has been included at step 25. Therefore, the
condition at step 19 is verified, and λi 6= ∞. Therefore, the update at step 20
gives a finite label to j before including it in S, proving the result.
2. It is a direct consequence of the condition at step 19 and the label update statement
at step 20.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 23.2: Description of the iterations of the shortest path algorithm for Example 23.8
562
3 {3 6 9} 3 0 8 9 1 9 2
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
4 {6 9 4} 6 0 8 9 10 1 9 2
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
5 {9 4 7} 9 0 8 9 10 1 9 17 2
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
6 {4 7 10 13} 4 0 8 9 10 1 9 17 2 10 3
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
7 {7 10 13 8} 7 0 8 9 10 1 9 17 11 2 10 3
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
8 {10 13 8} 10 0 8 9 10 1 9 17 11 2 10 3
∞ ∞ ∞ ∞ ∞ ∞
9 {13 8 11} 13 0 8 9 10 1 9 17 11 2 10 18 3
∞ ∞ ∞ ∞ ∞
10 {8 11 14} 8 0 8 9 10 1 9 17 11 2 10 18 3 4
∞ ∞ ∞ ∞ ∞
11 {11 14 12} 11 0 8 9 10 1 9 17 11 2 10 18 12 3 4
∞ ∞ ∞ ∞
12 {14 12} 14 0 8 9 10 1 9 17 11 2 10 18 12 3 4
∞ ∞ ∞
13 {12 10 15} 12 0 8 9 10 1 9 17 11 2 5 18 12 3 4 12
∞ ∞
14 {10 15 16} 10 0 8 9 10 1 9 17 11 2 5 18 12 3 4 12 13
∞ ∞
15 {15 16 6 11} 15 0 8 9 10 1 6 17 11 2 5 13 12 3 4 12 13
∞
The shortest path algorithm
16 {16 6 11} 16 0 8 9 10 1 6 17 11 2 5 13 12 3 4 12 13
17 {6 11} 6 0 8 9 10 1 6 17 11 2 5 13 12 3 4 12 13
18 {11 2 7} 11 0 7 9 10 1 6 14 11 2 5 13 12 3 4 12 13
19 {2 7} 2 0 7 9 10 1 6 14 11 2 5 13 12 3 4 12 13
20 {7 3} 7 0 7 8 10 1 6 14 11 2 5 13 12 3 4 12 13
21 {3} 3 0 7 8 10 1 6 14 11 2 5 13 12 3 4 12 13
22 {4} 4 0 7 8 9 1 6 14 11 2 5 13 12 3 4 12 13
23 {8} 8 0 7 8 9 1 6 14 10 2 5 13 12 3 4 12 13
24 {12} 12 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 13
25 {16} 16 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
26 {} 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 23.3: Value of π for each iteration of the shortest path algorithm for Example 23.8
Iter. π1 π2 π3 π4 π5 π6 π7 π8 π9 π10 π11 π12 π13 π14 π15 π16
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
2 -1 1 2 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
3 -1 1 2 -1 1 5 -1 -1 5 -1 -1 -1 -1 -1 -1 -1
4 -1 1 2 3 1 5 -1 -1 5 -1 -1 -1 -1 -1 -1 -1
5 -1 1 2 3 1 5 6 -1 5 -1 -1 -1 -1 -1 -1 -1
6 -1 1 2 3 1 5 6 -1 5 9 -1 -1 9 -1 -1 -1
7 -1 1 2 3 1 5 6 4 5 9 -1 -1 9 -1 -1 -1
8 -1 1 2 3 1 5 6 4 5 9 -1 -1 9 -1 -1 -1
9 -1 1 2 3 1 5 6 4 5 9 10 -1 9 -1 -1 -1
10 -1 1 2 3 1 5 6 4 5 9 10 -1 9 13 -1 -1
11 -1 1 2 3 1 5 6 4 5 9 10 8 9 13 -1 -1
12 -1 1 2 3 1 5 6 4 5 9 10 8 9 13 -1 -1
13 -1 1 2 3 1 5 6 4 5 14 10 8 9 13 14 -1
Shortest path
14 -1 1 2 3 1 5 6 4 5 14 10 8 9 13 14 12
15 -1 1 2 3 1 10 6 4 5 14 10 8 9 13 14 12
16 -1 1 2 3 1 10 6 4 5 14 10 8 9 13 14 12
17 -1 1 2 3 1 10 6 4 5 14 10 8 9 13 14 12
18 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
19 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
20 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
21 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
22 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
23 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
24 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
25 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
563
26 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
564 The shortest path algorithm
3. Consider the first iteration. Before the iteration starts, all labels are set to ∞
(step 13), except λo = 0 (step 12). Note that the value 0 can be interpreted as the
length of a path from o to o. During the first iteration, all nodes i such that the
arc (o, i) exists have their label set to λo + coi = coi (step 20). This is obviously
the length of the direct path from o to i. All other labels remaining at ∞, the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
result is proved for the first iteration. Assume now by induction that the result is
true at the beginning of an iteration where the treated node (selected at step 17)
is i. From property 1, we have λi 6= ∞ and, by induction assumption, λi is the
length of a path P between o and i. When the label of a node j is updated at step
20, its value is therefore set to the length of the path composed of path P extended
by arc (i, j), proving the result for all labels updated during this iteration. As the
other labels are untouched, the result holds for all nodes.
4. There are two reasons for i not to be in S. First, if i has never been treated by
the algorithm. In that case, its label has not been updated and remains at the
initial value ∞. Second, i has been treated and removed from S. Because of step
19, just after i has been treated, we have λj ≤ λi + cij for all (i, j) ∈ A. Then
the label of i is not touched anymore while it is out of S. As soon as the label is
updated at step 20, i comes back into S (step 25). In the meantime, any other
label can only decrease (see property 2 above), so that the condition λj ≤ λi + cij
is verified whenever i is not in S.
Theorem 23.10 (Termination of the shortest path algorithm). Algorithm 23.1 ter-
minates after a finite number of iterations.
a finite label. This contradicts the assumption, proving the sufficient condition. The
necessary condition is shown by the contrapositive of property 3 of Theorem 23.9,
which states that if there is no path from o to j, then λj = ∞.
Consider now the case where λj 6= ∞. By property 4 of Theorem 23.9, we have
for each i such that λi 6= ∞,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Consider a node ℓ. From property 3 of the same theorem, λℓ is the length of a path
from o to ℓ. Call it Pℓ . Take any path Q from o to ℓ. Using the same argument as in
the proof of Theorem 23.1, we have
C(Q) ≥ λℓ − λo .
It means that there exists (i, j) ∈ A such that λj > λi + cij , contradicting (23.3).
Assume next that
λj < min (λi + cij ).
(i,j)∈A
Proof. As the network does not contain a cycle with negative length, Algorithm 23.1
terminates with S = ∅. Assume by contradiction that Bellman’s subnetwork contains
a cycle i1 , . . . , iℓ . Its length is
ci1 i2 +ci2 i3 +· · ·+ciℓ−1 iℓ +ciℓ i1 = λi2 −λi1 +λi3 −λi2 +· · ·+λiℓ −λiℓ−1 +λi1 −λℓ = 0,
Table 23.4: Description of the iterations of the Dijkstra algorithm for Example 23.8
Iter. S i λ1 λ2 λ3 λ4 λ5 λ6 λ7 λ8 λ9 λ10 λ11 λ12 λ13 λ14 λ15 λ16
0 {1} 1 0
1 {2 5} 5 0 8 1
2 {2 6 9} 9 0 8 1 9 2
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
3 {2 6 10 13} 13 0 8 1 9 2 10 3
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
4 {2 6 10 14} 14 0 8 1 9 2 10 3 4
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
5 {2 6 10 15} 10 0 8 1 9 2 5 3 4 12
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
6 {2 6 15 11} 6 0 8 1 6 2 5 13 3 4 12
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
7 {2 15 11 7} 2 0 7 1 6 14 2 5 13 3 4 12
∞ ∞ ∞ ∞ ∞ ∞ ∞
8 {15 11 7 3} 3 0 7 8 1 6 14 2 5 13 3 4 12
∞ ∞ ∞ ∞ ∞ ∞
Shortest path
9 {15 11 7 4} 4 0 7 8 9 1 6 14 2 5 13 3 4 12
∞ ∞ ∞ ∞ ∞
10 {15 11 7 8} 8 0 7 8 9 1 6 14 10 2 5 13 3 4 12
∞ ∞ ∞ ∞
11 {15 11 7 12} 12 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12
∞ ∞ ∞
12 {15 11 7 16} 15 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
∞ ∞
13 {11 7 16} 16 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
∞
14 {11 7} 11 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
15 {7} 7 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
16 {} 0 7 8 9 1 6 14 10 2 5 13 11 3 4 12 12
567
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 568
Table 23.5: Value of π for each iteration of the Dijkstra algorithm for Example 23.8
Iter. π1 π2 π3 π4 π5 π6 π7 π8 π9 π10 π11 π12 π13 π14 π15 π16
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
2 -1 1 -1 -1 1 5 -1 -1 5 -1 -1 -1 -1 -1 -1 -1
3 -1 1 -1 -1 1 5 -1 -1 5 9 -1 -1 9 -1 -1 -1
4 -1 1 -1 -1 1 5 -1 -1 5 9 -1 -1 9 13 -1 -1
5 -1 1 -1 -1 1 5 -1 -1 5 14 -1 -1 9 13 14 -1
6 -1 1 -1 -1 1 10 -1 -1 5 14 10 -1 9 13 14 -1
7 -1 6 -1 -1 1 10 6 -1 5 14 10 -1 9 13 14 -1
8 -1 6 2 -1 1 10 6 -1 5 14 10 -1 9 13 14 -1
9 -1 6 2 3 1 10 6 -1 5 14 10 -1 9 13 14 -1
Dijkstra’s algorithm
10 -1 6 2 3 1 10 6 4 5 14 10 -1 9 13 14 -1
11 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 -1
12 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
13 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
14 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
15 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
16 -1 6 2 3 1 10 6 4 5 14 10 8 9 13 14 12
Shortest path 569
21 S := S \ {i}.
22 Until S = ∅.
Dijkstra’s algorithm has the same properties as the shortest path algorithm, described
in Section 23.2. It has also the following properties.
The following properties hold at the end of each iteration of Algorithm 23.2:
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1. If i ∈ T and j 6∈ T , then λi ≤ λj .
2. If i ∈ T in the beginning of the iteration, then the label λi is not modified
during the iteration.
3. If i ∈ T in the beginning of the iteration, then i 6∈ S at the end of the iteration.
4. If i ∈ T , then λi is the length of the shortest path from o to i.
Proof. 1. We prove properties 1 and 2 by induction. Property 1 holds for the first
iteration, where node o is treated, with λo = 0. It is the only node in T at the
end of the iteration. All other labels are equal to ∞, except for nodes j such that
(o, j) ∈ A. As λj = coj ≥ λo = 0, the property holds for these labels. As T = ∅
at the beginning of the iteration, property 2 trivially holds for the first iteration.
Consider now another iteration, and assume that property 1 is true at the begin-
ning of the iteration, that is λi ≤ λj , ∀i ∈ T , ∀j 6∈ T . The iteration is treating
node ℓ. According to the rule of node selection,
λℓ ≤ λj , ∀j 6∈ T . (23.12)
4. From property 2, the label of i will not be modified anymore by any iteration.
Therefore, when the algorithm terminates (Theorem 23.13), the final value is λi .
From Theorem 23.11, it is the length of the shortest path from o to i.
subject to
X X
xoj − xko = 1,
j|(o,j)∈A k|(k,o)∈A
X X
xdj − xkd = −1,
j|(d,j)∈A k|(k,d)∈A
X X
xij − xki = 0, ∀i ∈ N , i 6= o, i 6= d,
j|(i,j)∈A k|(k,i)∈A
xij ≥ 0, ∀(i, j) ∈ A.
As discussed in Section 1.2.1 and as with any optimization problem, it can be trans-
formed into a minimization problem by changing the sign of the objective function:
X X X
maxn cij xij ⇐⇒ minn − cij xij = (−cij )xij . (23.14)
x∈R x∈R
(i,j)∈A (i,j)∈A (i,j)∈A
572 The longest path problem
Consequently, it is equivalent to the shortest path problem where the sign of each cost
in the network has been changed. Note that, in many applications, this transformed
problem is likely to contain negative cost cycles. In this case, the problem posed as a
transhipment problem is unbounded, and the shortest path algorithm does not work.
Other modeling frameworks related to combinatorial optimization (see Part VII) must
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
be considered.
A concrete application of the longest path problem is the program evaluation and
review technique (PERT) used in project management. Consider a project composed
of m tasks of a given duration. Each task i is associated with a list of other tasks that
must be completed before task i can start. They are the predecessors of task i. For
example, consider a household that decides to renovate the bathroom in the house.
The list of tasks, together with their duration (in days) and list of predecessors, is
reported in Table 23.6.
The relevant questions for project management are: what is the minimum possible
duration of the project? What are the tasks that do not tolerate any delay without
delaying the duration of the whole project? Such tasks are called critical .
We construct a network in the following way:
• a node is associated with each task;
• a node o represents the beginning of the project;
• a node d represents the end of the project;
• for each task j, insert an arc (i, j) for each predecessor i;
• for each task j without predecessor, insert an arc (o, j);
• for each task i without successor, that is, each task which is the predecessor of no
other task, insert an arc (i, d);
Shortest path 573
• for each task i, the cost of each arc (i, j) is the duration of task i;
• the cost of each arc (o, j) is 0.
An arc (i, j) means that “task i must be completed before task j is started.” Note
that, thanks to the network structure, arcs are needed only for direct predecessors.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
In our example, task 11 (tiling) cannot start if task 5 (select the tiles) has not been
completed. However, there is no need to insert an arc between these two tasks. By
transitivity, the precedence is captured by the presence of a forward path between
the two tasks. The network representation for the bathroom project is illustrated in
Figure 23.5. To answer the two questions for the project management, a longest path
problem must be solved. Note that such a network does not contain any forward cycle.
Indeed, as each arc (i, j) means “task i must be completed before starting task j,” a
forward cycle would mean that, for each node i on the cycle, task i must be completed
before starting task i, which is a non sense. If it appears to be the case, there must
be a mistake in the problem definition. Consequently, when solving the longest path
problem with the shortest path algorithm, although all costs are negative, no negative
cost cycle exists, and the algorithm terminates with a valid solution. The optimal
labels provide, after changing their sign, the earliest time when each task can be
started. The label of node d is the maximum project duration. For our example, task
7, say, cannot start before 13 days, and the project cannot last less than 24 days (see
Table 23.7). The arcs in the longest path tree are depicted in bold in Figure 23.5. It
can be seen that the longest path is the sequence of tasks 1, 2, 3, 6, 4, 7, 9, 11, and
12, taking a total of 24 days. These tasks are critical tasks, and this path is called
a critical path. If any of these tasks were delayed just a little, the whole project
would be delayed as well. Consequently, the pressure should be put on the tiler. The
installer can afford some delay (how much?) without affecting the end of the whole
project. Note that, in the presence of several longest paths, the algorithm is not
reporting all critical tasks.
1 2 5
2 5 7 9
1 3
1 1
0 1 3 3 2
o 1 3 4 11 12 d
5 2 1
3
5 6 2
6 8 10 13
2 -1 7 -13 12 -22
3 -2 8 -10 13 -18
4 -10 9 -18 d -24
Many variants of the algorithms presented in this chapter have been proposed in
the literature. Namely, some algorithms such as the A∗ algorithm (Hart et al., 1968)
are designed to solve the shortest path problem for road networks, where the Eu-
clidean distance can be exploited as a proxy to the shortest path distance. Algo-
rithms designed to be efficient for navigation systems have also been proposed (see,
for instance, Abraham et al., 2011).
23.5 Exercises
Exercise 23.1. Consider the network represented in Figure 23.6, where the cost of
each arc is shown next to it. Apply Dijkstra’s algorithm (Algorithm 23.2) to identify
the shortest path from node o to any other node.
7
2 4 6 8
2 3
5
3
o 9
1
4
5 8
4
1 3 5 7
1 1 6
Figure 23.6: Network for Exercise 23.1. The cost of each arc is shown next to it
Exercise 23.2. Consider the network represented in Figure 23.7, where the value as-
sociated with each arc represents its length. Determine, when they exist, the shortest
paths from node o to all other nodes in the network.
Shortest path 575
2
2 5
4
o 3 1
5
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
4
6
4
8
3
2 2 3 1 6 8
2
7 6
6
Figure 23.7: Network for Exercise 23.2, where the value associated with each arc
represents its length
Exercise 23.3. Modify Dijkstra’s algorithm to generate all shortest path trees. Hint:
maintain several labels at each node.
Exercise 23.4. A museum hires attendants during opening hours, from 9:00 to 17:00.
It has the possibility of hiring several people, each of them being available for several
hours during the day, at a given cost, as reported in Table 23.8. Identify who the
museum should hire so that there is at least one attendant present in the museum at
any time, in order to minimize the total cost. Hint: model the problem as a shortest
path problem.
Table 23.8: Availabilities and costs of the museum attendants for Exercise 23.4
Name from to cost
Durin 9:00 13:00 30
Isumbras 9:00 11:00 18
Hamfast 12:00 15:00 14
Isengrim 12:00 17:00 38
Arathorn 14:00 17:00 16
Bilbo 13:00 16:00 22
Gelmir 16:00 17:00 9
Exercise 23.5. Consider the six Swiss cities represented in Figure 23.8. The travel
time by car (C) and by public transportation (PT) is shown next to each arc con-
necting two cities.
1. Identify the fastest itinerary from Orbe to any other city by car.
2. Identify the fastest itinerary from Orbe to any other city by public transportation.
576 Exercises
3. Thanks to the car sharing service, the traveler can change from car to public
transportation, or the other way around, in any city. In this context, identify the
fastest itinerary from Orbe to any other city.
4. Thanks to the car sharing service, the traveler can change from car to public trans-
portation, or the other way around, but only in Lausanne, Bern, and Fribourg.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
In this context, identify the fastest itinerary from Orbe to any other city.
Neuchatel
C:47
C:48 PT:34 Bern
PT:64 PT:54 PT:22
C:36 C:34
Fribourg
Orbe
C:50
PT:98 PT:43
C:28 C:103 PT:87
PT:120
Lausanne C:83
C:71
PT:79
Sierre
Figure 23.8: Six cities in Switzerland, with the travel time by car (C) and by public
transportation (for Exercise 23.5)
Exercise 23.6. In the program evaluation and review technique (PERT) presented
in Section 23.4, the longest path problem allows us to identify the earliest possible ter-
mination of each task. Design an algorithm to identify the latest possible termination
of each task. Hint: start from node d and proceed backward.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 24
Maximum flow
Contents
24.1 The Ford-Fulkerson algorithm . . . . . . . . . . . . . . . . 577
24.2 The minimum cut problem . . . . . . . . . . . . . . . . . . 583
24.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
The algorithm is based on two concepts: unsaturated paths and saturated cuts.
We illustrate these ideas using the small example presented in Section 22.4.2. As
discussed there, we start by sending 2 units of flow on the path o → 2 → 3 → d
(the maximum that can be transported) to obtain the flow pattern illustrated in
Figure 24.2(a). No more flow can be sent on this path, which is said to be saturated.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
4
0[4] 0[1]
0[3]
(a) 2 units sent
4
0[4] 0[1]
0[3]
(b) Unsaturated path
4
1[4] 1[1]
1[3]
(c) 1 more unit sent
Figure 24.2: Finding the maximum flow. On each arc, the flow xij and the capacity
cij are shown as xij [cij ]
considering paths with backward arcs in order to update the current flow vector.
In this example, the path o → 3 ← 2 → 4 → d represented in Figure 24.2(b) is
unsaturated, in the sense that some flow can be sent along this path from o to d.
Indeed, arc (o, 3) can transport up to 3 units of flow. Arc (2, 3) is traversed backward.
It means that a unit of flow traversing it is decreasing the current value, which is 2. As
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
the lower bound is 0, the arc is not at capacity and can transport up to 2 units of flow
backward. Arc (2, 4) can transport 4 units of flow, and arc (4, d) only 1. Therefore,
1 unit of flow can be sent along this path to obtain the flow pattern represented in
Figure 24.2(c). If we decompose the flow (Algorithm 21.3, but it is easy to do it by
hand here), we obtain that one unit of flow is sent along path o → 2 → 3 → d, one
unit along path o → 3 → d, and one unit along path o → 2 → 4 → d. Note that it is
not the same optimal solution as the one proposed in Section 22.4.2, but it achieves
the same objective, that is, transporting 3 units of flow from o to d.
Consider now the cut
Γ = ({o, 2, 3, 4}, {d}).
We have Γ → = {(3, d), (4, d)}, and Γ ← = ∅. Therefore, the flow through the cut is
X(Γ ) = 1 + 2 = 3, and its capacity is U(Γ ) = 1 + 2 = 3. The cut is therefore saturated,
and there is no way to send more flow from the first set of nodes to the second. As
the cut separates o from d, there is therefore no way to send more flow from o to d,
and the solution is optimal.
The above example provides the intuition of the concept of a saturated path. The
formal definition follows.
Definition 24.1 (Saturated path). Consider a network (N , A), with m nodes and
n arcs, a vector of lower capacities ℓ ∈ Rn , a vector of upper capacities u ∈ Rn , a
feasible flow vector x ∈ Rn , and a path P. The path P is saturated with respect to x
if
∃(i, j) ∈ P→ with xij = uij , or ∃(i, j) ∈ P← with xij = ℓij . (24.1)
The path is said to be unsaturated if
xij < uij , ∀(i, j) ∈ P→ and xij > ℓij , ∀(i, j) ∈ P← . (24.2)
records the connected node in the previous layer and the direction of the connecting
arc. The notation j[i →] means that node j has been reached by following arc (i, j) in
the forward direction, while j[← i] means that node j has been reached by following
arc (j, i) in the backward direction. This is useful to reconstruct a path from o to
d, starting from d and following back the track across layers until node o is reached.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Step 23 identifies the upstream node of the forward arcs thanks to the labels, and
step 24 identifies the downstream node of the backward arcs.
18 t := t + 1.
19 Until d ∈ St−1 or St−1 = ∅.
20 if St−1 = ∅ then return M No unsaturated path.
21 j := d, s := t − 1, P := {d}.
22 Repeat
23 if j[k →] then P := {k →} ∪ P, j := k
24 if j[← k] then P := {k ←} ∪ P, j := k
25 Until j = o
26 f := min min(i,j)∈P → (uij − xij ), min(i,j)∈P ← (xij − ℓij ) .
27 forall (i, j) ∈ A do
28 if (i, j) ∈ P → then zij = f
29 if (i, j) ∈ P ← then zij = −f
30 if (i, j) 6∈ P then zij = 0
Maximum flow 581
If an unsaturated path P has been found, a flow can be sent along it. As we want
to send as much flow as possible, we calculate, for each arc, the maximum additional
flow that it can transport. For forward arcs, it is the difference uij − xij between the
upper bound and the current flow, as sending additional flow along the path increases
the flow on this arc. For backward arcs, it is the difference xij −ℓij between the current
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
flow and the lower bound, as sending additional flow along the path decreases the
flow on this arc. The quantity of flow that is feasible to send along the path is the
minimum of these values across all arcs of the path, that is,
f := min min → (uij − xij ), min ← (xij − ℓij ) . (24.3)
(i,j)∈P (i,j)∈P
If node d has not been reached by the algorithm that generates the layers, it means
that no unsaturated path exists. In this case, the algorithm is interrupted because
no further arc with residual capacity can be found. The set M defines the cut
Γ = (M, N \ M). By design of the algorithm, any arc with one node i in M and one
node j not in M must be saturated. Indeed, if it were not the case, node j would have
been included into a layer by the algorithm and would then be in M. Therefore, the
cut Γ is saturated. This is the Ford-Fulkerson algorithm, presented as Algorithm 24.2.
Example 24.2 (Maximum flow). Consider the network represented in Figure 24.3,
where the capacities are shown in square brackets. The iterations of the Ford-
Fulkerson algorithm are reported in Table 24.1. During each iteration, layers are
built in order to identify an unsaturated path. They are described in Table 24.2.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2
3[3]
5[5]
2[3] 6
9[9]
3[3] 5[5]
o 3 1[1] d
0[1]
2[2]
0[3] 5
3[4]
3[5]
4
Figure 24.3: Network for Example 24.2, with flows and [capacities]
Flow
Iter
1 0 0 0 0 0 0 0 0 0 0 0 0 3 o→2→6→d
2 3 0 0 0 3 0 0 0 0 0 0 3 3 o→3→6→d
3 3 3 0 0 3 0 3 0 0 0 0 6 2 o→4→5→d
4 3 3 2 0 3 0 3 0 2 0 2 6 2 o→2→3→6→d
5 5 3 2 2 3 0 5 0 2 0 2 8 1 o→4→5→6→d
6 5 3 3 2 3 0 5 0 3 1 2 9
Note that Algorithm 24.1 identifies an unsaturated path with the minimum pos-
sible number of arcs. This is needed to guarantee that the Ford-Fulkerson algorithm
converges. Indeed, if another strategy is used, it may fail to terminate when some
capacities on the arc are irrational (see Zwick, 1995 for simple examples). The version
of the Ford-Fulkerson algorithm presented in this text is not efficient. Indeed, at each
iteration, the layers are reconstructed from the beginning. An algorithm proposed by
Dinic (1970) is based on a more efficient implementation.
Maximum flow 583
Table 24.2: Constructions of layers during the iterations of the Ford-Fulkerson algo-
rithm for Example 24.2
Iteration 1
S1 = {1}
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
not in M∗ , and they are all saturated. Using the analogy discussed in Section 21.2,
the cut can be seen as a partition of the nodes into those on the left bank and those
on the right bank of a river separating the city, and the arcs of the cut as the bridges
from one bank to the other. If all bridges are saturated, there is no possibility to
move more flow across the river. It happens that, among all the possible cuts in the
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
network, Γ ∗ has the smallest capacity. It is the optimal solution of the minimum cut
problem.
The minimum cut problem is intimately related to the maximum flow problem.
Actually, both problems are dual to each other. In particular, their optimal value is
the same.
Proof. Consider any arbitrary cut Γ (o, d) = (M, N \ M) separating o from d. From
Theorem 21.14, we have
X
X(Γ (o, d)) = div(x∗ )i = div(x∗ )o ,
i∈M
as o and d are the only nodes with a non zero divergence, and d is not in M. From
(21.8), we also have
div(x∗ )o = X(Γ (o, d)) ≤ U(Γ (o, d)). (24.6)
Now, if we apply Algorithm 24.1, as x∗ is optimal, no unsaturated path can be found,
and the algorithm stops with a saturated cut that separates o from d. Call it Γ ∗ (o, d).
Again, the flow through the cut is
X(Γ ∗ (o, d)) = div(x∗ )o . (24.7)
In order to investigate further the dual relationship between the two problems,
we consider the formulation (22.27)–(22.31) of the maximum flow problem as a tran-
shipment problem (see Section 22.4.2). To each supply constraint (22.28), that is to
each node i, we associate a dual variable pi . To each capacity constraint (22.29), that
is to each arc (i, j), we associate a dual variable λij . Using the techniques presented
in Chapter 4, we write the dual problem as follows
X
min λij uij (24.9)
(i,j)∈A
subject to
λij − pi + pj ≥ 0, ∀(i, j) ∈ A, (24.10)
po − pd ≥ 1, (24.11)
λij ≥ 0, ∀(i, j) ∈ A. (24.12)
In the above formulation, the dual variables p are involved only with respect to their
differences. Moreover, they do not appear in the objective function. Therefore, if p
is feasible, p + αe is also feasible for any α ∈ R (e is a vector with all entries equal to
1), and the objective function is not affected. Therefore, without loss of generality,
one of the dual variables can be normalized to an arbitrary value. Later, we propose
po = 1. Note that the matrix of the constraints of the dual problem is the transpose
of the matrix from the primal, which is totally unimodular by Theorem 22.6. The
determinant of each square submatrix is 0, −1, or +1. This holds as well for the
transposed matrix, which is also totally unimodular. Therefore, Theorem 22.4 applies
for the dual. As the right hand side of the constraints involves only 0 and 1, there is
an integer optimal solution even if the capacities are not integer.
We now show the relationship between this formulation and the minimum cut
problem. The following result shows how to generate the values of the dual variables
given a cut.
Lemma 24.5. Consider the minimum cut problem and an arbitrary cut Γ (o, d) =
(M, N \ M) separating o from d. Consider the vector p ∈ Rm defined as
1 if i ∈ M,
pi = (24.13)
0 otherwise,
and the vector λ ∈ Rn defined as
1 if (i, j) ∈ Γ → ,
λij = (24.14)
0 otherwise.
586 The minimum cut problem
Then, p and λ verify the constraints (24.10)–(24.12), and the objective function
(24.9) is the capacity of the cut.
• Consider an arc (i, j) where i and j are both in M, or both not in M. In this
case, pi = pj and the constraints (24.10) become λij ≥ 0, and are verified.
• Consider an arc (i, j) where i is in M and j not. Therefore pi = 1 and pj = 0.
As (i, j) is an arc of the cut, we also have λij = 1, so that (24.10) is written as
1 − 1 + 0 ≥ 0, and is verified.
• From (24.13), po = 1 and pd = 0, and (24.11) is verified.
P
• From (21.7), U(Γ ) = (i,j)∈Γ → uij . From the definition of λ, we have
X
U(Γ ) = λij uij .
(i,j)∈A
Lemma 24.6. Consider the minimum cut problem. Consider also a vector p ∈
Rm and a vector λ ∈ Rn verifying the constraints (24.10)–(24.12). For any
0 ≤ γ < 1, consider the set
We show now that, for each (i, j), the probability that the arc is in the cut is bounded
by the value of the dual variable, that is
The probability that (i, j) is in the cut is the probability that i is in MX and j is not.
By definition (24.15), we have
po − pj ≤ 0, the probability is 0. Then (24.17) results from the fact that λij ≥ 0,
that is from (24.12). If they are compatible, then, as X is uniformly distributed,
Pr(po − pj < X ≤ po − pi ) = pi − pj ,
By definition of the expected value, there always exists a value 0 ≤ γ∗ < 1 such that
the realization is not greater than the expected value, that is U(Γγ∗ ) ≤ E[U(ΓX )],
proving the result.
We have now all the elements to show that the linear optimization problem (24.9)–
(24.12) is the minimum cut problem.
The cut Γ ∗ (o, d) solves the minimum cut problem if and only if (p∗ , λ∗ ) is the
optimal solution of the linear optimization problem (24.9)–(24.12):
X
min λij uij
(i,j)∈A
subject to
λij − pi + pj ≥ 0, ∀(i, j) ∈ A,
po − pd ≥ 1,
λij ≥ 0, ∀(i, j) ∈ A.
588 Exercises
Proof. If M∗ is the optimal cut, we invoke Lemma 24.5, that states that (p∗ , λ∗ ) is
feasible, and that the objective function (that is, the capacity of the cut) is minimal.
For the other direction, we exploit the fact that there is an integer optimal solution
to (24.9)–(24.12). Also, as discussed earlier, only the differences of the dual variables
matter, so that one of them can be normalized to an arbitrary value. Therefore, we
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
From the strong duality theorem (Theorems 4.17 and 6.32), we know that the op-
P
timal value of the dual problem is the same as the primal. Therefore, (i,j)∈A λ∗ij uij
has the same value as the maximum flow problem which, from Theorem 24.4, is the
optimal value of the minimum cut problem, so that
X
U(Γ ∗ ) ≥ λ∗ij uij .
(i,j)∈A
Consequently, we have X
U(Γ ∗ ) = λ∗ij uij ,
(i,j)∈A
∗
showing that Γ is a minimum cut.
The material presented in Chapters 21 to 24 is based on lecture notes, inspired
by Ahuja et al. (1993) and Bertsekas (1998).
24.3 Exercises
Exercise 24.1. Consider the network represented in Figure 24.4, where the lower
capacity of each arc is 0, and the upper capacity is shown next to the arc.
1. Apply the Ford-Fulkerson algorithm (Algorithm 24.2) to obtain the maximum
flow through the network from node o to node d, as a function of the parameter
α, where α ≥ 0.
2. What are the values of α, α ≥ 0, such that arc (b, a) belongs to the minimum
cut? And what is the minimum cut?
Maximum flow 589
5 8
o α d
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10 4
Figure 24.4: Network for Exercise 24.1, where the value of each arc represents its
upper capacity
Exercise 24.2. Consider the network represented in Figure 21.25, where each arc
(i, j) is associated with its lower bound ℓij , its flow xij , and its upper bound uij in
the following way: (ℓij , xij , uij ).
1. Apply the Ford-Fulkerson algorithm (Algorithm 24.2) to obtain the maximum
flow through the network from node o to node d.
2. Write the mathematical formulation of the minimum cut problem on this net-
work. Solve it using the simplex algorithm (Algorithm 16.5), and verify that
Theorem 24.7 applies in this case.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Part VII
Discrete optimization
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Leopold Kronecker
Chapter 25
Introduction to discrete
optimization
Contents
25.1 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
25.2 Classical problems . . . . . . . . . . . . . . . . . . . . . . . 607
25.2.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . 607
25.2.2 Set covering . . . . . . . . . . . . . . . . . . . . . . . . . . 609
25.2.3 The traveling salesman problem . . . . . . . . . . . . . . 610
25.3 The curse of dimensionality . . . . . . . . . . . . . . . . . 614
25.4 Relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
25.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
25.1 Modeling
We focus now on optimization problems where the variables are discrete and take
integer values. Such constraints are relevant in contexts where the decisions to be
taken concern a number of items, or entities, that are indivisible. The example
presented in Section 1.1.7 involves the production of toys, where it is not an option
to produce parts of toys. It is also relevant in situations where the set of feasible
solutions consists in all possible combinations of values of several discrete variables.
In this case, it is referred to as “combinatorial optimization.” Other examples are
presented in Section 25.2.
A particularly useful type of variables in this context are binary variables, which
can only take the value 0 or 1. A value 1 may refer to an action that is taken, a decision
to do something, or a switch that is set to “on.” The value 0 corresponds to an action
not taken, a decision not to do something, a switch set to “off”. Binary variables
provide a powerful modeling tool to translate logical conditions into a mathematical
formulation that can be used in an optimization framework. The constraints of the
optimization problem correspond to logical conditions, and a solution is feasible if
596 Modeling
all these conditions are verified. The possibilities are endless, and the modeling
of optimization problems is more of an art than a science. We provide below a few
examples of common modeling techniques using binary variables. In order to illustrate
each of them, we consider the modeling of the following problem.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Example 25.1 (Locating plants for the supply of energy). A company delivers gas
and electricity, and has to decide on the location of its plants. n sites have been
identified to locate the plants to cover the distribution to m cities that are clients of
the company. For each potential plant i, there is a decision of the local authority if
it is allowed to open the plant or not. Moreover, there is a fixed cost pi to open it.
There is also a cost of pgi for each unit of gas produced. The unitary production cost
for electricity is pei . For each city j, we have the following data:
The cost of infrastructure (wires, pipes, etc.) to allow the transport of the gas (resp.
the electricity) from plant i to city j is cgij (resp. ceij ). Finally, each plant must be
dedicated to either gas or electricity, but not both. The objective of the problem
is to identify what plants must be opened, to assign each of them to either gas or
electricity, and to decide the quantity to be produced and the city to be served.
More specifically, consider an instance with n = 10 potential sites (all approved
by the authorities) and m = 3 cities. The data is reported in Table 25.1.
A solution consists in opening plants 6 (30 units) and 8 (50 units) for gas, and
plants 4 (10 units), 5 (30 units), and 7 (20 units) for electricity. City 1 receives gas
from plant 8 and electricity from plant 5. City 2 receives electricity from plant 7.
City 3 receives gas from plant 6 and electricity from plant 4. The total cost is 153.
It happens to be an optimal solution.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We start by presenting how the common logical operations translate into binary
variables or constraints for the optimization problem.
P x
True 1
False 0
Typically, this associates the logical propositions with binary parameters and vari-
ables. Considering Example 25.1, we may have the following:
P ¬P x 1−x
True False 1 0
False True 0 1
In the above example, the quantity 1 − xi is associated with the proposition “plant
i is not opened.”
Logical conjunction If we have two propositions P and Q characterized by two
binary variables x and y, their conjunction P ∧ Q is true if both P and Q are true,
and false otherwise. It is characterized by the binary variable z = xy, as shown in
the following truth table:
598 Modeling
P Q P∧Q x y xy
True True True 1 1 1
True False False 1 0 0
False True False 0 1 0
False False False 0 0 0
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
In our example, a plant is available on site i if the local authorities allow its
construction (that is, ai = 1) and if the company decides to construct it (that
is, xi = 1). The availability of the plant can therefore be modeled by a binary
variable xa i = ai xi . Note that in general, this type of condition can be used to
preprocess the problem and simplify its definition. In this example, it is easier
simply to ignore all the sites that have not received the authorization and work
only with the remaining ones. This is what we assume in the remaining of the
presentation of the example.
When this formulation is used with two variables, it introduces a non linear rela-
tionship between the two variables: xy = 1, which is in general undesirable. In
the context of optimization, it is more appropriate to model the conjunction as
two constraints (x = 1 and y = 1), as all constraints have to be verified to achieve
feasibility.
Therefore, most of the time it is not necessary to model explicitly the conjunction
by a product. We have included it for the sake of completeness.
Logical disjunction If we have two propositions P and Q characterized by two bi-
nary variables x and y, their disjunction P ∨ Q is true if P or Q is true, and is
false if both are false. It is characterized by the constraint x + y ≥ 1, as shown in
the following truth table:
P Q P∨Q x y x+y≥1
True True True 1 1 Yes
True False True 1 0 Yes
False True True 0 1 Yes
False False False 0 0 No
This can be generalized to several propositions P1 , . . . , Pr , characterized by binary
variables x1 , . . . , xr . The disjunction P1 ∨ . . . ∨ Pr is true if at least one of the
propositions P1 , . . . , Pr is true. It is characterized by the constraint
r
X
xi ≥ 1. (25.1)
i=1
Pr
Note that if the variable z = x + y or the variable z = i=1 xi is included in the
model, they are not binary variables.
In our example, each city must receive its gas by plant 1, or plant 2, or . . . , or
plant n. This is modeled as
n
X
zgij ≥ 1, j = 1, . . . , m. (25.2)
i=1
Introduction to discrete optimization 599
Similarly, the fact that a plant serves gas to a city obviously implies that it pro-
duces gas. We obtain the constraints
always verified.
In our example, if city j buys gas from the company (that is, if gj = 1), it must
be served by at least one plant, that is
X g
zij ≥ 1. (25.6)
i
P g
As i zijis always non negative, it plays the role of f(x) in the above discussion.
Setting a = 1 and z = gj , (25.5) is written as
X g
zij ≥ gj . (25.7)
i
The constraint qgi ≤ 0 must be verified if plant i is not dedicated to gas, that is if
ygi = 0. Therefore, we apply (25.8) with g(x) = qgi , b = 0, z = 1 − ygi and obtain
m
X
qgi ≤ ygi gj dgj . (25.10)
j=1
Introduction to discrete optimization 601
where x, y, and z are binary variables. This non linear constraint is equivalent to
the following set of linear constraints:
x+y≤1+z
z≤x (25.14)
z ≤ y,
x y z x+y≤1+z z≤x z ≤y xy = z
1 1 1 Yes Yes Yes Yes
1 1 0 No Yes Yes No
1 0 1 Yes Yes No No
1 0 0 Yes Yes Yes Yes
0 1 1 Yes No Yes No
0 1 0 Yes Yes Yes Yes
0 0 1 Yes No No No
0 0 0 Yes Yes Yes Yes
602 Modeling
Constraints:
• If plant i produces gas, then plant i is open:
ygi ≤ xi ∀i. (25.18)
• If plant i produces electricity, then plant i is open:
yei ≤ xi ∀i. (25.19)
• If plant i produces gas, it cannot produce electricity. Using the logical impli-
cation and the logical negation, we obtain ygi ≤ 1 − yei . Similarly, if plant i
produces electricity, it cannot produce gas, which gives yei ≤ 1 − ygi . Both
constraints are equivalent and can be written as
ygi + yei ≤ 1, ∀i. (25.20)
Introduction to discrete optimization 603
• Plant i must produce gas in sufficient quantity to satisfy the total demand
associated with it. The demand for city j is dgj gj , that is dg if city j buys gas
from the company: X g g
qgi ≥ dj gj zij . (25.21)
j
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
• Plant i must produce electricity in sufficient quantity to satisfy the total de-
mand associated with it. The demand for city j is dej ej , that is de if city j
buys electricity from the company:
X
qei ≥ dej ej zeij . (25.22)
j
• If plant i is not dedicated to gas, then the quantity of gas produced must be
equal to zero. From the discussion above, the constraint is (25.10):
m
X
qgi ≤ ygi gj dgj , ∀i. (25.23)
j=1
• If city j buys gas from the company (that is, if gj = 1), it must be served by
at least one plant. As discussed above, the constraint is (25.7):
X g
zij ≥ gj , ∀j. (25.25)
i
• If city j buys electricity from the company (that is, if ej = 1), it must be served
by at least one plant: X
zeij ≥ ej , ∀j. (25.26)
i
• If city j receives gas from plant i, it implies that plant i produces gas:
• If city j receives electricity from plant i, it implies that plant i produces elec-
tricity:
zeij ≤ yei , ∀i, j. (25.28)
• If city j receives gas from plant i, it implies that city j buys gas from the
company:
zgij ≤ gj , ∀i, j. (25.29)
• If city j receives electricity from plant i, it implies that city j buys electricity
from the company:
zeij ≤ ej , ∀i, j. (25.30)
604 Modeling
n
X n
X n
X n X
X m n X
X m
min pi x i + pgi qgi + pei qei + cgij zgij + ceij zeij .
i=1 i=1 i=1 i=1 j=1 i=1 j=1
subject to
ygi ≤ xi ∀i,
yei ≤ xi ∀i,
ygi + yei ≤ 1, ∀i,
X g g
qgi ≥ dj gj zij ,
j
X
qei ≥ dej ej zeij ,
j
m
X
qgi ≤ ygi dgj , ∀i,
j=1
m
X
qei ≤ yei dej , ∀i,
j=1
X
zgij ≥ gj , ∀j,
i
X
zeij ≥ ej , ∀j,
i
Note that the above formulation is certainly not the only possible way to model
the problem, and probably not the best one. Several simplifications can be done
(for instance, constraints (25.29) and (25.30) can be used to reduce the number of
variables). Still it illustrates various aspects of modeling that appear in many appli-
cations.
Once the modeling step has been finalized, we obtain a mixed integer optimization
problem.
Introduction to discrete optimization 605
subject to
Ax x + Az z = b
x≥0 (25.32)
nz
z∈N ,
where Ax ∈ Rm×nx , Az ∈ Rm×nz and b ∈ Rm .
The special case where all variables are binary is called a binary linear optimiza-
tion problem.
min cT x (25.33)
x∈Nn
subject to
Ax = b
(25.34)
x ∈ {0, 1}n ,
where A ∈ Rm×n and b ∈ Rm .
Note that it is possible to transform an integer variable into several binary vari-
ables, if the variable is bounded and can take only a finite number of values. Indeed,
any number can be converted into binary notation. This is exactly what happens in
a computer anyway. More specifically, consider an integer variable x that can take
606 Modeling
u ≤ 2K − 1, (25.35)
that is
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
If all variables zi are 0, the value of x is ℓ. If all variables zi are 1, the value of x is
ℓ + (u − ℓ) = u. Any other combination of 0 and 1 for the variables zi corresponds to
an integer value of x between ℓ and u. There is a major shortcoming to this approach,
though. Indeed, the same value of x may correspond to several combinations of the
variables zi . Consider an example where ℓ = 3 and u = 6. We introduce 3 binary
variables z1 , z2 , and z3 , and we associate each combination with a value of x as
represented in Table 25.2.
The values 1 and 2 can be represented in 3 different ways each. It artificially
increases the size of the feasible set. In order to avoid that, additional constraints
must be introduced. For instance, we may impose the use of binary variables in the
order that they appear. It means that we may set a binary variable zk to 1 only if
the previous variable zk−1 is 1. Using the modeling of logical implications (zk = 1
implies zk−1 = 1), we obtain the constraints
zk ≤ zk−1 , k = 2, . . . , u − ℓ. (25.40)
x z1 z2 z3
0 0 0 0
1 0 0 1
1 0 1 0
2 0 1 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 1 0 0
2 1 0 1
2 1 1 0
3 1 1 1
It is named as such because large finite sets are often generated by the list of
combinations of given elements. For instance, there are 265 possible words with 5
letters. Even if integer optimization problems may happen to have an infinite feasible
set, the use of upper bounds on the objective function allows to transform them into
problems with finite sets.
The name of the knapsack problem comes from Example 25.6. Definition 25.7
provides a more general definition of the problem. Definition 25.8 describes the 0 − 1
knapsack problem, another version of the problem that forbids multiple selection of
the same item.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Definition 25.7 (The knapsack problem). Consider a set of n items. Each item i is
associated with a value characterizing its utility ui ∈ R and a weight wi ≥ 0. The
knapsack problem consists in deciding the number of times that each item must be
selected so that the total weight of the selected items does not exceed an upper bound
W and the total utility is maximized.
The knapsack problem has many applications and variants. Consider a portfolio
of stocks, where each stock has a price wi and a potential return on investment ui .
The question how to invest a total budget of W in order to maximize the expected
profit is also a “knapsack problem.”
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Definition 25.10 (Set covering). Consider a set U of elements and a list of n subsets
of U, denoted by Si , i = 1, . . . , n, each associated with a cost ci , such that
n
[
Si = U. (25.45)
j=1
The set covering problem consists in selecting a sublist Sij , j = 1, . . . , J such that
their union includes all the elements in U, that is
J
[
Sij = U, (25.46)
j=1
PJ
and the total cost j=1 cij is minimal.
Note that if condition (25.45), that requires the union of all Si to be equal to
U, is not verified, the problem is not feasible. Note also that the problem is often
presented in the literature with ci = 1 for each subset i, so that the covering has to
involve the minimum number of subsets.
In the above example, U is the set of stickers missing by Camille, and each subset
Si corresponds to the collection of one of her schoolmates. We denote j = 1, . . . , m
the missing stickers, and i = 1, . . . , n the available collections. For each i, the price of
collection i is ci . For each i and j, the parameter aij is equal to 1 if sticker j belongs
to collection i, and to 0 otherwise. These parameters characterize the subsets Si .
Decision variables: for each i we define a binary variable xi with value 1 if it is
decided to purchase collection i, and 0 otherwise.
610 Classical problems
i=1
Indeed, for each sticker j, at least one of the terms aij xi must be 1, so that the sum
over all collections must be at least 1. Moreover, by definition of the variables,
the following constraints must also be verified:
subject to
n
X
aij xi ≥ 1, j = 1, . . . , m,
i=1
xi ∈ {0, 1}, i = 1, . . . , n.
of a graph).
228
Z L
64
279
104
12
5
158
G B
There are several ways to model this problem as an integer optimization problem.
Here is one of them.
Decision variables: for each pair of nodes we define the binary variable xij , which
is 1 if the salesman visits node j just after node i, and 0 otherwise.
Objective function: the total length of the tour must be minimized. For n cities,
it is
X n X
X
min cij xij = min cij xij , (25.50)
(i,j)∈A i=1 j6=i
that is,
xLG + xLB + xLZ = 1,
xGL + xGB + xGZ = 1,
xBL + xBG + xBZ = 1,
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
that is,
xGL + xBL + xZL = 1,
xLG + xBG + xZG = 1,
xLB + xGB + xZB = 1,
xLZ + xGZ + xZB = 1.
Unfortunately, these constraints are not sufficient. Indeed, the optimal solution
of the above problem is xLG = xGL = xBZ = xZB = 1, and all other variables set
to 0. The interpretation is to travel from Lausanne to Geneva and back, and to
travel from Bern to Zürich and back. Instead of one tour, the optimization prob-
lem proposes two subtours that verify the constraints (each city has exactly one
predecessor and one successor) and minimize the distance. Additional constraints
must be included to eliminate these subtours.
One possible idea is to explicitly keep track of the order of the customers along the
tour, starting from home. We introduce new variables representing the position
of each customer in the tour. If customer j is visited after customer i in the tour,
the position of customer j must be strictly larger then the position of customer
i. It is sufficient to impose that constraint for each pair of successive customers,
so that it is verified for all customers in the tour. Denoting yi the position of
customer i, we impose that
xij = 1 =⇒ yj ≥ yi + 1, (25.53)
where i and j are customers, that is any node except home. It is important to
exclude home, because the ordering must end at the last customer, and the above
constraint does not hold for the last leg, from the last customer back to home.
It could have been included for the first leg, from home to the first customer,
but it is not necessary as the objective is to remove subtours that do not include
home. This is actually the target of this constraint. If there is a tour that does
not include home, there is no way to position its nodes. Without a reference node,
it is not possible to decide if node i comes before or after node j in the loop. In
the above example, one subtour includes the arcs ZB and BZ. The constraints
yB ≥ yZ + 1 and yZ ≥ yB + 1 are incompatible, as the first imposes that Bern
comes after Zürich, while the second imposes exactly the opposite.
Introduction to discrete optimization 613
We now need to transform the condition (25.53) into a constraint for the opti-
mization problem. We apply the technique for optional constraints described in
Section 25.1. It requires finding a version of the constraint that is always valid.
In our case, the value yj − yi is always greater or equal to 2 − n. Indeed, as the
variables represent the position of the customer in the tour, the largest difference
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
happens when customer j is visited just after home (yj = 2) and customer i is
visited last (yj = n). Therefore, the technique of optional constraints can be
applied with f(y) = yj − yi + n − 2. Indeed, f(y) is greater than zero for any
y. The constraint yj ≥ yi + 1 is equivalent to yj − yi + n − 2 ≥ n − 1, that is,
f(y) ≥ n − 1. Therefore, we use a = n − 1 in (25.5) to obtain
or, equivalently,
xij (n − 1) + yi − yj ≤ n − 2. (25.55)
Therefore, if xij = 1, we have yj − yi + n − 2 ≥ n − 1, that is yj − yi ≥ 1, which
is the required constraint. If xij = 0, we have yi − yj ≤ n − 2, which is always
verified.
In our example, we must add the constraints
xGB (n − 1) + yG − yB ≤ n − 2,
xBG (n − 1) + yB − yG ≤ n − 2,
xGZ (n − 1) + yG − yZ ≤ n − 2,
xZG (n − 1) + yZ − yG ≤ n − 2,
xBZ (n − 1) + yB − yZ ≤ n − 2,
xZB (n − 1) + yZ − yB ≤ n − 2.
Note that the solution proposed above, where both xBZ and xZB are equal to 1 is
not feasible anymore, as there is no value of yB and yZ such that both constraints
(n − 1) + yB − yZ ≤ n − 2 and (n − 1) + yZ − yB ≤ n − 2 are verified.
Therefore, the optimization problem for the traveling salesman problem with n cities
is written as:
Xn X
min cij xij (25.56)
x∈Zn(n−1) ,y∈Z(n−1)(n−2)
i=1 j6=i
subject to
X
xij = 1 ∀i = 1, . . . , n,
j6=i
X
xij = 1 ∀j = 1, . . . , n,
i6=j (25.57)
xij (n − 1) + yi − yj ≤ n − 2, ∀i = 2, . . . , n, j = 2, . . . , n, i 6= j,
xij ∈ {0, 1} ∀i = 1, . . . , n, j = 1, . . . , n, i 6= j,
yi ≥ 0 ∀i = 1, . . . , n.
614 The curse of dimensionality
There are many other combinatorial optimization problems that are not described
in this book, such as vehicle routing problems, scheduling problems, bin packing prob-
lems, or facility location problems, to cite the most classical. We refer the reader to
Papadimitriou and Steiglitz (1998) and Pardalos et al. (2013), among other references.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
2x1 + 9x2 ≤ 29
(25.59)
11x1 − 8x2 ≤ 79.
The feasible set is defined as the intersection between the polyhedron
and the set N2 . The polyhedron is represented in Figure 25.2, together with the
points of N2 with x1 ranging from 0 to 9 and x2 ranging from 0 to 4. The feasible
points are the 24 points of this lattice that are inside the polyhedron. The list of
these points is reported in Table 25.3. The level curves of the objective function are
represented by dotted lines, and the arrow identifies the direction of descent. In order
to identify the optimal solution, we can enumerate the feasible points, calculate the
value of the objective function for each of them, and select the point corresponding to
the smallest value. From the values of the objective function reported in Table 25.3,
the optimal solution is x∗ = (1, 3), corresponding to the value -42.
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5 6 7 8 9
Figure 25.2: The feasible set and the level curves for Example 25.13
Table 25.3: Enumeration of the feasible solutions of Example 25.13 with the corre-
sponding value of the objective function
x1 x2 cT x x1 x2 cT x x1 x2 cT x
0 0 0 2 0 -6 4 2 -38
0 1 -13 2 1 -19 5 0 -15
0 2 -26 2 2 -32 5 1 -28
0 3 -39 3 0 -9 5 2 -41
1 0 -3 3 1 -22 6 0 -18
1 1 -16 3 2 -35 6 1 -31
1 2 -29 4 0 -12 7 0 -21
1 3 -42 4 1 -25 7 1 -34
for abandoning the vertex enumeration method and for developing the simplex al-
gorithm. Integer optimization problems suffer from the same issue, which precludes
applying an enumeration technique.
Consider the knapsack problem introduced in Example 25.6, where all variables
are binary, that is, each item potentially carried is available only once. In order
to solve the problem by enumeration, each configuration of the variables x has to
P
be analyzed, that is, the corresponding weight i wi xi must be calculated and, if
P
smaller than the capacity W, the objective function i ui xi must be recorded. If
there are n items to be considered, there are 2n combinations of values for x. Each
of them needs about 2n floating point operations to compute the weight and the
objective function. Assume that we are using a processor with 1 Teraflops, that is a
processor able to perform 1012 floating point operations per second.
• If n = 34, it takes about 1 second to solve the problem by complete enumeration.
• If n = 40, it takes about 1 minute.
• If n = 45, it takes about 1 hour.
616 Relaxation
25.4 Relaxation
As complete enumeration is not an operational algorithm, other methods have to be
investigated. In particular, it would be convenient to transform the problem into a
continuous optimization problem by ignoring the integrality constraints and using a
relevant algorithm to solve the continuous optimization problem. This problem is
called the relaxation of the integer optimization problem.
subject to
g(x, y, z) ≤ 0
h(x, y, z) = 0
(25.62)
y ∈ Zny
z ∈ {0, 1}nz ,
where f : Rnx × Rny × Rnz → R, g : Rnx × Rny × Rnz → Rm , h : Rnx × Rny × Rnz →
Rp .
Introduction to discrete optimization 617
subject to
g(x, y, z) ≤ 0
h(x, y, z) = 0 (25.64)
0≤z≤1
is called the relaxation of P and denoted by R(P).
By definition, the feasible set of the original problem is included in the feasible
set of its relaxation. In other words, if (x, y, z) is feasible for P, it is also feasible for
R(P). Therefore, the optimal value of R(P) is a lower bound on the optimal value of
P.
Theorem 25.15 (Lower bound from the relaxation). Let P be a mixed integer
optimization problem and R(P) its relaxation. Denote (x∗ , y∗ , z∗ ) the optimal so-
lution of problem P and (x∗R , y∗R , z∗R ) the optimal solution of problem R(P). Then,
Definition 25.16 (Linear relaxation). Consider the mixed integer linear optimization
problem P:
n
minny n
cTx x + cTy y + cTz z (25.66)
x∈R x ,y∈N ,z∈N z
subject to
Ax x + Ay y + Az z = b
x, y, z ≥ 0
(25.67)
y ∈ Nny
z ∈ {0, 1}nz ,
where cx ∈ Rnx , cy ∈ Rny , cz ∈ Rnz , Ax ∈ Rm×nx , Ay ∈ Rm×ny , Az ∈ Rm×nz ,
and b ∈ Rm . The linear optimization problem
min cTx x + cTy y + cTz z (25.68)
x∈Rnx ,y∈Rny ,z∈Rnz
618 Relaxation
subject to
Ax x + Ay y + Az z = b
x, y, z ≥ 0 (25.69)
z≤1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The relaxation is a linear optimization problem and can be solved using any
appropriate algorithm, such as the simplex method. Except if the matrix of the
constraints is totally unimodular (see Definition 22.3), the optimal solution of the
relaxation may not provide an integer solution.
Unfortunately, it is not sufficient to round up or round down the fractional solution
of the relaxation in order to identify the optimal solution of the integer optimization
problem. Consider again Example 25.13. The relaxation of the problem is
subject to
2x1 + 9x2 ≤ 29
11x1 − 8x2 ≤ 79 (25.71)
x1 ,x2 ≥ 0.
The optimal solution of the relaxation is (8.2, 1.4), as illustrated in Figure 25.3, where
the level curves of the objective function are represented by dotted lines, and the arrow
identifies the direction of descent.
0
0 1 2 3 4 5 6 7 8 9
Figure 25.3: The feasible set of the relaxation and the level curves for Example 25.13
There are two ways to round a real number to an integer: round down or round
up. As there are two real numbers to round, there are four ways to round the optimal
solution of the relaxation: (8, 1), (8, 2), (9, 1), and (9, 2) as depicted in Figure 25.4.
Introduction to discrete optimization 619
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5 6 7 8 9
Figure 25.4: Example 25.13: rounding the optimal solution of the relaxation
In this example, none of these integer solutions obtained by rounding the fractional
solution of the relaxation in one way or the other is feasible. Moreover, even if one of
them was, it appears that the fractional solution of the relaxation does not lie in the
vicinity of the optimal solution of the integer optimization problem, which is (1, 3).
The problem relaxation plays an important role in the algorithms to solve integer
optimization problems. But as it appears from the example above, there is more to it
than simply rounding the optimal solution. In Chapter 26, we present methods that
use the bound provided by the relaxation (see Theorem 25.15) to avoid an explicit
complete enumeration of the feasible space.
25.5 Exercises
Exercise 25.1. In order to participate in a cooking competition called “Top Chef,”
Benoît must build a team of excellent chefs. He has access to a pool of candidates
(see Table 25.4). For each of them, he knows the age, the restaurant where they come
from, and their cooking specialties (some candidates have only one, some two). He
also knows the number of points that each of them has been able to collect in previous
similar competitions. And he wants to build a team with the maximum number of
such points. But several constraints apply.
1. The team must contain at least 3 chefs who are skilled in preparing appetizers.
2. The team must contain at least 4 chefs who are skilled in preparing fish.
3. The team must contain at least 4 chefs who are skilled in preparing meat.
4. The team must contain at least 3 chefs who are skilled in preparing dessert.
5. To promote young people, the team must contain at least 2 chefs who are 20 or
less.
6. Yoda and Obi-Wan cannot stand each other, and it is not possible to have both
of them in the team.
620 Exercises
Table 25.4: Potential candidates for the Top Chef competition for Exercise 25.1
7. Han and Sheev have so much experience in working together that if one of the
two is included in the team, the other one must be too.
8. For the sake of fairness, not more than 3 chefs from the same restaurant should
be hired in the team.
Write an integer optimization problem to help Benoît build his team.
Exercise 25.2 (Scheduling). The journal Millenium needs to schedule the staff for
the printing workshop for the five days of the week. During each day, there are eight
one-hour time slots. Four employees are available for the tasks. Each employee has
reported his or her preference for each time slot and each day on a scale from 0 to 10,
where 10 corresponds to the highest preference and 0 corresponds to unavailability
(see Table 25.5). The following constraints must be verified.
1. Each of the 40 slots must be covered by exactly one employee.
2. An employee cannot be assigned to a time slot if she/he is not available.
3. Every person must take a lunch break either between 12:00 and 13:00, or between
13:00 and 14:00.
Introduction to discrete optimization 621
4. Because of the noisy work environment, every person can work only two consec-
utive time slots. A break of at least one hour must be taken after that.
5. No one can work more than 20 hours per week.
Write an integer optimization problem to help Millenium schedule the workshop
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Table 25.5: Preference of each worker for each time slot (Exercise 25.2)
Name Slot Mo Tu We Th Fr
Mikael 9–10 10 10 10 10 10
Mikael 10–11 9 9 9 9 9
Mikael 11–12 8 8 8 8 8
Mikael 12–13 1 1 1 1 1
Mikael 13–14 1 1 1 1 1
Mikael 14–15 1 1 1 1 1
Mikael 15–16 1 1 1 1 1
Mikael 16–17 1 1 1 1 1
Lisbeth 9–10 10 9 8 7 6
Lisbeth 10–11 10 9 8 7 6
Lisbeth 11–12 10 9 8 7 6
Lisbeth 12–13 10 3 3 3 3
Lisbeth 13–14 1 1 1 1 1
Lisbeth 14–15 1 2 3 4 5
Lisbeth 15–16 1 2 3 4 5
Lisbeth 16–17 1 2 3 4 5
Harriet 9–10 10 10 10 10 10
Harriet 10–11 9 9 9 9 9
Harriet 11–12 8 8 8 8 8
Harriet 12–13 0 0 0 0 0
Harriet 13–14 1 1 1 1 1
Harriet 14–15 1 1 1 1 1
Harriet 15–16 1 1 1 1 1
Harriet 16–17 1 1 1 1 1
Alexander 9–10 10 9 8 7 6
Alexander 10–11 10 9 8 7 6
Alexander 11–12 10 9 8 7 6
Alexander 12–13 10 3 3 3 3
Alexander 13–14 1 1 1 1 1
Alexander 14–15 1 2 3 4 5
Alexander 15–16 1 2 3 4 5
Alexander 16–17 1 2 3 4 5
622 Exercises
Exercise 25.3 (Graph coloring). Consider the map of Belgium (Figure 25.5). We
want to color each province of the map so that two provinces with a common border
have different colors. What is the minimum number of colors that must be used?
Write an integer optimization problem to answer this question and to provide a valid
coloring.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Exercise 25.4 (Bin packing). You have 10 objects of different heights (in cm): 80,
70, 60, 50, 40, 40, 20, 20, 10, and 10. As you are moving, you need to stack them
in boxes of 1 meter high. Assuming that the sections of the objects do not allow to
store them side by side, but only one over the others, how do you arrange the objects
into the boxes to use a minimum number of them? Write an integer optimization
problem to answer this question.
Exercise 25.5 (Vehicle routing). The Nespresso factory in Orbe must deliver 18,000
capsules to Lausanne, 26,000 to Neuchatel, 11,000 to Fribourg, 30,000 to Berne and
21,000 to Sierre. The travel time between each city is reported in Table 25.6. The
company has vehicles that can transport at most Q capsules each. How does the
company have to organize the delivery of the capsules to satisfy the demand of each
city, while minimizing the total time traveled? Write an integer optimization problem
to answer this question.
Introduction to discrete optimization 623
Table 25.6: Travel time between each pair of cities for Exercise 25.5.
Neuchatel 48 48 111
Fribourg 35 85
Bern 105
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 26
Contents
subject to
x ∈ F, (26.2)
where F represents the feasible set. The idea is to partition it into smaller subsets:
F = F1 ∪ . . . ∪ FK .
subject to
x ∈ Fk , (26.4)
and call x∗k a (global) optimal solution of Pk . As Fk ⊆ F , x∗k is feasible for P. The
key idea is that each optimal solution of P is one of the optimal solutions x∗k .
Exact methods for discrete optimization 627
Consequently, f(y∗ ) = f(x∗i ) and x∗i is indeed an optimal solution of the problem.
The fact that problem Pk is simpler than problem P does not mean that it is
simple. To solve Pk , it may again be necessary to partition its feasible set into smaller
subsets. And they can be partitioned themselves, if needed. This decomposition can
be depicted as a tree, as represented in Figure 26.2. The “root” of the tree corresponds
to the original problem P. Each subproblem corresponds to a “branch,” which can be
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
divided into other branches. Clearly, the number of nodes in this tree, that is, the
number of subproblems, increases rather quickly with the size of the problem, and
the curse of dimensionality is again in the way. To deal with this, we need to avoid
constructing all possible branches of the tree.
P1 P2 ... PK
Note also that a branching strategy may generate empty subsets Fk . This is why
it is necessary to verify that the problem is feasible (step 17) before trying to solve
it. Finally, the exact procedure to calculate a good lower bound (step 20) is problem
Exact methods for discrete optimization 629
dependent.
15 Repeat
16 Select a problem Pk in P.
17 if Pk is infeasible then
18 Discard Pk from P
19 else
20 Calculate a lower bound ℓ(Pk )
21 if f∗ > ℓ(Pk ) then
22 if Pk is easy to solve then
23 Calculate x∗k a global optimal solution of Pk
24 if f(x∗k ) < f∗ then
25 x∗ := x∗k , f∗ := f(x∗k )
26 else
27 Create a list of subproblems {Pk1 , . . . , PkK }
28 P := P ∪ {Pk1 , . . . , PkK }
Example 26.3 (Tasks assignment for Geppetto). Geppetto has hired four workers
with skills in carpentry and finishing to take care of the production of his toys (trains
and soldiers, see Section 1.1.7). Each worker is able to work on any task, with the
same efficiency. The number of hours that each worker needs to perform each task is
reported in the following table.
630 Branch and bound
Tasks
Carpentry Finishing Carpentry Finishing
Workers trains trains soldiers soldiers
Pinocchio 9 2 7 8
Jiminy 6 4 3 7
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Lampwick 5 8 1 8
Figaro 7 6 9 4
Geppetto wants to assign each task to a worker, in such a way that the total time is
minimized.
We illustrate Algorithm 26.1 on Example 26.3. In this case, a lower bound on the
optimal value can easily be derived from the data:
• the minimum number of hours that Pinocchio would work is 2,
• the minimum number of hours that Jiminy would work is 3,
• the minimum number of hours that Lampwick would work is 1,
• the minimum number of hours that Figaro would work is 4.
Consequently, the total number of hours cannot be lower than 2 + 3 + 1 + 4 = 10. As
an initial feasible solution, we consider an arbitrary assignment:
Worker Task Time
Pinocchio Carpentry trains 9
Jiminy Finishing trains 4
Lampwick Carpentry soldiers 1
Figaro Finishing soldiers 4
18
We partition the set of feasible solutions by assigning the task to Pinocchio. Problem
P1 consists in assuming that Pinocchio takes care of the carpentry for trains, and
in assigning the three other tasks to the three other workers. Problems P2 , P3 , and
P4 are defined similarly, where Pinocchio is assigned to the finishing of trains, the
carpentry of soldiers, and the finishing of soldiers, respectively.
A lower bound is derived for each subproblem, in the same way as above:
• the minimum number of hours that Jiminy would work is 3,
• the minimum number of hours that Lampwick would work is 1,
• the minimum number of hours that Figaro would work is 4.
For the three of them, the total time cannot be lower than 3 + 1 + 4 = 8 hours.
• For P1 , Pinocchio is working 9 hours so that ℓ(P1 ) = 9 + 8 = 17.
• For P2 , Pinocchio is working 2 hours so that ℓ(P2 ) = 2 + 8 = 10.
• For P3 , Pinocchio is working 7 hours so that ℓ(P3 ) = 7 + 8 = 15.
• For P4 , Pinocchio is working 8 hours so that ℓ(P4 ) = 8 + 8 = 16.
Exact methods for discrete optimization 631
P[10]
The branching and the calculation of the bound are summarized in Figure 26.3, where
the number into square brackets is the bound for the corresponding problem.
The initial feasible solution corresponds to a total of 18 hours. Therefore, no
subproblem can be discarded, as each lower bound is better than this value.
We now solve one of the subproblems. We select P2 , as it has the smallest lower
bound. It corresponds to the decision that Pinocchio is assigned to finishing trains.
We branch now based on the assignment of Jiminy and create the following problems:
• P21 , where Jiminy is assigned to carpentry for trains,
• P22 , where Jiminy is assigned to finishing for trains,
• P23 , where Jiminy is assigned to carpentry for soldiers,
• P24 , where Jiminy is assigned to finishing for soldiers.
We immediately note that problem P22 is not feasible, as Pinocchio and Jiminy are
not allowed to perform the same task. It is therefore discarded. A lower bound is
derived for each remaining subproblem:
• the minimum number of hours that Lampwick would work is 1,
• the minimum number of hours that Figaro would work is 4.
For the two of them, the total time cannot be lower than 1 + 4 = 5 hours.
• For P21 , Jiminy is working 6 hours so that ℓ(P1 ) = 2 + 6 + 5 = 13.
• For P23 , Jiminy is working 3 hours so that ℓ(P3 ) = 2 + 3 + 5 = 10.
• For P24 , Jiminy is working 7 hours so that ℓ(P4 ) = 2 + 7 + 5 = 14.
The branching and the calculation of the bound is summarized in Figure 26.4.
Now we select problem P23 that corresponds to the smallest lower bound. As
Pinocchio and Jiminy have already been assigned for a total of 2 + 3 = 5 hours, the
problem can be solved by complete enumeration.
• Lampwick is assigned to carpentry for trains: 5 + 5 + 4 = 14, or
• Lampwick is assigned to finishing for soldiers: 5 + 8 + 7 = 20.
The optimal solution of P23 assigns Pinocchio to finishing for trains, Jiminy to carpen-
try for soldiers, Lampwick to carpentry for trains, and Figaro to finishing for soldiers.
The total number of hours is 14. It is better than the initial feasible solution that has
a value of 18. Therefore, it becomes the candidate to be the optimal solution. We
write x∗ := [P(FT ), J(CS), L(CT ), F(FS)], and f∗ := 14.
632 Branch and bound
P[10]
We can now remove all problems with a lower bound equal or higher to f∗ = 14,
discarding P1 , P3 , P4 , and P24 . As P1 , P3 , and P4 are discarded, we know that
each optimal solution of P is an optimal solution of P2 . In particular, we know that
Pinocchio is assigned to the finishing of trains in any optimal solution, as each optimal
solution of problem P2 is also an optimal solution of problem P. The current status
of the algorithm is illustrated in Figure 26.5, where the round shape corresponds to
a solved problem, and the value in parentheses is its optimal value.
P[10]
Figure 26.5: Branch & bound for Example 26.3: one subproblem is solved
The next problem to solve is problem P21 . As Pinocchio and Jiminy have already
been assigned for a total of 2 + 6 = 8 hours, the problem can be solved by complete
enumeration.
• Lampwick is assigned to carpentry for soldiers: 8 + 1 + 4 = 13, or
• Lampwick is assigned to finishing for soldiers: 8 + 8 + 9 = 25.
The optimal solution to P21 is therefore x∗21 = [P(FT ), J(CT ), L(CS), F(FS)]. As its
value is lower than the current value of f∗ , it becomes the new candidate for the
optimal solution: x∗ := x∗21 and f∗ := 13. All the subproblems of problem P2 have
Exact methods for discrete optimization 633
Figure 26.3.
P(13)
Figure 26.6: Branch & bound for Example 26.3: final tree with all subproblems solved
or discarded
Using these ingredients, the branch and bound algorithm for integer optimization
is described in Algorithm 26.2.
1 Objective
2 Find a global minimum of the problem P0 : minx f(x) subject to g(x) ≤ 0,
h(x) = 0, x ∈ Zn .
3 Input
4 The functions f : Rn → R, g : Rn → Rm , h : Rn → Rp .
5 Output
6 A global minimum x∗ .
7 Initialization
8 P := {P0 }.
9 f∗ := +∞.
10 Repeat
11 Select a problem Pk in P.
12 if Pk is infeasible then
13 discard Pk from P
14 else
15 Calculate the global minimum x∗R of the relaxation R(Pk )
16 ℓ(Pk ) := f(x∗R )
17 if f∗ > ℓ(Pk ) then
18 if x∗R is integer then
19 if f(x∗R ) < f∗ then
20 x∗ := x∗R , f∗ := f(x∗R )
21 else
22 Select i such that (x∗R )i is not integer
23 Create subproblem Pkℓ by adding the constraint xi ≤ ⌊(x∗R )i ⌋ to
Pk
24 Create subproblem Pkr by adding the constraint xi ≥ ⌈(x∗R )i ⌉ to
Pk
25 P := P ∪ {Pkℓ , Pkr } \ Pk
subject to
−4x1 + 6x2 ≤5
x1 + x2 ≤5
x1 , x2 ≥0
x1 , x2 ∈ N.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5
0
0 1 2 3 4 5
We now illustrate Algorithm 26.2 on Example 26.4. Call the original problem P0
and initialize f∗ = +∞ and P := {P0 }. The optimal solution of the relaxation R(P0 )
is x∗0 = (2.5, 2.5), with value f(x∗0 ) = −2.5. The feasible set of the relaxation R(P0 ),
some level curves of the objective function, and the optimal solution are represented
in Figure 26.7(b). As the optimal solution is not integer, we decide to branch on x2 .
In the first subproblem P1 = P0ℓ , we include the constraint x2 ≤ ⌊2.5⌋ = 2. In the
second one P2 = P0r , we include the constraint x2 ≥ ⌈2.5⌉ = 3.
636 Branch and bound
P1 = P0ℓ P2 = P0r
min x1 − 2x2 min x1 − 2x2
subject to subject to
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
These two additional constraints are depicted in Figure 26.8(a). It appears clearly
that problem P2 is infeasible as no feasible solution of the original problem is such
that x2 is 3 or larger. Remember that the simplex algorithm is designed to detect
infeasible problems (see Section 16.3). It is immediately discarded and P = {P1 }. The
feasible set of problem P1 is represented in Figure 26.8(b).
0
0 1 2 3 4 5
0
0 1 2 3 4 5
It is seen that all feasible (that is, integer) points of the original problem are also
feasible for P1 . Therefore, the optimal solution of P1 is also the optimal solution of
P0 . What has changed is the feasible set of the relaxation. The polygon has shrunk.
Moreover, the optimal solution of the relaxation, (2.5, 2.5) is now excluded from the
feasible set of R(P1 ). Note that one more vertex of the polygon now has integer
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
coordinates: (3, 2). As the optimal solution is to be found at one vertex, we increase
our chances to find an integer optimal solution by solving the relaxation.
However, the optimal solution of R(P1 ) is not integer: x∗1 = (1.75, 2), with value
f(x∗1 ) = −2.25. Here, we branch on x1 , which is the only fractional variable. In the
first subproblem P11 = P1ℓ , we include the constraint x1 ≤ ⌊1.75⌋ = 1. In the second
one P12 = P1r , we include the constraint x1 ≥ ⌈1.75⌉ = 2. We now have P = {P11 , P12 }.
P11 P12
min x1 − 2x2 min x1 − 2x2
subject to subject to
−4x1 + 6x2 ≤ 5 −4x1 + 6x2 ≤ 5
x1 + x2 ≤ 5 x1 + x2 ≤ 5
x1 , x2 ≥ 0 x1 , x2 ≥ 0
x1 , x2 ∈ N x1 , x2 ∈ N
x2 ≤ 2 x2 ≤ 2
x1 ≤ 1 x1 ≥ 2
These additional constraints are illustrated in Figure 26.9(a). The feasible set of
R(P12 ), which is the polygon on the right of Figure 26.9(b), appears to be such that
each of its vertices corresponds to an integer solution. Therefore, it is guaranteed
that one of its optimal solutions is integer and, therefore, also an optimal solution
of P12 . In this case, the optimal solution is unique and is x∗12 = (2, 2), with value
f(x∗12 ) = −2. It becomes therefore the current (and first) candidate to be the optimal
solution of P: x∗ = (2, 2) and f∗ = −2. Hence, P12 is discarded from P that now
comprises {P0 , P1 , P11 }.
We now treat P11 . The optimal solution of R(P11 ) is x∗11 = (1, 1.5), with value
ℓ(P11 ) = f(x∗11 ) = −2. It is not an integer solution and, therefore, not a feasible
solution of P11 . Because f∗ ≤ ℓ(P11 ), the problem can be discarded without being
solved. Indeed, its optimal value cannot be better than −2. Therefore, the optimal
solution of P1 (and consequently of P0 ) is the optimal solution of P12 , so that P1 and
P0 can also be removed from P, as they have been solved. We now have P = ∅, and
the algorithm terminates. An optimal solution of P is x∗ = (2, 2) with value f∗ = −2.
2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5
3
x∗12
2
x∗11
1
0
0 1 2 3 4 5
to exactly the same feasible set of integer solutions. Clearly, the last of them is the
most appealing. Indeed, each vertex is integer, so that an optimal solution of the
relaxation is also an optimal solution of the original problem. This polyhedron is the
convex hull of the feasible solutions (see Definition B.3).
The idea of cutting planes methods is to start from the original formulation, in-
clude additional constraints that shrink the polyhedron without modifying the feasible
set, and force some vertices of the new polyhedron to be integer. These additional
constraints are called valid inequalities.
3 3
2 2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 1
0 0
0 1 2 3 4 5 0 1 2 3 4 5
3 3
2 2
1 1
0 0
0 1 2 3 4 5 0 1 2 3 4 5
ular method has been proposed by Gomory (1958) and exploits the simplex tableau
introduced in Section 16.2.
Consider the (mixed) integer linear optimization problem P. We solve its relax-
ation P using the simplex algorithm in two phases (Algorithm 16.5), and we obtain
the optimal tableau
B−1 A B−1 b
cT − cTB B−1 A −cTB B−1 b
where B contains the columns of A corresponding to the basic variables. The top part
of the tableau contains a transformed version of the equality constraints. Separating
the variables into basic variables xB and non basic variables xN , and denoting N the
columns corresponding to non basic variables (see Section 3.4), it is written as
B−1 Ax = B−1 b,
B−1 BxB + B−1 NxN = B−1 b, (26.12)
−1 −1
xB + B NxN = B b.
To simplify the following equations, let us assume that the variables are numbered in
such a way that the m first variables are basic, so that xi = (xB )i . Denote αij the
entry in row i and column j of the matrix B−1 A, which is obtained directly from the
640 Cutting planes
tableau, remembering that B−1 b = x∗B . Therefore, the ith constraint is written as
X
xi + αij xj = (x∗B )i . (26.13)
j non basic
Rounding down the two sides of this inequality, we obtain another valid inequality
for the feasible solutions of the relaxation:
X
xi + ⌊αij ⌋xj ≤ ⌊(x∗B )i ⌋. (26.15)
j non basic
which is a valid inequality for all feasible solutions of the integer optimization problem.
Equation (26.17) is called a Gomory cut .
We show now that the optimal solution x∗ of the relaxation does not verify (26.17).
Indeed, all non basic components of x∗ are zero, and (26.17) is written as
where (x∗B )i = x∗i because of our numbering convention. Inequality (26.18) is satisfied
by x∗ only if x∗i is integer. Therefore, in order to generate a valid inequality that
excludes x∗ from the relaxation polyhedron, the index i must be chosen such that x∗i
is fractional. Algorithm 26.3 describes how Gomory cuts are used to solve an integer
linear optimization problem.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
We illustrate the method in Example 26.4. Note that in order for the relaxation
to be solved by Algorithm 16.5, the problem must first be transformed into standard
form by adding two slack variables:
min x1 − 2x2
subject to
−4x1 + 6x2 + x3 =5
x1 + x2 + x4 =5
x1 , x2 , x3 , x4 ≥0
that is
x2 ≤ 2. (26.21)
x1 − x3 ≤ 2, (26.23)
as ⌊−0.1⌋ = −1, ⌊0.6⌋ = 0, and ⌊2.5⌋ = 2. As x3 = 5 + 4x1 − 6x2 , the valid inequality
in the original variables is
−3x1 + 6x2 ≤ 7. (26.24)
3 3
2 2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 1
0 0
0 1 2 3 4 5 0 1 2 3 4 5
Variables x1 and x4 are fractional. Therefore, the following valid inequalities can
be generated:
x4 − 3x5 ≤ 1 (26.25)
for x4 and
x1 − x3 + x5 ≤ 1 (26.26)
for x1 . In the original variables, these are
−x1 + 2x2 ≤ 2 (26.27)
and
−3x1 + 5x2 ≤ 4. (26.28)
These cuts are illustrated in Figure 26.13. They both have the property that they cut
the polygon at (2, 2), which becomes a vertex. Actually, the optimal solution of the
relaxation of any of these two problems is (2, 2), which is also the optimal solution of
the integer optimization problem. No more cuts are necessary.
Exact methods for discrete optimization 643
3 3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
2 2
1 1
0 0
0 1 2 3 4 5 0 1 2 3 4 5
We provide another illustration of the Gomory cuts with Example 25.13. The
feasible set is represented in Figure 25.2. After the introduction of the slack variables,
we obtain the relaxation:
min −3x1 − 13x2 (26.29)
x∈N2
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
subject to
2x1 + 9x2 + x3 = 29
11x1 − 8x2 + x4 = 79 (26.30)
x1 , x2 , x3 , x4 ≥ 0.
The optimal tableau of the relaxation is
x1 x2 x3 x4
0 1 0.10 −0.02 1.4 x2
1 0 0.07 0.08 8.2 x1
0 0 1.45 0.01 42.8
The two variables are fractional, so two valid inequalities can be generated:
x2 − x4 ≤ 1 (26.31)
and
x1 ≤ 8. (26.32)
As x4 = 79 − 11x1 + 8x2 , the first inequality in the original variables is written as
These two cuts are illustrated in Figure 26.14. It appears in this example that the part
of the polyhedron that is cut can be small. We expect, in this case, the algorithm
to take a while to converge. Depending on the cut selected for inclusion at each
iteration, the algorithm may use more than 50 iterations to find the optimal solution
of this problem.
In practice, the cutting plane method is usually combined with the branch and
bound algorithm described in Section 26.1. In addition to the additional constraints
generated by the branching strategy, valid inequalities such as Gomory cuts are also
included. Such a method is called branch and cut.
26.3 Exercises
Exercise 26.1. Find better bounds for Example 26.3.
Exercise 26.2. Consider the assignment problem presented as Exercise 22.2.
1. Solve it using the branch and bound algorithm (Algorithm 26.1).
2. Consider its mathematical formulation as a transhipment problem (see Exer-
cise 22.2). Solve it with the simplex algorithm (Algorithm 16.5).
Exact methods for discrete optimization 645
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5 6 7 8 9
Figure 26.14: The feasible set for Example 25.13 with Gomory cuts
26.4 Project
The general organization of the projects is described in Appendix D.
Objective
The objective of the project is to analyze how different exact methods handle different
optimization problems.
Approach
Algorithms
Problems
Exercise 26.3. Solve the instance of the problem of locating plants for the supply
of energy described in Example 25.1, with 10 sites and 3 cities, using the data in
Table 25.1.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Chapter 27
Heuristics
Contents
27.1 Greedy heuristics . . . . . . . . . . . . . . . . . . . . . . . 648
27.1.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . 648
27.1.2 The traveling salesman problem . . . . . . . . . . . . . . 649
27.2 Neighborhood and local search . . . . . . . . . . . . . . . 656
27.2.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . 662
27.2.2 The traveling salesman problem . . . . . . . . . . . . . . 665
27.3 Variable neighborhood search . . . . . . . . . . . . . . . . 669
27.3.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . 670
27.3.2 The traveling salesman problem . . . . . . . . . . . . . . 672
27.4 Simulated annealing . . . . . . . . . . . . . . . . . . . . . . 674
27.4.1 The knapsack problem . . . . . . . . . . . . . . . . . . . . 677
27.4.2 The traveling salesman problem . . . . . . . . . . . . . . 679
27.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
27.6 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Due to the combinatorial nature of the integer optimization problems, the methods
described in Chapter 26 may fail to identify the optimal solution in a reasonable
amount of time. Also, the number of subproblems to consider in a branch and bound
tree may be so high that the tree may sometimes not fit into the memory of the
computer. Under such circumstances, it is hopeless to find the optimal solution
of the problem. Instead, for all practical purposes, we are interested in efficient
techniques that identify a “good” solution, meaning a solution that is feasible and
(hopefully) significantly better than a solution that would have been designed “by
hand” by a human being, expert in the problem. Such techniques are called heuristic
algorithms.
context.
For these reasons, the heuristics introduced in this chapter are described for spe-
cific problems, in order to illustrate the concepts. We refer the reader to the large
literature for additional examples (see, among others, Gendreau and Potvin, 2010).
i 1 2 3 4 5 6 7 8 9 10 11 12
u 80 31 48 17 27 84 34 39 46 58 23 67
w 84 27 47 22 21 96 42 46 54 53 32 78
The capacity of the knapsack is 300.
Consider Example 27.2. We sort the items according to their relative value:
i 5 2 10 3 1 6 12 9 8 7 4 11
ui 27 31 58 48 80 84 67 46 39 34 17 23
wi 21 27 53 47 84 96 78 54 46 42 22 32
ui
wi
1.29 1.15 1.09 1.02 0.95 0.88 0.86 0.85 0.85 0.81 0.77 0.72
We proceed through the list and include items 5, 2, 10, 3, and 1, for a total weight
of 232 and the total utility to 244. Items 6 and 12 cannot be included, as it would
violate the capacity constraint. Item 9 can be included, increasing the weight to 286
and the utility to 290. None of the remaining items can be included anymore.
Heuristics 649
from home and, at each step, select the closest city as the next one, as described in
Algorithm 27.1.
Example 27.3 (The traveling salesman problem: 16 cities). A salesman must visit
15 customers during the day. Starting from home, he has to plan a tour, that is, a
sequence of customers to visit, in order to minimize the travel distance. We model it
with a graph, where each vertex represents either the home place or a customer. There
is an edge between each pair of vertices, and the cost of the edge is the Euclidean
straight distance between two vertices. The location of the home place (vertex 1) and
of the 15 customers are reported in Table 27.1 and illustrated in Figure 27.1.
650 Greedy heuristics
Table 27.1: Traveling salesman problem: position of the home (vertex 1) and of 15
customers to visit
Vertex x-coord y-coord Vertex x-coord y-coord
1 9.14 3.92 9 3.41 27.54
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
40 14
15
35
30 13 16
9
25
10 11 12
20
6
15
7
10 5 8
3
4
5
1
2
0
0 5 10 15 20 25 30 35 40
Figure 27.1: Traveling salesman problem: position of the home (vertex 1) and of 15
customers to visit
Heuristics 651
14 7.4
15
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 4.2 13
.1
13 16
2.9
9 10
.5
10.8 12
10 11
4.7
30
.4
8.6
6
15.3
8.1
7
4.4
4.1 8
5 7.9
3
6.4
1 9.7
Figure 27.2: Feasible solution provided by the nearest neighbor greedy algorithm for
Example 27.3 (length: 158.5)
Another greedy heuristic for the traveling salesman problem consists in improving
an existing subtour by inserting a vertex. An example of insertion is illustrated in
Figure 27.3, where a subtour of length 134.4 is constructed by inserting city 14 into a
subtour of 12 cities (of length 108.1). Note that it is not the best possible insertion,
which would consist in inserting city 15 after city 16 in the tour and obtaining a
subtour of length 125.6. The greedy algorithm consists in selecting the best possible
insertion at each step, as described in Algorithm 27.2.
The iterations of the insertion greedy algorithm (Algorithm 27.2) on Example 27.3
are reported in Table 27.2, and the final tour illustrated in Figure 27.4.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 652 Greedy heuristics
14
15
19
17.3
13
.9 16
9 10
.3 .5
11
10.8 12
10 11
4.7
15.3
8.1
7 5.9
4.4
5 8 7.9
3
6.4
4
.1
13
1 9.7
Figure 27.3: Example of a subtour involving 12 cities, of length 108.1, with insertion
of city 14
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Heuristics 653
Table 27.2: Iterations of the insertion greedy algorithm (Algorithm 27.2) on Exam-
ple 27.3
Length Subtour
12.8 1 5 1
28.6 1 6 5 1
37.9 1 6 10 5 1
50.9 1 2 6 10 5 1
64.2 1 2 3 6 10 5 1
66.1 1 2 3 7 6 10 5 1
71.8 1 2 3 8 7 6 10 5 1
78.0 1 2 3 8 7 11 6 10 5 1
93.1 1 2 3 4 8 7 11 6 10 5 1
110.0 1 2 3 4 8 7 11 6 10 9 5 1
114.6 1 2 3 4 8 7 11 6 10 13 9 5 1
132.9 1 2 3 4 8 7 11 6 10 14 13 9 5 1
140.5 1 2 3 4 8 7 11 6 10 15 14 13 9 5 1
156.6 1 2 3 4 8 7 11 6 10 16 15 14 13 9 5 1
172.9 1 2 3 4 8 7 11 6 10 12 16 15 14 13 9 5 1
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Heuristics 655
14 7.4
15
1 4.2 13
.1
13 16
2.9
9 10
.5
26.3
10 11 12
12.7
4.7
18.1
8.6
7 5.9
8
5
3 11.3 7.9
6.4
4
.1
13
1 9.7
Figure 27.4: Result of the insertion greedy algorithm (Algorithm 27.2) on Exam-
ple 27.3 (length: 172.9)
656 Neighborhood and local search
yk+
i = yk−
i = xi , ∀i 6= k, yk+
k = xk + 1, yk−
k = xk − 1. (27.1)
For example, if k = 2,
y2+
y1− x y1+
y2−
integer optimization problem is illustrated in Figure 27.6, where the neighbors are
generated using moves inspired by the knights of a chess game. Other examples
of neighborhood structures are provided later in this chapter. When dealing with
practical applications, it is good practice to get inspiration from experts from the
field when defining a neighborhood structure. In particular, a good way to define a
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
The idea is simple. At each iteration, the current iterate is replaced by its best
feasible neighbor, until the current feasible solution is the best in the neighborhood.
Therefore, Algorithm 27.3 generates a local minimum with respect to the given neigh-
borhood structure. Note that this concept of local minimum is a generalization of the
one introduced for continuous optimization (Definition 1.5), where the neighborhood
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
• An element x belongs to its own neighborhood: for all x, x ∈ N(x). This property
is important only to characterize a local minimum as x∗ ∈ argminx∈N(x)∩F f(x).
• The neighborhood structure is symmetric, that is, for all x and y, x ∈ N(y) if and
only if y ∈ N(x).
• The neighborhood structure should allow any feasible point to be reached from
any other feasible point in a finite number of steps.
• The size of the neighborhood structure should not grow too fast with the size
of the problem. The optimization problem solved at each iteration within the
neighborhood structure must be tractable.
There are several variants of the local search method. One of them consists in
evaluating the neighbors in a given order, and to accept as next iterate the first one
that is better than the current iterate (Algorithm 27.4). This may allow compu-
tational time to be saved in early iterations, when many neighbors are better than
the current feasible solution. It means that the neighborhood structure should be
associated with an order of its elements.
For large neighborhoods, some variants propose to randomly select a fixed number
of candidates in the neighborhood. If none of these candidates is better than the
current iterate, the algorithm is interrupted. The advantage of this approach is that
the computational complexity of the algorithm can be controlled independently of
the size of the neighborhood.
Consider Example 25.13, together with the neighborhood structure defined by
(27.1) and illustrated in Figure 27.5. We apply Algorithm 27.3 with x0 = (6, 0). The
iterations are described in Table 27.3 and illustrated in Figure 27.7. The starting point
x0 = (6, 0) has four neighbors. The point (6, −1) is infeasible. Among the others,
(6, 1) is associated with the lowest value of the objective function and is selected as
the next iterate. Among its four neighbors, (6, 2) is infeasible and (7, 1) is selected as
the next iterate. Among its neighbors, two are infeasible and two have a higher value
of the objective function. Therefore, (7, 1) is a local minimum for this neighborhood
structure.
Heuristics 659
3
4 The objective function f : Rn → R.
5 The feasible set F .
6 A neighborhood structure N such that for each x, N(x) is an ordered
sequence of solutions.
7 An initial feasible solution x0 ∈ F such that N(x0 ) ∩ F 6= ∅.
8 Output
9 A feasible solution x∗ .
10 Repeat
11 improvement :=FALSE .
12 for xc ∈ N(xk ) ∩ F do
13 if f(xc ) < f(xk ) then
14 improvement :=TRUE
15 xk+1 := xc
16 k := k + 1
17 break // The “for” loop is interrupted
xk Neighbors
x (6,0) (7,0) (5,0) (6,1) (6,-1)
f(x) -18 -21 -15 -31 —
x (6,1) (7,1) (5,1) (6,2) (6,0)
f(x) -31 -34 -28 — -18
x (7,1) (8,1) (6,1) (7,2) (7,0)
f(x) -34 — -31 — -21
660 Neighborhood and local search
3
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5 6 7 8 9
Figure 27.7: Local search on Example 25.13 with x0 = (6, 0)
If another starting point is selected, a different local minimum can be reached. The
iterations starting from (2, 0) are reported in Table 27.4 and illustrated in Figure 27.8.
xk Neighbors
x (2,0) (3,0) (1,0) (2,1) (2,-1)
f(x) -6 -9 -3 -19 —
x (2,1) (3,1) (1,1) (2,2) (2,0)
f(x) -19 -22 -16 -32 -6
x (2,2) (3,2) (1,2) (2,3) (2,1)
f(x) -32 -35 -29 — -19
x (3,2) (4,2) (2,2) (3,3) (3,1)
f(x) -35 -38 -32 — -22
x (4,2) (5,2) (3,2) (4,3) (4,1)
f(x) -38 -41 -35 — -25
x (5,2) (6,2) (4,2) (5,3) (5,1)
f(x) -41 — -38 — -28
4
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
0
0 1 2 3 4 5 6 7 8 9
Figure 27.8: Local search on Example 25.13 with x0 = (2, 0)
Table 27.5: Local search on Example 25.13 with the “knight” neighborhood and x0 =
(2, 0)
xk Neighbors
x (2,0) (4,1) (4,-1) (0,1) (0,-1) (3,2) (3,-2) (1,2) (1,-2)
f(x) -6 -25 — -13 — -35 — -29 —
x (3,2) (5,3) (5,1) (1,3) (1,1) (4,4) (4,0) (2,4) (2,0)
f(x) -35 — -28 -42 -16 — -12 — -6
x (1,3) (3,4) (3,2) (-1,4) (-1,2) (2,5) (2,1) (0,5) (0,1)
f(x) -42 — -35 — — — -19 — -13
0
0 1 2 3 4 5 6 7 8 9
Figure 27.9: Local search on Example 25.13 with the “knight” neighborhood and
x0 = (2, 0)
662 Neighborhood and local search
yij = xj ∀j 6= i,
yii = 1 − xi .
The iterations of the local search algorithm (Algorithm 27.4) for Example 27.2 are
reported in Table 27.6. Each block represents an iteration with the list of neighbors
that have been considered, the last one being selected for the next iteration. In the
last block, all neighbors are rejected, so that the current iterate is a local minimum.
The interpretation of these iterations is simple: each item is included one by one into
the knapsack until the next one does not fit. A total of 6 items can fit, for a total
weight of 297 and a total utility of 203. Note that the greedy algorithm presented in
Section 27.1.1 found a feasible solution with weight 286 and utility 290.
The simple neighborhood structure presented above can be generalized. We define
a neighborhood of size k by selecting k items, and modify the decision about them.
In particular, if k = 1, there are n neighbors, and the neighborhood structure is the
one used earlier. If k = n, there is only 1 neighbor, obtained by changing the status
of all the items. The size of this neighborhood is
1
n! 2n+ 2
≈ √ , (27.2)
k!(n − k)! πn
where the approximation holds when n is large and k = n/2. Therefore, the size
of this neighborhood grows exponentially with the size of the problem, which is
not desirable. In order to avoid that, the neighborhood is defined by the random
selection of a fixed number of neighbors, as defined in Algorithm 27.5. In this case,
the size of the neighborhood is bounded above by M, irrespectively of the values
of k and n. Note the randomization of the procedure, which prevents items being
considered in the same order. Note also that only feasible solutions are considered in
the neighborhood. This illustrates the flexibility of the neighborhood definition.
This procedure may generate the same neighbor several times, as the random
draws are made with replacement. The exact size of the neighborhood varies from
run to run, as infeasible combinations are discarded. It may also generate an empty
sequence, if the feasibility test at step 19 fails for each selected item. The use of this
neighborhood is illustrated in Section 27.3.1.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Heuristics 663
k 1 2 3 4 5 6 7 8 9 10 11 12 wT xc uT xc uT x∗
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 84 80 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 80
2 1 1 0 0 0 0 0 0 0 0 0 0 111 111 80
0 1 0 0 0 0 0 0 0 0 0 0 27 31 111
1 0 0 0 0 0 0 0 0 0 0 0 84 80 111
3 1 1 1 0 0 0 0 0 0 0 0 0 158 159 111
0 1 1 0 0 0 0 0 0 0 0 0 74 79 159
1 0 1 0 0 0 0 0 0 0 0 0 131 128 159
1 1 0 0 0 0 0 0 0 0 0 0 111 111 159
4 1 1 1 1 0 0 0 0 0 0 0 0 180 176 159
0 1 1 1 0 0 0 0 0 0 0 0 96 96 176
1 0 1 1 0 0 0 0 0 0 0 0 153 145 176
1 1 0 1 0 0 0 0 0 0 0 0 133 128 176
1 1 1 0 0 0 0 0 0 0 0 0 158 159 176
5 1 1 1 1 1 0 0 0 0 0 0 0 201 203 176
0 1 1 1 1 0 0 0 0 0 0 0 117 123 203
1 0 1 1 1 0 0 0 0 0 0 0 174 172 203
1 1 0 1 1 0 0 0 0 0 0 0 154 155 203
1 1 1 0 1 0 0 0 0 0 0 0 179 186 203
1 1 1 1 0 0 0 0 0 0 0 0 180 176 203
6 1 1 1 1 1 1 0 0 0 0 0 0 297 287 203
0 1 1 1 1 1 0 0 0 0 0 0 213 207 287
1 0 1 1 1 1 0 0 0 0 0 0 270 256 287
1 1 0 1 1 1 0 0 0 0 0 0 250 239 287
1 1 1 0 1 1 0 0 0 0 0 0 275 270 287
1 1 1 1 0 1 0 0 0 0 0 0 276 260 287
1 1 1 1 1 0 0 0 0 0 0 0 201 203 287
1 1 1 1 1 1 1 0 0 0 0 0 339 321 287
1 1 1 1 1 1 0 1 0 0 0 0 343 326 287
1 1 1 1 1 1 0 0 1 0 0 0 351 333 287
1 1 1 1 1 1 0 0 0 1 0 0 350 345 287
1 1 1 1 1 1 0 0 0 0 1 0 329 310 287
7 1 1 1 1 1 1 0 0 0 0 0 1 375 354 287
Heuristics 665
14
15
13 16
10 11 12
5 8
3
4
The neighborhood structure that we consider for the local search algorithm is
called 2-OPT. It consists in selecting two customers and deciding to swap their posi-
tion in the tour, inverting the sequence of visits between the two. If a and b are the
two customers selected to be swapped, the 2-OPT neighbor of
h, i1 , . . . im , a, j1 , j2 , . . . jn , b, k1 , . . . , kp
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 666
1 2 3 8 4 12 7 10 11 16 15 14 13 9 6 5 169.16 9 13
1 2 3 8 4 12 7 10 9 13 14 15 16 11 6 5 169.11 11 9
1 2 3 8 4 12 7 11 16 15 14 13 9 10 6 5 153.82 10 11
Heuristics 667
is
h, i1 , . . . im , b, jn , . . . j2 , j1 , a, k1 , . . . , kp .
is
1, 7, 10, 3, 13, 12, 2, 8, 14, 6, 4, 11, 15, 16, 5, 9.
The neighborhood therefore consists of a set of tours generated using this procedure
for any pair of cities. We apply now Algorithm 27.3 using this neighborhood structure.
The iterations are reported in Table 27.7. Each row corresponds to an iteration. For
each iteration, the current tour and its length are reported, as well as the two cities
involved in the 2-OPT neighbor.
14 7.4
15
1 4.2 13
.1
13 16
2.9
9 10
.5
11.
6
10 11 12
4.7
8.6
6
15.3
8.1
7
21.8
4.4
4.1 8
5 7.9
3
6.4
1 9.7
Figure 27.11: Feasible solution provided by the local search algorithm, started from
the feasible solution provided by the greedy algorithm for Example 27.3 (length:
150.7)
668 Neighborhood and local search
This feasible solution is a little bit better than the feasible solution provided by
the greedy algorithm presented in Section 27.1.2 (which is 158.5, see Figure 27.2),
but it involves a significantly higher computational effort. Therefore, it may make
sense to initiate the local search with the feasible solution provided by the greedy
algorithm as a starting point, instead of a randomly generated initial tour. For our
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
example, it performs only one iteration, by applying the 2-OPT operator on cities 9
and 11, to obtain the tour represented in Figure 27.11, with length 150.7.
As local search methods get trapped in local minima, it is good practice to apply
them from different starting points, in order to increase the chance of finding different
local minima. The methods presented in the next sections are also designed to escape
from local minima.
14 7.4
15
1 4.2 13
.1
13 16
2.9
9 .3
11.
6 11
10 11 12
4.7
.3
15
8.6
6
15.3
8.1
4.1 8
5 7.9
3
6.4
4
.1
13
1 9.7
Figure 27.12: Feasible solution provided by Algorithm 27.3 on Example 27.3 (length:
153.8)
Heuristics 669
The feasible solution provided by the local search algorithm (Algorithm 27.3) is
x+ := LS(f, F , x∗ , Nk )
The iterations of the VNS algorithm on Example 27.2 using the neighborhood
structures defined by Algorithm 27.5 (with M = 1,000) are illustrated in Figure 27.13.
300 12
k 11
Neighborhood size k
250 f(x∗ ) 10
9
200 8
uT x∗
150 7
6
100 5
4
50 3
2
0 1
0 5 10 15 20 25
Iterations
Figure 27.13: Iterations of run 1 of Algorithm 27.6 on Example 27.2 using the neigh-
borhood structures defined by Algorithm 27.5.
The solid line shows how the size k of the neighborhood changes from iteration to
iteration. Note that it is reset to k = 1 each time a better feasible solution is found.
The dashed line provides the value of the objective function for the best feasible
solution found so far at each iteration. The first local search allows a value of 284 to
be reached. The mechanism of the VNS allows us to escape from this local minimum,
and reach an objective value of 300, obtained by the selection of items 1, 2, 3, 4, 5, 8,
and 10. There is no guarantee that it is the optimal solution. As it is a randomized
algorithm, it may be appropriate to run the same algorithm several times. In this
case, the algorithm was run 10 times. The final feasible solution was always the same.
The iterations of runs 2 and 3 of this experiment are reported in Figures 27.14 and
27.15.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Heuristics 671
300 12
k 11
Neighborhood size k
250 f(x∗ ) 10
9
200 8
uT x∗
150 7
6
100 5
4
50 3
2
0 1
0 2 4 6 8 10 12 14 16
Iterations
Figure 27.14: Iterations of run 2 of Algorithm 27.6 on Example 27.2 using the neigh-
borhood structures defined by Algorithm 27.5
300 12
k 11
Neighborhood size k
250 f(x∗ ) 10
9
200 8
uT x∗
150 7
6
100 5
4
50 3
2
0 1
0 5 10 15 20 25
Iterations
Figure 27.15: Iterations of run 3 of Algorithm 27.6 on Example 27.2 using the neigh-
borhood structures defined by Algorithm 27.5
672 Variable neighborhood search
Figure 27.16 illustrates a tour t of length 156.2 obtained using the insertion greedy
algorithm (Algorithm 27.2) starting with subtour s=1–2–3–7–8–4–12–16–11–1.
14 7.4
15
1 4.2 13
.1
13 16
2.9
9 10
.3 .5
21.7 11
10.8 12
10 11
4.7
6
15.3
8.1
7 5.9
.7
23
4.4
5 8 7.9
3
6.4
4
.1
13
1 9.7
Figure 27.16: Tour (length: 156.2) obtained using the insertion greedy algorithm
(Algorithm 27.2) starting with subtour 1–2–3–7–8–4–12–16–11–1
Heuristics 673
14 7.4
15
1 4.2 13
.1
13 16
2.9
9 .3
11.
6 11
15.5
10 11 12
4.7
.0
6
35
15.3
8.1
7 5.9
4.4
5 8 7.9
3
6.4
4
.1
13
1 9.7
Figure 27.17: Tour (length: 151.6) obtained using the insertion greedy algorithm
(Algorithm 27.2) starting with subtour 1–2–3–7–8–4–12–11–16–1
This neighborhood structure can be used in Algorithm 27.6 (where the neighbor-
hood of size 1 is undefined and therefore skipped by the algorithm). The iterations in
the case of Example 27.3 are illustrated in Figure 27.18. The algorithm succeeds in
improving the objective function with a neighborhood of size 2 in the first iteration.
The next improvement is obtained with a neighborhood of size 6, and the last one
with a neighborhood of size 9.
674 Simulated annealing
400 16
k 15
f(x∗ ) 14
Neighborhood size k
350
13
12
Tour length
300 11
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
10
250 9
8
200 7
6
5
150 4
3
100 2
0 5 10 15 20 25 30
Iterations
Figure 27.18: Iterations of Algorithm 27.6 on Example 27.3 using the neighborhood
structures introduced in Section 27.3.2 (best feasible solution: 149.2)
The above heuristic is certainly not efficient and has been designed to illustrate
the concepts introduced in this book. Many other neighborhood structures are pos-
sible. In particular, a natural structure for the VNS method applied to the traveling
salesman problem would be a generalization of the 2-OPT neighborhood, such as the
k-OPT neighborhood, where k is the number of cities that are re-organized in the
tour (see Helsgaun, 2009). In their paper, Mladenović and Hansen (1997) illustrate
the efficiency of the VNS heuristic on the traveling salesman problem. They combine
the VNS idea with the GENIUS heuristic proposed by Gendreau et al. (1992).
0.8
Prob(xk+1 = y)
0.6
Note that this extension may be applied to any version of the local search algo-
rithm. Algorithm 27.7 proposes a version of the simulated annealing method where
the candidate neighbor is selected randomly in the neighborhood.
The performance of the algorithm varies with the value of its parameters K, that
is, the number of trials for each level of temperature, and T0 , Tf and the sequence
(Tℓ )ℓ , controlling the temperature reduction.
With respect to the temperature reduction mechanism, it is easier to interpret it
in terms of probability of acceptance. Let δt be a typical increase of the objective
function in the neighborhood structure N. In the beginning of the algorithm, we
would like such an increase to be accepted with high probability p0 = 0.999, say. At
the end, it should be accepted with low probability pf = 0.00001, say. If we allow the
algorithm to modify the temperature M times, then for ℓ = 0, . . . , M we have
δt
Tℓ = − −p0 . (27.4)
ln(p0 + pfM ℓ)
1000 1
Temperature
Acceptance probability
Tm (log scale)
100 Acceptance probability 0.8
10 0.6
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 0.4
0.1 0.2
0.01 0
0 200 400 600 800 1000
m
300
1000
250
100 200
uT x
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
150
T
10 100
uT xc
T 50
uT x∗
1 0
0 1421 2500 3493 5000
Iterations
Figure 27.21: Iterations of the simulated annealing algorithm on the knapsack prob-
lem (K = 50, M = 100)
300
1000
250
100 200
uT x
150
T
10 100
uT xc
T 50
uT x∗
1 0
0 282 2500 5000
Iterations
Figure 27.22: Iterations of the simulated annealing algorithm on the knapsack prob-
lem K = 1,000, M = 5
The same feasible solution is obtained, but is reached earlier (iteration 282), when
the temperature is equal to T = 89.22. When the temperature has reached 1.74, the
algorithm cannot escape from the local maximum anymore, at the value 257. It is in
general not a good idea to drop the temperature too quickly.
Finally, the algorithm is run with K = 5 and M = 1,000. That is, the temperature
is modified 1,000 times, and each time 5 candidates are tested. The iterations are
illustrated in Figure 27.23, using the same convention as before. The same feasible
solution is obtained and reached at iteration 4,206, when the temperature is equal to
T = 16.6.
It is good practice to test different values of the parameters on small instances of
a problem before running it on large instances.
Heuristics 679
300
1000
250
100 200
uT x
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
150
T
10 100
uT xc
T 50
uT x∗
1 0
0 2500 4206 5000
Iterations
Figure 27.23: Iterations of the simulated annealing algorithm on the knapsack prob-
lem K = 5, M = 1,000
1000 450
f(xc )
T 400
100 f(x∗ )
350
f(x)
10 300
T
250
1
200
0.1 150
0 2500 5000
Iterations
Figure 27.24: Iterations of the simulated annealing algorithm on the traveling sales-
man problem (K = 50, M = 100)
680 Simulated annealing
The feasible solution provided by the algorithm has length 149.2 and is represented
in Figure 27.25.
The algorithm has also been run with K = 1,000 and M = 5 (Figure 27.26) and
with K = 5 and M = 1,000 (Figure 27.27). In both cases, the feasible solution reached
length 150.7.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
14 7.4
15
1 4.2
15.8
13 16
2.9
9 10
.3 .5
11.
6 11
10 11 12
4.7
15.3
8.1
7 5.9
4.4
5 8 7.9
3
6.4
4
.1
13
1 9.7
Note that these results are based on only one execution of the algorithm. As the
algorithm is randomized, its outcome varies from run to run. Applying the algorithm
100 times with K = 50, M = 100, we obtain 53 times the value 149.2, and 26 times
the value 150.7. The complete results are reported in Table 27.8.
Simulated annealing can of course be applied to any type of neighborhood. For
instance, Alfa et al. (1991) use a 3-OPT neighborhood in this context.
Heuristics 681
100 450
xc
T 400
x∗
10 350
f(x)
300
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
1 250
200
0.1 150
0 2500 5000
Iterations
Figure 27.26: Iterations of the simulated annealing algorithm on the traveling sales-
man problem (K = 1,000, M = 5)
10000 450
xc
T 400
1000
x∗
350
100
f(x)
300
T
10
250
1 200
0.1 150
0 2500 5000
Iterations
Figure 27.27: Iterations of the simulated annealing algorithm on the traveling sales-
man problem (K = 5, M = 1,000)
Table 27.8: Value of the objective function for 100 runs of the simulated annealing
algorithm
682 Conclusion
27.5 Conclusion
Heuristics play an important role in optimization because, for some problems, they
are the only possible way of tackling them. This is the only family of methods
presented in this book that is not supported by a rigorous theoretical framework.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
27.6 Project
The general organization of the projects is described in Appendix D.
Objective
The objective of the project is to analyze how different heuristics handle different
optimization problems.
Approach
Algorithms
Problems
Exercise 27.1. Solve the instance of the problem of locating plants for the supply
of energy described in Example 25.1, with 10 sites and 3 cities, using the data in
Table 25.1.
Heuristics 683
Part VIII
Appendices
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Appendix A
Notations
The book uses standard notations in linear algebra and analysis. We provide here
some further details that the reader may find useful.
Positive / negative A number x is positive if x > 0. A number x is negative if
x < 0. Zero is neither positive or negative. We refer to a non negative number if
x ≥ 0, and to a non positive number if x ≤ 0.
Vectors Vectors of Rn are column vectors, represented with lowercase letters, such
as
x1
x = ... .
xn
The notation xk refers to the kth entry of vector x. When included in the core
of the text, the notation x = (x1 . . . xn )T is used, where superscript T refers to
“transposed.” The inner product of x ∈ Rn and y ∈ Rn is denoted by
xT y.
Matrices Matrices of Rm×n have m rows and n columns and are represented by
uppercase letters:
a11 . . . a1n
.. .
A = ... ..
. .
am1 . . . amn
The notation aij refers to the entry at row i and column j. The multiplication of
two matrices A ∈ Rm×p and B ∈ Rp×n is denoted by AB ∈ Rm×n , and is such
that
Xp
(AB)ij = Aik Bkj , i = 1, . . . , m, j = 1, . . . , n.
k=1
n
As a vector x ∈ R is a column vector, it is considered as a matrix of dimension
n × 1.
The inverse of matrix A is denoted by A−1 , the transpose of matrix A is denoted
by AT , and the inverse of the transpose of matrix A is denoted by A−T .
688
min and argmin Consider the function f : Rn → R and the set of constraints X ⊆
Rn . The equation
f∗ = min f(x) (A.1)
x∈X
means that
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
f∗ ≤ f(x), ∀x ∈ X, (A.2)
and f∗ ∈ R represents the value of the objective function at a minimum. The
equation
x∗ ∈ argminx∈X f(x) (A.3)
means that
x∗ ∈ {x ∈ X|f(x) ≤ f(y) ∀y ∈ Y} (A.4)
and x∗ belongs to the set of minima. In an algorithmic context, x∗ usually refers
to the minimum returned by the algorithm under consideration.
When there is a unique minimum, the equation can be written
Iterations Most algorithms presented in the book are iterative algorithms. In this
context, the notation xk ∈ Rn is used to refer to the value of the iterate at
iteration k. It is a vector of dimension n. In general, there is no ambiguity about
the meaning of the notation xk as representing the kth entry of x or iterate k of
the algorithm. In the former case, it is a real number, in the latter, a vector of
Rn . In the event of a possible ambiguity, the exact meaning is made explicit.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Appendix B
Definitions
x ∞
= max |xi | .
i=1,...,n
with λj ≥ 0, j = 1, . . . , k, and
k
X
λj = 1 . (B.2)
j=1
690
The set of all convex combinations of y1 , . . . , yk is called the convex hull of the
vectors y1 , . . . , yk .
Definition B.4 (Convex cone). The set C ⊆ Rn is a convex cone if, for any subset
x, y ∈ C, and any αx , αy > 0, then αx x + αy y ∈ C.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
i.e., if and only if, for all ε ∈ R, ε > 0, there exists η > 0 such that
x − x0 < η and x ∈ X =⇒ f(x) − f(x0 ) < ε . (B.4)
Definition B.11 (Minor). Consider the element aij of a square matrix A ∈ Rn×n .
The minor of aij is the matrix obtained by removing row i and column j from A.
Definition B.12 (Cofactor matrix). Consider the element aij of a square matrix
A ∈ Rn×n . The cofactor of aij is the determinant of the minor of aij multiplied by
(−1)i+j . The cofactor matrix is the matrix such that its element (i, j) is the cofactor
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
of aij .
Definition B.13 (Determinant). The determinant of a square matrix A ∈ Rn×n is
defined as
X n
Y
det(A) = sgn(σ) aiσi , (B.9)
σ∈Pn k=1
where Pn is the set of all permutations of the set {1, . . . , n}, and the sign of a permu-
tation σ is
sgn(σ) = (−1)M (B.10)
where M is the number of pairwise swaps that are required to obtain σ from {1, . . . , n}.
The following recursive definition is more adequate to calculate the determinant. If
A ∈ R1×1 , that is, if A contains only one element a11 , then det(A) = a11 . If
A ∈ Rn×n , then
n
X n
X
1+j
det(A) = (−1) a1j det(A1j ) = a1j C1j , (B.11)
j=1 j=1
where A1j is the minor of a1j , and C1j is the cofactor of a1j (see Definition B.12).
Definition B.14 (Unimodular matrix). A unimodular matrix is a square integer
matrix with determinant equal to 1 or −1.
where d(x, y) is the distance between x and y. When a = 1, the function is called a
Lipschitz function. If, moreover, k < 1, the function is called contracting. A Lipschitz
function is uniformly continuous on E.
Definition B.16 (Lipschitz continuity). Consider f : X ⊆ Rn → Rm . The function
f is Lipschitz continuous on X if there exists a constant M > 0 such that, for all
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
x, y ∈ X, we have
f(x) − f(y) m ≤ M x − y n , (B.12)
where k · km is a norm on Rm and k · kn is a norm on Rn . If M = 0, then f is
constant on X, i.e., there exists c such that f(x) = c, ∀x ∈ X.
Definition B.17 (Landau notation o( · )). Let f and g be two functions of R → R,
with f(x) 6= 0, ∀x. The Landau notation g(x) = o f(x) signifies that
g(x)
lim = 0. (B.13)
x→0 f(x)
By abuse of language, we say that g(x) tends toward zero faster than f(x).
Definition B.18 (Cholesky decomposition). Let A ∈ Rn×n be a positive definite
symmetric matrix. The Cholesky decomposition of A is
A = LLT , (B.14)
kAxk
A m×n
= max (B.19)
x∈Rn , x6=0 kxk
UT AV = diag (σ1 , . . . , σp ) ,
the subspace generated by the matrix A. The rank of A is the dimension of this
subspace. It is equal to the number of singular values of A that are non zero.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Appendix C
Theorems
1 T 2
f(x + d) = f(x) + dT ∇f(x) + d ∇ f(x + αd)d . (C.4)
2
m n n p
Theorem C.3 (Chain rule differentiation).
Consider f : R → R , g : R → R
m p
and h : R → R such that h(x) = g f(x) . Then,
∇h(x) = ∇f(x)∇g f(x) , ∀x ∈ Rm , (C.5)
xT Ax
λ1 = max (C.7)
x6=0 xT x
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
and
xT Ax
λn = min . (C.8)
x6=0 xT x
QT AQ = Λ = diag(λ1 , . . . , λn ). (C.9)
AQk = λk Qk , (C.10)
f(x+ , y+ ) = 0 (C.11)
and such that the gradient matrix ∇y f(x, y) is continuous and non singular in
a neighborhood of (x+ , y+ ). Then, there exist neighborhoods Vx+ and Vy+ of x+
and y+ , respectively, as well as a continuous function
such that
y+ = φ(x+ ) (C.13)
and
f x, φ(x) = 0 , ∀x ∈ Vx+ . (C.14)
The function φ is unique in the sense that any (x, y) ∈ Vx+ × Vy+ such that
f(x, y) = 0 also satisfies y = φ(x). If, moreover, f is differentiable, then so is φ
and −1
∇φ(x) = −∇x f x, φ(x) ∇y f x, φ(x) , ∀x ∈ Vx+ . (C.15)
is the projection operator on the kernel of A, i.e., we have APy = 0 for all
y ∈ Rn .
Theorems 697
Theorem C.14 (Matrix norms). The matrix norms k · k2 (Definition B.27) and
k · kF (Definition B.26) satisfy the following properties:
1. Consider A and B ∈ Rn×n . Then
xyT F
= xyT 2
= kxk2 kyk2 . (C.25)
Then,
1
A−1 = C(A)T , (C.26)
det(A)
where C(A)T is the cofactor matrix of A (see Definition B.12).
Theorem C.16 (Inverse of a perturbed matrix). Let k · k be a norm on Rn×n
satisfying the conditions
kABk ≤ kAk kBk
(C.27)
kIk = 1 .
Let A be a non singular matrix and let us take B such that
kA−1 k
kB−1 k ≤ . (C.29)
1 − A−1 (B − A)
Theorem C.18 (Positive definite matrix). Let A and B be two symmetric matrices
such that B is positive semidefinite and A is positive definite in the kernel of B,
i.e., that xT Ax > 0 for all non zero x such that xT Bx = 0. Then, there exists
c̄ ∈ R such that A + cB is positive definite for all c > c̄.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Appendix D
Projects
this file neat so that it can be easily read or easily imported into another software
(spreadsheet, database, visualization software, etc.)
• The use of a visualization software for the functions and level curves is recom-
mended. The freeware Gnuplot (www.gnuplot.info) has been used in this book.
• One must be attentive when it comes to numeric problems. Computers operate
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
with what is called finite arithmetic, in the sense that only a finite set of real
numbers can be represented. One of the consequences is that the result of the
operation 1 + ε can be 1, even if ε > 0. The smallest value of ε such that 1 + ε 6= 1
is called the ε-machine and depends on the representation of real numbers in the
employed processor. Typically, for a representation in double precision, the ε-
machine is on the order of 10−16 (see Algorithm 7.1 and the discussions about
it).
• Error handling is important. For example, if the algorithm tries to invert a singular
matrix, it must be properly detected and an adequate error message should be
displayed.
If Tp = +∞, no algorithm can solve this problem. We then normalize the performance
indices by defining τ
p,a if τp,a 6= +∞
ρp,a = Tp
R otherwise,
where R is sufficiently large, in the sense that R > ρp,a for any p and a such that
τp,a 6= +∞. The quantity ρp,a represents the performance of algorithm a on problem
Projects 701
p, compared to the best algorithm among those tested. For each algorithm, we
consider the performance function, defined by
We illustrate these concepts with an example where two algorithms are tested on
10 problems. The performances (τp,a ) are listed in Table D.1.
After normalization, the relative performances (ρp,a ) are given in Table D.2. Note
that R = 10 in this case. We could have chosen any value such that R > 6. Finally, the
function Pa for each algorithm is shown in Figure D.1. In this example, algorithm A
turns out to be more efficient than algorithm B, but the latter is slightly more robust.
Pr(τp,a ≤ π)
0
1
0.2
0.4
0.6
0.8
1
2
Algo. B
Algo. A
3
π
4
5
Performance analysis
Bibliography
PA.
Bertsekas, D. P. (1976). On the Goldstein-Levitin-Polyak Gradient Projection
Method, IEEE Transactions on Automatic Control 21: 174–184.
Bertsekas, D. P. (1982). Constrained Optimization and Lagrange Multiplier Meth-
ods, Academic Press, London.
Bertsekas, D. P. (1998). Network Optimization – Continuous and Discrete Models,
Athena Scientific, Belmont, MA.
Bertsekas, D. P. (1999). Nonlinear Programming, 2nd edn, Athena Scientific, Bel-
mont, MA.
Bertsimas, D. and Tsitsiklis, J. N. (1997). Introduction to Linear Optimization,
Athena Scientific, Belmont, MA.
Bertsimas, D. and Weismantel, R. (2005). Optimization over Integers, Athena
Scientific, Belmont, MA.
Bierlaire, M. (2006). Introduction à l’optimisation différentiable, Presses polytech-
niques et universitaires romandes, Lausanne, Switzerland. In french.
Birge, J. R. and Louveaux, F. (1997). Introduction to Stochastic Programming,
Springer.
Bland, R. G. (1977). New Finite Pivoting Rules for the Simplex Method, Mathemat-
ics of Operations Research 2(2): 103–107.
Bland, R. G. and Orlin, J. B. (2005). IFORS’ Operational Research Hall of Fame:
Delbert Ray Fulkerson, International Transactions in Operational Research
12: 367–372.
Bonnans, J. F., Gilbert, J.-C., Lemaréchal, C. and Sagastizábal, C. (1997). Optimi-
sation numérique – Aspects théoriques et pratiques, number 27 in Mathéma-
tiques et applications, Springer Verlag, Berlin.
Bonnans, J. F., Gilbert, J.-C., Lemaréchal, C. and Sagastizábal, C. (2003). Numerical
Optimization: Theoretical and Numerical Aspects, Springer Verlag, Berlin.
Bonnans, J., Gilbert, J., Lemarechal, C. and Sagastizábal, C. (2006). Numerical
Optimization: Theoretical and Practical Aspects, Universitext, Springer.
Boyd, S. and Vandenberghe, L. (2004). Convex Optimization, Cambridge University
Press, Cambridge, UK.
Brassard, G. and Bratley, P. (1996). Fundamentals of Algorithmics, Prentice Hall,
Englewood Cliffs, NJ.
Breton, M. and Haurie, A. (1999). Initiation aux techniques classiques de
l’optimisation, Modulo, Montréal, CA.
Broyden, C. G. (1965). A class of Methods for Solving Nonlinear Simultaneous Equa-
tions, Mathematics of Computation 19: 577–593.
Bibliography 705
garra, A. Ruhe and H. van der Vorst (eds), Templates for the Solution of
Algebraic Eigenvalue Problems: A Practical Guide.
Eaton, J. W. (1997). GNU Octave: A High Level Interactive Language for Numerical
Computations, www.octave.org.
Euler, L. (1748). Introductio in analysin infinitorum, auctore Leonhardo Eu-
lero..., apud Marcum-Michaelem Bousquet, Lausanne.
Fiacco, A. V. and McCormick, G. P. (1968). Nonlinear Programming: Sequen-
tial Unconstrained Minimization Techniques, J. Wiley and Sons, New York.
Reprinted as Classics in Applied Mathematics 4, SIAM, Philadelphia, PA
(1990).
Finkel, B. F. (1897). Biography: Leonhard Euler, The American Mathematical
Monthly 4(12): 297–302.
Fletcher, R. (1980). Practical Methods of Optimization: Unconstrained Optimiza-
tion, J. Wiley and Sons, New York.
Fletcher, R. (1981). Practical Methods of Optimization: Constrained Optimiza-
tion, J. Wiley and Sons, New York.
Fletcher, R. (1983). Penalty Functions, in A. Bachem, M. Groetschel and B. Korte
(eds), Mathematical Programming: The State of the Art, Springer Verlag,
Berlin.
Ford, L. R. and Fulkerson, D. R. (1956). Maximal Flow Through a Network, Cana-
dian Journal of Mathematics 8: 399–404.
Forrest, J. J. and Tomlin, J. A. (1972). Updated Triangular Factors of the Basis to
Maintain Sparsity in the Product Form Simplex Method, Mathematical Pro-
gramming 2(1): 263–278.
Forster, W. (1995). Homotopy Methods, Handbook of Global Optimization, Kluwer,
Dordrecht, The Netherlands, pp. 669–750.
Gardner, L. and Nicolio, O. (2008). A Maximum Flow Algorithm to Locate Non-
Attacking Queens on an NxN Chessboard, Congressus Numerantium 191: 129–
141.
Gärtner, B. and Matousek, J. (2012). Approximation Algorithms and Semidefinite
Programming, Springer.
Gass, S. I. (2003). IFORS’ Operational Research Hall of Fame: George B. Dantzig,
International Transactions in Operational Research 10(2): 191.
Gass, S. I. (2004). IFORS’ Operational Research Hall of Fame: Albert William
Tucker, International Transactions in Operational Research 11(2): 239.
Gauvin, J. (1992). Théorie de la programmation mathématique non convexe, Les
publications CRM, Montréal.
Bibliography 707
Gendreau, M., Hertz, A. and Laporte, G. (1992). New Insertion and Postopti-
mization Procedures for the Traveling Salesman Problem, Operations Research
40(6): 1086–1094.
Gendreau, M. and Potvin, J. (2010). Handbook of Metaheuristics, International
Series in Operations Research & Management Science, Springer.
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Haykin, S. O. (2008). Neural Networks and Learning Machines, 3rd edn, Prentice
Hall.
Helsgaun, K. (2009). General k-OPT Submoves for the Lin–Kernighan TSP Heuristic,
Mathematical Programming Computation 1(2-3): 119–163.
Hestenes, M. R. (1951). Iterative Methods for Solving Linear Equations, NAML
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Klee, V. and Minty, G. J. (1972). How Good is the Simplex Algorithm?, in O. Shisha
(ed.), Inequalities III, Academic Press, New York, pp. 159–175.
Korte, B., Fonlupt, J. and Vygen, J. (2010). Optimisation combinatoire: Théorie
et algorithmes, Collection IRIS, Springer, France.
Korte, B. and Vygen, J. (2007). Combinatorial Optimization: Theory and Algo-
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48
Zoutendijk, 284
Ce document est la propriété exclusive de Kavyaa Kannan (kk392@snu.edu.in) - jeudi 18 avril 2024 à 07h48 Index
720