This is page iii Printer: Opaque this Jorge Nocedal Stephen J. Wright Numerical Optimization Second Edition This is pag Printer: O Jorge Nocedal EECS Department Northwestern University Evanston, IL 60208-3118 USA nocedal@eecs.northwestern.edu Stephen J. Wright Computer Sciences Department University of Wisconsin 1210 West Dayton Street Madison, WI 53706–1613 USA swright@cs.wisc.edu Series Editors: Thomas V. Mikosch University of Copenhagen Laboratory of Actuarial Mathematics DK-1017 Copenhagen Denmark mikosch@act.ku.dk Stephen M. Robinson Department of Industrial and Systems Engineering University of Wisconsin 1513 University Avenue Madison, WI 53706–1539 USA smrobins@facstaff.wise.edu Sidney I. Resnick Cornell University School of Operations Research and Industrial Engineering Ithaca, NY 14853 USA sirl@cornell.edu Mathematics Subject Classification (2000): 90B30, 90C11, 90-01, 90-02 Library of Congress Control Number: 2006923897 ISBN-10: 0-387-30303-0 ISBN-13: 978-0387-30303-1 Printed on acid-free paper. C 2006 Springer Science+Business Media, LLC. All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed in the United States of America. 9 8 7 6 5 4 3 2 1 springer.com (TB/HAM) This is page v Printer: Opaque this To Sue, Isabel and Martin and To Mum and Dad This is page vii Printer: Opaque this Contents Preface xvii Preface to the Second Edition 1 2 Introduction Mathematical Formulation . . . . . . . . . . Example: A Transportation Problem . . . . . Continuous versus Discrete Optimization . . . Constrained and Unconstrained Optimization Global and Local Optimization . . . . . . . . Stochastic and Deterministic Optimization . . Convexity . . . . . . . . . . . . . . . . . . . Optimization Algorithms . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . xxi . . . . . . . . . 1 2 4 5 6 6 7 7 8 9 Fundamentals of Unconstrained Optimization 2.1 What Is a Solution? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii CONTENTS Recognizing a Local Minimum . . . . . . . Nonsmooth Problems . . . . . . . . . . . . 2.2 Overview of Algorithms . . . . . . . . . . . Two Strategies: Line Search and Trust Region Search Directions for Line Search Methods . Models for Trust-Region Methods . . . . . . Scaling . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . 3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 17 18 19 20 25 26 27 Line Search Methods 3.1 Step Length . . . . . . . . . . . . . . . . . . . . The Wolfe Conditions . . . . . . . . . . . . . . . The Goldstein Conditions . . . . . . . . . . . . . Sufficient Decrease and Backtracking . . . . . . . 3.2 Convergence of Line Search Methods . . . . . . . 3.3 Rate of Convergence . . . . . . . . . . . . . . . . Convergence Rate of Steepest Descent . . . . . . . Newton’s Method . . . . . . . . . . . . . . . . . Quasi-Newton Methods . . . . . . . . . . . . . . 3.4 Newton’s Method with Hessian Modification . . . Eigenvalue Modification . . . . . . . . . . . . . . Adding a Multiple of the Identity . . . . . . . . . Modified Cholesky Factorization . . . . . . . . . Modified Symmetric Indefinite Factorization . . . 3.5 Step-Length Selection Algorithms . . . . . . . . . Interpolation . . . . . . . . . . . . . . . . . . . . Initial Step Length . . . . . . . . . . . . . . . . . A Line Search Algorithm for the Wolfe Conditions Notes and References . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 31 33 36 37 37 41 42 44 46 48 49 51 52 54 56 57 59 60 62 63 Trust-Region Methods Outline of the Trust-Region Approach . . 4.1 Algorithms Based on the Cauchy Point . . The Cauchy Point . . . . . . . . . . . . . Improving on the Cauchy Point . . . . . . The Dogleg Method . . . . . . . . . . . . Two-Dimensional Subspace Minimization 4.2 Global Convergence . . . . . . . . . . . . Reduction Obtained by the Cauchy Point . Convergence to Stationary Points . . . . . 4.3 Iterative Solution of the Subproblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 68 71 71 73 73 76 77 77 79 83 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS The Hard Case . . . . . . . . . . . . . . . . . . . . . . . . Proof of Theorem 4.1 . . . . . . . . . . . . . . . . . . . . Convergence of Algorithms Based on Nearly Exact Solutions 4.4 Local Convergence of Trust-Region Newton Methods . . . 4.5 Other Enhancements . . . . . . . . . . . . . . . . . . . . Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . Trust Regions in Other Norms . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 Conjugate Gradient Methods 5.1 The Linear Conjugate Gradient Method . . . . . . . Conjugate Direction Methods . . . . . . . . . . . . Basic Properties of the Conjugate Gradient Method A Practical Form of the Conjugate Gradient Method Rate of Convergence . . . . . . . . . . . . . . . . . Preconditioning . . . . . . . . . . . . . . . . . . . Practical Preconditioners . . . . . . . . . . . . . . 5.2 Nonlinear Conjugate Gradient Methods . . . . . . The Fletcher–Reeves Method . . . . . . . . . . . . The Polak–Ribière Method and Variants . . . . . . Quadratic Termination and Restarts . . . . . . . . . Behavior of the Fletcher–Reeves Method . . . . . . Global Convergence . . . . . . . . . . . . . . . . . Numerical Performance . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . Quasi-Newton Methods 6.1 The BFGS Method . . . . . . . . . . . . . . . Properties of the BFGS Method . . . . . . . . Implementation . . . . . . . . . . . . . . . . 6.2 The SR1 Method . . . . . . . . . . . . . . . . Properties of SR1 Updating . . . . . . . . . . 6.3 The Broyden Class . . . . . . . . . . . . . . . 6.4 Convergence Analysis . . . . . . . . . . . . . Global Convergence of the BFGS Method . . . Superlinear Convergence of the BFGS Method Convergence Analysis of the SR1 Method . . . Notes and References . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 89 91 92 95 95 97 98 98 . . . . . . . . . . . . . . . . 101 102 102 107 111 112 118 120 121 121 122 124 125 127 131 132 133 . . . . . . . . . . . . 135 136 141 142 144 147 149 153 153 156 160 161 162 ix x CONTENTS 7 8 9 Large-Scale Unconstrained Optimization 7.1 Inexact Newton Methods . . . . . . . . . . . . . . . . Local Convergence of Inexact Newton Methods . . . . . Line Search Newton–CG Method . . . . . . . . . . . . Trust-Region Newton–CG Method . . . . . . . . . . . Preconditioning the Trust-Region Newton–CG Method Trust-Region Newton–Lanczos Method . . . . . . . . . 7.2 Limited-Memory Quasi-Newton Methods . . . . . . . Limited-Memory BFGS . . . . . . . . . . . . . . . . . Relationship with Conjugate Gradient Methods . . . . General Limited-Memory Updating . . . . . . . . . . . Compact Representation of BFGS Updating . . . . . . Unrolling the Update . . . . . . . . . . . . . . . . . . 7.3 Sparse Quasi-Newton Updates . . . . . . . . . . . . . 7.4 Algorithms for Partially Separable Functions . . . . . . 7.5 Perspectives and Software . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 165 166 168 170 174 175 176 177 180 181 181 184 185 186 189 190 191 Calculating Derivatives 8.1 Finite-Difference Derivative Approximations Approximating the Gradient . . . . . . . . . Approximating a Sparse Jacobian . . . . . . Approximating the Hessian . . . . . . . . . Approximating a Sparse Hessian . . . . . . . 8.2 Automatic Differentiation . . . . . . . . . . An Example . . . . . . . . . . . . . . . . . The Forward Mode . . . . . . . . . . . . . The Reverse Mode . . . . . . . . . . . . . . Vector Functions and Partial Separability . . Calculating Jacobians of Vector Functions . . Calculating Hessians: Forward Mode . . . . Calculating Hessians: Reverse Mode . . . . . Current Limitations . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 194 195 197 201 202 204 205 206 207 210 212 213 215 216 217 217 Derivative-Free Optimization 9.1 Finite Differences and Noise . . . . 9.2 Model-Based Methods . . . . . . . Interpolation and Polynomial Bases Updating the Interpolation Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 221 223 226 227 . . . . . . . . . . . . . . . . . . . . CONTENTS A Method Based on Minimum-Change Updating . Coordinate and Pattern-Search Methods . . . . . Coordinate Search Method . . . . . . . . . . . . Pattern-Search Methods . . . . . . . . . . . . . . 9.4 A Conjugate-Direction Method . . . . . . . . . . 9.5 Nelder–Mead Method . . . . . . . . . . . . . . . 9.6 Implicit Filtering . . . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 229 230 231 234 238 240 242 242 10 Least-Squares Problems 10.1 Background . . . . . . . . . . . . . . . . . . . . . . 10.2 Linear Least-Squares Problems . . . . . . . . . . . . 10.3 Algorithms for Nonlinear Least-Squares Problems . . The Gauss–Newton Method . . . . . . . . . . . . . . Convergence of the Gauss–Newton Method . . . . . . The Levenberg–Marquardt Method . . . . . . . . . . Implementation of the Levenberg–Marquardt Method Convergence of the Levenberg–Marquardt Method . . Methods for Large-Residual Problems . . . . . . . . . 10.4 Orthogonal Distance Regression . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 247 250 254 254 255 258 259 261 262 265 267 269 11 Nonlinear Equations 11.1 Local Algorithms . . . . . . . . . . . . . . Newton’s Method for Nonlinear Equations Inexact Newton Methods . . . . . . . . . Broyden’s Method . . . . . . . . . . . . . Tensor Methods . . . . . . . . . . . . . . 11.2 Practical Methods . . . . . . . . . . . . . Merit Functions . . . . . . . . . . . . . . Line Search Methods . . . . . . . . . . . . Trust-Region Methods . . . . . . . . . . . 11.3 Continuation/Homotopy Methods . . . . Motivation . . . . . . . . . . . . . . . . . Practical Continuation Methods . . . . . . Notes and References . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 274 274 277 279 283 285 285 287 290 296 296 297 302 302 12 Theory of Constrained Optimization Local and Global Solutions . . . . . . . . . . . . . . . . . . . . . . . . 304 305 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi xii CONTENTS Smoothness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Single Equality Constraint . . . . . . . . . . . . . . . . . . . . . . A Single Inequality Constraint . . . . . . . . . . . . . . . . . . . . . Two Inequality Constraints . . . . . . . . . . . . . . . . . . . . . . 12.2 Tangent Cone and Constraint Qualifications . . . . . . . . . . . . . 12.3 First-Order Optimality Conditions . . . . . . . . . . . . . . . . . . 12.4 First-Order Optimality Conditions: Proof . . . . . . . . . . . . . . . Relating the Tangent Cone and the First-Order Feasible Direction Set A Fundamental Necessary Condition . . . . . . . . . . . . . . . . . Farkas’ Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Proof of Theorem 12.1 . . . . . . . . . . . . . . . . . . . . . . . . . 12.5 Second-Order Conditions . . . . . . . . . . . . . . . . . . . . . . . Second-Order Conditions and Projected Hessians . . . . . . . . . . 12.6 Other Constraint Qualifications . . . . . . . . . . . . . . . . . . . . 12.7 A Geometric Viewpoint . . . . . . . . . . . . . . . . . . . . . . . . 12.8 Lagrange Multipliers and Sensitivity . . . . . . . . . . . . . . . . . . 12.9 Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1 13 Linear Programming: The Simplex Method Linear Programming . . . . . . . . . . . . 13.1 Optimality and Duality . . . . . . . . . . Optimality Conditions . . . . . . . . . . . The Dual Problem . . . . . . . . . . . . . 13.2 Geometry of the Feasible Set . . . . . . . . Bases and Basic Feasible Points . . . . . . Vertices of the Feasible Polytope . . . . . . 13.3 The Simplex Method . . . . . . . . . . . . Outline . . . . . . . . . . . . . . . . . . . A Single Step of the Method . . . . . . . . 13.4 Linear Algebra in the Simplex Method . . 13.5 Other Important Details . . . . . . . . . . Pricing and Selection of the Entering Index Starting the Simplex Method . . . . . . . Degenerate Steps and Cycling . . . . . . . 13.6 The Dual Simplex Method . . . . . . . . . 13.7 Presolving . . . . . . . . . . . . . . . . . 13.8 Where Does the Simplex Method Fit? . . . Notes and References . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 307 308 310 313 315 320 323 323 325 326 329 330 337 338 340 341 343 349 351 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 356 358 358 359 362 362 365 366 366 370 372 375 375 378 381 382 385 388 389 389 CONTENTS 14 Linear Programming: Interior-Point Methods 14.1 Primal-Dual Methods . . . . . . . . . . . . . . . . . . . Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . The Central Path . . . . . . . . . . . . . . . . . . . . . . Central Path Neighborhoods and Path-Following Methods 14.2 Practical Primal-Dual Algorithms . . . . . . . . . . . . . Corrector and Centering Steps . . . . . . . . . . . . . . . Step Lengths . . . . . . . . . . . . . . . . . . . . . . . . Starting Point . . . . . . . . . . . . . . . . . . . . . . . A Practical Algorithm . . . . . . . . . . . . . . . . . . . Solving the Linear Systems . . . . . . . . . . . . . . . . . 14.3 Other Primal-Dual Algorithms and Extensions . . . . . . Other Path-Following Methods . . . . . . . . . . . . . . Potential-Reduction Methods . . . . . . . . . . . . . . . Extensions . . . . . . . . . . . . . . . . . . . . . . . . . 14.4 Perspectives and Software . . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 393 393 397 399 407 407 409 410 411 411 413 413 414 415 416 417 418 15 Fundamentals of Algorithms for Nonlinear Constrained Optimization 15.1 Categorizing Optimization Algorithms . . . . . . . . . . . . . . 15.2 The Combinatorial Difficulty of Inequality-Constrained Problems 15.3 Elimination of Variables . . . . . . . . . . . . . . . . . . . . . . Simple Elimination using Linear Constraints . . . . . . . . . . . General Reduction Strategies for Linear Constraints . . . . . . . Effect of Inequality Constraints . . . . . . . . . . . . . . . . . . 15.4 Merit Functions and Filters . . . . . . . . . . . . . . . . . . . . Merit Functions . . . . . . . . . . . . . . . . . . . . . . . . . . Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.5 The Maratos Effect . . . . . . . . . . . . . . . . . . . . . . . . . 15.6 Second-Order Correction and Nonmonotone Techniques . . . . Nonmonotone (Watchdog) Strategy . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 422 424 426 428 431 434 435 435 437 440 443 444 446 446 16 Quadratic Programming 16.1 Equality-Constrained Quadratic Programs Properties of Equality-Constrained QPs . . 16.2 Direct Solution of the KKT System . . . . Factoring the Full KKT System . . . . . . Schur-Complement Method . . . . . . . . Null-Space Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 451 451 454 454 455 457 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii xiv CONTENTS 16.3 Iterative Solution of the KKT System . . . . . . . . . . . . . . . . CG Applied to the Reduced System . . . . . . . . . . . . . . . . . The Projected CG Method . . . . . . . . . . . . . . . . . . . . . . 16.4 Inequality-Constrained Problems . . . . . . . . . . . . . . . . . . Optimality Conditions for Inequality-Constrained Problems . . . . Degeneracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16.5 Active-Set Methods for Convex QPs . . . . . . . . . . . . . . . . . Specification of the Active-Set Method for Convex QP . . . . . . . Further Remarks on the Active-Set Method . . . . . . . . . . . . . Finite Termination of Active-Set Algorithm on Strictly Convex QPs Updating Factorizations . . . . . . . . . . . . . . . . . . . . . . . 16.6 Interior-Point Methods . . . . . . . . . . . . . . . . . . . . . . . Solving the Primal-Dual System . . . . . . . . . . . . . . . . . . . Step Length Selection . . . . . . . . . . . . . . . . . . . . . . . . A Practical Primal-Dual Method . . . . . . . . . . . . . . . . . . 16.7 The Gradient Projection Method . . . . . . . . . . . . . . . . . . Cauchy Point Computation . . . . . . . . . . . . . . . . . . . . . Subspace Minimization . . . . . . . . . . . . . . . . . . . . . . . 16.8 Perspectives and Software . . . . . . . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Penalty and Augmented Lagrangian Methods 17.1 The Quadratic Penalty Method . . . . . . . . . . . . Motivation . . . . . . . . . . . . . . . . . . . . . . . Algorithmic Framework . . . . . . . . . . . . . . . . Convergence of the Quadratic Penalty Method . . . . Ill Conditioning and Reformulations . . . . . . . . . 17.2 Nonsmooth Penalty Functions . . . . . . . . . . . . A Practical 1 Penalty Method . . . . . . . . . . . . . A General Class of Nonsmooth Penalty Methods . . . 17.3 Augmented Lagrangian Method: Equality Constraints Motivation and Algorithmic Framework . . . . . . . Properties of the Augmented Lagrangian . . . . . . . 17.4 Practical Augmented Lagrangian Methods . . . . . . Bound-Constrained Formulation . . . . . . . . . . . Linearly Constrained Formulation . . . . . . . . . . Unconstrained Formulation . . . . . . . . . . . . . . 17.5 Perspectives and Software . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 459 461 463 464 465 467 472 476 477 478 480 482 483 484 485 486 488 490 492 492 . . . . . . . . . . . . . . . . . . 497 498 498 501 502 505 507 511 513 514 514 517 519 519 522 523 525 526 527 CONTENTS 18 Sequential Quadratic Programming 18.1 Local SQP Method . . . . . . . . . . . . . . . . . . . . . . . SQP Framework . . . . . . . . . . . . . . . . . . . . . . . . Inequality Constraints . . . . . . . . . . . . . . . . . . . . . 18.2 Preview of Practical SQP Methods . . . . . . . . . . . . . . . IQP and EQP . . . . . . . . . . . . . . . . . . . . . . . . . Enforcing Convergence . . . . . . . . . . . . . . . . . . . . 18.3 Algorithmic Development . . . . . . . . . . . . . . . . . . . Handling Inconsistent Linearizations . . . . . . . . . . . . . Full Quasi-Newton Approximations . . . . . . . . . . . . . . Reduced-Hessian Quasi-Newton Approximations . . . . . . Merit Functions . . . . . . . . . . . . . . . . . . . . . . . . Second-Order Correction . . . . . . . . . . . . . . . . . . . 18.4 A Practical Line Search SQP Method . . . . . . . . . . . . . 18.5 Trust-Region SQP Methods . . . . . . . . . . . . . . . . . . A Relaxation Method for Equality-Constrained Optimization S1 QP (Sequential 1 Quadratic Programming) . . . . . . . Sequential Linear-Quadratic Programming (SLQP) . . . . . A Technique for Updating the Penalty Parameter . . . . . . . 18.6 Nonlinear Gradient Projection . . . . . . . . . . . . . . . . 18.7 Convergence Analysis . . . . . . . . . . . . . . . . . . . . . Rate of Convergence . . . . . . . . . . . . . . . . . . . . . . 18.8 Perspectives and Software . . . . . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Interior-Point Methods for Nonlinear Programming 19.1 Two Interpretations . . . . . . . . . . . . . . . . . 19.2 A Basic Interior-Point Algorithm . . . . . . . . . . 19.3 Algorithmic Development . . . . . . . . . . . . . . Primal vs. Primal-Dual System . . . . . . . . . . . Solving the Primal-Dual System . . . . . . . . . . . Updating the Barrier Parameter . . . . . . . . . . . Handling Nonconvexity and Singularity . . . . . . . Step Acceptance: Merit Functions and Filters . . . . Quasi-Newton Approximations . . . . . . . . . . . Feasible Interior-Point Methods . . . . . . . . . . . 19.4 A Line Search Interior-Point Method . . . . . . . . 19.5 A Trust-Region Interior-Point Method . . . . . . . An Algorithm for Solving the Barrier Problem . . . Step Computation . . . . . . . . . . . . . . . . . . Lagrange Multipliers Estimates and Step Acceptance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 530 531 532 533 533 534 535 535 536 538 540 543 545 546 547 549 551 553 554 556 557 560 561 561 . . . . . . . . . . . . . . . 563 564 566 569 570 570 572 573 575 575 576 577 578 578 580 581 xv xvi CONTENTS Description of a Trust-Region Interior-Point Method . The Primal Log-Barrier Method . . . . . . . . . . . . Global Convergence Properties . . . . . . . . . . . . Failure of the Line Search Approach . . . . . . . . . . Modified Line Search Methods . . . . . . . . . . . . Global Convergence of the Trust-Region Approach . . 19.8 Superlinear Convergence . . . . . . . . . . . . . . . 19.9 Perspectives and Software . . . . . . . . . . . . . . . Notes and References . . . . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.6 19.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Background Material A.1 Elements of Linear Algebra . . . . . . . . . . . . . . . . . . . . Vectors and Matrices . . . . . . . . . . . . . . . . . . . . . . . . Norms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Eigenvalues, Eigenvectors, and the Singular-Value Decomposition Determinant and Trace . . . . . . . . . . . . . . . . . . . . . . Matrix Factorizations: Cholesky, LU, QR . . . . . . . . . . . . . Symmetric Indefinite Factorization . . . . . . . . . . . . . . . . Sherman–Morrison–Woodbury Formula . . . . . . . . . . . . . Interlacing Eigenvalue Theorem . . . . . . . . . . . . . . . . . . Error Analysis and Floating-Point Arithmetic . . . . . . . . . . . Conditioning and Stability . . . . . . . . . . . . . . . . . . . . . A.2 Elements of Analysis, Geometry, Topology . . . . . . . . . . . . Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rates of Convergence . . . . . . . . . . . . . . . . . . . . . . . Topology of the Euclidean Space IRn . . . . . . . . . . . . . . . . Convex Sets in IRn . . . . . . . . . . . . . . . . . . . . . . . . . Continuity and Limits . . . . . . . . . . . . . . . . . . . . . . . Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Directional Derivatives . . . . . . . . . . . . . . . . . . . . . . Mean Value Theorem . . . . . . . . . . . . . . . . . . . . . . . Implicit Function Theorem . . . . . . . . . . . . . . . . . . . . Order Notation . . . . . . . . . . . . . . . . . . . . . . . . . . Root-Finding for Scalar Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582 583 587 587 589 589 591 592 593 594 . . . . . . . . . . . . . . . . . . . . . . . . 598 598 598 600 602 603 605 606 610 612 613 613 616 617 617 619 620 621 623 625 628 629 630 631 633 B A Regularization Procedure 635 References 637 Index 653 This is page xvii Printer: Opaque this Preface This is a book for people interested in solving optimization problems. Because of the wide (and growing) use of optimization in science, engineering, economics, and industry, it is essential for students and practitioners alike to develop an understanding of optimization algorithms. Knowledge of the capabilities and limitations of these algorithms leads to a better understanding of their impact on various applications, and points the way to future research on improving and extending optimization algorithms and software. Our goal in this book is to give a comprehensive description of the most powerful, state-of-the-art, techniques for solving continuous optimization problems. By presenting the motivating ideas for each algorithm, we try to stimulate the reader’s intuition and make the technical details easier to follow. Formal mathematical requirements are kept to a minimum. Because of our focus on continuous problems, we have omitted discussion of important optimization topics such as discrete and stochastic optimization. However, there are a great many applications that can be formulated as continuous optimization problems; for instance, finding the optimal trajectory for an aircraft or a robot arm; identifying the seismic properties of a piece of the earth’s crust by fitting a model of the region under study to a set of readings from a network of recording stations; xviii PREFACE designing a portfolio of investments to maximize expected return while maintaining an acceptable level of risk; controlling a chemical process or a mechanical device to optimize performance or meet standards of robustness; computing the optimal shape of an automobile or aircraft component. Every year optimization algorithms are being called on to handle problems that are much larger and complex than in the past. Accordingly, the book emphasizes largescale optimization techniques, such as interior-point methods, inexact Newton methods, limited-memory methods, and the role of partially separable functions and automatic differentiation. It treats important topics such as trust-region methods and sequential quadratic programming more thoroughly than existing texts, and includes comprehensive discussion of such “core curriculum” topics as constrained optimization theory, Newton and quasi-Newton methods, nonlinear least squares and nonlinear equations, the simplex method, and penalty and barrier methods for nonlinear programming. The Audience We intend that this book will be used in graduate-level courses in optimization, as offered in engineering, operations research, computer science, and mathematics departments. There is enough material here for a two-semester (or three-quarter) sequence of courses. We hope, too, that this book will be used by practitioners in engineering, basic science, and industry, and our presentation style is intended to facilitate self-study. Since the book treats a number of new algorithms and ideas that have not been described in earlier textbooks, we hope that this book will also be a useful reference for optimization researchers. Prerequisites for this book include some knowledge of linear algebra (including numerical linear algebra) and the standard sequence of calculus courses. To make the book as self-contained as possible, we have summarized much of the relevant material from these areas in the Appendix. Our experience in teaching engineering students has shown us that the material is best assimilated when combined with computer programming projects in which the student gains a good feeling for the algorithms—their complexity, memory demands, and elegance—and for the applications. In most chapters we provide simple computer exercises that require only minimal programming proficiency. Emphasis and Writing Style We have used a conversational style to motivate the ideas and present the numerical algorithms. Rather than being as concise as possible, our aim is to make the discussion flow in a natural way. As a result, the book is comparatively long, but we believe that it can be read relatively rapidly. The instructor can assign substantial reading assignments from the text and focus in class only on the main ideas. A typical chapter begins with a nonrigorous discussion of the topic at hand, including figures and diagrams and excluding technical details as far as possible. In subsequent sections, PREFACE the algorithms are motivated and discussed, and then stated explicitly. The major theoretical results are stated, and in many cases proved, in a rigorous fashion. These proofs can be skipped by readers who wish to avoid technical details. The practice of optimization depends not only on efficient and robust algorithms, but also on good modeling techniques, careful interpretation of results, and user-friendly software. In this book we discuss the various aspects of the optimization process—modeling, optimality conditions, algorithms, implementation, and interpretation of results—but not with equal weight. Examples throughout the book show how practical problems are formulated as optimization problems, but our treatment of modeling is light and serves mainly to set the stage for algorithmic developments. We refer the reader to Dantzig [86] and Fourer, Gay, and Kernighan [112] for more comprehensive discussion of this issue. Our treatment of optimality conditions is thorough but not exhaustive; some concepts are discussed more extensively in Mangasarian [198] and Clarke [62]. As mentioned above, we are quite comprehensive in discussing optimization algorithms. Topics Not Covered We omit some important topics, such as network optimization, integer programming, stochastic programming, nonsmooth optimization, and global optimization. Network and integer optimization are described in some excellent texts: for instance, Ahuja, Magnanti, and Orlin [1] in the case of network optimization and Nemhauser and Wolsey [224], Papadimitriou and Steiglitz [235], and Wolsey [312] in the case of integer programming. Books on stochastic optimization are only now appearing; we mention those of Kall and Wallace [174], Birge and Louveaux [22]. Nonsmooth optimization comes in many flavors. The relatively simple structures that arise in robust data fitting (which is sometimes based on the 1 norm) are treated by Osborne [232] and Fletcher [101]. The latter book also discusses algorithms for nonsmooth penalty functions that arise in constrained optimization; we discuss these briefly, too, in Chapter 18. A more analytical treatment of nonsmooth optimization is given by Hiriart-Urruty and Lemaréchal [170]. We omit detailed treatment of some important topics that are the focus of intense current research, including interior-point methods for nonlinear programming and algorithms for complementarity problems. Additional Resource The material in the book is complemented by an online resource called the NEOS Guide, which can be found on the World-Wide Web at http://www.mcs.anl.gov/otc/Guide/ The Guide contains information about most areas of optimization, and presents a number of case studies that describe applications of various optimization algorithms to real-world problems such as portfolio optimization and optimal dieting. Some of this material is interactive in nature and has been used extensively for class exercises. xix xx PREFACE For the most part, we have omitted detailed discussions of specific software packages, and refer the reader to Moré and Wright [217] or to the Software Guide section of the NEOS Guide, which can be found at http://www.mcs.anl.gov/otc/Guide/SoftwareGuide/ Users of optimization software refer in great numbers to this web site, which is being constantly updated to reflect new packages and changes to existing software. Acknowledgments We are most grateful to the following colleagues for their input and feedback on various sections of this work: Chris Bischof, Richard Byrd, George Corliss, Bob Fourer, David Gay, Jean-Charles Gilbert, Phillip Gill, Jean-Pierre Goux, Don Goldfarb, Nick Gould, Andreas Griewank, Matthias Heinkenschloss, Marcelo Marazzi, Hans Mittelmann, Jorge Moré, Will Naylor, Michael Overton, Bob Plemmons, Hugo Scolnik, David Stewart, Philippe Toint, Luis Vicente, Andreas Wächter, and Ya-xiang Yuan. We thank Guanghui Liu, who provided help with many of the exercises, and Jill Lavelle who assisted us in preparing the figures. We also express our gratitude to our sponsors at the Department of Energy and the National Science Foundation, who have strongly supported our research efforts in optimization over the years. One of us (JN) would like to express his deep gratitude to Richard Byrd, who has taught him so much about optimization and who has helped him in very many ways throughout the course of his career. Final Remark In the preface to his 1987 book [101], Roger Fletcher described the field of optimization as a “fascinating blend of theory and computation, heuristics and rigor.” The ever-growing realm of applications and the explosion in computing power is driving optimization research in new and exciting directions, and the ingredients identified by Fletcher will continue to play important roles for many years to come. Jorge Nocedal Evanston, IL Stephen J. Wright Argonne, IL This is page xxi Printer: Opaque this Preface to the Second Edition During the six years since the first edition of this book appeared, the field of continuous optimization has continued to grow and evolve. This new edition reflects a better understanding of constrained optimization at both the algorithmic and theoretical levels, and of the demands imposed by practical applications. Perhaps most notably, new chapters have been added on two important topics: derivative-free optimization (Chapter 9) and interiorpoint methods for nonlinear programming (Chapter 19). The former topic has proved to be of great interest in applications, while the latter topic has come into its own in recent years and now forms the basis of successful codes for nonlinear programming. Apart from the new chapters, we have revised and updated throughout the book, de-emphasizing or omitting less important topics, enhancing the treatment of subjects of evident interest, and adding new material in many places. The first part (unconstrained optimization) has been comprehensively reorganized to improve clarity. Discussion of Newton’s method—the touchstone method for unconstrained problems—is distributed more naturally throughout this part rather than being isolated in a single chapter. An expanded discussion of large-scale problems appears in Chapter 7. Some reorganization has taken place also in the second part (constrained optimization), with material common to sequential quadratic programming and interior-point methods now appearing in the chapter on fundamentals of nonlinear programming xxii PREFACE TO THE SECOND EDITION algorithms (Chapter 15) and the discussion of primal barrier methods moved to the new interior-point chapter. There is much new material in this part, including a treatment of nonlinear programming duality, an expanded discussion of algorithms for inequality constrained quadratic programming, a discussion of dual simplex and presolving in linear programming, a summary of practical issues in the implementation of interior-point linear programming algorithms, a description of conjugate-gradient methods for quadratic programming, and a discussion of filter methods and nonsmooth penalty methods in nonlinear programming algorithms. In many chapters we have added a Perspectives and Software section near the end, to place the preceding discussion in context and discuss the state of the art in software. The appendix has been rearranged with some additional topics added, so that it can be used in a more stand-alone fashion to cover some of the mathematical background required for the rest of the book. The exercises have been revised in most chapters. After these many additions, deletions, and changes, the second edition is only slightly longer than the first, reflecting our belief that careful selection of the material to include and exclude is an important responsibility for authors of books of this type. A manual containing solutions for selected problems will be available to bona fide instructors through the publisher. A list of typos will be maintained on the book’s web site, which is accessible from the web pages of both authors. We acknowledge with gratitude the comments and suggestions of many readers of the first edition, who sent corrections to many errors and provided valuable perspectives on the material, which led often to substantial changes. We mention in particular Frank Curtis, Michael Ferris, Andreas Griewank, Jacek Gondzio, Sven Leyffer, Philip Loewen, Rembert Reemtsen, and David Stewart. Our special thanks goes to Michael Overton, who taught from a draft of the second edition and sent many detailed and excellent suggestions. We also thank colleagues who read various chapters of the new edition carefully during development, including Richard Byrd, Nick Gould, Paul Hovland, Gabo Lopéz-Calva, Long Hei, Katya Scheinberg, Andreas Wächter, and Richard Waltz. We thank Jill Wright for improving some of the figures and for the new cover graphic. We mentioned in the original preface several areas of optimization that are not covered in this book. During the past six years, this list has only grown longer, as the field has continued to expand in new directions. In this regard, the following areas are particularly noteworthy: optimization problems with complementarity constraints, second-order cone and semidefinite programming, simulation-based optimization, robust optimization, and mixed-integer nonlinear programming. All these areas have seen theoretical and algorithmic advances in recent years, and in many cases developments are being driven by new classes of applications. Although this book does not cover any of these areas directly, it provides a foundation from which they can be studied. Jorge Nocedal Evanston, IL Stephen J. Wright Madison, WI This is page 1 Printer: Opaque this CHAPTER 1 Introduction People optimize. Investors seek to create portfolios that avoid excessive risk while achieving a high rate of return. Manufacturers aim for maximum efficiency in the design and operation of their production processes. Engineers adjust parameters to optimize the performance of their designs. Nature optimizes. Physical systems tend to a state of minimum energy. The molecules in an isolated chemical system react with each other until the total potential energy of their electrons is minimized. Rays of light follow paths that minimize their travel time. 2 CHAPTER 1. INTRODUCTION Optimization is an important tool in decision science and in the analysis of physical systems. To make use of this tool, we must first identify some objective, a quantitative measure of the performance of the system under study. This objective could be profit, time, potential energy, or any quantity or combination of quantities that can be represented by a single number. The objective depends on certain characteristics of the system, called variables or unknowns. Our goal is to find values of the variables that optimize the objective. Often the variables are restricted, or constrained, in some way. For instance, quantities such as electron density in a molecule and the interest rate on a loan cannot be negative. The process of identifying objective, variables, and constraints for a given problem is known as modeling. Construction of an appropriate model is the first step—sometimes the most important step—in the optimization process. If the model is too simplistic, it will not give useful insights into the practical problem. If it is too complex, it may be too difficult to solve. Once the model has been formulated, an optimization algorithm can be used to find its solution, usually with the help of a computer. There is no universal optimization algorithm but rather a collection of algorithms, each of which is tailored to a particular type of optimization problem. The responsibility of choosing the algorithm that is appropriate for a specific application often falls on the user. This choice is an important one, as it may determine whether the problem is solved rapidly or slowly and, indeed, whether the solution is found at all. After an optimization algorithm has been applied to the model, we must be able to recognize whether it has succeeded in its task of finding a solution. In many cases, there are elegant mathematical expressions known as optimality conditions for checking that the current set of variables is indeed the solution of the problem. If the optimality conditions are not satisfied, they may give useful information on how the current estimate of the solution can be improved. The model may be improved by applying techniques such as sensitivity analysis, which reveals the sensitivity of the solution to changes in the model and data. Interpretation of the solution in terms of the application may also suggest ways in which the model can be refined or improved (or corrected). If any changes are made to the model, the optimization problem is solved anew, and the process repeats. MATHEMATICAL FORMULATION Mathematically speaking, optimization is the minimization or maximization of a function subject to constraints on its variables. We use the following notation: - x is the vector of variables, also called unknowns or parameters; - f is the objective function, a (scalar) function of x that we want to maximize or minimize; - ci are constraint functions, which are scalar functions of x that define certain equations and inequalities that the unknown vector x must satisfy. CHAPTER 1. INTRODUCTION x2 c2 c1 contours of f feasible region x* x1 Figure 1.1 Geometrical representation of the problem (1.2). Using this notation, the optimization problem can be written as follows: minn f (x) subject to x∈IR ci (x) 0, i ∈ E, ci (x) ≥ 0, i ∈ I. (1.1) Here I and E are sets of indices for equality and inequality constraints, respectively. As a simple example, consider the problem min (x1 − 2)2 + (x2 − 1)2 subject to x12 − x2 ≤ 0, (1.2) x1 + x2 ≤ 2. We can write this problem in the form (1.1) by defining f (x) (x1 − 2) + (x2 − 1) , 2 c(x) c1 (x) c2 (x) x 2 −x12 + x2 −x1 − x2 + 2 x1 x2 , , I {1, 2}, E ∅. Figure 1.1 shows the contours of the objective function, that is, the set of points for which f (x) has a constant value. It also illustrates the feasible region, which is the set of points satisfying all the constraints (the area between the two constraint boundaries), and the point 3 4 CHAPTER 1. INTRODUCTION x ∗ , which is the solution of the problem. Note that the “infeasible side” of the inequality constraints is shaded. The example above illustrates, too, that transformations are often necessary to express an optimization problem in the particular form (1.1). Often it is more natural or convenient to label the unknowns with two or three subscripts, or to refer to different variables by completely different names, so that relabeling is necessary to pose the problem in the form (1.1). Another common difference is that we are required to maximize rather than minimize f , but we can accommodate this change easily by minimizing − f in the formulation (1.1). Good modeling systems perform the conversion to standardized formulations such as (1.1) transparently to the user. EXAMPLE: A TRANSPORTATION PROBLEM We begin with a much simplified example of a problem that might arise in manufacturing and transportation. A chemical company has 2 factories F1 and F2 and a dozen retail outlets R1 , R2 , . . . , R12 . Each factory Fi can produce ai tons of a certain chemical product each week; ai is called the capacity of the plant. Each retail outlet R j has a known weekly demand of b j tons of the product. The cost of shipping one ton of the product from factory Fi to retail outlet R j is ci j . The problem is to determine how much of the product to ship from each factory to each outlet so as to satisfy all the requirements and minimize cost. The variables of the problem are xi j , i 1, 2, j 1, . . . , 12, where xi j is the number of tons of the product shipped from factory Fi to retail outlet R j ; see Figure 1.2. We can write the problem as min (1.3a) ci j xi j ij subject to 12 xi j ≤ ai , i 1, 2, (1.3b) xi j ≥ b j , j 1, . . . , 12, (1.3c) i 1, 2, j 1, . . . , 12. (1.3d) j1 2 i1 xi j ≥ 0, This type of problem is known as a linear programming problem, since the objective function and the constraints are all linear functions. In a more practical model, we would also include costs associated with manufacturing and storing the product. There may be volume discounts in practice for shipping the product; for example the cost (1.3a) could be represented by i j ci j δ + x i j , where δ > 0 is a small subscription fee. In this case, the problem is a nonlinear program because the objective function is nonlinear. CHAPTER 1. INTRODUCTION R1 F1 X21 R2 R3 F2 R12 Figure 1.2 A transportation problem. CONTINUOUS VERSUS DISCRETE OPTIMIZATION In some optimization problems the variables make sense only if they take on integer values. For example, a variable xi could represent the number of power plants of type i that should be constructed by an electicity provider during the next 5 years, or it could indicate whether or not a particular factory should be located in a particular city. The mathematical formulation of such problems includes integrality constraints, which have the form xi ∈ Z, where Z is the set of integers, or binary constraints, which have the form xi ∈ {0, 1}, in addition to algebraic constraints like those appearing in (1.1). Problems of this type are called integer programming problems. If some of the variables in the problem are not restricted to be integer or binary variables, they are sometimes called mixed integer programming problems, or MIPs for short. Integer programming problems are a type of discrete optimization problem. Generally, discrete optimization problems may contain not only integers and binary variables, but also more abstract variable objects such as permutations of an ordered set. The defining feature of a discrete optimization problem is that the unknown x is drawn from a a finite (but often very large) set. By contrast, the feasible set for continuous optimization problems—the class of problems studied in this book—is usually uncountably infinite, as when the components of x are allowed to be real numbers. Continuous optimization problems are normally easier to solve because the smoothness of the functions makes it possible to use objective and constraint information at a particular point x to deduce information about the function’s behavior at all points close to x. In discrete problems, by constrast, the behavior of the objective and constraints may change significantly as we move from one feasible point to another, even if the two points are “close” by some measure. The feasible sets for discrete optimization problems can be thought of as exhibiting an extreme form of nonconvexity, as a convex combination of two feasible points is in general not feasible. 5 6 CHAPTER 1. INTRODUCTION Discrete optimization problems are not addressed directly in this book; we refer the reader to the texts by Papadimitriou and Steiglitz [235], Nemhauser and Wolsey [224], Cook et al. [77], and Wolsey [312] for comprehensive treatments of this subject. We note, however, that continuous optimization techniques often play an important role in solving discrete optimization problems. For instance, the branch-and-bound method for integer linear programming problems requires the repeated solution of linear programming “relaxations,” in which some of the integer variables are fixed at integer values, while for other integer variables the integrality constraints are temporarily ignored. These subproblems are usually solved by the simplex method, which is discussed in Chapter 13 of this book. CONSTRAINED AND UNCONSTRAINED OPTIMIZATION Problems with the general form (1.1) can be classified according to the nature of the objective function and constraints (linear, nonlinear, convex), the number of variables (large or small), the smoothness of the functions (differentiable or nondifferentiable), and so on. An important distinction is between problems that have constraints on the variables and those that do not. This book is divided into two parts according to this classification. Unconstrained optimization problems, for which we have E I ∅ in (1.1), arise directly in many practical applications. Even for some problems with natural constraints on the variables, it may be safe to disregard them as they do not affect on the solution and do not interfere with algorithms. Unconstrained problems arise also as reformulations of constrained optimization problems, in which the constraints are replaced by penalization terms added to objective function that have the effect of discouraging constraint violations. Constrained optimization problems arise from models in which constraints play an essential role, for example in imposing budgetary constraints in an economic problem or shape constraints in a design problem. These constraints may be simple bounds such as 0 ≤ x1 ≤ 100, more general linear constraints such as i xi ≤ 1, or nonlinear inequalities that represent complex relationships among the variables. When the objective function and all the constraints are linear functions of x, the problem is a linear programming problem. Problems of this type are probably the most widely formulated and solved of all optimization problems, particularly in management, financial, and economic applications. Nonlinear programming problems, in which at least some of the constraints or the objective are nonlinear functions, tend to arise naturally in the physical sciences and engineering, and are becoming more widely used in management and economic sciences as well. GLOBAL AND LOCAL OPTIMIZATION Many algorithms for nonlinear optimization problems seek only a local solution, a point at which the objective function is smaller than at all other feasible nearby points. They do not always find the global solution, which is the point with lowest function value among all feasible points. Global solutions are needed in some applications, but for many problems they CHAPTER 1. INTRODUCTION are difficult to recognize and even more difficult to locate. For convex programming problems, and more particularly for linear programs, local solutions are also global solutions. General nonlinear problems, both constrained and unconstrained, may possess local solutions that are not global solutions. In this book we treat global optimization only in passing and focus instead on the computation and characterization of local solutions. We note, however, that many successful global optimization algorithms require the solution of many local optimization problems, to which the algorithms described in this book can be applied. Research papers on global optimization can be found in Floudas and Pardalos [109] and in the Journal of Global Optimization. STOCHASTIC AND DETERMINISTIC OPTIMIZATION In some optimization problems, the model cannot be fully specified because it depends on quantities that are unknown at the time of formulation. This characteristic is shared by many economic and financial planning models, which may depend for example on future interest rates, future demands for a product, or future commodity prices, but uncertainty can arise naturally in almost any type of application. Rather than just use a “best guess” for the uncertain quantities, modelers may obtain more useful solutions by incorporating additional knowledge about these quantities into the model. For example, they may know a number of possible scenarios for the uncertain demand, along with estimates of the probabilities of each scenario. Stochastic optimization algorithms use these quantifications of the uncertainty to produce solutions that optimize the expected performance of the model. Related paradigms for dealing with uncertain data in the model include chanceconstrained optimization, in which we ensure that the variables x satisfy the given constraints to some specified probability, and robust optimization, in which certain constraints are required to hold for all possible values of the uncertain data. We do not consider stochastic optimization problems further in this book, focusing instead on deterministic optimization problems, in which the model is completely known. Many algorithms for stochastic optimization do, however, proceed by formulating one or more deterministic subproblems, each of which can be solved by the techniques outlined here. Stochastic and robust optimization have seen a great deal of recent research activity. For further information on stochastic optimization, consult the books of Birge and Louveaux [22] and Kall and Wallace [174]. Robust optimization is discussed in Ben-Tal and Nemirovski [15]. CONVEXITY The concept of convexity is fundamental in optimization. Many practical problems possess this property, which generally makes them easier to solve both in theory and practice. 7 8 CHAPTER 1. INTRODUCTION The term “convex” can be applied both to sets and to functions. A set S ∈ IRn is a convex set if the straight line segment connecting any two points in S lies entirely inside S. Formally, for any two points x ∈ S and y ∈ S, we have αx + (1 − α)y ∈ S for all α ∈ [0, 1]. The function f is a convex function if its domain S is a convex set and if for any two points x and y in S, the following property is satisfied: f (αx + (1 − α)y) ≤ α f (x) + (1 − α) f (y), for all α ∈ [0, 1]. (1.4) Simple instances of convex sets include the unit ball {y ∈ IRn | y2 ≤ 1}; and any polyhedron, which is a set defined by linear equalities and inequalities, that is, {x ∈ IRn | Ax b, C x ≤ d}, where A and C are matrices of appropriate dimension, and b and d are vectors. Simple instances of convex functions include the linear function f (x) c T x + α, for any constant vector c ∈ IRn and scalar α; and the convex quadratic function f (x) x T H x, where H is a symmetric positive semidefinite matrix. We say that f is strictly convex if the inequality in (1.4) is strict whenever x y and α is in the open interval (0, 1). A function f is said to be concave if − f is convex. If the objective function in the optimization problem (1.1) and the feasible region are both convex, then any local solution of the problem is in fact a global solution. The term convex programming is used to describe a special case of the general constrained optimization problem (1.1) in which • the objective function is convex, • the equality constraint functions ci (·), i ∈ E, are linear, and • the inequality constraint functions ci (·), i ∈ I, are concave. OPTIMIZATION ALGORITHMS Optimization algorithms are iterative. They begin with an initial guess of the variable x and generate a sequence of improved estimates (called “iterates”) until they terminate, hopefully at a solution. The strategy used to move from one iterate to the next distinguishes one algorithm from another. Most strategies make use of the values of the objective function f , the constraint functions ci , and possibly the first and second derivatives of these functions. Some algorithms accumulate information gathered at previous iterations, while others use only local information obtained at the current point. Regardless of these specifics (which will receive plenty of attention in the rest of the book), good algorithms should possess the following properties: • Robustness. They should perform well on a wide variety of problems in their class, for all reasonable values of the starting point. CHAPTER 1. INTRODUCTION • Efficiency. They should not require excessive computer time or storage. • Accuracy. They should be able to identify a solution with precision, without being overly sensitive to errors in the data or to the arithmetic rounding errors that occur when the algorithm is implemented on a computer. These goals may conflict. For example, a rapidly convergent method for a large unconstrained nonlinear problem may require too much computer storage. On the other hand, a robust method may also be the slowest. Tradeoffs between convergence rate and storage requirements, and between robustness and speed, and so on, are central issues in numerical optimization. They receive careful consideration in this book. The mathematical theory of optimization is used both to characterize optimal points and to provide the basis for most algorithms. It is not possible to have a good understanding of numerical optimization without a firm grasp of the supporting theory. Accordingly, this book gives a solid (though not comprehensive) treatment of optimality conditions, as well as convergence analysis that reveals the strengths and weaknesses of some of the most important algorithms. NOTES AND REFERENCES Optimization traces its roots to the calculus of variations and the work of Euler and Lagrange. The development of linear programming n the 1940s broadened the field and stimulated much of the progress in modern optimization theory and practice during the past 60 years. Optimization is often called mathematical programming, a somewhat confusing term coined in the 1940s, before the word “programming” became inextricably linked with computer software. The original meaning of this word (and the intended one in this context) was more inclusive, with connotations of algorithm design and analysis. Modeling will not be treated extensively in the book. It is an essential subject in its own right, as it makes the connection between optimization algorithms and software on the one hand, and applications on the other hand. Information about modeling techniques for various application areas can be found in Dantzig [86], Ahuja, Magnanti, and Orlin [1], Fourer, Gay, and Kernighan [112], Winston [308], and Rardin [262]. 9 This is pag Printer: O CHAPTER 2 Fundamentals of Unconstrained Optimization In unconstrained optimization, we minimize an objective function that depends on real variables, with no restrictions at all on the values of these variables. The mathematical formulation is min f (x), x (2.1) where x ∈ IRn is a real vector with n ≥ 1 components and f : IRn → IR is a smooth function. CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION y . y3 y2 y1 . . . . t t1 Figure 2.1 t2 t3 tm Least squares data fitting problem. Usually, we lack a global perspective on the function f . All we know are the values of f and maybe some of its derivatives at a set of points x0 , x1 , x2 , . . .. Fortunately, our algorithms get to choose these points, and they try to do so in a way that identifies a solution reliably and without using too much computer time or storage. Often, the information about f does not come cheaply, so we usually prefer algorithms that do not call for this information unnecessarily. ❏ EXAMPLE 2.1 Suppose that we are trying to find a curve that fits some experimental data. Figure 2.1 plots measurements y1 , y2 , . . . , ym of a signal taken at times t1 , t2 , . . . , tm . From the data and our knowledge of the application, we deduce that the signal has exponential and oscillatory behavior of certain types, and we choose to model it by the function φ(t; x) x1 + x2 e−(x3 −t) /x4 + x5 cos(x6 t). 2 The real numbers xi , i 1, 2, . . . , 6, are the parameters of the model; we would like to choose them to make the model values φ(t j ; x) fit the observed data y j as closely as possible. To state our objective as an optimization problem, we group the parameters xi into a vector of unknowns x (x1 , x2 , . . . , x6 )T , and define the residuals r j (x) y j − φ(t j ; x), j 1, 2, . . . , m, (2.2) which measure the discrepancy between the model and the observed data. Our estimate of 11 12 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION x will be obtained by solving the problem min6 f (x) r12 (x) + r22 (x) + · · · + rm2 (x). (2.3) x∈IR This is a nonlinear least-squares problem, a special case of unconstrained optimization. It illustrates that some objective functions can be expensive to evaluate even when the number of variables is small. Here we have n 6, but if the number of measurements m is large (105 , say), evaluation of f (x) for a given parameter vector x is a significant computation. ❐ Suppose that for the data given in Figure 2.1 the optimal solution of (2.3) is approximately x ∗ (1.1, 0.01, 1.2, 1.5, 2.0, 1.5) and the corresponding function value is f (x ∗ ) 0.34. Because the optimal objective is nonzero, there must be discrepancies between the observed measurements y j and the model predictions φ(t j , x ∗ ) for some (usually most) values of j—the model has not reproduced all the data points exactly. How, then, can we verify that x ∗ is indeed a minimizer of f ? To answer this question, we need to define the term “solution” and explain how to recognize solutions. Only then can we discuss algorithms for unconstrained optimization problems. 2.1 WHAT IS A SOLUTION? Generally, we would be happiest if we found a global minimizer of f , a point where the function attains its least value. A formal definition is A point x ∗ is a global minimizer if f (x ∗ ) ≤ f (x) for all x, where x ranges over all of IRn (or at least over the domain of interest to the modeler). The global minimizer can be difficult to find, because our knowledge of f is usually only local. Since our algorithm does not visit many points (we hope!), we usually do not have a good picture of the overall shape of f , and we can never be sure that the function does not take a sharp dip in some region that has not been sampled by the algorithm. Most algorithms are able to find only a local minimizer, which is a point that achieves the smallest value of f in its neighborhood. Formally, we say: A point x ∗ is a local minimizer if there is a neighborhood N of x ∗ such that f (x ∗ ) ≤ f (x) for all x ∈ N . (Recall that a neighborhood of x ∗ is simply an open set that contains x ∗ .) A point that satisfies this definition is sometimes called a weak local minimizer. This terminology distinguishes 2.1. WHAT IS A SOLUTION? it from a strict local minimizer, which is the outright winner in its neighborhood. Formally, A point x ∗ is a strict local minimizer (also called a strong local minimizer) if there is a neighborhood N of x ∗ such that f (x ∗ ) < f (x) for all x ∈ N with x x ∗ . For the constant function f (x) 2, every point x is a weak local minimizer, while the function f (x) (x − 2)4 has a strict local minimizer at x 2. A slightly more exotic type of local minimizer is defined as follows. A point x ∗ is an isolated local minimizer if there is a neighborhood N of x ∗ such that x ∗ is the only local minimizer in N . Some strict local minimizers are not isolated, as illustrated by the function f (x) x 4 cos(1/x) + 2x 4 , f (0) 0, which is twice continuously differentiable and has a strict local minimizer at x ∗ 0. However, there are strict local minimizers at many nearby points x j , and we can label these points so that x j → 0 as j → ∞. While strict local minimizers are not always isolated, it is true that all isolated local minimizers are strict. Figure 2.2 illustrates a function with many local minimizers. It is usually difficult to find the global minimizer for such functions, because algorithms tend to be “trapped” at local minimizers. This example is by no means pathological. In optimization problems associated with the determination of molecular conformation, the potential function to be minimized may have millions of local minima. f x Figure 2.2 A difficult case for global minimization. 13 14 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION Sometimes we have additional “global” knowledge about f that may help in identifying global minima. An important special case is that of convex functions, for which every local minimizer is also a global minimizer. RECOGNIZING A LOCAL MINIMUM From the definitions given above, it might seem that the only way to find out whether a point x ∗ is a local minimum is to examine all the points in its immediate vicinity, to make sure that none of them has a smaller function value. When the function f is smooth, however, there are more efficient and practical ways to identify local minima. In particular, if f is twice continuously differentiable, we may be able to tell that x ∗ is a local minimizer (and possibly a strict local minimizer) by examining just the gradient ∇ f (x ∗ ) and the Hessian ∇ 2 f (x ∗ ). The mathematical tool used to study minimizers of smooth functions is Taylor’s theorem. Because this theorem is central to our analysis throughout the book, we state it now. Its proof can be found in any calculus textbook. Theorem 2.1 (Taylor’s Theorem). Suppose that f : IRn → IR is continuously differentiable and that p ∈ IRn . Then we have that f (x + p) f (x) + ∇ f (x + t p)T p, (2.4) for some t ∈ (0, 1). Moreover, if f is twice continuously differentiable, we have that ∇ f (x + p) ∇ f (x) + 1 ∇ 2 f (x + t p) p dt, (2.5) 0 and that f (x + p) f (x) + ∇ f (x)T p + 12 p T ∇ 2 f (x + t p) p, (2.6) for some t ∈ (0, 1). Necessary conditions for optimality are derived by assuming that x ∗ is a local minimizer and then proving facts about ∇ f (x ∗ ) and ∇ 2 f (x ∗ ). Theorem 2.2 (First-Order Necessary Conditions). If x ∗ is a local minimizer and f is continuously differentiable in an open neighborhood ∗ of x , then ∇ f (x ∗ ) 0. 2.1. WHAT IS A SOLUTION? PROOF. Suppose for contradiction that ∇ f (x ∗ ) 0. Define the vector p −∇ f (x ∗ ) and note that p T ∇ f (x ∗ ) −∇ f (x ∗ )2 < 0. Because ∇ f is continuous near x ∗ , there is a scalar T > 0 such that p T ∇ f (x ∗ + t p) < 0, for all t ∈ [0, T ]. For any t¯ ∈ (0, T ], we have by Taylor’s theorem that f (x ∗ + t¯ p) f (x ∗ ) + t¯ p T ∇ f (x ∗ + t p), for some t ∈ (0, t¯). Therefore, f (x ∗ + t¯ p) < f (x ∗ ) for all t¯ ∈ (0, T ]. We have found a direction leading away from x ∗ along which f decreases, so x ∗ is not a local minimizer, and we have a contradiction. We call x ∗ a stationary point if ∇ f (x ∗ ) 0. According to Theorem 2.2, any local minimizer must be a stationary point. For the next result we recall that a matrix B is positive definite if p T Bp > 0 for all p 0, and positive semidefinite if p T Bp ≥ 0 for all p (see the Appendix). Theorem 2.3 (Second-Order Necessary Conditions). If x ∗ is a local minimizer of f and ∇ 2 f exists and is continuous in an open neighborhood ∗ of x , then ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) is positive semidefinite. PROOF. We know from Theorem 2.2 that ∇ f (x ∗ ) 0. For contradiction, assume that ∇ 2 f (x ∗ ) is not positive semidefinite. Then we can choose a vector p such that p T ∇ 2 f (x ∗ ) p < 0, and because ∇ 2 f is continuous near x ∗ , there is a scalar T > 0 such that p T ∇ 2 f (x ∗ + t p) p < 0 for all t ∈ [0, T ]. By doing a Taylor series expansion around x ∗ , we have for all t¯ ∈ (0, T ] and some t ∈ (0, t¯) that f (x ∗ + t¯ p) f (x ∗ ) + t¯ p T ∇ f (x ∗ ) + 12 t¯2 p T ∇ 2 f (x ∗ + t p) p < f (x ∗ ). As in Theorem 2.2, we have found a direction from x ∗ along which f is decreasing, and so again, x ∗ is not a local minimizer. We now describe sufficient conditions, which are conditions on the derivatives of f at the point z ∗ that guarantee that x ∗ is a local minimizer. 15 16 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION Theorem 2.4 (Second-Order Sufficient Conditions). Suppose that ∇ 2 f is continuous in an open neighborhood of x ∗ and that ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) is positive definite. Then x ∗ is a strict local minimizer of f . PROOF. Because the Hessian is continuous and positive definite at x ∗ , we can choose a radius r > 0 so that ∇ 2 f (x) remains positive definite for all x in the open ball D {z | z − x ∗ < r }. Taking any nonzero vector p with p < r , we have x ∗ + p ∈ D and so f (x ∗ + p) f (x ∗ ) + p T ∇ f (x ∗ ) + 12 p T ∇ 2 f (z) p f (x ∗ ) + 12 p T ∇ 2 f (z) p, where z x ∗ + t p for some t ∈ (0, 1). Since z ∈ D, we have p T ∇ 2 f (z) p > 0, and therefore f (x ∗ + p) > f (x ∗ ), giving the result. Note that the second-order sufficient conditions of Theorem 2.4 guarantee something stronger than the necessary conditions discussed earlier; namely, that the minimizer is a strict local minimizer. Note too that the second-order sufficient conditions are not necessary: A point x ∗ may be a strict local minimizer, and yet may fail to satisfy the sufficient conditions. A simple example is given by the function f (x) x 4 , for which the point x ∗ 0 is a strict local minimizer at which the Hessian matrix vanishes (and is therefore not positive definite). When the objective function is convex, local and global minimizers are simple to characterize. Theorem 2.5. When f is convex, any local minimizer x ∗ is a global minimizer of f . If in addition f is differentiable, then any stationary point x ∗ is a global minimizer of f . PROOF. Suppose that x ∗ is a local but not a global minimizer. Then we can find a point z ∈ IRn with f (z) < f (x ∗ ). Consider the line segment that joins x ∗ to z, that is, x λz + (1 − λ)x ∗ , for some λ ∈ (0, 1]. (2.7) By the convexity property for f , we have f (x) ≤ λ f (z) + (1 − λ) f (x ∗ ) < f (x ∗ ). (2.8) Any neighborhood N of x ∗ contains a piece of the line segment (2.7), so there will always be points x ∈ N at which (2.8) is satisfied. Hence, x ∗ is not a local minimizer. 2.1. WHAT IS A SOLUTION? For the second part of the theorem, suppose that x ∗ is not a global minimizer and choose z as above. Then, from convexity, we have d f (x ∗ + λ(z − x ∗ )) |λ0 (see the Appendix) dλ f (x ∗ + λ(z − x ∗ )) − f (x ∗ ) lim λ↓0 λ λ f (z) + (1 − λ) f (x ∗ ) − f (x ∗ ) ≤ lim λ↓0 λ f (z) − f (x ∗ ) < 0. ∇ f (x ∗ )T (z − x ∗ ) Therefore, ∇ f (x ∗ ) 0, and so x ∗ is not a stationary point. These results, which are based on elementary calculus, provide the foundations for unconstrained optimization algorithms. In one way or another, all algorithms seek a point where ∇ f (·) vanishes. NONSMOOTH PROBLEMS This book focuses on smooth functions, by which we generally mean functions whose second derivatives exist and are continuous. We note, however, that there are interesting problems in which the functions involved may be nonsmooth and even discontinuous. It is not possible in general to identify a minimizer of a general discontinuous function. If, however, the function consists of a few smooth pieces, with discontinuities between the pieces, it may be possible to find the minimizer by minimizing each smooth piece individually. If the function is continuous everywhere but nondifferentiable at certain points, as in Figure 2.3, we can identify a solution by examing the subgradient or generalized f x* Figure 2.3 x Nonsmooth function with minimum at a kink. 17 18 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION gradient, which are generalizations of the concept of gradient to the nonsmooth case. Nonsmooth optimization is beyond the scope of this book; we refer instead to HiriartUrruty and Lemaréchal [170] for an extensive discussion of theory. Here, we mention only that the minimization of a function such as the one illustrated in Figure 2.3 (which contains a jump discontinuity in the first derivative f (x) at the minimum) is difficult because the behavior of f is not predictable near the point of nonsmoothness. That is, we cannot be sure that information about f obtained at one point can be used to infer anything about f at neighboring points, because points of nondifferentiability may intervene. However, minimization of certain special nondifferentiable functions, such as f (x) r (x)1 , f (x) r (x)∞ (2.9) (where r (x) is a vector function), can be reformulated as smooth constrained optimization problems; see Exercise 12.5 in Chapter 12 and (17.31). The functions (2.9) are useful in data fitting, where r (x) is the residual vector whose components are defined in (2.2). 2.2 OVERVIEW OF ALGORITHMS The last forty years have seen the development of a powerful collection of algorithms for unconstrained optimization of smooth functions. We now give a broad description of their main properties, and we describe them in more detail in Chapters 3, 4, 5, 6, and 7. All algorithms for unconstrained minimization require the user to supply a starting point, which we usually denote by x0 . The user with knowledge about the application and the data set may be in a good position to choose x0 to be a reasonable estimate of the solution. Otherwise, the starting point must be chosen by the algorithm, either by a systematic approach or in some arbitrary manner. Beginning at x0 , optimization algorithms generate a sequence of iterates {xk }∞ k0 that terminate when either no more progress can be made or when it seems that a solution point has been approximated with sufficient accuracy. In deciding how to move from one iterate xk to the next, the algorithms use information about the function f at xk , and possibly also information from earlier iterates x0 , x1 , . . . , xk−1 . They use this information to find a new iterate xk+1 with a lower function value than xk . (There exist nonmonotone algorithms that do not insist on a decrease in f at every step, but even these algorithms require f to be decreased after some prescribed number m of iterations, that is, f (xk ) < f (xk−m ).) There are two fundamental strategies for moving from the current point xk to a new iterate xk+1 . Most of the algorithms described in this book follow one of these approaches. 2.2. OVERVIEW OF ALGORITHMS TWO STRATEGIES: LINE SEARCH AND TRUST REGION In the line search strategy, the algorithm chooses a direction pk and searches along this direction from the current iterate xk for a new iterate with a lower function value. The distance to move along pk can be found by approximately solving the following onedimensional minimization problem to find a step length α: min f (xk + αpk ). (2.10) α>0 By solving (2.10) exactly, we would derive the maximum benefit from the direction pk , but an exact minimization may be expensive and is usually unnecessary. Instead, the line search algorithm generates a limited number of trial step lengths until it finds one that loosely approximates the minimum of (2.10). At the new point, a new search direction and step length are computed, and the process is repeated. In the second algorithmic strategy, known as trust region, the information gathered about f is used to construct a model function m k whose behavior near the current point xk is similar to that of the actual objective function f . Because the model m k may not be a good approximation of f when x is far from xk , we restrict the search for a minimizer of m k to some region around xk . In other words, we find the candidate step p by approximately solving the following subproblem: min m k (xk + p), where xk + p lies inside the trust region. p (2.11) If the candidate solution does not produce a sufficient decrease in f , we conclude that the trust region is too large, and we shrink it and re-solve (2.11). Usually, the trust region is a ball defined by p2 ≤ , where the scalar > 0 is called the trust-region radius. Elliptical and box-shaped trust regions may also be used. The model m k in (2.11) is usually defined to be a quadratic function of the form m k (xk + p) f k + p T ∇ f k + 12 p T Bk p, (2.12) where f k , ∇ f k , and Bk are a scalar, vector, and matrix, respectively. As the notation indicates, f k and ∇ f k are chosen to be the function and gradient values at the point xk , so that m k and f are in agreement to first order at the current iterate xk . The matrix Bk is either the Hessian ∇ 2 f k or some approximation to it. Suppose that the objective function is given by f (x) 10(x2 − x12 )2 + (1 − x1 )2 . At the point xk (0, 1) its gradient and Hessian are ∇ fk −2 20 , ∇ fk 2 −38 0 0 20 . 19 20 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION m = 12 m =1 contours of f xk p k contours of model pk * unconstrained minimizer Figure 2.4 Two possible trust regions (circles) and their corresponding steps pk . The solid lines are contours of the model function m k . The contour lines of the quadratic model (2.12) with Bk ∇ 2 f k are depicted in Figure 2.4, which also illustrates the contours of the objective function f and the trust region. We have indicated contour lines where the model m k has values 1 and 12. Note from Figure 2.4 that each time we decrease the size of the trust region after failure of a candidate iterate, the step from xk to the new candidate will be shorter, and it usually points in a different direction from the previous candidate. The trust-region strategy differs in this respect from line search, which stays with a single search direction. In a sense, the line search and trust-region approaches differ in the order in which they choose the direction and distance of the move to the next iterate. Line search starts by fixing the direction pk and then identifying an appropriate distance, namely the step length αk . In trust region, we first choose a maximum distance—the trust-region radius k —and then seek a direction and step that attain the best improvement possible subject to this distance constraint. If this step proves to be unsatisfactory, we reduce the distance measure k and try again. The line search approach is discussed in more detail in Chapter 3. Chapter 4 discusses the trust-region strategy, including techniques for choosing and adjusting the size of the region and for computing approximate solutions to the trust-region problems (2.11). We now preview two major issues: choice of the search direction pk in line search methods, and choice of the Hessian Bk in trust-region methods. These issues are closely related, as we now observe. SEARCH DIRECTIONS FOR LINE SEARCH METHODS The steepest descent direction −∇ f k is the most obvious choice for search direction for a line search method. It is intuitive; among all the directions we could move from xk , 2.2. OVERVIEW OF ALGORITHMS it is the one along which f decreases most rapidly. To verify this claim, we appeal again to Taylor’s theorem (Theorem 2.1), which tells us that for any search direction p and step-length parameter α, we have f (xk + αp) f (xk ) + αp T ∇ f k + 12 α 2 p T ∇ 2 f (xk + t p) p, for some t ∈ (0, α) (see (2.6)). The rate of change in f along the direction p at xk is simply the coefficient of α, namely, p T ∇ f k . Hence, the unit direction p of most rapid decrease is the solution to the problem min p T ∇ f k , subject to p 1. p (2.13) Since p T ∇ f k p ∇ f k cos θ ∇ f k cos θ , where θ is the angle between p and ∇ f k , it is easy to see that the minimizer is attained when cos θ −1 and p −∇ f k /∇ f k , as claimed. As we illustrate in Figure 2.5, this direction is orthogonal to the contours of the function. The steepest descent method is a line search method that moves along pk −∇ f k at every step. It can choose the step length αk in a variety of ways, as we discuss in Chapter 3. One advantage of the steepest descent direction is that it requires calculation of the gradient ∇ f k but not of second derivatives. However, it can be excruciatingly slow on difficult problems. Line search methods may use search directions other than the steepest descent direction. In general, any descent direction—one that makes an angle of strictly less than π/2 radians with −∇ f k —is guaranteed to produce a decrease in f , provided that the step length . pk x* xk Figure 2.5 Steepest descent direction for a function of two variables. 21 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION p k – ∆ 22 fk Figure 2.6 A downhill direction pk . is sufficiently small (see Figure 2.6). We can verify this claim by using Taylor’s theorem. From (2.6), we have that f (xk + pk ) f (xk ) + pkT ∇ f k + O( 2 ). When pk is a downhill direction, the angle θk between pk and ∇ f k has cos θk < 0, so that pkT ∇ f k pk ∇ f k cos θk < 0. It follows that f (xk + pk ) < f (xk ) for all positive but sufficiently small values of . Another important search direction—perhaps the most important one of all— is the Newton direction. This direction is derived from the second-order Taylor series approximation to f (xk + p), which is def f (xk + p) ≈ f k + p T ∇ f k + 12 p T ∇ 2 f k p m k ( p). (2.14) Assuming for the moment that ∇ 2 f k is positive definite, we obtain the Newton direction by finding the vector p that minimizes m k ( p). By simply setting the derivative of m k ( p) to zero, we obtain the following explicit formula: −1 pkN − ∇ 2 f k ∇ fk . (2.15) The Newton direction is reliable when the difference between the true function f (xk + p) and its quadratic model m k ( p) is not too large. By comparing (2.14) with (2.6), we see that the only difference between these functions is that the matrix ∇ 2 f (xk + t p) in the third term of the expansion has been replaced by ∇ 2 f k . If ∇ 2 f is sufficiently smooth, this difference introduces a perturbation of only O( p3 ) into the expansion, so that when p is small, the approximation f (xk + p) ≈ m k ( p) is quite accurate. 2.2. OVERVIEW OF ALGORITHMS The Newton direction can be used in a line search method when ∇ 2 f k is positive definite, for in this case we have ∇ f kT pkN − pkN T ∇ 2 f k pkN ≤ −σk pkN 2 for some σk > 0. Unless the gradient ∇ f k (and therefore the step pkN ) is zero, we have that ∇ f kT pkN < 0, so the Newton direction is a descent direction. Unlike the steepest descent direction, there is a “natural” step length of 1 associated with the Newton direction. Most line search implementations of Newton’s method use the unit step α 1 where possible and adjust α only when it does not produce a satisfactory reduction in the value of f . When ∇ 2 f is not positive definite, the Newton direction may not even be defined, 2 −1 k may not exist. Even when it is defined, it may not satisfy the descent property since ∇ f k ∇ f kT pkN < 0, in which case it is unsuitable as a search direction. In these situations, line search methods modify the definition of pk to make it satisfy the descent condition while retaining the benefit of the second-order information contained in ∇ 2 f k . We describe these modifications in Chapter 3. Methods that use the Newton direction have a fast rate of local convergence, typically quadratic. After a neighborhood of the solution is reached, convergence to high accuracy often occurs in just a few iterations. The main drawback of the Newton direction is the need for the Hessian ∇ 2 f (x). Explicit computation of this matrix of second derivatives can sometimes be a cumbersome, error-prone, and expensive process. Finite-difference and automatic differentiation techniques described in Chapter 8 may be useful in avoiding the need to calculate second derivatives by hand. Quasi-Newton search directions provide an attractive alternative to Newton’s method in that they do not require computation of the Hessian and yet still attain a superlinear rate of convergence. In place of the true Hessian ∇ 2 f k , they use an approximation Bk , which is updated after each step to take account of the additional knowledge gained during the step. The updates make use of the fact that changes in the gradient g provide information about the second derivative of f along the search direction. By using the expression (2.5) from our statement of Taylor’s theorem, we have by adding and subtracting the term ∇ 2 f (x) p that ∇ f (x + p) ∇ f (x) + ∇ f (x) p + 2 1 ∇ 2 f (x + t p) − ∇ 2 f (x) p dt. 0 Because ∇ f (·) is continuous, the size of the final integral term is o( p). By setting x xk and p xk+1 − xk , we obtain ∇ f k+1 ∇ f k + ∇ 2 f k (xk+1 − xk ) + o(xk+1 − xk ). When xk and xk+1 lie in a region near the solution x ∗ , within which ∇ 2 f is positive definite, the final term in this expansion is eventually dominated by the ∇ 2 f k (xk+1 − xk ) term, and 23 24 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION we can write ∇ 2 f k (xk+1 − xk ) ≈ ∇ f k+1 − ∇ f k . (2.16) We choose the new Hessian approximation Bk+1 so that it mimics the property (2.16) of the true Hessian, that is, we require it to satisfy the following condition, known as the secant equation: Bk+1 sk yk , (2.17) where sk xk+1 − xk , yk ∇ f k+1 − ∇ f k . Typically, we impose additional conditions on Bk+1 , such as symmetry (motivated by symmetry of the exact Hessian), and a requirement that the difference between successive approximations Bk and Bk+1 have low rank. Two of the most popular formulae for updating the Hessian approximation Bk are the symmetric-rank-one (SR1) formula, defined by Bk+1 Bk + (yk − Bk sk )(yk − Bk sk )T , (yk − Bk sk )T sk (2.18) and the BFGS formula, named after its inventors, Broyden, Fletcher, Goldfarb, and Shanno, which is defined by Bk+1 Bk − Bk sk skT Bk yk y T + Tk . T sk Bk sk yk sk (2.19) Note that the difference between the matrices Bk and Bk+1 is a rank-one matrix in the case of (2.18) and a rank-two matrix in the case of (2.19). Both updates satisfy the secant equation and both maintain symmetry. One can show that BFGS update (2.19) generates positive definite approximations whenever the initial approximation B0 is positive definite and skT yk > 0. We discuss these issues further in Chapter 6. The quasi-Newton search direction is obtained by using Bk in place of the exact Hessian in the formula (2.15), that is, pk −Bk−1 ∇ f k . (2.20) Some practical implementations of quasi-Newton methods avoid the need to factorize Bk at each iteration by updating the inverse of Bk , instead of Bk itself. In fact, the equivalent 2.2. OVERVIEW OF ALGORITHMS formula for (2.18) and (2.19), applied to the inverse approximation Hk Bk−1 , is def Hk+1 I − ρk sk ykT Hk I − ρk yk skT + ρk sk skT , ρk 1 ykT sk . (2.21) Calculation of pk can then be performed by using the formula pk −Hk ∇ f k . This matrix– vector multiplication is simpler than the factorization/back-substitution procedure that is needed to implement the formula (2.20). Two variants of quasi-Newton methods designed to solve large problems—partially separable and limited-memory updating—are described in Chapter 7. The last class of search directions we preview here is that generated by nonlinear conjugate gradient methods. They have the form pk −∇ f (xk ) + βk pk−1 , where βk is a scalar that ensures that pk and pk−1 are conjugate—an important concept in the minimization of quadratic functions that will be defined in Chapter 5. Conjugate gradient methods were originally designed to solve systems of linear equations Ax b, where the coefficient matrix A is symmetric and positive definite. The problem of solving this linear system is equivalent to the problem of minimizing the convex quadratic function defined by φ(x) 12 x T Ax − b T x, so it was natural to investigate extensions of these algorithms to more general types of unconstrained minimization problems. In general, nonlinear conjugate gradient directions are much more effective than the steepest descent direction and are almost as simple to compute. These methods do not attain the fast convergence rates of Newton or quasiNewton methods, but they have the advantage of not requiring storage of matrices. An extensive discussion of nonlinear conjugate gradient methods is given in Chapter 5. All of the search directions discussed so far can be used directly in a line search framework. They give rise to the steepest descent, Newton, quasi-Newton, and conjugate gradient line search methods. All except conjugate gradients have an analogue in the trustregion framework, as we now discuss. MODELS FOR TRUST-REGION METHODS If we set Bk 0 in (2.12) and define the trust region using the Euclidean norm, the trust-region subproblem (2.11) becomes min f k + p T ∇ f k p subject to p2 ≤ k . 25 26 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION We can write the solution to this problem in closed form as pk − k ∇ f k . ∇ f k This is simply a steepest descent step in which the step length is determined by the trustregion radius; the trust-region and line search approaches are essentially the same in this case. A more interesting trust-region algorithm is obtained by choosing Bk to be the exact Hessian ∇ 2 f k in the quadratic model (2.12). Because of the trust-region restriction p2 ≤ k , the subproblem (2.11) is guaranteed to have a solution even when ∇ 2 f k is not positive definite pk , as we see in Figure 2.4. The trust-region Newton method has proved to be highly effective in practice, as we discuss in Chapter 7. If the matrix Bk in the quadratic model function m k of (2.12) is defined by means of a quasi-Newton approximation, we obtain a trust-region quasi-Newton method. SCALING The performance of an algorithm may depend crucially on how the problem is formulated. One important issue in problem formulation is scaling. In unconstrained optimization, a problem is said to be poorly scaled if changes to x in a certain direction produce much larger variations in the value of f than do changes to x in another direction. A simple example is provided by the function f (x) 109 x12 + x22 , which is very sensitive to small changes in x1 but not so sensitive to perturbations in x2 . Poorly scaled functions arise, for example, in simulations of physical and chemical systems where different processes are taking place at very different rates. To be more specific, consider a chemical system in which four reactions occur. Associated with each reaction is a rate constant that describes the speed at which the reaction takes place. The optimization problem is to find values for these rate constants by observing the concentrations of each chemical in the system at different times. The four constants differ greatly in magnitude, since the reactions take place at vastly different speeds. Suppose we have the following rough estimates for the final values of the constants, each correct to within, say, an order of magnitude: x1 ≈ 10−10 , x2 ≈ x3 ≈ 1, x4 ≈ 105 . Before solving this problem we could introduce a new variable z defined by ⎡ x1 ⎢ ⎢ x2 ⎢ ⎢ x ⎣ 3 x4 ⎤ ⎡ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎦ ⎣ 10−10 0 0 0 1 0 0 0 1 0 0 0 0 ⎤⎡ z1 ⎥⎢ ⎥ ⎢ z2 ⎥⎢ ⎢ 0 ⎥ ⎦ ⎣ z3 105 z4 0 ⎤ ⎥ ⎥ ⎥, ⎥ ⎦ and then define and solve the optimization problem in terms of the new variable z. The 2.2. OVERVIEW OF ALGORITHMS ∆ – f k ∆ – f k Figure 2.7 Poorly scaled and well scaled problems, and performance of the steepest descent direction. optimal values of z will be within about an order of magnitude of 1, making the solution more balanced. This kind of scaling of the variables is known as diagonal scaling. Scaling is performed (sometimes unintentionally) when the units used to represent variables are changed. During the modeling process, we may decide to change the units of some variables, say from meters to millimeters. If we do, the range of those variables and their size relative to the other variables will both change. Some optimization algorithms, such as steepest descent, are sensitive to poor scaling, while others, such as Newton’s method, are unaffected by it. Figure 2.7 shows the contours of two convex nearly quadratic functions, the first of which is poorly scaled, while the second is well scaled. For the poorly scaled problem, the one with highly elongated contours, the steepest descent direction does not yield much reduction in the function, while for the well-scaled problem it performs much better. In both cases, Newton’s method will produce a much better step, since the second-order quadratic model (m k in (2.14)) happens to be a good approximation of f . Algorithms that are not sensitive to scaling are preferable, because they can handle poor problem formulations in a more robust fashion. In designing complete algorithms, we try to incorporate scale invariance into all aspects of the algorithm, including the line search or trust-region strategies and convergence tests. Generally speaking, it is easier to preserve scale invariance for line search algorithms than for trust-region algorithms. ✐ EXERCISES ✐ 2.1 Compute the gradient ∇ f (x) and Hessian ∇ 2 f (x) of the Rosenbrock function f (x) 100(x2 − x12 )2 + (1 − x1 )2 . (2.22) 27 28 CHAPTER 2. FUNDAMENTALS OF UNCONSTRAINED OPTIMIZATION Show that x ∗ (1, 1)T is the only local minimizer of this function, and that the Hessian matrix at that point is positive definite. ✐ 2.2 Show that the function f (x) 8x1 + 12x2 + x12 − 2x22 has only one stationary point, and that it is neither a maximum or minimum, but a saddle point. Sketch the contour lines of f . ✐ 2.3 Let a be a given n-vector, and A be a given n × n symmetric matrix. Compute the gradient and Hessian of f 1 (x) a T x and f 2 (x) x T Ax. ✐ 2.4 Write the second-order Taylor expansion (2.6) for the function cos(1/x) around a nonzero point x, and the third-order Taylor expansion of cos(x) around any point x. Evaluate the second expansion for the specific case of x 1. ✐ 2.5 Consider the function f : IR2 → IR defined by f (x) x2 . Show that the sequence of iterates {xk } defined by cos k 1 xk 1 + k 2 sin k satisfies f (xk+1 ) < f (xk ) for k 0, 1, 2, . . . . Show that every point on the unit circle {x | x2 1} is a limit point for {xk }. Hint: Every value θ ∈ [0, 2π ] is a limit point of the subsequence {ξk } defined by k ξk k(mod 2π ) k − 2π , 2π where the operator · denotes rounding down to the next integer. ✐ 2.6 Prove that all isolated local minimizers are strict. (Hint: Take an isolated local minimizer x ∗ and a neighborhood N . Show that for any x ∈ N , x x ∗ we must have f (x) > f (x ∗ ).) ✐ 2.7 Suppose that f (x) x T Qx, where Q is an n × n symmetric positive semidefinite matrix. Show using the definition (1.4) that f (x) is convex on the domain IRn . Hint: It may be convenient to prove the following equivalent inequality: f (y + α(x − y)) − α f (x) − (1 − α) f (y) ≤ 0, for all α ∈ [0, 1] and all x, y ∈ IRn . ✐ 2.8 Suppose that f is a convex function. Show that the set of global minimizers of f is a convex set. 2.2. OVERVIEW OF ALGORITHMS 2 2.9 Consider the function f (x1 , x2 ) x1 + x22 . At the point x T (1, 0) we consider the search direction p T (−1, 1). Show that p is a descent direction and find all minimizers of the problem (2.10). ✐ 2.10 Suppose that f˜(z) f (x), where x Sz + s for some S ∈ IRn×n and s ∈ IRn . Show that ✐ ∇ f˜(z) S T ∇ f (x), ∇ 2 f˜(z) S T ∇ 2 f (x)S. (Hint: Use the chain rule to express d f˜/dz j in terms of d f /d xi and d xi /dz j for all i, j 1, 2, . . . , n.) ✐ 2.11 Show that the symmetric rank-one update (2.18) and the BFGS update (2.19) are scale-invariant if the initial Hessian approximations B0 are chosen appropriately. That is, using the notation of the previous exercise, show that if these methods are applied to f (x) starting from x0 Sz 0 + s with initial Hessian B0 , and to f˜(z) starting from z 0 with initial Hessian S T B0 S, then all iterates are related by xk Sz k + s. (Assume for simplicity that the methods take unit step lengths.) ✐ 2.12 Suppose that a function f of two variables is poorly scaled at the solution x ∗ . Write two Taylor expansions of f around x ∗ —one along each coordinate direction—and use them to show that the Hessian ∇ 2 f (x ∗ ) is ill-conditioned. ✐ 2.13 (For this and the following three questions, refer to the material on “Rates of Convergence” in Section A.2 of the Appendix.) Show that the sequence xk 1/k is not Q-linearly convergent, though it does converge to zero. (This is called sublinear convergence.) ✐ 2.14 Show that the sequence xk 1 + (0.5)2 is Q-quadratically convergent to 1. ✐ 2.15 Does the sequence xk 1/k! converge Q-superlinearly? Q-quadratically? ✐ 2.16 Consider the sequence {xk } defined by k xk 2k 1 , k even, (xk−1 )/k, k odd. 4 Is this sequence Q-superlinearly convergent? Q-quadratically convergent? R-quadratically convergent? 29 This is pag Printer: O CHAPTER 3 Line Search Methods Each iteration of a line search method computes a search direction pk and then decides how far to move along that direction. The iteration is given by xk+1 xk + αk pk , (3.1) where the positive scalar αk is called the step length. The success of a line search method depends on effective choices of both the direction pk and the step length αk . Most line search algorithms require pk to be a descent direction—one for which pkT ∇ f k < 0—because this property guarantees that the function f can be reduced along 3.1. STEP LENGTH this direction, as discussed in the previous chapter. Moreover, the search direction often has the form pk −Bk−1 ∇ f k , (3.2) where Bk is a symmetric and nonsingular matrix. In the steepest descent method, Bk is simply the identity matrix I , while in Newton’s method, Bk is the exact Hessian ∇ 2 f (xk ). In quasi-Newton methods, Bk is an approximation to the Hessian that is updated at every iteration by means of a low-rank formula. When pk is defined by (3.2) and Bk is positive definite, we have pkT ∇ f k −∇ f kT Bk−1 ∇ f k < 0, and therefore pk is a descent direction. In this chapter, we discuss how to choose αk and pk to promote convergence from remote starting points. We also study the rate of convergence of steepest descent, quasiNewton, and Newton methods. Since the pure Newton iteration is not guaranteed to produce descent directions when the current iterate is not close to a solution, we discuss modifications in Section 3.4 that allow it to start from any initial point. We now give careful consideration to the choice of the step-length parameter αk . 3.1 STEP LENGTH In computing the step length αk , we face a tradeoff. We would like to choose αk to give a substantial reduction of f , but at the same time we do not want to spend too much time making the choice. The ideal choice would be the global minimizer of the univariate function φ(·) defined by φ(α) f (xk + αpk ), α > 0, (3.3) but in general, it is too expensive to identify this value (see Figure 3.1). To find even a local minimizer of φ to moderate precision generally requires too many evaluations of the objective function f and possibly the gradient ∇ f . More practical strategies perform an inexact line search to identify a step length that achieves adequate reductions in f at minimal cost. Typical line search algorithms try out a sequence of candidate values for α, stopping to accept one of these values when certain conditions are satisfied. The line search is done in two stages: A bracketing phase finds an interval containing desirable step lengths, and a bisection or interpolation phase computes a good step length within this interval. Sophisticated line search algorithms can be quite complicated, so we defer a full description until Section 3.5. 31 32 CHAPTER 3. LINE SEARCH METHODS φ (α) first local minimizer α first stationary point Figure 3.1 global minimizer The ideal step length is the global minimizer. We now discuss various termination conditions for line search algorithms and show that effective step lengths need not lie near minimizers of the univariate function φ(α) defined in (3.3). A simple condition we could impose on αk is to require a reduction in f , that is, f (xk + αk pk ) < f (xk ). That this requirement is not enough to produce convergence to x ∗ is illustrated in Figure 3.2, for which the minimum function value is f ∗ −1, but a sequence of iterates {xk } for which f (xk ) 5/k, k 0, 1, . . . yields a decrease at each iteration but has a limiting function value of zero. The insufficient reduction in f at each step causes it to fail to converge to the minimizer of this convex function. To avoid this behavior we need to enforce a sufficient decrease condition, a concept we discuss next. f( x ) x x1 Figure 3.2 Insufficient reduction in f . x 2 x 0 3.1. STEP LENGTH THE WOLFE CONDITIONS A popular inexact line search condition stipulates that αk should first of all give sufficient decrease in the objective function f , as measured by the following inequality: f (xk + αpk ) ≤ f (xk ) + c1 α∇ f kT pk , (3.4) for some constant c1 ∈ (0, 1). In other words, the reduction in f should be proportional to both the step length αk and the directional derivative ∇ f kT pk . Inequality (3.4) is sometimes called the Armijo condition. The sufficient decrease condition is illustrated in Figure 3.3. The right-hand-side of (3.4), which is a linear function, can be denoted by l(α). The function l(·) has negative slope c1 ∇ f kT pk , but because c1 ∈ (0, 1), it lies above the graph of φ for small positive values of α. The sufficient decrease condition states that α is acceptable only if φ(α) ≤ l(α). The intervals on which this condition is satisfied are shown in Figure 3.3. In practice, c1 is chosen to be quite small, say c1 10−4 . The sufficient decrease condition is not enough by itself to ensure that the algorithm makes reasonable progress because, as we see from Figure 3.3, it is satisfied for all sufficiently small values of α. To rule out unacceptably short steps we introduce a second requirement, called the curvature condition, which requires αk to satisfy ∇ f (xk + αk pk )T pk ≥ c2 ∇ f kT pk , (3.5) for some constant c2 ∈ (c1 , 1), where c1 is the constant from (3.4). Note that the left-handside is simply the derivative φ (αk ), so the curvature condition ensures that the slope of φ at αk is greater than c2 times the initial slope φ (0). This makes sense because if the slope φ (α) φ (α) = f(xk+ α pk ) l( α) α acceptable Figure 3.3 Sufficient decrease condition. acceptable 33 34 CHAPTER 3. LINE SEARCH METHODS φ (α) =f(x k+α pk ) desired slope tangent α acceptable Figure 3.4 acceptable The curvature condition. is strongly negative, we have an indication that we can reduce f significantly by moving further along the chosen direction. On the other hand, if φ (αk ) is only slightly negative or even positive, it is a sign that we cannot expect much more decrease in f in this direction, so it makes sense to terminate the line search. The curvature condition is illustrated in Figure 3.4. Typical values of c2 are 0.9 when the search direction pk is chosen by a Newton or quasi-Newton method, and 0.1 when pk is obtained from a nonlinear conjugate gradient method. The sufficient decrease and curvature conditions are known collectively as the Wolfe conditions. We illustrate them in Figure 3.5 and restate them here for future reference: f (xk + αk pk ) ≤ f (xk ) + c1 αk ∇ f kT pk , ∇ f (xk + αk pk ) pk ≥ c2 ∇ T f kT pk , (3.6a) (3.6b) with 0 < c1 < c2 < 1. A step length may satisfy the Wolfe conditions without being particularly close to a minimizer of φ, as we show in Figure 3.5. We can, however, modify the curvature condition to force αk to lie in at least a broad neighborhood of a local minimizer or stationary point of φ. The strong Wolfe conditions require αk to satisfy f (xk + αk pk ) ≤ f (xk ) + c1 αk ∇ f kT pk , |∇ f (xk + αk pk ) pk | ≤ c2 |∇ T f kT pk |, (3.7a) (3.7b) with 0 < c1 < c2 < 1. The only difference with the Wolfe conditions is that we no longer allow the derivative φ (αk ) to be too positive. Hence, we exclude points that are far from stationary points of φ. 3.1. STEP LENGTH φ (α ) = f(x k + α pk ) line of sufficient decrease l(α ) desired slope α acceptable Figure 3.5 acceptable Step lengths satisfying the Wolfe conditions. It is not difficult to prove that there exist step lengths that satisfy the Wolfe conditions for every function f that is smooth and bounded below. Lemma 3.1. Suppose that f : IRn → IR is continuously differentiable. Let pk be a descent direction at xk , and assume that f is bounded below along the ray {xk + αpk |α > 0}. Then if 0 < c1 < c2 < 1, there exist intervals of step lengths satisfying the Wolfe conditions (3.6) and the strong Wolfe conditions (3.7). PROOF. Note that φ(α) f (xk + αpk ) is bounded below for all α > 0. Since 0 < c1 < 1, the line l(α) f (xk ) + αc1 ∇ f kT pk is unbounded below and must therefore intersect the graph of φ at least once. Let α > 0 be the smallest intersecting value of α, that is, f (xk + α pk ) f (xk ) + α c1 ∇ f kT pk . (3.8) The sufficient decrease condition (3.6a) clearly holds for all step lengths less than α . By the mean value theorem (see (A.55)), there exists α ∈ (0, α ) such that f (xk + α pk ) − f (xk ) α ∇ f (xk + α pk )T pk . (3.9) By combining (3.8) and (3.9), we obtain ∇ f (xk + α pk )T pk c1 ∇ f kT pk > c2 ∇ f kT pk , (3.10) since c1 < c2 and ∇ f kT pk < 0. Therefore, α satisfies the Wolfe conditions (3.6), and the inequalities hold strictly in both (3.6a) and (3.6b). Hence, by our smoothness assumption on f , there is an interval around α for which the Wolfe conditions hold. Moreover, since 35 36 CHAPTER 3. LINE SEARCH METHODS the term in the left-hand side of (3.10) is negative, the strong Wolfe conditions (3.7) hold in the same interval. The Wolfe conditions are scale-invariant in a broad sense: Multiplying the objective function by a constant or making an affine change of variables does not alter them. They can be used in most line search methods, and are particularly important in the implementation of quasi-Newton methods, as we see in Chapter 6. THE GOLDSTEIN CONDITIONS Like the Wolfe conditions, the Goldstein conditions ensure that the step length α achieves sufficient decrease but is not too short. The Goldstein conditions can also be stated as a pair of inequalities, in the following way: f (xk ) + (1 − c)αk ∇ f kT pk ≤ f (xk + αk pk ) ≤ f (xk ) + cαk ∇ f kT pk , (3.11) with 0 < c < 1/2. The second inequality is the sufficient decrease condition (3.4), whereas the first inequality is introduced to control the step length from below; see Figure 3.6 A disadvantage of the Goldstein conditions vis-à-vis the Wolfe conditions is that the first inequality in (3.11) may exclude all minimizers of φ. However, the Goldstein and Wolfe conditions have much in common, and their convergence theories are quite similar. The Goldstein conditions are often used in Newton-type methods but are not well suited for quasi-Newton methods that maintain a positive definite Hessian approximation. φ ( α ) = f(x k+ α pk ) α c f kTp k α (1 _ c) fkTpk α acceptable steplengths Figure 3.6 The Goldstein conditions. 3.2. CONVERGENCE OF LINE SEARCH METHODS SUFFICIENT DECREASE AND BACKTRACKING We have mentioned that the sufficient decrease condition (3.6a) alone is not sufficient to ensure that the algorithm makes reasonable progress along the given search direction. However, if the line search algorithm chooses its candidate step lengths appropriately, by using a so-called backtracking approach, we can dispense with the extra condition (3.6b) and use just the sufficient decrease condition to terminate the line search procedure. In its most basic form, backtracking proceeds as follows. Algorithm 3.1 (Backtracking Line Search). Choose ᾱ > 0, ρ ∈ (0, 1), c ∈ (0, 1); Set α ← ᾱ; repeat until f (xk + αpk ) ≤ f (xk ) + cα∇ f kT pk α ← ρα; end (repeat) Terminate with αk α. In this procedure, the initial step length ᾱ is chosen to be 1 in Newton and quasiNewton methods, but can have different values in other algorithms such as steepest descent or conjugate gradient. An acceptable step length will be found after a finite number of trials, because αk will eventually become small enough that the sufficient decrease condition holds (see Figure 3.3). In practice, the contraction factor ρ is often allowed to vary at each iteration of the line search. For example, it can be chosen by safeguarded interpolation, as we describe later. We need ensure only that at each iteration we have ρ ∈ [ρlo , ρhi ], for some fixed constants 0 < ρlo < ρhi < 1. The backtracking approach ensures either that the selected step length αk is some fixed value (the initial choice ᾱ), or else that it is short enough to satisfy the sufficient decrease condition but not too short. The latter claim holds because the accepted value αk is within a factor ρ of the previous trial value, αk /ρ, which was rejected for violating the sufficient decrease condition, that is, for being too long. This simple and popular strategy for terminating a line search is well suited for Newton methods but is less appropriate for quasi-Newton and conjugate gradient methods. 3.2 CONVERGENCE OF LINE SEARCH METHODS To obtain global convergence, we must not only have well chosen step lengths but also well chosen search directions pk . We discuss requirements on the search direction in this section, focusing on one key property: the angle θk between pk and the steepest descent direction −∇ f k , defined by cos θk −∇ f kT pk . ∇ f k pk (3.12) 37 38 CHAPTER 3. LINE SEARCH METHODS The following theorem, due to Zoutendijk, has far-reaching consequences. It quantifies the effect of properly chosen step lengths αk , and shows, for example, that the steepest descent method is globally convergent. For other algorithms, it describes how far pk can deviate from the steepest descent direction and still produce a globally convergent iteration. Various line search termination conditions can be used to establish this result, but for concreteness we will consider only the Wolfe conditions (3.6). Though Zoutendijk’s result appears at first to be technical and obscure, its power will soon become evident. Theorem 3.2. Consider any iteration of the form (3.1), where pk is a descent direction and αk satisfies the Wolfe conditions (3.6). Suppose that f is bounded below in IRn and that f is continuously def differentiable in an open set N containing the level set L {x : f (x) ≤ f (x0 )}, where x0 is the starting point of the iteration. Assume also that the gradient ∇ f is Lipschitz continuous on N , that is, there exists a constant L > 0 such that ∇ f (x) − ∇ f (x̃) ≤ Lx − x̃, for all x, x̃ ∈ N . (3.13) Then cos2 θk ∇ f k 2 < ∞. k≥0 PROOF. From (3.6b) and (3.1) we have that (∇ f k+1 − ∇ f k )T pk ≥ (c2 − 1)∇ f kT pk , while the Lipschitz condition (3.13) implies that (∇ f k+1 − ∇ f k )T pk ≤ αk L pk 2 . By combining these two relations, we obtain αk ≥ c2 − 1 ∇ f kT pk . L pk 2 By substituting this inequality into the first Wolfe condition (3.6a), we obtain f k+1 ≤ f k − c1 1 − c2 (∇ f kT pk )2 . L pk 2 From the definition (3.12), we can write this relation as f k+1 ≤ f k − c cos2 θk ∇ f k 2 , (3.14) 3.2. CONVERGENCE OF LINE SEARCH METHODS where c c1 (1 − c2 )/L. By summing this expression over all indices less than or equal to k, we obtain f k+1 ≤ f 0 − c k cos2 θ j ∇ f j 2 . (3.15) j0 Since f is bounded below, we have that f 0 − f k+1 is less than some positive constant, for all k. Hence, by taking limits in (3.15), we obtain ∞ cos2 θk ∇ f k 2 < ∞, k0 which concludes the proof. Similar results to this theorem hold when the Goldstein conditions (3.11) or strong Wolfe conditions (3.7) are used in place of the Wolfe conditions. For all these strategies, the step length selection implies inequality (3.14), which we call the Zoutendijk condition. Note that the assumptions of Theorem 3.2 are not too restrictive. If the function f were not bounded below, the optimization problem would not be well defined. The smoothness assumption—Lipschitz continuity of the gradient—is implied by many of the smoothness conditions that are used in local convergence theorems (see Chapters 6 and 7) and are often satisfied in practice. The Zoutendijk condition (3.14) implies that cos2 θk ∇ f k 2 → 0. (3.16) This limit can be used in turn to derive global convergence results for line search algorithms. If our method for choosing the search direction pk in the iteration (3.1) ensures that the angle θk defined by (3.12) is bounded away from 90◦ , there is a positive constant δ such that cos θk ≥ δ > 0, for all k. (3.17) It follows immediately from (3.16) that lim ∇ f k 0. k→∞ (3.18) In other words, we can be sure that the gradient norms ∇ f k converge to zero, provided that the search directions are never too close to orthogonality with the gradient. In particular, the method of steepest descent (for which the search direction pk is parallel to the negative 39 40 CHAPTER 3. LINE SEARCH METHODS gradient) produces a gradient sequence that converges to zero, provided that it uses a line search satisfying the Wolfe or Goldstein conditions. We use the term globally convergent to refer to algorithms for which the property (3.18) is satisfied, but note that this term is sometimes used in other contexts to mean different things. For line search methods of the general form (3.1), the limit (3.18) is the strongest global convergence result that can be obtained: We cannot guarantee that the method converges to a minimizer, but only that it is attracted by stationary points. Only by making additional requirements on the search direction pk —by introducing negative curvature information from the Hessian ∇ 2 f (xk ), for example—can we strengthen these results to include convergence to a local minimum. See the Notes and References at the end of this chapter for further discussion of this point. Consider now the Newton-like method (3.1), (3.2) and assume that the matrices Bk are positive definite with a uniformly bounded condition number. That is, there is a constant M such that Bk Bk−1 ≤ M, for all k. It is easy to show from the definition (3.12) that cos θk ≥ 1/M (3.19) (see Exercise 3.5). By combining this bound with (3.16) we find that lim ∇ f k 0. k→∞ (3.20) Therefore, we have shown that Newton and quasi-Newton methods are globally convergent if the matrices Bk have a bounded condition number and are positive definite (which is needed to ensure that pk is a descent direction), and if the step lengths satisfy the Wolfe conditions. For some algorithms, such as conjugate gradient methods, we will be able to prove the limit (3.18), but only the weaker result lim inf ∇ f k 0. k→∞ (3.21) In other words, just a subsequence of the gradient norms ∇ f k j converges to zero, rather than the whole sequence (see Appendix A). This result, too, can be proved by using Zoutendijk’s condition (3.14), but instead of a constructive proof, we outline a proof by contradiction. Suppose that (3.21) does not hold, so that the gradients remain bounded away from zero, that is, there exists γ > 0 such that ∇ f k ≥ γ , for all k sufficiently large. (3.22) 3.3. RATE OF CONVERGENCE Then from (3.16) we conclude that cos θk → 0, (3.23) that is, the entire sequence {cos θk } converges to 0. To establish (3.21), therefore, it is enough to show that a subsequence {cos θk j } is bounded away from zero. We will use this strategy in Chapter 5 to study the convergence of nonlinear conjugate gradient methods. By applying this proof technique, we can prove global convergence in the sense of (3.20) or (3.21) for a general class of algorithms. Consider any algorithm for which (i) every iteration produces a decrease in the objective function, and (ii) every mth iteration is a steepest descent step, with step length chosen to satisfy the Wolfe or Goldstein conditions. Then, since cos θk 1 for the steepest descent steps, the result (3.21) holds. Of course, we would design the algorithm so that it does something “better" than steepest descent at the other m − 1 iterates. The occasional steepest descent steps may not make much progress, but they at least guarantee overall global convergence. Note that throughout this section we have used only the fact that Zoutendijk’s condition implies the limit (3.16). In later chapters we will make use of the bounded sum condition (3.14), which forces the sequence {cos2 θk ∇ f k 2 } to converge to zero at a sufficiently rapid rate. 3.3 RATE OF CONVERGENCE It would seem that designing optimization algorithms with good convergence properties is easy, since all we need to ensure is that the search direction pk does not tend to become orthogonal to the gradient ∇ f k , or that steepest descent steps are taken regularly. We could simply compute cos θk at every iteration and turn pk toward the steepest descent direction if cos θk is smaller than some preselected constant δ > 0. Angle tests of this type ensure global convergence, but they are undesirable for two reasons. First, they may impede a fast rate of convergence, because for problems with an ill-conditioned Hessian, it may be necessary to produce search directions that are almost orthogonal to the gradient, and an inappropriate choice of the parameter δ may cause such steps to be rejected. Second, angle tests destroy the invariance properties of quasi-Newton methods. Algorithmic strategies that achieve rapid convergence can sometimes conflict with the requirements of global convergence, and vice versa. For example, the steepest descent method is the quintessential globally convergent algorithm, but it is quite slow in practice, as we shall see below. On the other hand, the pure Newton iteration converges rapidly when started close enough to a solution, but its steps may not even be descent directions away from the solution. The challenge is to design algorithms that incorporate both properties: good global convergence guarantees and a rapid rate of convergence. We begin our study of convergence rates of line search methods by considering the most basic approach of all: the steepest descent method. 41 42 CHAPTER 3. Figure 3.7 LINE SEARCH METHODS Steepest descent steps. CONVERGENCE RATE OF STEEPEST DESCENT We can learn much about the steepest descent method by considering the ideal case, in which the objective function is quadratic and the line searches are exact. Let us suppose that f (x) 12 x T Qx − b T x, (3.24) where Q is symmetric and positive definite. The gradient is given by ∇ f (x) Qx − b and the minimizer x ∗ is the unique solution of the linear system Qx b. It is easy to compute the step length αk that minimizes f (xk −α∇ f k ). By differentiating the function 1 f (xk − α∇ f k ) (xk − α∇ f k )T Q(xk − α∇ f k ) − b T (xk − α∇ f k ) 2 with respect to α, and setting the derivative to zero, we obtain αk ∇ f kT ∇ f k . ∇ f kT Q∇ f k (3.25) If we use this exact minimizer αk , the steepest descent iteration for (3.24) is given by xk+1 xk − ∇ f kT ∇ f k ∇ f kT Q∇ f k ∇ fk . (3.26) Since ∇ f k Qxk − b, this equation yields a closed-form expression for xk+1 in terms of xk . In Figure 3.7 we plot a typical sequence of iterates generated by the steepest descent method on a two-dimensional quadratic objective function. The contours of f are ellipsoids whose 3.3. RATE OF CONVERGENCE axes lie along the orthogonal eigenvectors of Q. Note that the iterates zigzag toward the solution. To quantify the rate of convergence we introduce the weighted norm x2Q x T Qx. By using the relation Qx ∗ b, we can show that 1 x 2 − x ∗ 2Q f (x) − f (x ∗ ), (3.27) so this norm measures the difference between the current objective value and the optimal value. By using the equality (3.26) and noting that ∇ f k Q(xk − x ∗ ), we can derive the equality 2 T ∇ f ∇ f k k xk − x ∗ 2Q xk+1 − x ∗ 2Q 1 − T ∇ f k Q∇ f k ∇ f kT Q −1 ∇ f k (3.28) (see Exercise 3.7). This expression describes the exact decrease in f at each iteration, but since the term inside the brackets is difficult to interpret, it is more useful to bound it in terms of the condition number of the problem. Theorem 3.3. When the steepest descent method with exact line searches (3.26) is applied to the strongly convex quadratic function (3.24), the error norm (3.27) satisfies xk+1 − x ∗ 2Q ≤ λn − λ1 λn + λ1 2 xk − x ∗ 2Q , (3.29) where 0 < λ1 ≤ λ2 ≤ · · · ≤ λn are the eigenvalues of Q. The proof of this result is given by Luenberger [195]. The inequalities (3.29) and (3.27) show that the function values f k converge to the minimum f ∗ at a linear rate. As a special case of this result, we see that convergence is achieved in one iteration if all the eigenvalues are equal. In this case, Q is a multiple of the identity matrix, so the contours in Figure 3.7 are circles and the steepest descent direction always points at the solution. In general, as the condition number κ(Q) λn /λ1 increases, the contours of the quadratic become more elongated, the zigzagging in Figure 3.7 becomes more pronounced, and (3.29) implies that the convergence degrades. Even though (3.29) is a worst-case bound, it gives an accurate indication of the behavior of the algorithm when n > 2. The rate-of-convergence behavior of the steepest descent method is essentially the same on general nonlinear objective functions. In the following result we assume that the step length is the global minimizer along the search direction. Theorem 3.4. Suppose that f : IRn → IR is twice continuously differentiable, and that the iterates generated by the steepest-descent method with exact line searches converge to a point x ∗ at 43 44 CHAPTER 3. LINE SEARCH METHODS which the Hessian matrix ∇ 2 f (x ∗ ) is positive definite. Let r be any scalar satisfying λn − λ1 r∈ ,1 , λn + λ1 where λ1 ≤ λ2 ≤ · · · ≤ λn are the eigenvalues of ∇ 2 f (x ∗ ). Then for all k sufficiently large, we have f (xk+1 ) − f (x ∗ ) ≤ r 2 [ f (xk ) − f (x ∗ )]. In general, we cannot expect the rate of convergence to improve if an inexact line search is used. Therefore, Theorem 3.4 shows that the steepest descent method can have an unacceptably slow rate of convergence, even when the Hessian is reasonably well conditioned. For example, if κ(Q) 800, f (x1 ) 1, and f (x ∗ ) 0, Theorem 3.4 suggests that the function value will still be about 0.08 after one thousand iterations of the steepest descent method with exact line search. NEWTON’S METHOD We now consider the Newton iteration, for which the search is given by pkN −∇ 2 f k−1 ∇ f k . (3.30) Since the Hessian matrix ∇ 2 f k may not always be positive definite, pkN may not always be a descent direction, and many of the ideas discussed so far in this chapter no longer apply. In Section 3.4 and Chapter 4 we will describe two approaches for obtaining a globally convergent iteration based on the Newton step: a line search approach, in which the Hessian ∇ 2 f k is modified, if necessary, to make it positive definite and thereby yield descent, and a trust region approach, in which ∇ 2 f k is used to form a quadratic model that is minimized in a ball around the current iterate xk . Here we discuss just the local rate-of-convergence properties of Newton’s method. We know that for all x in the vicinity of a solution point x ∗ such that ∇ 2 f (x ∗ ) is positive definite, the Hessian ∇ 2 f (x) will also be positive definite. Newton’s method will be well defined in this region and will converge quadratically, provided that the step lengths αk are eventually always 1. Theorem 3.5. Suppose that f is twice differentiable and that the Hessian ∇ 2 f (x) is Lipschitz continuous (see (A.42)) in a neighborhood of a solution x ∗ at which the sufficient conditions (Theorem 2.4) are satisfied. Consider the iteration xk+1 xk + pk , where pk is given by (3.30). Then (i) if the starting point x0 is sufficiently close to x ∗ , the sequence of iterates converges to x ∗ ; (ii) the rate of convergence of {xk } is quadratic; and (iii) the sequence of gradient norms {∇ f k } converges quadratically to zero. 3.3. RATE OF CONVERGENCE PROOF. From the definition of the Newton step and the optimality condition ∇ f ∗ 0 we have that xk + pkN − x ∗ xk − x ∗ − ∇ 2 f k−1 ∇ f k ∇ 2 f k−1 ∇ 2 f k (xk − x ∗ ) − (∇ f k − ∇ f ∗ ) . (3.31) Since Taylor’s theorem (Theorem 2.1) tells us that 1 ∇ 2 f (xk + t(x ∗ − xk ))(xk − x ∗ ) dt, ∇ fk − ∇ f∗ 0 we have 2 ∇ f (xk )(xk − x ∗ ) − (∇ f k − ∇ f (x ∗ )) 1 2 2 ∗ ∗ ∇ f (xk ) − ∇ f (xk + t(x − xk )) (xk − x ) dt 0 1 ∇ 2 f (xk ) − ∇ 2 f (xk + t(x ∗ − xk )) xk − x ∗ dt 0 1 ∗ 2 Lt dt 12 Lxk − x ∗ 2 , ≤ xk − x ≤ (3.32) 0 where L is the Lipschitz constant for ∇ 2 f (x) for x near x ∗ . Since ∇ 2 f (x ∗ ) is nonsingular, there is a radius r > 0 such that ∇ 2 f k−1 ≤ 2∇ 2 f (x ∗ )−1 for all xk with xk − x ∗ ≤ r . By substituting in (3.31) and (3.32), we obtain xk + pkN − x ∗ ≤ L∇ 2 f (x ∗ )−1 xk − x ∗ 2 L̃xk − x ∗ 2 , (3.33) where L̃ L∇ 2 f (x ∗ )−1 . Choosing x0 so that x0 − x ∗ ≤ min(r, 1/(2 L̃)), we can use this inequality inductively to deduce that the sequence converges to x ∗ , and the rate of convergence is quadratic. By using the relations xk+1 − xk pkN and ∇ f k + ∇ 2 f k pkN 0, we obtain that ∇ f (xk+1 ) ∇ f (xk+1 ) − ∇ f k − ∇ 2 f (xk ) pkN 1 2 2 N N ∇ f (xk + t pk )(xk+1 − xk ) dt − ∇ f (xk ) pk 0 1 ≤ 0 ∇ 2 f (xk + t p N ) − ∇ 2 f (xk ) p N dt k k ≤ 12 L pkN 2 ≤ 12 L∇ 2 f (xk )−1 2 ∇ f k 2 ≤ 2L∇ 2 f (x ∗ )−1 2 ∇ f k 2 , proving that the gradient norms converge to zero quadratically. 45 46 CHAPTER 3. LINE SEARCH METHODS As the iterates generated by Newton’s method approach the solution, the Wolfe (or Goldstein) conditions will accept the step length αk 1 for all large k. This observation follows from Theorem 3.6 below. Indeed, when the search direction is given by Newton’s method, the limit (3.35) is satisfied—the ratio is zero for all k! Implementations of Newton’s method using these line search conditions, and in which the line search always tries the unit step length first, will set αk 1 for all large k and attain a local quadratic rate of convergence. QUASI-NEWTON METHODS Suppose now that the search direction has the form pk −Bk−1 ∇ f k , (3.34) where the symmetric and positive definite matrix Bk is updated at every iteration by a quasi-Newton updating formula. We already encountered one quasi-Newton formula, the BFGS formula, in Chapter 2; others will be discussed in Chapter 6. We assume here that the step length αk is computed by an inexact line search that satisfies the Wolfe or strong Wolfe conditions, with the same proviso mentioned above for Newton’s method: The line search algorithm will always try the step length α 1 first, and will accept this value if it satisfies the Wolfe conditions. (We could enforce this condition by setting ᾱ 1 in Algorithm 3.1, for example.) This implementation detail turns out to be crucial in obtaining a fast rate of convergence. The following result shows that if the search direction of a quasi-Newton method approximates the Newton direction well enough, then the unit step length will satisfy the Wolfe conditions as the iterates converge to the solution. It also specifies a condition that the search direction must satisfy in order to give rise to a superlinearly convergent iteration. To bring out the full generality of this result, we state it first in terms of a general descent iteration, and then examine its consequences for quasi-Newton and Newton methods. Theorem 3.6. Suppose that f : IRn → IR is twice continuously differentiable. Consider the iteration xk+1 xk + αk pk , where pk is a descent direction and αk satisfies the Wolfe conditions (3.6) with c1 ≤ 1/2. If the sequence {xk } converges to a point x ∗ such that ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) is positive definite, and if the search direction satisfies ∇ f k + ∇ 2 f k pk 0, k→∞ pk lim then (i) the step length αk 1 is admissible for all k greater than a certain index k0 ; and (ii) if αk 1 for all k > k0 , {xk } converges to x ∗ superlinearly. (3.35) 3.3. RATE OF CONVERGENCE It is easy to see that if c1 > 1/2, then the line search would exclude the minimizer of a quadratic, and unit step lengths may not be admissible. If pk is a quasi-Newton search direction of the form (3.34), then (3.35) is equivalent to (Bk − ∇ 2 f (x ∗ )) pk 0. k→∞ pk lim (3.36) Hence, we have the surprising (and delightful) result that a superlinear convergence rate can be attained even if the sequence of quasi-Newton matrices Bk does not converge to ∇ 2 f (x ∗ ); it suffices that the Bk become increasingly accurate approximations to ∇ 2 f (x ∗ ) along the search directions pk . Importantly, condition (3.36) is both necessary and sufficient for the superlinear convergence of quasi-Newton methods. Theorem 3.7. Suppose that f : IRn → IR is twice continuously differentiable. Consider the iteration xk+1 xk + pk (that is, the step length αk is uniformly 1) and that pk is given by (3.34). Let us assume also that {xk } converges to a point x ∗ such that ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) is positive definite. Then {xk } converges superlinearly if and only if (3.36) holds. PROOF. We first show that (3.36) is equivalent to pk − pkN o( pk ), (3.37) where pkN −∇ 2 f k−1 ∇ f k is the Newton step. Assuming that (3.36) holds, we have that pk − pkN ∇ 2 f k−1 (∇ 2 f k pk + ∇ f k ) ∇ 2 f k−1 (∇ 2 f k − Bk ) pk O((∇ 2 f k − Bk ) pk ) o( pk ), where we have used the fact that ∇ 2 f k−1 is bounded above for xk sufficiently close to x ∗ , since the limiting Hessian ∇ 2 f (x ∗ ) is positive definite. The converse follows readily if we multiply both sides of (3.37) by ∇ 2 f k and recall (3.34). By combining (3.33) and (3.37), we obtain that xk + pk − x ∗ ≤ xk + pkN − x ∗ + pk − pkN O(xk − x ∗ 2 ) + o( pk ). A simple manipulation of this inequality reveals that pk O(xk − x ∗ ), so we obtain xk + pk − x ∗ ≤ o(xk − x ∗ ), giving the superlinear convergence result. 47 48 CHAPTER 3. LINE SEARCH METHODS We will see in Chapter 6 that quasi-Newton methods normally satisfy condition (3.36) and are therefore superlinearly convergent. 3.4 NEWTON’S METHOD WITH HESSIAN MODIFICATION Away from the solution, the Hessian matrix ∇ 2 f (x) may not be positive definite, so the Newton direction pkN defined by ∇ 2 f (xk ) pkN −∇ f (xk ) (3.38) (see (3.30)) may not be a descent direction. We now describe an approach to overcome this difficulty when a direct linear algebra technique, such as Gaussian elimination, is used to solve the Newton equations (3.38). This approach obtains the step pk from a linear system identical to (3.38), except that the coefficient matrix is replaced with a positive definite approximation, formed before or during the solution process. The modified Hessian is obtained by adding either a positive diagonal matrix or a full matrix to the true Hessian ∇ 2 f (xk ). A general description of this method follows. Algorithm 3.2 (Line Search Newton with Modification). Given initial point x0 ; for k 0, 1, 2, . . . Factorize the matrix Bk ∇ 2 f (xk ) + E k , where E k 0 if ∇ 2 f (xk ) is sufficiently positive definite; otherwise, E k is chosen to ensure that Bk is sufficiently positive definite; Solve Bk pk −∇ f (xk ); Set xk+1 ← xk + αk pk , where αk satisfies the Wolfe, Goldstein, or Armijo backtracking conditions; end Some approaches do not compute E k explicitly, but rather introduce extra steps and tests into standard factorization procedures, modifying these procedures “on the fly” so that the computed factors are the factors of a positive definite matrix. Strategies based on modifying a Cholesky factorization and on modifying a symmetric indefinite factorization of the Hessian are described in this section. Algorithm 3.2 is a practical Newton method that can be applied from any starting point. We can establish fairly satisfactory global convergence results for it, provided that the strategy for choosing E k (and hence Bk ) satisfies the bounded modified factorization property. This property is that the matrices in the sequence {Bk } have bounded condition number whenever the sequence of Hessians {∇ 2 f (xk )} is bounded; that is, κ(Bk ) Bk Bk−1 ≤ C, some C > 0 and all k 0, 1, 2, . . . . (3.39) 3.4. NEWTON’S METHOD WITH HESSIAN MODIFICATION If this property holds, global convergence of the modified line search Newton method follows from the results of Section 3.2. Theorem 3.8. Let f be twice continuously differentiable on an open set D, and assume that the starting point x0 of Algorithm 3.2 is such that the level set L {x ∈ D : f (x) ≤ f (x0 )} is compact. Then if the bounded modified factorization property holds, we have that lim ∇ f (xk ) 0. k→∞ For a proof this result see [215]. We now consider the convergence rate of Algorithm 3.2. Suppose that the sequence of iterates xk converges to a point x ∗ where ∇ 2 f (x ∗ ) is sufficiently positive definite in the sense that the modification strategies described in the next section return the modification E k 0 for all sufficiently large k. By Theorem 3.6, we have that αk 1 for all sufficiently large k, so that Algorithm 3.2 reduces to a pure Newton method, and the rate of convergence is quadratic. For problems in which ∇ f ∗ is close to singular, there is no guarantee that the modification E k will eventually vanish, and the convergence rate may be only linear. Besides requiring the modified matrix Bk to be well conditioned (so that Theorem 3.8 holds), we would like the modification to be as small as possible, so that the second-order information in the Hessian is preserved as far as possible. Naturally, we would also like the modified factorization to be computable at moderate cost. To set the stage for the matrix factorization techniques that will be used in Algorithm 3.2, we will begin by assuming that the eigenvalue decomposition of ∇ 2 f (xk ) is available. This is not realistic for large-scale problems because this decomposition is generally too expensive to compute, but it will motivate several practical modification strategies. EIGENVALUE MODIFICATION Consider a problem in which, at the current iterate xk , ∇ f (xk ) (1, −3, 2)T and ∇ f (xk ) diag(10, 3, −1), which is clearly indefinite. By the spectral decomposition theorem (see Appendix A) we can define Q I and diag(λ1 , λ2 , λ3 ), and write 2 ∇ 2 f (xk ) QQ T n λi qi qiT . (3.40) i1 The pure Newton step—the solution of (3.38)—is pkN (−0.1, 1, 2)T , which is not a descent direction, since ∇ f (xk )T pkN > 0. One might suggest a modified strategy in which we replace ∇ 2 f (xk ) by a positive definite approximation Bk , in which all negative eigenvalues in ∇ 2 f (xk ) are replaced by a small positive number δ that is somewhat larger than ma√ chine precision u; say δ u. For a machine precision of 10−16 , the resulting matrix in 49 50 CHAPTER 3. LINE SEARCH METHODS our example is Bk 2 λi qi qiT + δq3 q3T diag 10, 3, 10−8 , (3.41) i1 which is numerically positive definite and whose curvature along the eigenvectors q1 and q2 has been preserved. Note, however, that the search direction based on this modified Hessian is pk −Bk−1 ∇ f k − ≈ − 2 × 108 q3 . 2 1 1 T qi qi ∇ f k − q3 q3T ∇ f (xk ) λ δ i1 i (3.42) For small δ, this step is nearly parallel to q3 (with relatively small contributions from q1 and q2 ) and quite long. Although f decreases along the direction pk , its extreme length violates the spirit of Newton’s method, which relies on a quadratic approximation of the objective function that is valid in a neighborhood of the current iterate xk . It is therefore not clear that this search direction is effective. Various other modification strategies are possible. We could flip the signs of the negative eigenvalues in (3.40), which amounts to setting δ 1 in our example. We could set the last term in (3.42) to zero, so that the search direction has no components along the negative curvature directions. We could adapt the choice of δ to ensure that the length of the step is not excessive, a strategy that has the flavor of trust-region methods. As this discussion shows, there is a great deal of freedom in devising modification strategies, and there is currently no agreement on which strategy is best. Setting the issue of the choice of δ aside for the moment, let us look more closely at the process of modifying a matrix so that it becomes positive definite. The modification (3.41) to the example matrix (3.40) can be shown to be optimal in the following sense. If A is a symmetric matrix with spectral decomposition A QQ T , then the correction matrix A of minimum Frobenius norm that ensures that λmin (A + A) ≥ δ is given by 0, λi ≥ δ, T A Q diag (τi )Q , with τi (3.43) δ − λi , λi < δ. Here, λmin (A) denotes the smallest eigenvalue of A, and the Frobenius norm of a matrix is defined as A2F i,n j1 ai2j (see (A.9)). Note that A is not diagonal in general, and that the modified matrix is given by A + A Q( + diag(τi ))Q T . By using a different norm we can obtain a diagonal modification. Suppose again that A is a symmetric matrix with spectral decomposition A QQ T . A correction matrix 3.4. NEWTON’S METHOD WITH HESSIAN MODIFICATION A with minimum Euclidean norm that satisfies λmin (A + A) ≥ δ is given by A τ I, with τ max(0, δ − λmin (A)). (3.44) The modified matrix now has the form A + τ I, (3.45) which happens to have the same form as the matrix occurring in (unscaled) trust–region methods (see Chapter 4). All the eigenvalues of (3.45) have thus been shifted, and all are greater than δ. These results suggest that both diagonal and nondiagonal modifications can be considered. Even though we have not answered the question of what constitutes a good modification, various practical diagonal and nondiagonal modifications have been proposed and implemented in software. They do not make use of the spectral decomposition of the Hessian, since it is generally too expensive to compute. Instead, they use Gaussian elimination, choosing the modifications indirectly and hoping that somehow they will produce good steps. Numerical experience indicates that the strategies described next often (but not always) produce good search directions. ADDING A MULTIPLE OF THE IDENTITY Perhaps the simplest idea is to find a scalar τ > 0 such that ∇ 2 f (xk ) + τ I is sufficiently positive definite. From the previous discussion we know that τ must satisfy (3.44), but a good estimate of the smallest eigenvalue of the Hessian is normally not available. The following algorithm describes a method that tries successively larger values of τ . (Here, aii denotes a diagonal element of A.) Algorithm 3.3 (Cholesky with Added Multiple of the Identity). Choose β > 0; if mini aii > 0 set τ0 ← 0; else τ0 − min(aii ) + β; end (if) for k 0, 1, 2, . . . Attempt to apply the Cholesky algorithm to obtain L L T A + τk I ; if the factorization is completed successfully stop and return L; else τk+1 ← max(2τk , β); end (if) end (for) 51 52 CHAPTER 3. LINE SEARCH METHODS The choice of β is heuristic; a typical value is β 10−3 . We could choose the first nonzero shift τ0 to be proportional to be the final value of τ used in the latest Hessian modification; see also Algorithm B.1. The strategy implemented in Algorithm 3.3 is quite simple and may be preferable to the modified factorization techniques described next, but it suffers from one drawback. Every value of τk requires a new factorization of A + τk I , and the algorithm can be quite expensive if several trial values are generated. Therefore it may be advantageous to increase τ more rapidly, say by a factor of 10 instead of 2 in the last else clause. MODIFIED CHOLESKY FACTORIZATION Another approach for modifying a Hessian matrix that is not positive definite is to perform a Cholesky factorization of ∇ 2 f (xk ), but to increase the diagonal elements encountered during the factorization (where necessary) to ensure that they are sufficiently positive. This modified Cholesky approach is designed to accomplish two goals: It guarantees that the modified Cholesky factors exist and are bounded relative to the norm of the actual Hessian, and it does not modify the Hessian if it is sufficiently positive definite. We begin our description of this approach by briefly reviewing the Cholesky factorization. Every symmetric positive definite matrix A can be written as A L DL T , (3.46) where L is a lower triangular matrix with unit diagonal elements and D is a diagonal matrix with positive elements on the diagonal. By equating the elements in (3.46), column by column, it is easy to derive formulas for computing L and D. ❏ EXAMPLE 3.1 Consider the case n 3. The equation A L DL T is given by ⎡ a11 ⎢ ⎣ a21 a31 a21 a22 a32 a31 ⎤ ⎡ 1 ⎥ ⎢ l a32 ⎦ ⎢ ⎣ 21 l31 a33 0 1 l32 0 ⎤⎡ d1 ⎥ 0 ⎥⎢ ⎦⎣ 0 1 0 0 0 ⎤⎡ 1 d2 ⎥⎢ 0 ⎦⎣ 0 0 d3 0 l21 l31 ⎤ 1 ⎥ l32 ⎦ . 0 1 (The notation indicates that A is symmetric.) By equating the elements of the first column, we have a11 d1 , a21 d1l21 ⇒ l21 a21 /d1 , a31 d1l31 ⇒ l31 a31 /d1 . 3.4. NEWTON’S METHOD WITH HESSIAN MODIFICATION Proceeding with the next two columns, we obtain 2 a22 d1l21 + d2 ⇒ 2 d2 a22 − d1l21 , a32 d1l31l21 + d2l32 ⇒ l32 (a32 − d1l31l21 ) /d2 , a33 ⇒ 2 2 d3 a33 − d1l31 − d2l32 . 2 d1l31 + 2 d2l32 + d3 ❐ This procedure is generalized in the following algorithm. Algorithm 3.4 (Cholesky Factorization, L DL T Form). for j 1, 2, . . . , n j−1 c j j ← a j j − s1 ds l 2js ; dj ← cjj; for i j + 1, . . . , n j−1 ci j ← ai j − s1 ds lis l js ; li j ← ci j /d j ; end end One can show (see, for example, Golub and Van Loan [136, Section 4.2.3]) that the diagonal elements d j j are all positive whenever A is positive definite. The scalars ci j have been introduced only to facilitate the description of the modified factorization discussed below. We should note that Algorithm 3.4 differs a little from the standard form of the Cholesky factorization, which produces a lower triangular matrix M such that A M MT . (3.47) In fact, we can make the identification M L D 1/2 to relate M to the factors L and D computed in Algorithm 3.4. The technique for computing M appears as Algorithm A.2 in Appendix A. If A is indefinite, the factorization A L DL T may not exist. Even if it does exist, Algorithm 3.4 is numerically unstable when applied to such matrices, in the sense that the elements of L and D can become arbitrarily large. It follows that a strategy of computing the L DL T factorization and then modifying the diagonal after the fact to force its elements to be positive may break down, or may result in a matrix that is drastically different from A. Instead, we can modify the matrix A during the course of the factorization in such a way that all elements in D are sufficiently positive, and so that the elements of D and L are not too large. To control the quality of the modification, we choose two positive parameters δ and β, and require that during the computation of the jth columns of L and D in Algorithm 3.4 (that is, for each j in the outer loop of the algorithm) the following 53 54 CHAPTER 3. LINE SEARCH METHODS bounds be satisfied: d j ≥ δ, |m i j | ≤ β, i j + 1, j + 2, . . . , n, (3.48) where m i j li j d j . To satisfy these bounds we only need to change one step in Algorithm 3.4: The formula for computing the diagonal element d j in Algorithm 3.4 is replaced by θj d j max |c j j |, β 2 ,δ , with θ j max |ci j |. j<i≤n (3.49) To verify that (3.48) holds, we note from Algorithm 3.4 that ci j li j d j , and therefore |ci j | |ci j |β |m i j | |li j d j | ≤ ≤ β, θj dj for all i > j. We note that θ j can be computed prior to d j because the elements ci j in the second for loop of Algorithm 3.4 do not involve d j . In fact, this is the reason for introducing the quantities ci j into the algorithm. These observations are the basis of the modified Cholesky algorithm described in detail in Gill, Murray, and Wright [130], which introduces symmetric interchanges of rows and columns to try to reduce the size of the modification. If P denotes the permutation matrix associated with the row and column interchanges, the algorithm produces the Cholesky factorization of the permuted, modified matrix P A P T + E, that is, P A P T + E L DL T M M T , (3.50) where E is a nonnegative diagonal matrix that is zero if A is sufficiently positive definite. One can show (Moré and Sorensen [215]) that the matrices Bk obtained by this modified Cholesky algorithm to the exact Hessians ∇ 2 f (xk ) have bounded condition numbers, that is, the bound (3.39) holds for some value of C. MODIFIED SYMMETRIC INDEFINITE FACTORIZATION Another strategy for modifying an indefinite Hessian is to use a procedure based on a symmetric indefinite factorization. Any symmetric matrix A, whether positive definite or not, can be written as P APT L BLT , (3.51) where L is unit lower triangular, B is a block diagonal matrix with blocks of dimension 1 or 2, and P is a permutation matrix (see our discussion in Appendix A and also Golub and 3.4. NEWTON’S METHOD WITH HESSIAN MODIFICATION Van Loan [136, Section 4.4]). We mentioned earlier that attempting to compute the L DL T factorization of an indefinite matrix (where D is a diagonal matrix) is inadvisable because even if the factors L and D are well defined, they may contain entries that are larger than the original elements of A, thus amplifying rounding errors that arise during the computation. However, by using the block diagonal matrix B, which allows 2 × 2 blocks as well as 1 × 1 blocks on the diagonal, we can guarantee that the factorization (3.51) always exists and can be computed by a numerically stable process. ❏ EXAMPLE 3.2 The matrix ⎡ 0 ⎢ ⎢ 1 A⎢ ⎢ 2 ⎣ 3 1 2 2 2 2 3 2 3 3 ⎤ ⎥ 2 ⎥ ⎥ 3 ⎥ ⎦ 4 can be written in the form (3.51) with P [e1 , e4 , e3 , e2 ], ⎡ 1 ⎢ ⎢ 0 ⎢ 1 L⎢ ⎢ ⎢ 9 ⎣ 2 9 0 0 1 2 3 1 3 0 1 0 0 ⎤ ⎥ 0 ⎥ ⎥ ⎥, 0 ⎥ ⎥ ⎦ 1 ⎡ 0 ⎢ ⎢ 3 ⎢ B⎢ ⎢ 0 ⎢ ⎣ 0 3 0 0 4 0 7 9 5 9 0 5 9 10 9 0 0 ⎤ ⎥ ⎥ ⎥ ⎥. ⎥ ⎥ ⎦ (3.52) Note that both diagonal blocks in B are 2 × 2. Several algorithms for computing symmetric indefinite factorizations are discussed in Section A.1 of Appendix A. ❐ The symmetric indefinite factorization allows us to determine the inertia of a matrix, that is, the number of positive, zero, and negative eigenvalues. One can show that the inertia of B equals the inertia of A. Moreover, the 2 × 2 blocks in B are always constructed to have one positive and one negative eigenvalue. Thus the number of positive eigenvalues in A equals the number of positive 1 × 1 blocks plus the number of 2 × 2 blocks. As for the Cholesky factorization, an indefinite symmetric factorization algorithm can be modified to ensure that the modified factors are the factors of a positive definite matrix. The strategy is first to compute the factorization (3.51), as well as the spectral decomposition B QQ T , which is inexpensive to compute because B is block diagonal 55 56 CHAPTER 3. LINE SEARCH METHODS (see Exercise 3.12). We then construct a modification matrix F such that L(B + F)L T is sufficiently positive definite. Motivated by the modified spectral decomposition (3.43), we choose a parameter δ > 0 and define F to be F Q diag(τi ) Q , T τi 0, λi ≥ δ, δ − λi , λi < δ, i 1, 2, . . . , n, (3.53) where λi are the eigenvalues of B. The matrix F is thus the modification of minimum Frobenius norm that ensures that all eigenvalues of the modified matrix B + F are no less than δ. This strategy therefore modifies the factorization (3.51) as follows: P(A + E)P T L(B + F)L T , where E P T L F L T P. (Note that E will not be diagonal, in general.) Hence, in contrast to the modified Cholesky approach, this modification strategy changes the entire matrix A, not just its diagonal. The aim of strategy (3.53) is that the modified matrix satisfies λmin (A + E) ≈ δ whenever the original matrix A has λmin (A) < δ. It is not clear, however, whether it always comes close to attaining this goal. 3.5 STEP-LENGTH SELECTION ALGORITHMS We now consider techniques for finding a minimum of the one-dimensional function φ(α) f (xk + αpk ), (3.54) or for simply finding a step length αk satisfying one of the termination conditions described in Section 3.1. We assume that pk is a descent direction—that is, φ (0) < 0—so that our search can be confined to positive values of α. If f is a convex quadratic, f (x) 12 x T Qx − b T x, its one-dimensional minimizer along the ray xk + αpk can be computed analytically and is given by αk − ∇ f kT pk . pkT Qpk (3.55) For general nonlinear functions, it is necessary to use an iterative procedure. The line search procedure deserves particular attention because it has a major impact on the robustness and efficiency of all nonlinear optimization methods. 3.5. STEP-LENGTH SELECTION ALGORITHMS Line search procedures can be classified according to the type of derivative information they use. Algorithms that use only function values can be inefficient since, to be theoretically sound, they need to continue iterating until the search for the minimizer is narrowed down to a small interval. In contrast, knowledge of gradient information allows us to determine whether a suitable step length has been located, as stipulated, for example, by the Wolfe conditions (3.6) or Goldstein conditions (3.11). Often, particularly when xk is close to the solution, the very first choice of α satisfies these conditions, so the line search need not be invoked at all. In the rest of this section, we discuss only algorithms that make use of derivative information. More information on derivative-free procedures is given in the notes at the end of this chapter. All line search procedures require an initial estimate α0 and generate a sequence {αi } that either terminates with a step length satisfying the conditions specified by the user (for example, the Wolfe conditions) or determines that such a step length does not exist. Typical procedures consist of two phases: a bracketing phase that finds an interval [ā, b̄] containing acceptable step lengths, and a selection phase that zooms in to locate the final step length. The selection phase usually reduces the bracketing interval during its search for the desired step length and interpolates some of the function and derivative information gathered on earlier steps to guess the location of the minimizer. We first discuss how to perform this interpolation. In the following discussion we let αk and αk−1 denote the step lengths used at iterations k and k − 1 of the optimization algorithm, respectively. On the other hand, we denote the trial step lengths generated during the line search by αi and αi−1 and also α j . We use α0 to denote the initial guess. INTERPOLATION We begin by describing a line search procedure based on interpolation of known function and derivative values of the function φ. This procedure can be viewed as an enhancement of Algorithm 3.1. The aim is to find a value of α that satisfies the sufficient decrease condition (3.6a), without being “too small.” Accordingly, the procedures here generate a decreasing sequence of values αi such that each value αi is not too much smaller than its predecessor αi−1 . Note that we can write the sufficient decrease condition in the notation of (3.54) as φ(αk ) ≤ φ(0) + c1 αk φ (0), (3.56) and that since the constant c1 is usually chosen to be small in practice (c1 10−4 , say), this condition asks for little more than descent in f . We design the procedure to be “efficient” in the sense that it computes the derivative ∇ f (x) as few times as possible. Suppose that the initial guess α0 is given. If we have φ(α0 ) ≤ φ(0) + c1 α0 φ (0), 57 58 CHAPTER 3. LINE SEARCH METHODS this step length satisfies the condition, and we terminate the search. Otherwise, we know that the interval [0, α0 ] contains acceptable step lengths (see Figure 3.3). We form a quadratic approximation φq (α) to φ by interpolating the three pieces of information available—φ(0), φ (0), and φ(α0 )—to obtain φq (α) φ(α0 ) − φ(0) − α0 φ (0) α 2 + φ (0)α + φ(0). α02 (3.57) (Note that this function is constructed so that it satisfies the interpolation conditions φq (0) φ(0), φq (0) φ (0), and φq (α0 ) φ(α0 ).) The new trial value α1 is defined as the minimizer of this quadratic, that is, we obtain α1 − φ (0)α02 . 2 [φ(α0 ) − φ(0) − φ (0)α0 ] (3.58) If the sufficient decrease condition (3.56) is satisfied at α1 , we terminate the search. Otherwise, we construct a cubic function that interpolates the four pieces of information φ(0), φ (0), φ(α0 ), and φ(α1 ), obtaining φc (α) aα 3 + bα 2 + αφ (0) + φ(0), where a b 1 2 2 α0 α1 (α1 − α0 ) α02 −α12 −α03 α13 φ(α1 ) − φ(0) − φ (0)α1 φ(α0 ) − φ(0) − φ (0)α0 . By differentiating φc (x), we see that the minimizer α2 of φc lies in the interval [0, α1 ] and is given by α2 −b + b2 − 3aφ (0) . 3a If necessary, this process is repeated, using a cubic interpolant of φ(0), φ (0) and the two most recent values of φ, until an α that satisfies (3.56) is located. If any αi is either too close to its predecessor αi−1 or else too much smaller than αi−1 , we reset αi αi−1 /2. This safeguard procedure ensures that we make reasonable progress on each iteration and that the final α is not too small. The strategy just described assumes that derivative values are significantly more expensive to compute than function values. It is often possible, however, to compute the directional derivative simultaneously with the function, at little additional cost; see Chapter 8. Accordingly, we can design an alternative strategy based on cubic interpolation of the values of φ and φ at the two most recent values of α. 3.5. STEP-LENGTH SELECTION ALGORITHMS Cubic interpolation provides a good model for functions with significant changes of curvature. Suppose we have an interval [ā, b̄] known to contain desirable step lengths, and two previous step length estimates αi−1 and αi in this interval. We use a cubic function to interpolate φ(αi−1 ), φ (αi−1 ), φ(αi ), and φ (αi ). (This cubic function always exists and is unique; see, for example, Bulirsch and Stoer [41, p. 52].) The minimizer of this cubic in [ā, b̄] is either at one of the endpoints or else in the interior, in which case it is given by φ (αi ) + d2 − d1 , (3.59) αi+1 αi − (αi − αi−1 ) φ (αi ) − φ (αi−1 ) + 2d2 with d1 φ (αi−1 ) + φ (αi ) − 3 φ(αi−1 ) − φ(αi ) , αi−1 − αi d2 sign(αi − αi−1 ) d12 − φ (αi−1 )φ (αi ) 1/2 . The interpolation process can be repeated by discarding the data at one of the step lengths αi−1 or αi and replacing it by φ(αi+1 ) and φ (αi+1 ). The decision on which of αi−1 and αi should be kept and which discarded depends on the specific conditions used to terminate the line search; we discuss this issue further below in the context of the Wolfe conditions. Cubic interpolation is a powerful strategy, since it usually produces a quadratic rate of convergence of the iteration (3.59) to the minimizing value of α. INITIAL STEP LENGTH For Newton and quasi-Newton methods, the step α0 1 should always be used as the initial trial step length. This choice ensures that unit step lengths are taken whenever they satisfy the termination conditions and allows the rapid rate-of-convergence properties of these methods to take effect. For methods that do not produce well scaled search directions, such as the steepest descent and conjugate gradient methods, it is important to use current information about the problem and the algorithm to make the initial guess. A popular strategy is to assume that the first-order change in the function at iterate xk will be the same as that obtained at the previT pk−1 , ous step. In other words, we choose the initial guess α0 so that α0 ∇ f kT pk αk−1 ∇ f k−1 that is, α0 αk−1 T ∇ f k−1 pk−1 ∇ f kT pk . Another useful strategy is to interpolate a quadratic to the data f (xk−1 ), f (xk ), and T pk−1 and to define α0 to be its minimizer. This strategy yields ∇ f k−1 α0 2( f k − f k−1 ) . φ (0) (3.60) 59 60 CHAPTER 3. LINE SEARCH METHODS It can be shown that if xk → x ∗ superlinearly, then the ratio in this expression converges to 1. If we adjust the choice (3.60) by setting α0 ← min(1, 1.01α0 ), we find that the unit step length α0 1 will eventually always be tried and accepted, and the superlinear convergence properties of Newton and quasi-Newton methods will be observed. A LINE SEARCH ALGORITHM FOR THE WOLFE CONDITIONS The Wolfe (or strong Wolfe) conditions are among the most widely applicable and useful termination conditions. We now describe in some detail a one-dimensional search procedure that is guaranteed to find a step length satisfying the strong Wolfe conditions (3.7) for any parameters c1 and c2 satisfying 0 < c1 < c2 < 1. As before, we assume that p is a descent direction and that f is bounded below along the direction p. The algorithm has two stages. This first stage begins with a trial estimate α1 , and keeps increasing it until it finds either an acceptable step length or an interval that brackets the desired step lengths. In the latter case, the second stage is invoked by calling a function called zoom (Algorithm 3.6, below), which successively decreases the size of the interval until an acceptable step length is identified. A formal specification of the line search algorithm follows. We refer to (3.7a) as the sufficient decrease condition and to (3.7b) as the curvature condition. The parameter αmax is a user-supplied bound on the maximum step length allowed. The line search algorithm terminates with α∗ set to a step length that satisfies the strong Wolfe conditions. Algorithm 3.5 (Line Search Algorithm). Set α0 ← 0, choose αmax > 0 and α1 ∈ (0, αmax ); i ← 1; repeat Evaluate φ(αi ); if φ(αi ) > φ(0) + c1 αi φ (0) or [φ(αi ) ≥ φ(αi−1 ) and i > 1] α∗ ←zoom(αi−1 , αi ) and stop; Evaluate φ (αi ); if |φ (αi )| ≤ −c2 φ (0) set α∗ ← αi and stop; if φ (αi ) ≥ 0 set α∗ ←zoom(αi , αi−1 ) and stop; Choose αi+1 ∈ (αi , αmax ); i ← i + 1; end (repeat) 3.5. STEP-LENGTH SELECTION ALGORITHMS Note that the sequence of trial step lengths {αi } is monotonically increasing, but that the order of the arguments supplied to the zoom function may vary. The procedure uses the knowledge that the interval (αi−1 , αi ) contains step lengths satisfying the strong Wolfe conditions if one of the following three conditions is satisfied: (i) αi violates the sufficient decrease condition; (ii) φ(αi ) ≥ φ(αi−1 ); (iii) φ (αi ) ≥ 0. The last step of the algorithm performs extrapolation to find the next trial value αi+1 . To implement this step we can use approaches like the interpolation procedures above, or we can simply set αi+1 to some constant multiple of αi . Whichever strategy we use, it is important that the successive steps increase quickly enough to reach the upper limit αmax in a finite number of iterations. We now specify the function zoom, which requires a little explanation. The order of its input arguments is such that each call has the form zoom(αlo , αhi ), where (a) the interval bounded by αlo and αhi contains step lengths that satisfy the strong Wolfe conditions; (b) αlo is, among all step lengths generated so far and satisfying the sufficient decrease condition, the one giving the smallest function value; and (c) αhi is chosen so that φ (αlo )(αhi − αlo ) < 0. Each iteration of zoom generates an iterate α j between αlo and αhi , and then replaces one of these endpoints by α j in such a way that the properties (a), (b), and (c) continue to hold. Algorithm 3.6 (zoom). repeat Interpolate (using quadratic, cubic, or bisection) to find a trial step length α j between αlo and αhi ; Evaluate φ(α j ); if φ(α j ) > φ(0) + c1 α j φ (0) or φ(α j ) ≥ φ(αlo ) αhi ← α j ; else Evaluate φ (α j ); if |φ (α j )| ≤ −c2 φ (0) Set α∗ ← α j and stop; if φ (α j )(αhi − αlo ) ≥ 0 αhi ← αlo ; αlo ← α j ; end (repeat) 61 62 CHAPTER 3. LINE SEARCH METHODS If the new estimate α j happens to satisfy the strong Wolfe conditions, then zoom has served its purpose of identifying such a point, so it terminates with α∗ α j . Otherwise, if α j satisfies the sufficient decrease condition and has a lower function value than xlo , then we set αlo ← α j to maintain condition (b). If this setting results in a violation of condition (c), we remedy the situation by setting αhi to the old value of αlo . Readers should sketch some graphs to see for themselves how zoom works! As mentioned earlier, the interpolation step that determines α j should be safeguarded to ensure that the new step length is not too close to the endpoints of the interval. Practical line search algorithms also make use of the properties of the interpolating polynomials to make educated guesses of where the next step length should lie; see [39, 216]. A problem that can arise is that as the optimization algorithm approaches the solution, two consecutive function values f (xk ) and f (xk−1 ) may be indistinguishable in finite-precision arithmetic. Therefore, the line search must include a stopping test if it cannot attain a lower function value after a certain number (typically, ten) of trial step lengths. Some procedures also stop if the relative change in x is close to machine precision, or to some user-specified threshold. A line search algorithm that incorporates all these features is difficult to code. We advocate the use of one of the several good software implementations available in the public domain. See Dennis and Schnabel [92], Lemaréchal [189], Fletcher [101], Moré and Thuente [216] (in particular), and Hager and Zhang [161]. One may ask how much more expensive it is to require the strong Wolfe conditions instead of the regular Wolfe conditions. Our experience suggests that for a “loose” line search (with parameters such as c1 10−4 and c2 0.9), both strategies require a similar amount of work. The strong Wolfe conditions have the advantage that by decreasing c2 we can directly control the quality of the search, by forcing the accepted value of α to lie closer to a local minimum. This feature is important in steepest descent or nonlinear conjugate gradient methods, and therefore a step selection routine that enforces the strong Wolfe conditions has wide applicability. NOTES AND REFERENCES For an extensive discussion of line search termination conditions see Ortega and Rheinboldt [230]. Akaike [2] presents a probabilistic analysis of the steepest descent method with exact line searches on quadratic functions. He shows that when n > 2, the worst-case bound (3.29) can be expected to hold for most starting points. The case n 2 can be studied in closed form; see Bazaraa, Sherali, and Shetty [14]. Theorem 3.6 is due to Dennis and Moré. Some line search methods (see Goldfarb [132] and Moré and Sorensen [213]) compute a direction of negative curvature, whenever it exists, to prevent the iteration from converging to nonminimizing stationary points. A direction of negative curvature p− is one that satisfies p−T ∇ 2 f (xk ) p− < 0. These algorithms generate a search direction by combining p− with the steepest descent direction −∇ f k , often performing a curvilinear backtracking line search. 3.5. STEP-LENGTH SELECTION ALGORITHMS It is difficult to determine the relative contributions of the steepest descent and negative curvature directions. Because of this fact, the approach fell out of favor after the introduction of trust-region methods. For a more thorough treatment of the modified Cholesky factorization see Gill, Murray, and Wright [130] or Dennis and Schnabel [92]. A modified Cholesky factorization based on Gershgorin disk estimates is described in Schnabel and Eskow [276]. The modified indefinite factorization is from Cheng and Higham [58]. Another strategy for implementing a line search Newton method when the Hessian contains negative eigenvalues is to compute a direction of negative curvature and use it to define the search direction (see Moré and Sorensen [213] and Goldfarb [132]). Derivative-free line search algorithms include golden section and Fibonacci search. They share some of the features with the line search method given in this chapter. They typically store three trial points that determine an interval containing a one-dimensional minimizer. Golden section and Fibonacci differ in the way in which the trial step lengths are generated; see, for example, [79, 39]. Our discussion of interpolation follows Dennis and Schnabel [92], and the algorithm for finding a step length satisfying the strong Wolfe conditions can be found in Fletcher [101]. ✐ EXERCISES ✐ 3.1 Program the steepest descent and Newton algorithms using the backtracking line search, Algorithm 3.1. Use them to minimize the Rosenbrock function (2.22). Set the initial step length α0 1 and print the step length used by each method at each iteration. First try the initial point x0 (1.2, 1.2)T and then the more difficult starting point x0 (−1.2, 1)T . ✐ 3.2 Show that if 0 < c2 < c1 < 1, there may be no step lengths that satisfy the Wolfe conditions. ✐ 3.3 Show that the one-dimensional minimizer of a strongly convex quadratic function is given by (3.55). ✐ 3.4 Show that the one-dimensional minimizer of a strongly convex quadratic function always satisfies the Goldstein conditions (3.11). ✐ 3.5 Prove that Bx ≥ x/B −1 for any nonsingular matrix B. Use this fact to establish (3.19). ✐ 3.6 Consider the steepest descent method with exact line searches applied to the convex quadratic function (3.24). Using the properties given in this chapter, show that if the initial point is such that x0 − x ∗ is parallel to an eigenvector of Q, then the steepest descent method will find the solution in one step. 63 64 CHAPTER 3. LINE SEARCH METHODS ✐ 3.7 Prove the result (3.28) by working through the following steps. First, use (3.26) to show that xk − x ∗ 2Q − xk+1 − x ∗ 2Q 2αk ∇ f kT Q(xk − x ∗ ) − αk2 ∇ f kT Q∇ f k , where · Q is defined by (3.27). Second, use the fact that ∇ f k Q(xk − x ∗ ) to obtain xk − x ∗ 2Q − xk+1 − x ∗ 2Q (∇ f kT ∇ f k )2 2(∇ f kT ∇ f k )2 − (∇ f kT Q∇ f k ) (∇ f kT Q∇ f k ) and xk − x ∗ 2Q ∇ f kT Q −1 ∇ f k . ✐ 3.8 Let Q be a positive definite symmetric matrix. Prove that for any vector x, we have (x T (x T x)2 4λn λ1 ≥ , Qx)(x T Q −1 x) (λn + λ1 )2 where λn and λ1 are, respectively, the largest and smallest eigenvalues of Q. (This relation, which is known as the Kantorovich inequality, can be used to deduce (3.29) from (3.28).) ✐ 3.9 Program the BFGS algorithm using the line search algorithm described in this chapter that implements the strong Wolfe conditions. Have the code verify that ykT sk is always positive. Use it to minimize the Rosenbrock function using the starting points given in Exercise 3.1. ✐ 3.10 Compute the eigenvalues of the 2 diagonal blocks of (3.52) and verify that each block has a positive and a negative eigenvalue. Then compute the eigenvalues of A and verify that its inertia is the same as that of B. ✐ 3.11 Describe the effect that the modified Cholesky factorization (3.50) would have on the Hessian ∇ 2 f (xk ) diag(−2, 12, 4). ✐ 3.12 Consider a block diagonal matrix B with 1 × 1 and 2 × 2 blocks. Show that the eigenvalues and eigenvectors of B can be obtained by computing the spectral decomposition of each diagonal block separately. ✐ 3.13 Show that the quadratic function that interpolates φ(0), φ (0), and φ(α0 ) is given by (3.57). Then, make use of the fact that the sufficient decrease condition (3.6a) is not satisfied at α0 to show that this quadratic has positive curvature and that the minimizer satisfies α1 < α0 . 2(1 − c1 ) 3.5. STEP-LENGTH SELECTION ALGORITHMS Since c1 is chosen to be quite small in practice, this inequality indicates that α1 cannot be much greater than 12 (and may be smaller), which gives us an idea of the new step length. ✐ 3.14 If φ(α0 ) is large, (3.58) shows that α1 can be quite small. Give an example of a function and a step length α0 for which this situation arises. (Drastic changes to the estimate of the step length are not desirable, since they indicate that the current interpolant does not provide a good approximation to the function and that it should be modified before being trusted to produce a good step length estimate. In practice, one imposes a lower bound— typically, ρ 0.1—and defines the new step length as αi max(ραi−1 , α̂i ), where α̂i is the minimizer of the interpolant.) ✐ 3.15 Suppose that the sufficient decrease condition (3.6a) is not satisfied at the step lengths α0 , and α1 , and consider the cubic interpolating φ(0), φ (0), φ(α0 ) and φ(α1 ). By drawing graphs illustrating the two situations that can arise, show that the minimizer of the cubic lies in [0, α1 ]. Then show that if φ(0) < φ(α1 ), the minimizer is less than 23 α1 . 65 This is pag Printer: O CHAPTER 4 Trust-Region Methods Line search methods and trust-region methods both generate steps with the help of a quadratic model of the objective function, but they use this model in different ways. Line search methods use it to generate a search direction, and then focus their efforts on finding a suitable step length α along this direction. Trust-region methods define a region around the current iterate within which they trust the model to be an adequate representation of the objective function, and then choose the step to be the approximate minimizer of the model in this region. In effect, they choose the direction and length of the step simultaneously. If a step is not acceptable, they reduce the size of the region and find a new CHAPTER 4. TRUST-REGION METHODS minimizer. In general, the direction of the step changes whenever the size of the trust region is altered. The size of the trust region is critical to the effectiveness of each step. If the region is too small, the algorithm misses an opportunity to take a substantial step that will move it much closer to the minimizer of the objective function. If too large, the minimizer of the model may be far from the minimizer of the objective function in the region, so we may have to reduce the size of the region and try again. In practical algorithms, we choose the size of the region according to the performance of the algorithm during previous iterations. If the model is consistently reliable, producing good steps and accurately predicting the behavior of the objective function along these steps, the size of the trust region may be increased to allow longer, more ambitious, steps to be taken. A failed step is an indication that our model is an inadequate representation of the objective function over the current trust region. After such a step, we reduce the size of the region and try again. Figure 4.1 illustrates the trust-region approach on a function f of two variables in which the current point xk and the minimizer x ∗ lie at opposite ends of a curved valley. The quadratic model function m k , whose elliptical contours are shown as dashed lines, is constructed from function and derivative information at xk and possibly also on information accumulated from previous iterations and steps. A line search method based on this model searches along the step to the minimizer of m k (shown), but this direction will yield at most a small reduction in f , even if the optimal steplength is used. The trust-region method steps to the minimizer of m k within the dotted circle (shown), yielding a more significant reduction in f and better progress toward the solution. In this chapter, we will assume that the model function m k that is used at each iterate xk is quadratic. Moreover, m k is based on the Taylor-series expansion of f around Trust region Line search direction contours of mk Trust region step contours of f Figure 4.1 Trust-region and line search steps. 67 68 CHAPTER 4. TRUST-REGION METHODS xk , which is f (xk + p) f k + gkT p + 12 p T ∇ 2 f (xk + t p) p, (4.1) where f k f (xk ) and gk ∇ f (xk ), and t is some scalar in the interval (0, 1). By using an approximation Bk to the Hessian in the second-order term, m k is defined as follows: m k ( p) f k + gkT p + 12 p T Bk p, (4.2) where Bk is some symmetric matrix. The difference between m k ( p) and f (xk + p) is O p2 , which is small when p is small. When Bk is equal to the true Hessian ∇ 2 f (xk ), the approximation error in the model function m k is O p3 , so this model is especially accurate when p is small. This choice Bk ∇ 2 f (xk ) leads to the trust-region Newton method, and will be discussed further in Section 4.4. In other sections of this chapter, we emphasize the generality of the trust-region approach by assuming little about Bk except symmetry and uniform boundedness. To obtain each step, we seek a solution of the subproblem minn m k ( p) f k + gkT p + 12 p T Bk p p∈IR s.t. p ≤ k , (4.3) where k > 0 is the trust-region radius. In most of our discussions, we define · to be the Euclidean norm, so that the solution pk∗ of (4.3) is the minimizer of m k in the ball of radius k . Thus, the trust-region approach requires us to solve a sequence of subproblems (4.3) in which the objective function and constraint (which can be written as p T p ≤ 2k ) are both quadratic. When Bk is positive definite and Bk−1 gk ≤ k , the solution of (4.3) is easy to identify—it is simply the unconstrained minimum pkB −Bk−1 gk of the quadratic m k ( p). In this case, we call pkB the full step. The solution of (4.3) is not so obvious in other cases, but it can usually be found without too much computational expense. In any case, as described below, we need only an approximate solution to obtain convergence and good practical behavior. OUTLINE OF THE TRUST-REGION APPROACH One of the key ingredients in a trust-region algorithm is the strategy for choosing the trust-region radius k at each iteration. We base this choice on the agreement between the model function m k and the objective function f at previous iterations. Given a step pk we define the ratio ρk f (xk ) − f (xk + pk ) ; m k (0) − m k ( pk ) (4.4) the numerator is called the actual reduction, and the denominator is the predicted reduction (that is, the reduction in f predicted by the model function). Note that since the step pk CHAPTER 4. TRUST-REGION METHODS is obtained by minimizing the model m k over a region that includes p 0, the predicted reduction will always be nonnegative. Hence, if ρk is negative, the new objective value f (xk + pk ) is greater than the current value f (xk ), so the step must be rejected. On the other hand, if ρk is close to 1, there is good agreement between the model m k and the function f over this step, so it is safe to expand the trust region for the next iteration. If ρk is positive but significantly smaller than 1, we do not alter the trust region, but if it is close to zero or negative, we shrink the trust region by reducing k at the next iteration. The following algorithm describes the process. Algorithm 4.1 (Trust Region). ˆ > 0, 0 ∈ (0, ), ˆ and η ∈ 0, 1 : Given 4 for k 0, 1, 2, . . . Obtain pk by (approximately) solving (4.3); Evaluate ρk from (4.4); if ρk < 14 k+1 14 k else if ρk > 34 and pk k ˆ k+1 min(2k , ) else k+1 k ; if ρk > η xk+1 xk + pk else xk+1 xk ; end (for). ˆ is an overall bound on the step lengths. Note that the radius is increased only if pk Here actually reaches the boundary of the trust region. If the step stays strictly inside the region, we infer that the current value of k is not interfering with the progress of the algorithm, so we leave its value unchanged for the next iteration. To turn Algorithm 4.1 into a practical algorithm, we need to focus on solving the trust-region subproblem (4.3). In discussing this matter, we sometimes drop the iteration subscript k and restate the problem (4.3) as follows: def minn m( p) f + g T p + 12 p T Bp p∈IR s.t. p ≤ . (4.5) A first step to characterizing exact solutions of (4.5) is given by the following theorem (due to Moré and Sorensen [214]), which shows that the solution p ∗ of (4.5) satisfies (B + λI ) p ∗ −g for some λ ≥ 0. (4.6) 69 70 CHAPTER 4. TRUST-REGION METHODS Theorem 4.1. The vector p ∗ is a global solution of the trust-region problem minn m( p) f + g T p + 12 p T Bp, p∈IR s.t. p ≤ , (4.7) if and only if p ∗ is feasible and there is a scalar λ ≥ 0 such that the following conditions are satisfied: (B + λI ) p ∗ −g, (4.8a) ∗ λ( − || p ||) 0, (4.8b) (B + λI ) (4.8c) is positive semidefinite. We delay the proof of this result until Section 4.3, and instead discuss just its key features here with the help of Figure 4.2. The condition (4.8b) is a complementarity condition that states that at least one of the nonnegative quantities λ and ( − p ∗ ) must be zero. Hence, when the solution lies strictly inside the trust region (as it does when 1 in Figure 4.2), we must have λ 0 and so Bp ∗ −g with B positive semidefinite, from (4.8a) and (4.8c), respectively. In the other cases 2 and 3 , we have p ∗ , and so λ is allowed to take a positive value. Note from (4.8a) that λp ∗ −Bp ∗ − g −∇m( p ∗ ). ∆1 ∆2 ∆3 contours of m p*1 Figure 4.2 p*2 p*3 Solution of trust-region subproblem for different radii 1 , 2 , 3 . 4.1. ALGORITHMS BASED ON THE CAUCHY POINT Thus, when λ > 0, the solution p ∗ is collinear with the negative gradient of m and normal to its contours. These properties can be seen in Figure 4.2. In Section 4.1, we describe two strategies for finding approximate solutions of the subproblem (4.3), which achieve at least as much reduction in m k as the reduction achieved by the so-called Cauchy point. This point is simply the minimizer of m k along the steepest descent direction −gk . subject to the trust-region bound. The first approximate strategy is the dogleg method, which is appropriate when the model Hessian Bk is positive definite. The second strategy, known as two-dimensional subspace minimization, can be applied when Bk is indefinite, though it requires an estimate of the most negative eigenvalue of this matrix. A third strategy, described in Section 7.1, uses an approach based on the conjugate gradient method to minimize m k , and can therefore be applied when B is large and sparse. Section 4.3 is devoted to a strategy in which an iterative method is used to identify the value of λ for which (4.6) is satisfied by the solution of the subproblem. We prove global convergence results in Section 4.2. Section 4.4 discusses the trust-region Newton method, in which the Hessian Bk of the model function is equal to the Hessian ∇ 2 f (xk ) of the objective function. The key result of this section is that, when the trust-region Newton algorithm converges to a point x ∗ satisfying second-order sufficient conditions, it converges superlinearly. 4.1 ALGORITHMS BASED ON THE CAUCHY POINT THE CAUCHY POINT As we saw in Chapter 3, line search methods can be globally convergent even when the optimal step length is not used at each iteration. In fact, the step length αk need only satisfy fairly loose criteria. A similar situation applies in trust-region methods. Although in principle we seek the optimal solution of the subproblem (4.3), it is enough for purposes of global convergence to find an approximate solution pk that lies within the trust region and gives a sufficient reduction in the model. The sufficient reduction can be quantified in terms of the Cauchy point, which we denote by pkC and define in terms of the following simple procedure. Algorithm 4.2 (Cauchy Point Calculation). Find the vector pkS that solves a linear version of (4.3), that is, pkS arg minn f k + gkT p p∈IR s.t. p ≤ k ; (4.9) Calculate the scalar τk > 0 that minimizes m k (τ pkS ) subject to satisfying the trust-region bound, that is, τk arg min m k (τ pkS ) τ ≥0 Set pkC τk pkS . s.t. τ pkS ≤ k ; (4.10) 71 72 CHAPTER 4. TRUST-REGION METHODS It is easy to write down a closed-form definition of the Cauchy point. For a start, the solution of (4.9) is simply pkS − k gk . gk To obtain τk explicitly, we consider the cases of gkT Bk gk ≤ 0 and gkT Bk gk > 0 separately. For the former case, the function m k (τ pkS ) decreases monotonically with τ whenever gk 0, so τk is simply the largest value that satisfies the trust-region bound, namely, τk 1. For the case gkT Bk gk > 0, m k (τ pkS ) is a convex quadratic in τ , so τk is either the unconstrained minimizer of this quadratic, gk 3 /(k gkT Bk gk ), or the boundary value 1, whichever comes first. In summary, we have pkC −τk k gk , gk (4.11) where τk 1 min gk 3 /(k gkT Bk gk ), 1 if gkT Bk gk ≤ 0; otherwise. (4.12) Figure 4.3 illustrates the Cauchy point for a subproblem in which Bk is positive definite. In this example, pkC lies strictly inside the trust region. The Cauchy step pkC is inexpensive to calculate—no matrix factorizations are required—and is of crucial importance in deciding if an approximate solution of the trust-region subproblem is acceptable. Specifically, a trust-region method will be globally Trust region contours of mk pC k —gk Figure 4.3 The Cauchy point. 4.1. ALGORITHMS BASED ON THE CAUCHY POINT convergent if its steps pk give a reduction in the model m k that is at least some fixed positive multiple of the decrease attained by the Cauchy step. IMPROVING ON THE CAUCHY POINT Since the Cauchy point pkC provides sufficient reduction in the model function m k to yield global convergence, and since the cost of calculating it is so small, why should we look any further for a better approximate solution of (4.3)? The reason is that by always taking the Cauchy point as our step, we are simply implementing the steepest descent method with a particular choice of step length. As we have seen in Chapter 3, steepest descent performs poorly even if an optimal step length is used at each iteration. The Cauchy point does not depend very strongly on the matrix Bk , which is used only in the calculation of the step length. Rapid convergence can be expected only if Bk plays a role in determining the direction of the step as well as its length, and if Bk contains valid curvature information about the function. A number of trust-region algorithms compute the Cauchy point and then try to improve on it. The improvement strategy is often designed so that the full step pkB −Bk−1 gk is chosen whenever Bk is positive definite and pkB ≤ k . When Bk is the exact Hessian ∇ 2 f (xk ) or a quasi-Newton approximation, this strategy can be expected to yield superlinear convergence. We now consider three methods for finding approximate solutions to (4.3) that have the features just described. Throughout this section we will be focusing on the internal workings of a single iteration, so we simplify the notation by dropping the subscript “k” from the quantities k , pk , m k , and gk and refer to the formulation (4.5) of the subproblem. In this section, we denote the solution of (4.5) by p ∗ (), to emphasize the dependence on . THE DOGLEG METHOD The first approach we discuss goes by the descriptive title of the dogleg method. It can be used when B is positive definite. To motivate this method, we start by examining the effect of the trust-region radius on the solution p ∗ () of the subproblem (4.5). When B is positive definite, we have already noted that the unconstrained minimizer of m is p B −B −1 g. When this point is feasible for (4.5), it is obviously a solution, so we have p ∗ () p B , when ≥ p B . (4.13) When is small relative to p B , the restriction p ≤ ensures that the quadratic term in m has little effect on the solution of (4.5). For such , we can get an approximation to p() 73 74 CHAPTER 4. TRUST-REGION METHODS Trust region Optimal trajectory p (∆ ) pB ( full step ) pU ( unconstrained min along —g) —g dogleg path Figure 4.4 Exact trajectory and dogleg approximation. by simply omitting the quadratic term from (4.5) and writing p ∗ () ≈ − g , g when is small. (4.14) For intermediate values of , the solution p ∗ () typically follows a curved trajectory like the one in Figure 4.4. The dogleg method finds an approximate solution by replacing the curved trajectory for p ∗ () with a path consisting of two line segments. The first line segment runs from the origin to the minimizer of m along the steepest descent direction, which is pU − gT g g, g T Bg (4.15) while the second line segment runs from p U to p B (see Figure 4.4). Formally, we denote this trajectory by p̃(τ ) for τ ∈ [0, 2], where p̃(τ ) τ pU , 0 ≤ τ ≤ 1, p + (τ − 1)( p − p ), U B U 1 ≤ τ ≤ 2. (4.16) The dogleg method chooses p to minimize the model m along this path, subject to the trust-region bound. The following lemma shows that the minimum along the dogleg path can be found easily. 4.1. ALGORITHMS BASED ON THE CAUCHY POINT Lemma 4.2. Let B be positive definite. Then (i) p̃(τ ) is an increasing function of τ , and (ii) m( p̃(τ )) is a decreasing function of τ . PROOF. It is easy to show that (i) and (ii) both hold for τ ∈ [0, 1], so we restrict our attention to the case of τ ∈ [1, 2]. For (i), define h(α) by h(α) 12 p̃(1 + α)2 12 p U + α( p B − p U )2 12 p U 2 + α( p U )T ( p B − p U ) + 12 α 2 p B − p U 2 . Our result is proved if we can show that h (α) ≥ 0 for α ∈ (0, 1). Now, h (α) −( p U )T ( p U − p B ) + α p U − p B 2 ≥ −( p U )T ( p U − p B ) gT g gT g T −1 g − T g+B g T g Bg g Bg −1 (g T g)2 T gB g g g T 1− T g Bg (g Bg)(g T B −1 g) ≥ 0, where the final inequality is a consequence of the Cauchy-Schwarz inequality. (We leave the details as an exercise.) For (ii), we define ĥ(α) m( p̃(1 + α)) and show that ĥ (α) ≤ 0 for α ∈ (0, 1). Substitution of (4.16) into (4.5) and differentiation with respect to the argument leads to ĥ (α) ( p B − p U )T (g + B p U ) + α( p B − p U )T B( p B − p U ) ≤ ( p B − p U )T (g + B p U + B( p B − p U )) ( p B − p U )T (g + B p B ) 0, giving the result. It follows from this lemma that the path p̃(τ ) intersects the trust-region boundary p at exactly one point if p B ≥ , and nowhere otherwise. Since m is decreasing along the path, the chosen value of p will be at p B if p B ≤ , otherwise at the point of intersection of the dogleg and the trust-region boundary. In the latter case, we compute the appropriate value of τ by solving the following scalar quadratic equation: p U + (τ − 1)( p B − p U )2 2 . 75 76 CHAPTER 4. TRUST-REGION METHODS Consider now the case in which the exact Hessian ∇ 2 f (xk ) is available for use in the model problem (4.5). When ∇ 2 f (xk ) is positive definite, we can simply set B ∇ 2 f (xk ) (that is, p B (∇ 2 f (xk ))−1 gk ) and apply the procedure above to find the Newton-dogleg step. Otherwise, we can define p B by choosing B to be one of the positive definite modified Hessians described in Section 3.4, then proceed as above to find the dogleg step. Near a solution satisfying second-order sufficient conditions (see Theorem 2.4), p B will be set to the usual Newton step, allowing the possibility of rapid local convergence of Newton’s method (see Section 4.4). The use of a modified Hessian in the Newton-dogleg method is not completely satisfying from an intuitive viewpoint, however. A modified factorization perturbs the diagonals of ∇ 2 f (xk ) in a somewhat arbitrary manner, and the benefits of the trust-region approach may not be realized. In fact, the modification introduced during the factorization of the Hessian is redundant in some sense because the trust-region strategy introduces its own modification. As we show in Section 4.3, the exact solution of the trust-region problem (4.3) with Bk ∇ 2 f (xk ) is (∇ 2 f (xk ) + λI )−1 gk , where λ is chosen large enough to make (∇ 2 f (xk ) + λI ) positive definite, and its value depends on the trust-region radius k . We conclude that the Newton-dogleg method is most appropriate when the objective function is convex (that is, ∇ 2 f (xk ) is always positive semidefinite). The techniques described below may be more suitable for the general case. The dogleg strategy can be adapted to handle indefinite matrices B, but there is not much point in doing so because the full step p B is not the unconstrained minimizer of m in this case. Instead, we now describe another strategy, which aims to include directions of negative curvature (that is, directions d for which d T Bd < 0) in the space of candidate trust-region steps. TWO-DIMENSIONAL SUBSPACE MINIMIZATION When B is positive definite, the dogleg method strategy can be made slightly more sophisticated by widening the search for p to the entire two-dimensional subspace spanned by p U and p B (equivalently, g and −B −1 g). The subproblem (4.5) is replaced by min m( p) f + g T p + 12 p T Bp p s.t. p ≤ , p ∈ span[g, B −1 g]. (4.17) This is a problem in two variables that is computationally inexpensive to solve. (After some algebraic manipulation it can be reduced to finding the roots of a fourth degree polynomial.) Clearly, the Cauchy point p C is feasible for (4.17), so the optimal solution of this subproblem yields at least as much reduction in m as the Cauchy point, resulting in global convergence of the algorithm. The two-dimensional subspace minimization strategy is obviously an extension of the dogleg method as well, since the entire dogleg path lies in span[g, B −1 g]. This strategy can be modified to handle the case of indefinite B in a way that is intuitive, practical, and theoretically sound. We mention just the salient points of the handling of the 4.2. GLOBAL CONVERGENCE indefiniteness here, and refer the reader to papers by Byrd, Schnabel, and Schultz (see [54] and [279]) for details. When B has negative eigenvalues, the two-dimensional subspace in (4.17) is changed to span[g, (B + α I )−1 g], for some α ∈ (−λ1 , −2λ1 ], (4.18) where λ1 denotes the most negative eigenvalue of B. (This choice of α ensures that B + α I is positive definite, and the flexibility in the choice of α allows us to use a numerical procedure such as the Lanczos method to compute it.) When (B + α I )−1 g ≤ , we discard the subspace search of (4.17), (4.18) and instead define the step to be p −(B + α I )−1 g + v, (4.19) where v is a vector that satisfies v T (B + α I )−1 g ≤ 0. (This condition ensures that p ≥ (B + α I )−1 g.) When B has zero eigenvalues but no negative eigenvalues, we define the step to be the Cauchy point p p C . When the exact Hessian is available, we can set B ∇ 2 f (xk ), and note that B −1 g is the Newton step. Hence, when the Hessian is positive definite at the solution x ∗ and when xk is close to x ∗ and is sufficiently large, the subspace minimization problem (4.17) will be solved by the Newton step. The reduction in model function m achieved by the two-dimensional subspace minimization strategy often is close to the reduction achieved by the exact solution of (4.5). Most of the computational effort lies in a single factorization of B or B + α I (estimation of α and solution of (4.17) are less significant), while strategies that find nearly exact solutions of (4.5) typically require two or three such factorizations (see Section 4.3). 4.2 GLOBAL CONVERGENCE REDUCTION OBTAINED BY THE CAUCHY POINT In the preceding discussion of algorithms for approximately solving the trust-region subproblem, we have repeatedly emphasized that global convergence depends on the approximate solution obtaining at least as much decrease in the model function m as the Cauchy point. (In fact, a fixed positive fraction of the Cauchy decrease suffices.) We start the global convergence analysis by obtaining an estimate of the decrease in m achieved by the Cauchy point. We then use this estimate to prove that the sequence of gradients {gk } generated by Algorithm 4.1 has an accumulation point at zero, and in fact converges to zero when η is strictly positive. Our first main result is that the dogleg and two-dimensional subspace minimization algorithms and Steihaug’s algorithm (Algorithm 7.2) produce approximate solutions pk of the subproblem (4.3) that satisfy the following estimate of decrease in the model function: gk , m k (0) − m k ( pk ) ≥ c1 gk min k , Bk (4.20) 77 78 CHAPTER 4. TRUST-REGION METHODS for some constant c1 ∈ (0, 1]. The usefulness of this estimate will become clear in the following two sections. For now, we note that when k is the minimum value in (4.20), the condition is slightly reminiscent of the first Wolfe condition: The desired reduction in the model is proportional to the gradient and the size of the step. We show now that the Cauchy point pkC satisfies (4.20), with c1 12 . Lemma 4.3. The Cauchy point pkC satisfies (4.20) with c1 12 , that is, gk m k (0) − m k ( pkC ) ≥ 12 gk min k , . Bk (4.21) PROOF. For simplicity, we drop the iteration index k in the proof. We consider first the case g T Bg ≤ 0. Here, we have m( p C ) − m(0) m(−g/g) − f 2 T − g2 + 12 g Bg g g2 ≤ −g g ≤ −g min , , B and so (4.21) certainly holds. For the next case, consider g T Bg > 0 and g3 ≤ 1. g T Bg From (4.12), we have τ g3 / g T Bg , and so from (4.11) it follows that (4.22) g4 g4 1 T + g Bg 2 g T Bg (g T Bg)2 4 g − 12 T g Bg g4 ≤ − 12 Bg2 g2 − 12 B g ≤ − 12 g min , , B m( p C ) − m(0) − so (4.21) holds here too. In the remaining case, (4.22) does not hold, and therefore g T Bg < g3 . (4.23) 4.2. GLOBAL CONVERGENCE From (4.12), we have τ 1, and using this fact together with (4.23), we obtain 1 2 T g2 + g Bg g 2 g2 1 2 g3 ≤ −g + 2 g2 1 − 2 g g 1 , ≤ − 2 g min , B m( p C ) − m(0) − yielding the desired result (4.21) once again. To satisfy (4.20), our approximate solution pk has only to achieve a reduction that is at least some fixed fraction c2 of the reduction achieved by the Cauchy point. We state the observation formally as a theorem. Theorem 4.4. Let pk be any vector such that pk ≤ k and m k (0)−m k ( pk ) ≥ c2 m k (0) − m k ( pkC ) . Then pk satisfies (4.20) with c1 c2 /2. In particular, if pk is the exact solution pk∗ of (4.3), then it satisfies (4.20) with c1 12 . PROOF. Since pk ≤ k , we have from Lemma 4.3 that 1 gk C m k (0) − m k ( pk ) ≥ c2 m k (0) − m k ( pk ) ≥ 2 c2 gk min k , , Bk giving the result. Note that the dogleg and two-dimensional subspace minimization algorithms both satisfy (4.20) with c1 12 , because they all produce approximate solutions pk for which m k ( pk ) ≤ m k ( pkC ). CONVERGENCE TO STATIONARY POINTS Global convergence results for trust-region methods come in two varieties, depending on whether we set the parameter η in Algorithm 4.1 to zero or to some small positive value. When η 0 (that is, the step is taken whenever it produces a lower value of f ), we can show that the sequence of gradients {gk } has a limit point at zero. For the more stringent acceptance test with η > 0, which requires the actual decrease in f to be at least some small fraction of the predicted decrease, we have the stronger result that gk → 0. In this section we prove the global convergence results for both cases. We assume throughout that the approximate Hessians Bk are uniformly bounded in norm, and that f 79 80 CHAPTER 4. TRUST-REGION METHODS is bounded below on the level set def S {x | f (x) ≤ f (x0 )}. (4.24) For later reference, we define an open neighborhood of this set by def S(R0 ) {x | x − y < R0 for some y ∈ S}, where R0 is a positive constant. To allow our results to be applied more generally, we also allow the length of the approximate solution pk of (4.3) to exceed the trust-region bound, provided that it stays within some fixed multiple of the bound; that is, pk ≤ γ k , for some constant γ ≥ 1. (4.25) The first result deals with the case η 0. Theorem 4.5. Let η 0 in Algorithm 4.1. Suppose that Bk ≤ β for some constant β, that f is bounded below on the level set S defined by (4.24) and Lipschitz continuously differentiable in the neighborhood S(R0 ) for some R0 > 0, and that all approximate solutions of (4.3) satisfy the inequalities (4.20) and (4.25), for some positive constants c1 and γ . We then have lim inf gk 0. k→∞ (4.26) PROOF. By performing some technical manipulation with the ratio ρk from (4.4), we obtain ( f (xk ) − f (xk + pk )) − (m k (0) − m k ( pk )) |ρk − 1| m k (0) − m k ( pk ) m k ( pk ) − f (xk + pk ) . m k (0) − m k ( pk ) Since from Taylor’s theorem (Theorem 2.1) we have that 1 f (xk + pk ) f (xk ) + g(xk )T pk + [g(xk + t pk ) − g(xk )]T pk dt, 0 for some t ∈ (0, 1), it follows from the definition (4.2) of m k that 1 1 T T [g(xk + t pk ) − g(xk )] pk dt |m k ( pk ) − f (xk + pk )| 2 pk Bk pk − 0 ≤ (β/2) pk 2 + β1 pk 2 , (4.27) 4.2. GLOBAL CONVERGENCE where we have used β1 to denote the Lipschitz constant for g on the set S(R0 ), and assumed that pk ≤ R0 to ensure that xk and xk + t pk both lie in the set S(R0 ). Suppose for contradiction that there is > 0 and a positive index K such that gk ≥ , for all k ≥ K . (4.28) From (4.20), we have for k ≥ K that gk ≥ c1 min k , . m k (0) − m k ( pk ) ≥ c1 gk min k , Bk β (4.29) Using (4.29), (4.27), and the bound (4.25), we have |ρk − 1| ≤ γ 2 2k (β/2 + β1 ) . c1 min(k , /β) (4.30) We now derive a bound on the right-hand-side that holds for all sufficiently small values of ¯ where ¯ is defined as follows: k , that is, for all k ≤ , ¯ min c1 R0 1 , 2 2 γ (β/2 + β1 ) γ . (4.31) The R0 /γ term in this definition ensures that the bound (4.27) is valid (because pk ≤ ¯ ≤ R0 ). Note that since c1 ≤ 1 and γ ≥ 1, we have ¯ ≤ /β. The latter γ k ≤ γ ¯ condition implies that for all k ∈ [0, ], we have min(k , /β) k , so from (4.30) and (4.31), we have |ρk − 1| ≤ ¯ γ 2 2k (β/2 + β1 ) + β1 ) γ 2 (β/2 1 γ 2 k (β/2 + β1 ) ≤ ≤ . c1 k c1 c1 2 Therefore, ρk > 14 , and so by the workings of Algorithm 4.1, we have k+1 ≥ k whenever ¯ It follows that reduction of k by a factor of 1 can occur k falls below the threshold . 4 in our algorithm only if ¯ k ≥ , and therefore we conclude that ¯ k ≥ min K , /4 for all k ≥ K . Suppose now that there is an infinite subsequence K such that ρk ≥ (4.32) 1 4 for k ∈ K. For 81 82 CHAPTER 4. TRUST-REGION METHODS k ∈ K and k ≥ K , we have from (4.29) that f (xk ) − f (xk+1 ) f (xk ) − f (xk + pk ) ≥ ≥ 1 (0) − m k ( pk )] 4 [m k 1 c min(k , /β). 4 1 Since f is bounded below, it follows from this inequality that lim k∈K, k→∞ k 0, contradicting (4.32). Hence no such infinite subsequence K can exist, and we must have ρk < 14 for all k sufficiently large. In this case, k will eventually be multiplied by 14 at every iteration, and we have limk→∞ k 0, which again contradicts (4.32). Hence, our original assertion (4.28) must be false, giving (4.26). Our second global convergence result, for the case η > 0, borrows much of the analysis from the proof above. Our approach here follows that of Schultz, Schnabel, and Byrd [279]. Theorem 4.6. Let η ∈ 0, 14 in Algorithm 4.1. Suppose that Bk ≤ β for some constant β, that f is bounded below on the level set S (4.24) and Lipschitz continuously differentiable in S(R0 ) for some R0 > 0, and that all approximate solutions pk of (4.3) satisfy the inequalities (4.20) and (4.25) for some positive constants c1 and γ . We then have lim gk 0. k→∞ (4.33) PROOF. We consider a particular positive index m with gm 0. Using β1 again to denote the Lipschitz constant for g on the set S(R0 ), we have g(x) − gm ≤ β1 x − xm , for all x ∈ S(R0 ). We now define the scalars and R to satisfy 1 2 gm , R min , R0 . β1 Note that the ball B(xm , R) {x | x − xm ≤ R} is contained in S(R0 ), so Lipschitz continuity of g holds inside B(xm , R). We have x ∈ B(xm , R) ⇒ g(x) ≥ gm − g(x) − gm ≥ 12 gm . If the entire sequence {xk }k≥m stays inside the ball B(xm , R), we would have gk ≥ >0 4.3. ITERATIVE SOLUTION OF THE SUBPROBLEM for all k ≥ m. The reasoning in the proof of Theorem 4.5 can be used to show that this scenario does not occur. Therefore, the sequence {xk }k≥m eventually leaves B(xm , R). Let the index l ≥ m be such that xl+1 is the first iterate after xm outside B(xm , R). Since gk ≥ for k m, m + 1, . . . , l, we can use (4.29) to write f (xm ) − f (xl+1 ) l f (xk ) − f (xk+1 ) km l η[m k (0) − m k ( pk )] l , ≥ ηc1 min k , km,xk xk+1 β ≥ km,xk xk+1 where we have limited the sum to the iterations k for which xk xk+1 , that is, those iterations on which a step was actually taken. If k ≤ /β for all k m, m + 1, . . . , l, we have f (xm ) − f (xl+1 ) ≥ ηc1 l k ≥ ηc1 R ηc1 min km,xk xk+1 β1 , R0 . (4.34) Otherwise, we have k > /β for some k m, m + 1, . . . , l, and so f (xm ) − f (xl+1 ) ≥ ηc1 β . (4.35) Since the sequence { f (xk )}∞ k0 is decreasing and bounded below, we have that f (xk ) ↓ f ∗ (4.36) for some f ∗ > −∞. Therefore, using (4.34) and (4.35), we can write f (xm ) − f ∗ ≥ f (xm ) − f (xl+1 ) , , R0 ≥ ηc1 min β β1 gm gm 1 , , R0 > 0. ηc1 gm min 2 2β 2β1 Since f (xm ) − f ∗ ↓ 0, we must have gm → 0, giving the result. 4.3 ITERATIVE SOLUTION OF THE SUBPROBLEM In this section, we describe a technique that uses the characterization (4.6) of the subproblem solution, applying Newton’s method to find the value of λ which matches the given 83 84 CHAPTER 4. TRUST-REGION METHODS trust-region radius in (4.5). We also prove the key result Theorem 4.1 concerning the characterization of solutions of (4.3). The methods of Section 4.1 make no serious attempt to find the exact solution of the subproblem (4.5). They do, however, make some use of the information in the model Hessian Bk , and they have advantages of reasonable implementation cost and nice global convergence properties. When the problem is relatively small (that is, n is not too large), it may be worthwhile to exploit the model more fully by looking for a closer approximation to the solution of the subproblem. In this section, we describe an approach for finding a good approximation at the cost of a few factorizations of the matrix B (typically three factorization), as compared with a single factorization for the dogleg and two-dimensional subspace minimization methods. This approach is based on the characterization of the exact solution given in Theorem 4.1, together with an ingenious application of Newton’s method in one variable. Essentially, the algorithm tries to identify the value of λ for which (4.6) is satisfied by the solution of (4.5). The characterization of Theorem 4.1 suggests an algorithm for finding the solution p of (4.7). Either λ 0 satisfies (4.8a) and (4.8c) with p ≤ , or else we define p(λ) −(B + λI )−1 g for λ sufficiently large that B + λI is positive definite and seek a value λ > 0 such that p(λ) . (4.37) This problem is a one-dimensional root-finding problem in the variable λ. To see that a value of λ with all the desired properties exists, we appeal to the eigendecomposition of B and use it to study the properties of p(λ). Since B is symmetric, there is an orthogonal matrix Q and a diagonal matrix such that B QQ T , where diag(λ1 , λ2 , . . . , λn ), and λ1 ≤ λ2 ≤ · · · ≤ λn are the eigenvalues of B; see (A.16). Clearly, B + λI Q( + λI )Q T , and for λ λ j , we have p(λ) −Q( + λI )−1 Q T g − n q Tj g j1 λj + λ qj, (4.38) where q j denotes the jth column of Q. Therefore, by orthonormality of q1 , q2 , . . . , qn , we have p(λ)2 n 2 q Tj g j1 (λ j + λ)2 . (4.39) 4.3. ITERATIVE SOLUTION 2 1 OF THE SUBPROBLEM || p || * 3 Figure 4.5 p(λ) as a function of λ. This expression tells us a lot about p(λ). If λ > −λ1 , we have λ j + λ > 0 for all j 1, 2, . . . , n, and so p(λ) is a continuous, nonincreasing function of λ on the interval (−λ1 , ∞). In fact, we have that lim p(λ) 0. λ→∞ (4.40) Moreover, we have when q Tj g 0 that lim p(λ) ∞. λ→−λ j (4.41) Figure 4.5 plots p(λ) against λ in a case in whcih q1T g, q2T g, and q3T g are all nonzero. Note that the properties (4.40) and (4.41) hold and that p(λ) is a nonincreasing function of λ on (−λ1 , ∞). In particular, as is always the case when q1T g 0, that there is a unique value λ∗ ∈ (−λ1 , ∞) such that p(λ∗ ) . (There may be other, smaller values of λ for which p(λ) , but these will fail to satisfy (4.8c).) We now sketch a procedure for identifying the λ∗ ∈ (−λ1 , ∞) for which p(λ∗ ) , which works when q1T g 0. (We discuss the case of q1T g 0 later.) First, note that when B positive definite and B −1 g ≤ , the value λ 0 satisfies (4.8), so the procedure can be terminated immediately with λ∗ 0. Otherwise, we could use the root-finding Newton’s method (see the Appendix) to find the value of λ > −λ1 that solves φ1 (λ) p(λ) − 0. (4.42) 85 86 CHAPTER 4. TRUST-REGION METHODS The disadvantage of this approach can be seen by considering the form of p(λ) when λ is greater than, but close to, −λ1 . For such λ, we can approximate φ1 by a rational function, as follows: φ1 (λ) ≈ C1 + C2 , λ + λ1 where C1 > 0 and C2 are constants. Clearly this approximation (and hence φ1 ) is highly nonlinear, so the root-finding Newton’s method will be unreliable or slow. Better results will be obtained if we reformulate the problem (4.42) so that it is nearly linear near the optimal λ. By defining φ2 (λ) 1 1 − , p(λ) it can be shown using (4.39) that for λ slightly greater than −λ1 , we have φ2 (λ) ≈ λ + λ1 1 − C3 for some C3 > 0. Hence, φ2 is nearly linear near −λ1 (see Figure 4.6), and the root-finding ||p|| --1 1 3 Figure 4.6 2 1/ p(λ) as a function of λ. 1 * 4.3. ITERATIVE SOLUTION OF THE SUBPROBLEM Newton’s method will perform well, provided that it maintains λ > −λ1 . The root-finding Newton’s method applied to φ2 generates a sequence of iterates λ() by setting λ (+1) λ () φ2 λ() − () . φ2 λ (4.43) After some elementary manipulation, this updating formula can be implemented in the following practical way. Algorithm 4.3 (Trust Region Subproblem). Given λ(0) , > 0: for 0, 1, 2, . . . Factor B + λ() I R T R; Solve R T Rp −g, R T q p ; Set λ(+1) λ() + p q 2 p − ; (4.44) end (for). Safeguards must be added to this algorithm to make it practical; for instance, when λ() < −λ1 , the Cholesky factorization B + λ() I R T R will not exist. A slightly enhanced version of this algorithm does, however, converge to a solution of (4.37) in most cases. The main work in each iteration of this method is, of course, the Cholesky factorization of B + λ() I . Practical versions of this algorithm do not iterate until convergence to the optimal λ is obtained with high accuracy, but are content with an approximate solution that can be obtained in two or three iterations. THE HARD CASE Recall that in the discussion above, we assumed that q1T g 0. In fact, the approach described above can be applied even when the most negative eigenvalue is a multiple eigenvalue (that is, 0 > λ1 λ2 · · ·), provided that Q 1T g 0, where Q 1 is the matrix whose columns span the subspace corresponding to the eigenvalue λ1 . When this condition does not hold, the situation becomes a little complicated, because the limit (4.41) does not hold for λ j λ1 and so there may not be a value λ ∈ (−λ1 , ∞) such that p(λ) (see Figure 4.7). Moré and Sorensen [214] refer to this case as the hard case. At first glance, it is not clear how p and λ can be chosen to satisfy (4.8) in the hard case. Clearly, our root-finding technique will not work, since there is no solution for λ in the open interval (−λ1 , ∞). But Theorem 4.1 assures us that the right value of λ lies in the interval [−λ1 , ∞), so there is only 87 88 CHAPTER 4. TRUST-REGION METHODS ||p|| ∆ −λ3 Figure 4.7 −λ2 −λ1 The hard case: p(λ) < for all λ ∈ (−λ1 , ∞). one possibility: λ −λ1 . To find p, it is not enough to delete the terms for which λ j λ1 from the formula (4.38) and set p q Tj g j:λ j λ1 λj + λ qj. Instead, we note that (B − λ1 I ) is singular, so there is a vector z such that z 1 and (B − λ1 I )z 0. In fact, z is an eigenvector of B corresponding to the eigenvalue λ1 , so by orthogonality of Q we have q Tj z 0 for λ j λ1 . It follows from this property that if we set p j:λ j λ1 q Tj g λj + λ qj + τz (4.45) for any scalar τ , we have p2 j:λ j λ1 2 q Tj g (λ j + λ)2 + τ 2, so it is always possible to choose τ to ensure that p . It is easy to check that the conditions (4.8) holds for this choice of p and λ −λ1 . 4.3. ITERATIVE SOLUTION OF THE SUBPROBLEM PROOF OF THEOREM 4.1 We now give a formal proof of Theorem 4.1, the result that characterizes the exact solution of (4.5). The proof relies on the following technical lemma, which deals with the unconstrained minimizers of quadratics and is particularly interesting in the case where the Hessian is positive semidefinite. Lemma 4.7. Let m be the quadratic function defined by m( p) g T p + 12 p T Bp, (4.46) where B is any symmetric matrix. Then the following statements are true. (i) m attains a minimum if and only if B is positive semidefinite and g is in the range of B. If B is positive semidefinite, then every p satisfying Bp −g is a global minimizer of m. (ii) m has a unique minimizer if and only if B is positive definite. PROOF. We prove each of the three claims in turn. (i) We start by proving the “if ” part. Since g is in the range of B, there is a p with Bp −g. For all w ∈ R n , we have m( p + w) g T ( p + w) + 12 ( p + w)T B( p + w) (g T p + 12 p T Bp) + g T w + (Bp)T w + 12 w T Bw m( p) + 12 w T Bw ≥ m( p), (4.47) since B is positive semidefinite. Hence, p is a minimizer of m. For the “only if ” part, let p be a minimizer of m. Since ∇m( p) Bp + g 0, we have that g is in the range of B. Also, we have ∇ 2 m( p) B positive semidefinite, giving the result. (ii) For the “if ” part, the same argument as in (i) suffices with the additional point that w T Bw > 0 whenever w 0. For the “only if ” part, we proceed as in (i) to deduce that B is positive semidefinite. If B is not positive definite, there is a vector w 0 such that Bw 0. Hence, from (4.47), we have m( p + w) m( p), so the minimizer is not unique, giving a contradiction. To illustrate case (i), suppose that ⎡ 1 ⎢ B⎣ 0 0 0 0 ⎤ 0 ⎥ 0 ⎦, 0 2 89 90 CHAPTER 4. TRUST-REGION METHODS which has eigenvalues 0, 1, 2 and is therefore singular. If g is any vector whose second component is zero, then g will be in the range of B, and the quadratic will attain a minimum. But if the second element in g is nonzero, we can decrease m(·) indefinitely by moving along the direction (0, −g2 , 0)T . We are now in a position to take account of the trust-region bound p ≤ and hence prove Theorem 4.1. PROOF. (Theorem 4.1) Assume first that there is λ ≥ 0 such that the conditions (4.8) are satisfied. Lemma 4.7(i) implies that p ∗ is a global minimum of the quadratic function m̂( p) g T p + 12 p T (B + λI ) p m( p) + λ T p p. 2 (4.48) Since m̂( p) ≥ m̂( p ∗ ), we have m( p) ≥ m( p ∗ ) + λ (( p ∗ )T p ∗ − p T p). 2 (4.49) Because λ( − p ∗ ) 0 and therefore λ(2 − ( p ∗ )T p ∗ ) 0, we have m( p) ≥ m( p ∗ ) + λ 2 ( − p T p). 2 Hence, from λ ≥ 0, we have m( p) ≥ m( p ∗ ) for all p with p ≤ . Therefore, p ∗ is a global minimizer of (4.7). For the converse, we assume that p ∗ is a global solution of (4.7) and show that there is a λ ≥ 0 that satisfies (4.8). In the case p ∗ < , p ∗ is an unconstrained minimizer of m, and so ∇m( p ∗ ) Bp ∗ + g 0, ∇ 2 m( p ∗ ) B positive semidefinite, and so the properties (4.8) hold for λ 0. Assume for the remainder of the proof that p ∗ . Then (4.8b) is immediately satisfied, and p ∗ also solves the constrained problem min m( p) subject to p . By applying optimality conditions for constrained optimization to this problem (see (12.34)), we find that there is a λ such that the Lagrangian function defined by L( p, λ) m( p) + λ T ( p p − 2 ) 2 4.3. ITERATIVE SOLUTION OF THE SUBPROBLEM has a stationary point at p ∗ . By setting ∇ p L( p ∗ , λ) to zero, we obtain Bp ∗ + g + λp ∗ 0 ⇒ (B + λI ) p ∗ −g, (4.50) so that (4.8a) holds. Since m( p) ≥ m( p ∗ ) for any p with p T p ( p ∗ )T p ∗ 2 , we have for such vectors p that m( p) ≥ m( p ∗ ) + λ ∗ T ∗ ( p ) p − pT p . 2 If we substitute the expression for g from (4.50) into this expression, we obtain after some rearrangement that 1 (p 2 − p ∗ )T (B + λI )( p − p ∗ ) ≥ 0. (4.51) Since the set of directions p − p∗ w : w± , for some p with p p − p∗ is dense on the unit sphere, (4.51) suffices to prove (4.8c). It remains to show that λ ≥ 0. Because (4.8a) and (4.8c) are satisfied by p ∗ , we have from Lemma 4.7(i) that p ∗ minimizes m̂, so (4.49) holds. Suppose that there are only negative values of λ that satisfy (4.8a) and (4.8c). Then we have from (4.49) that m( p) ≥ m( p ∗ ) whenever p ≥ p ∗ . Since we already know that p ∗ minimizes m for p ≤ , it follows that m is in fact a global, unconstrained minimizer of m. From Lemma 4.7(i) it follows that Bp −g and B is positive semidefinite. Therefore conditions (4.8a) and (4.8c) are satisfied by λ 0, which contradicts our assumption that only negative values of λ can satisfy the conditions. We conclude that λ ≥ 0, completing the proof. CONVERGENCE OF ALGORITHMS BASED ON NEARLY EXACT SOLUTIONS As we noted in the discussion of Algorithm 4.3, the loop to determine the optimal values of λ and p for the subproblem (4.5) does not iterate until high accuracy is achieved. Instead, it is terminated after two or three iterations with a fairly loose approximation to the true solution. The inexactness in this approximate solution is measured in a different way from the dogleg and subspace minimization algorithms. We can add safeguards to the root-finding Newton method to ensure that the key assumptions of Theorems 4.5 and 4.6 are satisfied by the approximate solution. Specifically, we require that m(0) − m( p) ≥ c1 (m(0) − m( p ∗ )), p ≤ γ (4.52a) (4.52b) 91 92 CHAPTER 4. TRUST-REGION METHODS (where p ∗ is the exact solution of (4.3)), for some constants c1 ∈ (0, 1] and γ > 0. The condition (4.52a) ensures that the approximate solution achieves a significant fraction of the maximum decrease possible in the model function m. (It is not necessary to know p ∗ ; there are practical termination criteria that imply (4.52a).) One major difference between (4.52) and the earlier criterion (4.20) is that (4.52) makes better use of the second-order part of m(·), that is, the p T Bp term. This difference is illustrated by the case in which g 0 while B has negative eigenvalues, indicating that the current iterate xk is a saddle point. Here, the right-hand-side of (4.20) is zero (indeed, the algorithms we described earlier would terminate at such a point). The right-hand-side of (4.52) is positive, indicating that decrease in the model function is still possible, so it forces the algorithm to move away from xk . The close attention that near-exact algorithms pay to the second-order term is warranted only if this term closely reflects the actual behavior of the function f —in fact, the trust-region Newton method, for which B ∇ 2 f (x), is the only case that has been treated in the literature. For purposes of global convergence analysis, the use of the exact Hessian allows us to say more about the limit points of the algorithm than merely that they are stationary points. The following result shows that second-order necessary conditions (Theorem 2.3) are satisfied at the limit points. Theorem 4.8. Suppose that the assumptions of Theorem 4.6 are satisfied and in addition that f is twice continuously differentiable in the level set S. Suppose that Bk ∇ 2 f (xk ) for all k, and that the approximate solution pk of (4.3) at each iteration satisfies (4.52) for some fixed γ > 0. Then limk→∞ gk 0. If, in addition, the level set S of (4.24) is compact, then either the algorithm terminates at a point xk at which the second-order necessary conditions (Theorem 2.3) for a local solution hold, or else {xk } has a limit point x ∗ in S at which the second-order necessary conditions hold. We omit the proof, which can be found in Moré and Sorensen [214, Section 4]. 4.4 LOCAL CONVERGENCE OF TRUST-REGION NEWTON METHODS Since global convergence of trust-region methods that use exact Hessians ∇ 2 f (x) is established above, we turn our attention now to local convergence issues. The key to attaining the fast rate of convergence usually associated with Newton’s method is to show that the trust-region bound eventually does not interfere as we approach a solution. Specifically, we hope that near the solution, the (approximate) solution of the trust-region subproblem is well inside the trust region and becomes closer and closer to the true Newton step. Steps that satisfy the latter property are said to be asymptotically similar to Newton steps. We first prove a general result that applies to any algorithm of the form of Algorithm 4.1 (see Chapter 4) that generates steps that are asymptotically similar to Newton 4.4. LOCAL CONVERGENCE OF TRUST-REGION NEWTON METHODS steps whenever the Newton steps easily satisfy the trust-region bound. It shows that the trust-region constraint eventually becomes inactive in algorithms with this property and that superlinear convergence can be attained. The result assumes that the exact Hessian Bk ∇ 2 f (xk ) is used in (4.3) when xk is close to a solution x ∗ that satisfies second-order sufficient conditions (see Theorem 2.4). Moreover, it assumes that the algorithm uses an approximate solution pk of (4.3) that achieves a similar decrease in the model function m k as the Cauchy point. Theorem 4.9. Let f be twice Lipschitz continuously differentiable in a neighborhhod of a point x ∗ at which second-order sufficient conditions (Theorem 2.4) are satisfied. Suppose the sequence {xk } converges to x ∗ and that for all k sufficiently large, the trust-region algorithm based on (4.3) with Bk ∇ 2 f (xk ) chooses steps pk that satisfy the Cauchy-point-based model reduction criterion (4.20) and are asymptotically similar to Newton steps pkN whenever pkN ≤ 12 k , that is, pk − pkN o( pkN ). (4.53) Then the trust-region bound k becomes inactive for all k sufficiently large and the sequence {xk } converges superlinearly to x ∗ . PROOF. We show that pkN ≤ 12 k and pk ≤ k , for all sufficiently large k, so the near-optimal step pk in (4.53) will eventually always be taken. We first seek a lower bound on the predicted reduction m k (0) − m k ( pk ) for all sufficiently large k. We assume that k is large enough that the o( pkN ) term in (4.53) is less than pkN . When pkN ≤ 12 k , we then have that pk ≤ pkN + o( pkN ) ≤ 2 pkN , while if pkN > 12 k , we have pk ≤ k < 2 pkN . In both cases, then, we have −1 pk ≤ 2 pkN ≤ 2 ∇ 2 f (xk ) gk , and so gk ≥ 12 pk / ∇ 2 f (xk )−1 . We have from the relation (4.20) that m k (0) − m k ( pk ) ≥ c1 gk min pk gk k , 2 ∇ f (xk ) min ≥ c1 2 ∇ 2 f (xk )−1 pk pk , 2 2 ∇ f (xk ) ∇ 2 f (xk )−1 pk 2 c1 . 2 4 ∇ 2 f (xk )−1 ∇ 2 f (xk ) Because xk → x ∗ , we use continuity of ∇ 2 f (x) and positive definiteness of ∇ 2 f (x ∗ ), to 93 94 CHAPTER 4. TRUST-REGION METHODS deduce that the following bound holds for all k sufficiently large: c1 c1 def ≥ c3 , 2 2 −1 −1 2 2 2 ∗ 2 ∗ 4 ∇ f (xk ) ∇ f (xk ) 8 ∇ f (x ) ∇ f (x ) where c3 > 0. Hence, we hae m k (0) − m k ( pk ) ≥ c3 pk 2 (4.54) for all sufficiently large k. By Lipschitz continuity of ∇ 2 f (x) near x ∗ , and using Taylor’s theorem (Theorem 2.1), we have |( f (xk ) − f (xk + pk )) − (m k (0) − m k ( pk ))| 1 1 T 2 T 2 1 pk ∇ f (xk + t pk ) pk dt 2 pk ∇ f (xk ) pk − 2 0 L ≤ pk 3 , 4 where L > 0 is the Lipschitz constant for ∇ 2 f (·). Hence, by definition (4.4) of ρk , we have for sufficiently large k that |ρk − 1| ≤ pk 3 (L/4) L L pk ≤ k . c3 pk 2 4c3 4c3 (4.55) Now, the trust-region radius can be reduced only if ρk < 14 (or some other fixed number less than 1), so it is clear from (4.55) that the sequence {k } is bounded away from zero. Since xk → x ∗ , we have pkN → 0 and therefore pk → 0 from (4.53). Hence, the trust-region bound is inactive for all k sufficiently large, and the bound pkN ≤ 12 k is eventually always satisfied. To prove superlinear convergence, we use the quadratic convergence of Newton’s method, proved in Theorem 3.5. In particular, we have from (3.33) that xk + pkN − x ∗ o xk − x ∗ 2 , which implies that pkN O(xk − x ∗ ). Therefore, using (4.53), we have xk + pk − x ∗ ≤ xk + pkN − x ∗ + pkN − pk o xk − x ∗ 2 + o( pkN ) o xk − x ∗ , thus proving superlinear convergence. It is immediate from Theorem 3.5 that if pk pkN for all k sufficiently large, we have quadratic convergence of {xk } to x ∗ . 4.5. OTHER ENHANCEMENTS Reasonable implementations of the dogleg, subspace minimization, and nearly-exact algorithm of Section 4.3 with Bk ∇ 2 f (xk ) eventually use the steps pk pkN under the conditions of Theorem 4.9, and therefore converge quadratically. In the case of the dogleg and two-dimensional subspace minimization methods, the exact step pkN is one of the candidates for pk —it lies inside the trust region, along the dogleg path, and inside the two-dimensional subspace. Since under the assumptions of Theorem 4.9, pkN is the unconstrained minimizer of m k for k sufficiently large, it is certainly the minimizer in the more restricted domains, so we have pk pkN . For the approach of Section 4.3, if we follow the reasonable strategy of checking whether pkN is a solution of (4.3) prior to embarking on Algorithm 4.3, then eventually we will also have pk pkN also. 4.5 OTHER ENHANCEMENTS SCALING As we noted in Chapter 2, optimization problems are often posed with poor scaling— the objective function f is highly sensitive to small changes in certain components of the vector x and relatively insensitive to changes in other components. Topologically, a symptom of poor scaling is that the minimizer x ∗ lies in a narrow valley, so that the contours of the objective f (·) near x ∗ tend towards highly eccentric ellipses. Algorithms that fail to compensate for poor scaling can perform badly; see Figure 2.7 for an illustration of the poor performance of the steepest descent approach. Recalling our definition of a trust region—a region around the current iterate within which the model m k (·) is an adequate representation of the true objective f (·)—it is easy to see that a spherical trust region may not be appropriate when f is poorly scaled. Even if the model Hessian Bk is exact, the rapid changes in f along certain directions probably will cause m k to be a poor approximation to f along these directions. On the other hand, m k may be a more reliable approximation to f along directions in which f is changing more slowly. Since the shape of our trust region should be such that our confidence in the model is more or less the same at all points on the boundary of the region, we are led naturally to consider elliptical trust regions in which the axes are short in the sensitive directions and longer in the less sensitive directions. Elliptical trust regions can be defined by Dp ≤ , (4.56) where D is a diagonal matrix with positive diagonal elements, yielding the following scaled trust-region subproblem: def minn m k ( p) f k + gkT p + 12 p T Bk p p∈IR s.t. Dp ≤ k . (4.57) 95 96 CHAPTER 4. TRUST-REGION METHODS When f (x) is highly sensitive to the value of the ith component xi , we set the corresponding diagonal element dii of D to be large, while dii is smaller for less-sensitive components. Information to construct the scaling matrix D may be derived from the second derivatives ∂ 2 f /∂ xi2 . We can allow D to change from iteration to iteration; most of the theory of this chapter will still apply with minor modifications provided that each dii stays within some predetermined range [dlo , dhi ], where 0 < dlo ≤ dhi < ∞. Of course, we do not need D to be a precise reflection of the scaling of the problem, so it is not necessary to devise elaborate heuristics or to perform extensive computations to get it just right. The following procedure shows how the Cauchy point calculation (Algorithm 4.2) changes when we use a scaled trust region, Algorithm 4.4 (Generalized Cauchy Point Calculation). Find the vector pkS that solves pkS arg minn f k + gkT p s.t. Dp ≤ k ; p∈IR (4.58) Calculate the scalar τk > 0 that minimizes m k (τ pkS ) subject to satisfying the trust-region bound, that is, τk arg min m k (τ pkS ) τ >0 s.t. τ D pkS ≤ k ; (4.59) pkC τk pkS . For this scaled version, we find that pkS − k D −2 gk , D −1 gk (4.60) and that the step length τk is obtained from the following modification of (4.12): τk ⎧ ⎪ ⎨ 1 ⎪ ⎩ min D −1 gk 3 k gkT D −2 Bk D −2 gk ,1 if gkT D −2 Bk D −2 gk ≤ 0 otherwise. (4.61) (The details are left as an exercise.) A simpler alternative for adjusting the definition of the Cauchy point and the various algorithms of this chapter to allow for the elliptical trust region is simply to rescale the variables p in the subproblem (4.57) so that the trust region is spherical in the scaled variables. By defining def p̃ Dp, 4.5. OTHER ENHANCEMENTS and by substituting into (4.57), we obtain minn m̃ k ( p̃) f k + gkT D −1 p̃ + 12 p̃ T D −1 Bk D −1 p̃ def p̃∈IR s.t. p̃ ≤ k . The theory and algorithms can now be derived in the usual way by substituting p̃ for p, D −1 gk for gk , D −1 Bk D −1 for Bk , and so on. TRUST REGIONS IN OTHER NORMS Trust regions may also be defined in terms of norms other than the Euclidean norm. For instance, we may have p1 ≤ k or p∞ ≤ k , or Dp∞ ≤ k , or their scaled counterparts Dp1 ≤ k where D is a positive diagonal matrix as before. Norms such as these offer no obvious advantages for small-medium unconstrained problems, but they may be useful for constrained problems. For instance, for the bound-constrained problem subject to x ≥ 0, minn f (x), x∈IR the trust-region subproblem may take the form minn m k ( p) f k + gkT p + 12 p T Bk p p∈IR s.t. xk + p ≥ 0, p ≤ k . (4.62) When the trust region is defined by a Euclidean norm, the feasible region for (4.62) consists of the intersection of a sphere and the nonnegative orthant—an awkward object, geometrically speaking. When the ∞-norm is used, however, the feasible region is simply the rectangular box defined by xk + p ≥ 0, p ≥ −k e, p ≤ k e, where e (1, 1, . . . , 1)T , so the solution of the subproblem is easily calculated by using techniques for bound-constrained quadratic programming. For large problems, in which factorization or formation the model Hessian Bk is not computationally desirable, the use of a trust region defined by · ∞ will also give rise to a bound-constrained subproblem, which may be more convenient to solve than the standard subproblem (4.3). To our knowledge, there has not been much research on the relative performance of methods that use trust regions of different shapes on large problems. 97 98 CHAPTER 4. TRUST-REGION METHODS NOTES AND REFERENCES One of the earliest works on trust-region methods is Winfield [307]. The influential paper of Powell [244] proves a result like Theorem 4.5 for the case of η 0, where the algorithm takes a step whenever it decreases the function value. Powell uses a weaker assumption than ours on the matrices B, but his analysis is more complicated. Moré [211] summarizes developments in algorithms and software before 1982, paying particular attention to the importance of using a scaled trust-region norm. Byrd, Schnabel, and Schultz [279], [54] provide a general theory for inexact trustregion methods; they introduce the idea of two-dimensional subspace minimization and also focus on proper handling of the case of indefinite B to ensure stronger local convergence results than Theorems 4.5 and 4.6. Dennis and Schnabel [93] survey trust-region methods as part of their overview of unconstrained optimization, providing pointers to many important developments in the literature. The monograph of Conn, Gould, and Toint [74] is an exhaustive treatment of the state of the art in trust-region methods for both unconstrained and constrained optimization. It includes an comprehensive annotated bibliography of the literature in the area. ✐ EXERCISES ✐ 4.1 Let f (x) 10(x2 − x12 )2 + (1 − x1 )2 . At x (0, −1) draw the contour lines of the quadratic model (4.2) assuming that B is the Hessian of f . Draw the family of solutions of (4.3) as the trust region radius varies from 0 to 2. Repeat this at x (0, 0.5). ✐ 4.2 Write a program that implements the dogleg method. Choose Bk to be the exact Hessian. Apply it to solve Rosenbrock’s function (2.22). Experiment with the update rule for the trust region by changing the constants in Algorithm 4.1, or by designing your own rules. ✐ 4.3 Program the trust-region method based on Algorithm 7.2. Choose Bk to be the exact Hessian, and use it to minimize the function min f (x) n 2 (1 − x2i−1 )2 + 10(x2i − x2i−1 )2 i1 with n 10. Experiment with the starting point and the stopping test for the CG iteration. Repeat the computation with n 50. Your program should indicate, at every iteration, whether Algorithm 7.2 encountered negative curvature, reached the trust-region boundary, or met the stopping test. 4.5. OTHER ENHANCEMENTS ✐ 4.4 Theorem 4.5 shows that the sequence {g} has an accumulation point at zero. Show that if the iterates x stay in a bounded set B, then there is a limit point x∞ of the sequence {xk } such that g(x∞ ) 0. ✐ 4.5 Show that τk defined by (4.12) does indeed identify the minimizer of m k along the direction −gk . ✐ 4.6 The Cauchy–Schwarz inequality states that for any vectors u and v, we have |u T v|2 ≤ (u T u)(v T v), with equality only when u and v are parallel. When B is positive definite, use this inequality to show that def γ g4 ≤ 1, (g T Bg)(g T B −1 g) with equality only if g and Bg (and B −1 g) are parallel. ✐ 4.7 When B is positive definite, the double-dogleg method constructs a path with three line segments from the origin to the full step. The four points that define the path are • the origin; • the unconstrained Cauchy step p C −(g T g)/(g T Bg)g; • a fraction of the full step γ̄ p B −γ̄ B −1 g, for some γ̄ ∈ (γ , 1], where γ is defined in the previous question; and • the full step p B −B −1 g. Show that p increases monotonically along this path. (Note: The double-dogleg method, as discussed in Dennis and Schnabel [92, Section 6.4.2], was for some time thought to be superior to the standard dogleg method, but later testing has not shown much difference in performance.) ✐ 4.8 Show that (4.43) and (4.44) are equivalent. Hints: Note that d dλ −1/2 −3/2 d d 1 p(λ)2 p(λ)2 , − p(λ)2 dλ 2 dλ n (q Tj g)2 d p(λ)2 −2 dλ (λ j + λ)3 j1 1 p(λ) 99 100 CHAPTER 4. TRUST-REGION METHODS (from (4.39)), and q2 R −T p2 p T (B + λI )−1 p n (q Tj g)2 j1 (λ j + λ)3 . ✐ 4.9 Derive the solution of the two-dimensional subspace minimization problem in the case where B is positive definite. ✐ 4.10 Show that if B is any symmetric matrix, then there exists λ ≥ 0 such that B + λI is positive definite. ✐ 4.11 Verify that the definitions (4.60) for pkS and (4.61) for τk are valid for the Cauchy point in the case of an elliptical trust region. (Hint: Using the theory of Chapter 12, we can show that the solution of (4.58) satisfies gk + α D 2 pkS 0 for some scalar α ≥ 0.) ✐ 4.12 The following example shows that the reduction in the model function m achieved by the two-dimensional minimization strategy can be much smaller than that achieved by the exact solution of (4.5). In (4.5), set T 1 g − , −1, − 2 , where is a small positive number. Set B diag 1 3 , 1, 3 , 0.5. T Show that the solution of (4.5) has components O( ), 12 + O( ), O( ) and that the reduction in the model m is 38 + O( ). For the two-dimensional minimization strategy, show that the solution is a multiple of B −1 g and that the reduction in m is O( ). This is page 101 Printer: Opaque this CHAPTER 5 Conjugate Gradient Methods Our interest in conjugate gradient methods is twofold. First, they are among the most useful techniques for solving large linear systems of equations. Second, they can be adapted to solve nonlinear optimization problems. The remarkable properties of both linear and nonlinear conjugate gradient methods will be described in this chapter. The linear conjugate gradient method was proposed by Hestenes and Stiefel in the 1950s as an iterative method for solving linear systems with positive definite coefficient matrices. It is an alternative to Gaussian elimination that is well suited for solving large problems. The performance of the linear conjugate gradient method is determined by the 102 CHAPTER 5. CONJUGATE GRADIENT METHODS distribution of the eigenvalues of the coefficient matrix. By transforming, or preconditioning, the linear system, we can make this distribution more favorable and improve the convergence of the method significantly. Preconditioning plays a crucial role in the design of practical conjugate gradient strategies. Our treatment of the linear conjugate gradient method will highlight those properties of the method that are important in optimization. The first nonlinear conjugate gradient method was introduced by Fletcher and Reeves in the 1960s. It is one of the earliest known techniques for solving large-scale nonlinear optimization problems. Over the years, many variants of this original scheme have been proposed, and some are widely used in practice. The key features of these algorithms are that they require no matrix storage and are faster than the steepest descent method. 5.1 THE LINEAR CONJUGATE GRADIENT METHOD In this section we derive the linear conjugate gradient method and discuss its essential convergence properties. For simplicity, we drop the qualifier “linear” throughout. The conjugate gradient method is an iterative method for solving a linear system of equations Ax b, (5.1) where A is an n × n symmetric positive definite matrix. The problem (5.1) can be stated equivalently as the following minimization problem: def min φ(x) 12 x T Ax − b T x, (5.2) that is, both (5.1) and (5.2) have the same unique solution. This equivalence will allow us to interpret the conjugate gradient method either as an algorithm for solving linear systems or as a technique for minimizing convex quadratic functions. For future reference, we note that the gradient of φ equals the residual of the linear system, that is, def ∇φ(x) Ax − b r (x), (5.3) so in particular at x xk we have rk Axk − b. (5.4) CONJUGATE DIRECTION METHODS One of the remarkable properties of the conjugate gradient method is its ability to generate, in a very economical fashion, a set of vectors with a property known as conjugacy. A 5.1. THE LINEAR CONJUGATE GRADIENT METHOD set of nonzero vectors { p0 , p1 , . . . , pl } is said to be conjugate with respect to the symmetric positive definite matrix A if piT Ap j 0, for all i j. (5.5) It is easy to show that any set of vectors satisfying this property is also linearly independent. (For a geometrical illustration of conjugate directions see Section 9.4.) The importance of conjugacy lies in the fact that we can minimize φ(·) in n steps by successively minimizing it along the individual directions in a conjugate set. To verify this claim, we consider the following conjugate direction method. (The distinction between the conjugate gradient method and the conjugate direction method will become clear as we proceed.) Given a starting point x0 ∈ IRn and a set of conjugate directions { p0 , p1 , . . . , pn−1 }, let us generate the sequence {xk } by setting xk+1 xk + αk pk , (5.6) where αk is the one-dimensional minimizer of the quadratic function φ(·) along xk + αpk , given explicitly by αk − rkT pk ; pkT Apk (5.7) see (3.55). We have the following result. Theorem 5.1. For any x0 ∈ IRn the sequence {xk } generated by the conjugate direction algorithm (5.6), (5.7) converges to the solution x ∗ of the linear system (5.1) in at most n steps. PROOF. Since the directions { pi } are linearly independent, they must span the whole space IRn . Hence, we can write the difference between x0 and the solution x ∗ in the following way: x ∗ − x0 σ0 p0 + σ1 p1 + · · · + σn−1 pn−1 , for some choice of scalars σk . By premultiplying this expression by pkT A and using the conjugacy property (5.5), we obtain σk pkT A(x ∗ − x0 ) . pkT Apk (5.8) We now establish the result by showing that these coefficients σk coincide with the step lengths αk generated by the formula (5.7). 103 104 CHAPTER 5. CONJUGATE GRADIENT METHODS If xk is generated by algorithm (5.6), (5.7), then we have xk x0 + α0 p0 + α1 p1 + · · · + αk−1 pk−1 . By premultiplying this expression by pkT A and using the conjugacy property, we have that pkT A(xk − x0 ) 0, and therefore pkT A(x ∗ − x0 ) pkT A(x ∗ − xk ) pkT (b − Axk ) − pkT rk . By comparing this relation with (5.7) and (5.8), we find that σk αk , giving the result. There is a simple interpretation of the properties of conjugate directions. If the matrix A in (5.2) is diagonal, the contours of the function φ(·) are ellipses whose axes are aligned with the coordinate directions, as illustrated in Figure 5.1. We can find the minimizer of this function by performing one-dimensional minimizations along the coordinate directions e2 . x* . x0 . x1 e1 Figure 5.1 Successive minimizations along the coordinate directions find the minimizer of a quadratic with a diagonal Hessian in n iterations. 5.1. THE LINEAR CONJUGATE GRADIENT METHOD e2 x* x3 x2 x0 x1 e1 Figure 5.2 Successive minimization along coordinate axes does not find the solution in n iterations, for a general convex quadratic. e1 , e2 , . . . , en in turn. When A is not diagonal, its contours are still elliptical, but they are usually no longer aligned with the coordinate directions. The strategy of successive minimization along these directions in turn no longer leads to the solution in n iterations (or even in a finite number of iterations). This phenomenon is illustrated in the two-dimensional example of Figure 5.2 We can, however, recover the nice behavior of Figure 5.1 if we transform the problem to make A diagonal and then minimize along the coordinate directions. Suppose we transform the problem by defining new variables x̂ as x̂ S −1 x, (5.9) where S is the n × n matrix defined by S [ p0 p1 · · · pn−1 ], where { p0 , p2 , . . . , pn−1 } is the set of conjugate directions with respect to A. The quadratic φ defined by (5.2) now becomes def φ̂(x̂) φ(S x̂) 12 x̂ T (S T AS)x̂ − (S T b)T x̂. By the conjugacy property (5.5), the matrix S T AS is diagonal, so we can find the minimizing value of φ̂ by performing n one-dimensional minimizations along the coordinate directions 105 106 CHAPTER 5. CONJUGATE GRADIENT METHODS of x̂. Because of the relation (5.9), however, the ith coordinate direction in x̂-space corresponds to the direction pi in x-space. Hence, the coordinate search strategy applied to φ̂ is equivalent to the conjugate direction algorithm (5.6), (5.7). We conclude, as in Theorem 5.1, that the conjugate direction algorithm terminates in at most n steps. Returning to Figure 5.1, we note another interesting property: When the Hessian matrix is diagonal, each coordinate minimization correctly determines one of the components of the solution x ∗ . In other words, after k one-dimensional minimizations, the quadratic has been minimized on the subspace spanned by e1 , e2 , . . . , ek . The following theorem proves this important result for the general case in which the Hessian of the quadratic is not necessarily diagonal. (Here and later, we use the notation span{ p0 , p1 , . . . , pk } to denote the set of all linear combinations of the vectors p0 , p1 , . . . , pk .) In proving the result we will make use of the following expression, which is easily verified from the relations (5.4) and (5.6): rk+1 rk + αk Apk . (5.10) Theorem 5.2 (Expanding Subspace Minimization). Let x0 ∈ IRn be any starting point and suppose that the sequence {xk } is generated by the conjugate direction algorithm (5.6), (5.7). Then rkT pi 0, for i 0, 1, . . . , k − 1, (5.11) and xk is the minimizer of φ(x) 12 x T Ax − b T x over the set {x | x x0 + span{ p0 , p1 , . . . , pk−1 }}. (5.12) PROOF. We begin by showing that a point x̃ minimizes φ over the set (5.12) if and only if r (x̃)T pi 0, for each i 0, 1, . . . , k − 1. Let us define h(σ ) φ(x0 + σ0 p0 + · · · + σk−1 pk−1 ), where σ (σ0 , σ1 , . . . , σk−1 )T . Since h(σ ) is a strictly convex quadratic, it has a unique minimizer σ ∗ that satisfies ∂h(σ ∗ ) 0, ∂σi i 0, 1, . . . , k − 1. By the chain rule, this equation implies that ∗ ∇φ(x0 + σ0∗ p0 + · · · + σk−1 pk−1 )T pi 0, i 0, 1, . . . , k − 1. By recalling the definition (5.3), we have for the minimizer x̃ x0 + σ0∗ p0 + σ1∗ p2 + · · · + ∗ pk−1 on the set (5.12) that r (x̃)T pi 0, as claimed. σk−1 We now use induction to show that xk satisfies (5.11). For the case k 1, we have from the fact that x1 x0 + α0 p0 minimizes φ along p0 that r1T p0 0. Let us now make 5.1. THE LINEAR CONJUGATE GRADIENT METHOD T the induction hypothesis, namely, that rk−1 pi 0 for i 0, 1, . . . , k − 2. By (5.10), we have rk rk−1 + αk−1 Apk−1 , so that T T T rk pk−1 rk−1 + αk−1 pk−1 Apk−1 0, pk−1 by the definition (5.7) of αk−1 . Meanwhile, for the other vectors pi , i 0, 1, . . . , k − 2, we have piT rk piT rk−1 + αk−1 piT Apk−1 0, where piT rk−1 0 because of the induction hypothesis and piT Apk−1 0 because of conjugacy of the vectors pi . We have shown that rkT pi 0, for i 0, 1, . . . , k − 1, so the proof is complete. The fact that the current residual rk is orthogonal to all previous search directions, as expressed in (5.11), is a property that will be used extensively in this chapter. The discussion so far has been general, in that it applies to a conjugate direction method (5.6), (5.7) based on any choice of the conjugate direction set { p0 , p1 , . . . , pn−1 }. There are many ways to choose the set of conjugate directions. For instance, the eigenvectors v1 , v2 , . . . , vn of A are mutually orthogonal as well as conjugate with respect to A, so these could be used as the vectors { p0 , p1 , . . . , pn−1 }. For large-scale applications, however, computation of the complete set of eigenvectors requires an excessive amount of computation. An alternative approach is to modify the Gram–Schmidt orthogonalization process to produce a set of conjugate directions rather than a set of orthogonal directions. (This modification is easy to produce, since the properties of conjugacy and orthogonality are closely related in spirit.) However, the Gram–Schmidt approach is also expensive, since it requires us to store the entire direction set. BASIC PROPERTIES OF THE CONJUGATE GRADIENT METHOD The conjugate gradient method is a conjugate direction method with a very special property: In generating its set of conjugate vectors, it can compute a new vector pk by using only the previous vector pk−1 . It does not need to know all the previous elements p0 , p1 , . . . , pk−2 of the conjugate set; pk is automatically conjugate to these vectors. This remarkable property implies that the method requires little storage and computation. In the conjugate gradient method, each direction pk is chosen to be a linear combination of the negative residual −rk (which, by (5.3), is the steepest descent direction for the 107 108 CHAPTER 5. CONJUGATE GRADIENT METHODS function φ) and the previous direction pk−1 . We write pk −rk + βk pk−1 , (5.13) where the scalar βk is to be determined by the requirement that pk−1 and pk must be T A and imposing the condition conjugate with respect to A. By premultiplying (5.13) by pk−1 T pk−1 Apk 0, we find that βk rkT Apk−1 . T pk−1 Apk−1 We choose the first search direction p0 to be the steepest descent direction at the initial point x0 . As in the general conjugate direction method, we perform successive one-dimensional minimizations along each of the search directions. We have thus specified a complete algorithm, which we express formally as follows: Algorithm 5.1 (CG–Preliminary Version). Given x0 ; Set r0 ← Ax0 − b, p0 ← −r0 , k ← 0; while rk 0 rkT pk ; pkT Apk ← xk + αk pk ; αk ← − xk+1 rk+1 ← Axk+1 − b; r T Apk βk+1 ← k+1 ; pkT Apk pk+1 ← −rk+1 + βk+1 pk ; k ← k + 1; (5.14a) (5.14b) (5.14c) (5.14d) (5.14e) (5.14f) end (while) This version is useful for studying the essential properties of the conjugate gradient method, but we present a more efficient version later. We show first that the directions p0 , p1 , . . . , pn−1 are indeed conjugate, which by Theorem 5.1 implies termination in n steps. The theorem below establishes this property and two other important properties. First, the residuals ri are mutually orthogonal. Second, each search direction pk and residual rk is contained in the Krylov subspace of degree k for r0 , defined as def K(r0 ; k) span{r0 , Ar0 , . . . , Ak r0 }. (5.15) 5.1. THE LINEAR CONJUGATE GRADIENT METHOD Theorem 5.3. Suppose that the kth iterate generated by the conjugate gradient method is not the solution point x ∗ . The following four properties hold: rkT ri 0, for i 0, 1, . . . , k − 1, (5.16) span{r0 , r1 , . . . , rk } span{r0 , Ar0 , . . . , A r0 }, (5.17) span{ p0 , p1 , . . . , pk } span{r0 , Ar0 , . . . , A r0 }, (5.18) k k pkT Api 0, for i 0, 1, . . . , k − 1. (5.19) Therefore, the sequence {xk } converges to x ∗ in at most n steps. PROOF. The proof is by induction. The expressions (5.17) and (5.18) hold trivially for k 0, while (5.19) holds by construction for k 1. Assuming now that these three expressions are true for some k (the induction hypothesis), we show that they continue to hold for k + 1. To prove (5.17), we show first that the set on the left-hand side is contained in the set on the right-hand side. Because of the induction hypothesis, we have from (5.17) and (5.18) that rk ∈ span{r0 , Ar0 , . . . , Ak r0 }, pk ∈ span{r0 , Ar0 , . . . , Ak r0 }, while by multiplying the second of these expressions by A, we obtain Apk ∈ span{Ar0 , . . . , Ak+1 r0 }. (5.20) By applying (5.10), we find that rk+1 ∈ span{r0 , Ar0 , . . . , Ak+1r0 }. By combining this expression with the induction hypothesis for (5.17), we conclude that span{r0 , r1 , . . . , rk , rk+1 } ⊂ span{r0 , Ar0 , . . . , Ak+1r0 }. To prove that the reverse inclusion holds as well, we use the induction hypothesis on (5.18) to deduce that Ak+1r0 A(Ak r0 ) ∈ span{Ap0 , Ap1 , . . . , Apk }. Since by (5.10) we have Api (ri+1 − ri )/αi for i 0, 1, . . . , k, it follows that Ak+1r0 ∈ span{r0 , r1 , . . . , rk+1 }. 109 110 CHAPTER 5. CONJUGATE GRADIENT METHODS By combining this expression with the induction hypothesis for (5.17), we find that span{r0 , Ar0 , . . . , Ak+1r0 } ⊂ span{r0 , r1 , . . . , rk , rk+1 }. Therefore, the relation (5.17) continues to hold when k is replaced by k + 1, as claimed. We show that (5.18) continues to hold when k is replaced by k + 1 by the following argument: span{ p0 , p1 , . . . , pk , pk+1 } span{ p0 , p1 , . . . , pk , rk+1 } by (5.14e) span{r0 , Ar0 , . . . , A r0 , rk+1 } by induction hypothesis for (5.18) span{r0 , r1 , . . . , rk , rk+1 } by (5.17) span{r0 , Ar0 , . . . , A by (5.17) for k + 1. k k+1 r0 } Next, we prove the conjugacy condition (5.19) with k replaced by k +1. By multiplying (5.14e) by Api , i 0, 1, . . . , k, we obtain T T pk+1 Api −rk+1 Api + βk+1 pkT Api . (5.21) By the definition (5.14d) of βk , the right-hand-side of (5.21) vanishes when i k. For i ≤ k − 1 we need to collect a number of observations. Note first that our induction hypothesis for (5.19) implies that the directions p0 , p1 , . . . , pk are conjugate, so we can apply Theorem 5.2 to deduce that T rk+1 pi 0, for i 0, 1, . . . , k. (5.22) Second, by repeatedly applying (5.18), we find that for i 0, 1, . . . , k − 1, the following inclusion holds: Api ∈ A span{r0 , Ar0 , . . . , Ai r0 } span{Ar0 , A2r0 , . . . , Ai+1 r0 } ⊂ span{ p0 , p1 , . . . , pi+1 }. (5.23) By combining (5.22) and (5.23), we deduce that T rk+1 Api 0, for i 0, 1, . . . , k − 1, so the first term in the right-hand-side of (5.21) vanishes for i 0, 1, . . . , k − 1. Because of the induction hypothesis for (5.19), the second term vanishes as well, and we 5.1. THE LINEAR CONJUGATE GRADIENT METHOD T conclude that pk+1 Api 0, i 0, 1, . . . , k. Hence, the induction argument holds for (5.19) also. It follows that the direction set generated by the conjugate gradient method is indeed a conjugate direction set, so Theorem 5.1 tells us that the algorithm terminates in at most n iterations. Finally, we prove (5.16) by a noninductive argument. Because the direction set is conjugate, we have from (5.11) that rkT pi 0 for all i 0, 1, . . . , k − 1 and any k 1, 2, . . . , n − 1. By rearranging (5.14e), we find that pi −ri + βi pi−1 , so that ri ∈ span{ pi , pi−1 } for all i 1, . . . , k − 1. We conclude that rkT ri 0 for all i 1, . . . , k − 1. To complete the proof, we note that rkT r0 −rkT p0 0, by definition of p0 in Algorithm 5.1 and by (5.11). The proof of this theorem relies on the fact that the first direction p0 is the steepest descent direction −r0 ; in fact, the result does not hold for other choices of p0 . Since the gradients rk are mutually orthogonal, the term “conjugate gradient method” is actually a misnomer. It is the search directions, not the gradients, that are conjugate with respect to A. A PRACTICAL FORM OF THE CONJUGATE GRADIENT METHOD We can derive a slightly more economical form of the conjugate gradient method by using the results of Theorems 5.2 and 5.3. First, we can use (5.14e) and (5.11) to replace the formula (5.14a) for αk by αk rkT rk . pkT Apk Second, we have from (5.10) that αk Apk rk+1 − rk , so by applying (5.14e) and (5.11) once again we can simplify the formula for βk+1 to βk+1 T rk+1 rk+1 rkT rk . By using these formulae together with (5.10), we obtain the following standard form of the conjugate gradient method. 111 112 CHAPTER 5. CONJUGATE GRADIENT METHODS Algorithm 5.2 (CG). Given x0 ; Set r0 ← Ax0 − b, p0 ← −r0 , k ← 0; while rk 0 rkT rk ; pkT Apk ← xk + αk pk ; αk ← xk+1 rk+1 ← rk + αk Apk ; r T rk+1 βk+1 ← k+1T ; rk rk pk+1 ← −rk+1 + βk+1 pk ; k ← k + 1; (5.24a) (5.24b) (5.24c) (5.24d) (5.24e) (5.24f) end (while) At any given point in Algorithm 5.2 we never need to know the vectors x, r , and p for more than the last two iterations. Accordingly, implementations of this algorithm overwrite old values of these vectors to save on storage. The major computational tasks to be performed at each step are computation of the matrix–vector product Apk , calculation of T rk+1 , and calculation of three vector sums. The inner the inner products pkT (Apk ) and rk+1 product and vector sum operations can be performed in a small multiple of n floating-point operations, while the cost of the matrix–vector product is, of course, dependent on the problem. The CG method is recommended only for large problems; otherwise, Gaussian elimination or other factorization algorithms such as the singular value decomposition are to be preferred, since they are less sensitive to rounding errors. For large problems, the CG method has the advantage that it does not alter the coefficient matrix and (in contrast to factorization techniques) does not produce fill in the arrays holding the matrix. Another key property is that the CG method sometimes approaches the solution quickly, as we discuss next. RATE OF CONVERGENCE We have seen that in exact arithmetic the conjugate gradient method will terminate at the solution in at most n iterations. What is more remarkable is that when the distribution of the eigenvalues of A has certain favorable features, the algorithm will identify the solution in many fewer than n iterations. To explain this property, we begin by viewing the expanding subspace minimization property proved in Theorem 5.2 in a slightly different way, using it to show that Algorithm 5.2 is optimal in a certain important sense. 5.1. THE LINEAR CONJUGATE GRADIENT METHOD From (5.24b) and (5.18), we have that xk+1 x0 + α0 p0 + · · · + αk pk x0 + γ0r0 + γ1 Ar0 + · · · + γk Ak r0 , (5.25) for some constants γi . We now define Pk∗ (·) to be a polynomial of degree k with coefficients γ0 , γ1 , . . . , γk . Like any polynomial, Pk∗ can take either a scalar or a square matrix as its argument. For the matrix argument A, we have Pk∗ (A) γ0 I + γ1 A + · · · + γk Ak , which allows us to express (5.25) as follows: xk+1 x0 + Pk∗ (A)r0 . (5.26) We now show that among all possible methods whose first k steps are restricted to the Krylov subspace K(r0 ; k) given by (5.15), Algorithm 5.2 does the best job of minimizing the distance to the solution after k steps, when this distance is measured by the weighted norm measure · A defined by z2A z T Az. (5.27) (Recall that this norm was used in the analysis of the steepest descent method of Chapter 3.) Using this norm and the definition of φ (5.2), and the fact that x ∗ minimizes φ, it is easy to show that 1 x 2 − x ∗ 2A 12 (x − x ∗ )T A(x − x ∗ ) φ(x) − φ(x ∗ ). (5.28) Theorem 5.2 states that xk+1 minimizes φ, and hence x − x ∗ 2A , over the set x0 + span{ p0 , p1 , . . . , pk }, which by (5.18) is the same as x0 +span{r0 , Ar0 , . . . , Ak r0 }. It follows from (5.26) that the polynomial Pk∗ solves the following problem in which the minimum is taken over the space of all possible polynomials of degree k: min x0 + Pk (A)r0 − x ∗ A . Pk (5.29) We exploit this optimality property repeatedly in the remainder of the section. Since r0 Ax0 − b Ax0 − Ax ∗ A(x0 − x ∗ ), we have that xk+1 − x ∗ x0 + Pk∗ (A)r0 − x ∗ [I + Pk∗ (A)A](x0 − x ∗ ). (5.30) 113 114 CHAPTER 5. CONJUGATE GRADIENT METHODS Let 0 < λ1 ≤ λ2 ≤ · · · ≤ λn be the eigenvalues of A, and let v1 , v2 , . . . , vn be the corresponding orthonormal eigenvectors, so that n A λi vi viT . i1 Since the eigenvectors span the whole space IRn , we can write x0 − x ∗ n ξi vi , (5.31) i1 for some coefficients ξi . It is easy to show that any eigenvector of A is also an eigenvector of Pk (A) for any polynomial Pk . For our particular matrix A and its eigenvalues λi and eigenvectors vi , we have Pk (A)vi Pk (λi )vi , i 1, 2, . . . , n. By substituting (5.31) into (5.30) we have xk+1 − x ∗ n [1 + λi Pk∗ (λi )]ξi vi . i1 By using the fact that z2A z T Az n i1 xk+1 − x ∗ 2A n λi (viT z)2 , we have λi [1 + λi Pk∗ (λi )]2 ξi2 . (5.32) i1 Since the polynomial Pk∗ generated by the CG method is optimal with respect to this norm, we have xk+1 − x ∗ 2A min n Pk λi [1 + λi Pk (λi )]2 ξi2 . i1 By extracting the largest of the terms [1 + λi Pk (λi )]2 from this expression, we obtain that ⎛ xk+1 − x ∗ 2A ≤ min max [1 + λi Pk (λi )]2 ⎝ Pk 1≤i≤n n ⎞ λ j ξ 2j ⎠ j1 min max [1 + λi Pk (λi )] x0 − x ∗ 2A , 2 Pk 1≤i≤n where we have used the fact that x0 − x ∗ 2A n j1 λ j ξ 2j . (5.33) 5.1. THE LINEAR CONJUGATE GRADIENT METHOD The expression (5.33) allows us to quantify the convergence rate of the CG method by estimating the nonnegative scalar quantity min max [1 + λi Pk (λi )]2 . (5.34) Pk 1≤i≤n In other words, we search for a polynomial Pk that makes this expression as small as possible. In some practical cases, we can find this polynomial explicitly and draw some interesting conclusions about the properties of the CG method. The following result is an example. Theorem 5.4. If A has only r distinct eigenvalues, then the CG iteration will terminate at the solution in at most r iterations. PROOF. Suppose that the eigenvalues λ1 , λ2 , . . . , λn take on the r distinct values τ1 < τ2 < · · · < τr . We define a polynomial Q r (λ) by Q r (λ) (−1)r (λ − τ1 )(λ − τ2 ) · · · (λ − τr ), τ1 τ2 · · · τr and note that Q r (λi ) 0 for i 1, 2, . . . , n and Q r (0) 1. From the latter observation, we deduce that Q r (λ) − 1 is a polynomial of degree r with a root at λ 0, so by polynomial division, the function P̄r −1 defined by P̄r −1 (λ) (Q r (λ) − 1)/λ is a polynomial of degree r − 1. By setting k r − 1 in (5.34), we have 0 ≤ min max [1 + λi Pr −1 (λi )]2 ≤ max [1 + λi P̄r −1 (λi )]2 max Q r2 (λi ) 0. Pr −1 1≤i≤n 1≤i≤n 1≤i≤n Hence, the constant in (5.34) is zero for the value k r − 1, so we have by substituting into (5.33) that xr − x ∗ 2A 0, and therefore xr x ∗ , as claimed. By using similar reasoning, Luenberger [195] establishes the following estimate, which gives a useful characterization of the behavior of the CG method. Theorem 5.5. If A has eigenvalues λ1 ≤ λ2 ≤ · · · ≤ λn , we have that xk+1 − x ∗ 2A ≤ λn−k − λ1 λn−k + λ1 2 x0 − x ∗ 2A . (5.35) 115 116 CHAPTER 5. CONJUGATE GRADIENT METHODS λ1 0 Figure 5.3 | 1 λ n−m λ n−m+1 λn Two clusters of eigenvalues. Without giving details of the proof, we describe how this result is obtained from (5.33). One selects a polynomial P̄k of degree k such that the polynomial Q k+1 (λ) 1 + λ P̄k (λ) has roots at the k largest eigenvalues λn , λn−1 , . . . , λn−k+1 , as well as at the midpoint between λ1 and λn−k . It can be shown that the maximum value attained by Q k+1 on the remaining eigenvalues λ1 , λ2 , . . . , λn−k is precisely (λn−k − λ1 )/(λn−k + λ1 ). We now illustrate how Theorem 5.5 can be used to predict the behavior of the CG method on specific problems. Suppose we have the situation plotted in Figure 5.3, where the eigenvalues of A consist of m large values, with the remaining n − m smaller eigenvalues clustered around 1. If we define λn−m − λ1 , Theorem 5.5 tells us that after m + 1 steps of the conjugate gradient algorithm, we have xm+1 − x ∗ A ≈ x0 − x ∗ A . For a small value of , we conclude that the CG iterates will provide a good estimate of the solution after only m + 1 steps. Figure 5.4 shows the behavior of CG on a problem of this type, which has five large eigenvalues with all the smaller eigenvalues clustered between 0.95 and 1.05, and compares this behavior with that of CG on a problem in which the eigenvalues satisfy some random distribution. In both cases, we plot the log of φ after each iteration. For the problem with clustered eigenvalues, Theorem 5.5 predicts a sharp decrease in the error measure at iteration 6. Note, however, that this decrease was achieved one iteration earlier, illustrating the fact that Theorem 5.5 gives only an upper bound, and that the rate of convergence can be faster. By contrast, we observe in Figure 5.4 that for the problem with randomly distributed eigenvalues (dashed line), the convergence rate is slower and more uniform. Figure 5.4 illustrates another interesting feature: After one more iteration (a total of seven) on the problem with clustered eigenvalues, the error measure drops sharply. An extension of the arguments leading to Theorem 5.4 explains this behavior. It is almost true to say that the matrix A has just six distinct eigenvalues: the five large eigenvalues and 1. Then we would expect the error measure to be zero after six iterations. Because the eigenvalues near 1 are slightly spread out, however, the error does not become very small until iteration 7. 5.1. THE LINEAR CONJUGATE GRADIENT METHOD log(||x-x*||A2) 5 clustered eigenvalues 0 uniformly distributed eigenvalues -5 -10 1 2 3 4 5 6 7 iteration Figure 5.4 Performance of the conjugate gradient method on (a) a problem in which five of the eigenvalues are large and the remainder are clustered near 1, and (b) a matrix with uniformly distributed eigenvalues. To state this claim more precisely, it is generally true that if the eigenvalues occur in r distinct clusters, the CG iterates will approximately solve the problem in about r steps (see [136]). This result can be proved by constructing a polynomial P̄r −1 such that (1+λ P̄r −1 (λ)) has zeros inside each of the clusters. This polynomial may not vanish at the eigenvalues λi , i 1, 2, . . . , n, but its value will be small at these points, so the constant defined in (5.34) will be small for k ≥ r − 1. We illustrate this behavior in Figure 5.5, which shows the performance of CG on a matrix of dimension n 14 that has four clusters of eigenvalues: single eigenvalues at 140 and 120, a cluster of 10 eigenvalues very close to 10, with the remaining eigenvalues clustered between 0.95 and 1.05. After four iterations, the error has decreased significantly. After six iterations, the solution is identified to good accuracy. Another, more approximate, convergence expression for CG is based on the Euclidean condition number of A, which is defined by κ(A) A2 A−1 2 λn /λ1 . It can be shown that k √ κ(A) − 1 xk − x A ≤ 2 √ x0 − x ∗ A . κ(A) + 1 ∗ (5.36) This bound often gives a large overestimate of the error, but it can be useful in those cases 117 118 CHAPTER 5. CONJUGATE GRADIENT METHODS log(||x-x*||A2) 5 0 -5 -10 1 2 3 4 5 6 7 iteration Figure 5.5 Performance of the conjugate gradient method on a matrix in which the eigenvalues occur in four distinct clusters. where the only information we have about A is estimates of the extreme eigenvalues λ1 and λn . This bound should be compared with that of the steepest descent method given by (3.29), which is identical in form but which depends on the condition number κ(A), and √ not on its square root κ(A). PRECONDITIONING We can accelerate the conjugate gradient method by transforming the linear system to improve the eigenvalue distribution of A. The key to this process, which is known as preconditioning, is a change of variables from x to x̂ via a nonsingular matrix C, that is, x̂ C x. (5.37) The quadratic φ defined by (5.2) is transformed accordingly to φ̂(x̂) 12 x̂ T (C −T AC −1 )x̂ − (C −T b)T x̂. (5.38) If we use Algorithm 5.2 to minimize φ̂ or, equivalently, to solve the linear system (C −T AC −1 )x̂ C −T b, then the convergence rate will depend on the eigenvalues of the matrix C −T AC −1 rather than those of A. Therefore, we aim to choose C such that the eigenvalues of C −T AC −1 5.1. THE LINEAR CONJUGATE GRADIENT METHOD are more favorable for the convergence theory discussed above. We can try to choose C such that the condition number of C −T AC −1 is much smaller than the original condition number of A, for instance, so that the constant in (5.36) is smaller. We could also try to choose C such that the eigenvalues of C −T AC −1 are clustered, which by the discussion of the previous section ensures that the number of iterates needed to find a good approximate solution is not much larger than the number of clusters. It is not necessary to carry out the transformation (5.37) explicitly. Rather, we can apply Algorithm 5.2 to the problem (5.38), in terms of the variables x̂, and then invert the transformations to reexpress all the equations in terms of x. This process of derivation results in Algorithm 5.3 (Preconditioned Conjugate Gradient), which we now define. It happens that Algorithm 5.3 does not make use of C explicitly, but rather the matrix M C T C, which is symmetric and positive definite by construction. Algorithm 5.3 (Preconditioned CG). Given x0 , preconditioner M; Set r0 ← Ax0 − b; Solve M y0 r0 for y0 ; Set p0 −y0 , k ← 0; while rk 0 rkT yk ; pkT Apk ← xk + αk pk ; αk ← xk+1 rk+1 ← rk + αk Apk ; (5.39a) (5.39b) (5.39c) Solve M yk+1 rk+1 ; r T yk+1 βk+1 ← k+1T ; rk yk pk+1 ← −yk+1 + βk+1 pk ; (5.39d) k ← k + 1; (5.39g) (5.39e) (5.39f) end (while) If we set M I in Algorithm 5.3, we recover the standard CG method, Algorithm 5.2. The properties of Algorithm 5.2 generalize to this case in interesting ways. In particular, the orthogonality property (5.16) of the successive residuals becomes riT M −1r j 0 for all i j. (5.40) 119 120 CHAPTER 5. CONJUGATE GRADIENT METHODS In terms of computational effort, the main difference between the preconditioned and unpreconditioned CG methods is the need to solve systems of the form M y r (step (5.39d)). PRACTICAL PRECONDITIONERS No single preconditioning strategy is “best” for all conceivable types of matrices: The tradeoff between various objectives—effectiveness of M, inexpensive computation and storage of M, inexpensive solution of M y r —varies from problem to problem. Good preconditioning strategies have been devised for specific types of matrices, in particular, those arising from discretizations of partial differential equations (PDEs). Often, the preconditioner is defined in such a way that the system M y r amounts to a simplified version of the original system Ax b. In the case of a PDE, M y r could represent a coarser discretization of the underlying continuous problem than Ax b. As in many other areas of optimization and numerical analysis, knowledge about the structure and origin of a problem (in this case, knowledge that the system Ax b is a finite-dimensional representation of a PDE) is the key to devising effective techniques for solving the problem. General-purpose preconditioners have also been proposed, but their success varies greatly from problem to problem. The most important strategies of this type include symmetric successive overrelaxation (SSOR), incomplete Cholesky, and banded preconditioners. (See [272], [136], and [72] for discussions of these techniques.) Incomplete Cholesky is probably the most effective in general. The basic idea is simple: We follow the Cholesky procedure, but instead of computing the exact Cholesky factor L that satisfies A L L T , we compute an approximate factor L̃ that is sparser than L. (Usually, we require L̃ to be no denser, or not much denser, than the lower triangle of the original matrix A.) We then have A ≈ L̃ L̃ T , and by choosing C L̃ T , we obtain M L̃ L̃ T and C −T AC −1 L̃ −1 A L̃ −T ≈ I, so the eigenvalue distribution of C −T AC −1 is favorable. We do not compute M explicitly, but rather store the factor L̃ and solve the system M y r by performing two triangular substitutions with L̃. Because the sparsity of L̃ is similar to that of A, the cost of solving M y r is similar to the cost of computing the matrix–vector product Ap. There are several possible pitfalls in the incomplete Cholesky approach. One is that the resulting matrix may not be (sufficiently) positive definite, and in this case one may need to increase the values of the diagonal elements to ensure that a value for L̃ can be found. Numerical instability or breakdown can occur during the incomplete factorization because of the sparsity conditions we impose on the factor L̃. This difficulty can be remedied by allowing additional fill-in in L̃, but the denser factor will be more expensive to compute and to apply at each iteration. 5.2. 5.2 NONLINEAR CONJUGATE GRADIENT METHODS NONLINEAR CONJUGATE GRADIENT METHODS We have noted that the CG method, Algorithm 5.2, can be viewed as a minimization algorithm for the convex quadratic function φ defined by (5.2). It is natural to ask whether we can adapt the approach to minimize general convex functions, or even general nonlinear functions f . In fact, as we show in this section, nonlinear variants of the conjugate gradient are well studied and have proved to be quite successful in practice. THE FLETCHER–REEVES METHOD Fletcher and Reeves [107] showed how to extend the conjugate gradient method to nonlinear functions by making two simple changes in Algorithm 5.2. First, in place of the formula (5.24a) for the step length αk (which minimizes φ along the search direction pk ), we need to perform a line search that identifies an approximate minimum of the nonlinear function f along pk . Second, the residual r , which is simply the gradient of φ in Algorithm 5.2 (see (5.3)), must be replaced by the gradient of the nonlinear objective f . These changes give rise to the following algorithm for nonlinear optimization. Algorithm 5.4 (FR). Given x0 ; Evaluate f 0 f (x0 ), ∇ f 0 ∇ f (x0 ); Set p0 ← −∇ f 0 , k ← 0; while ∇ f k 0 Compute αk and set xk+1 xk + αk pk ; Evaluate ∇ f k+1 ; FR βk+1 ← pk+1 T ∇ f k+1 ∇ f k+1 ; ∇ f kT ∇ f k FR ← −∇ f k+1 + βk+1 pk ; k ← k + 1; (5.41a) (5.41b) (5.41c) end (while) If we choose f to be a strongly convex quadratic and αk to be the exact minimizer, this algorithm reduces to the linear conjugate gradient method, Algorithm 5.2. Algorithm 5.4 is appealing for large nonlinear optimization problems because each iteration requires only evaluation of the objective function and its gradient. No matrix operations are required for the step computation, and just a few vectors of storage are required. To make the specification of Algorithm 5.4 complete, we need to be more precise about the choice of line search parameter αk . Because of the second term in (5.41b), the search direction pk may fail to be a descent direction unless αk satisfies certain conditions. 121 122 CHAPTER 5. CONJUGATE GRADIENT METHODS By taking the inner product of (5.41b) (with k replacing k + 1) with the gradient vector ∇ f k , we obtain ∇ f kT pk −∇ f k 2 + βkFR ∇ f kT pk−1 . (5.42) If the line search is exact, so that αk−1 is a local minimizer of f along the direction pk−1 , we have that ∇ f kT pk−1 0. In this case we have from (5.42) that ∇ f kT pk < 0, so that pk is indeed a descent direction. If the line search is not exact, however, the second term in (5.42) may dominate the first term, and we may have ∇ f kT pk > 0, implying that pk is actually a direction of ascent. Fortunately, we can avoid this situation by requiring the step length αk to satisfy the strong Wolfe conditions, which we restate here: f (xk + αk pk ) ≤ f (xk ) + c1 αk ∇ f kT pk , |∇ f (xk + αk pk ) pk | ≤ −c2 ∇ T f kT pk , (5.43a) (5.43b) where 0 < c1 < c2 < 12 . (Note that we impose c2 < 12 here, in place of the looser condition c2 < 1 that was used in the earlier statement (3.7).) By applying Lemma 5.6 below, we can show that condition (5.43b) implies that (5.42) is negative, and we conclude that any line search procedure that yields an αk satisfying (5.43) will ensure that all directions pk are descent directions for the function f . THE POLAK–RIBIÈRE METHOD AND VARIANTS There are many variants of the Fletcher–Reeves method that differ from each other mainly in the choice of the parameter βk . An important variant, proposed by Polak and Ribière, defines this parameter as follows: PR βk+1 T (∇ f k+1 − ∇ f k ) ∇ f k+1 . ∇ f k 2 (5.44) We refer to the algorithm in which (5.44) replaces (5.41a) as Algorithm PR. It is identical to Algorithm FR when f is a strongly convex quadratic function and the line search is exact, PR FR βk+1 . When applied since by (5.16) the gradients are mutually orthogonal, and so βk+1 to general nonlinear functions with inexact line searches, however, the behavior of the two algorithms differs markedly. Numerical experience indicates that Algorithm PR tends to be the more robust and efficient of the two. A surprising fact about Algorithm PR is that the strong Wolfe conditions (5.43) do not guarantee that pk is always a descent direction. If we define the β parameter as + PR βk+1 max{βk+1 , 0}, (5.45) 5.2. NONLINEAR CONJUGATE GRADIENT METHODS giving rise to an algorithm we call Algorithm PR+, then a simple adaptation of the strong Wolfe conditions ensures that the descent property holds. There are many other choices for βk+1 that coincide with the Fletcher–Reeves formula FR βk+1 in the case where the objective is quadratic and the line search is exact. The Hestenes– Stiefel formula, which defines HS βk+1 T (∇ f k+1 − ∇ f k ) ∇ f k+1 , (∇ f k+1 − ∇ f k )T pk (5.46) gives rise to an algorithm (called Algorithm HS) that is similar to Algorithm PR, both in terms of its theoretical convergence properties and in its practical performance. Formula (5.46) can be derived by demanding that consecutive search directions be conjugate with respect to the average Hessian over the line segment [xk , xk+1 ], which is defined as 1 Ḡ k ≡ [∇ 2 f (xk + τ αk pk )]dτ. 0 Recalling from Taylor’s theorem (Theorem 2.1) that ∇ f k+1 ∇ f k + αk Ḡ k pk , we see that T Ḡ k pk 0 for any direction of the form pk+1 −∇ f k+1 + βk+1 pk , the condition pk+1 requires βk+1 to be given by (5.46). Later, we see that it is possible to guarantee global convergence for any parameter βk satisfying the bound |βk | ≤ βkFR , (5.47) for all k ≥ 2. This fact suggests the following modification of the PR method, which has performed well on some applications. For all k ≥ 2 let ⎧ FR ⎪ ⎨ −βk βk βkPR ⎪ ⎩ βkFR if βkPR < −βkFR if |βkPR | ≤ βkFR if βk > βk . PR (5.48) FR The algorithm based on this strategy will be denoted by FR-PR. Other variants of the CG method have recently been proposed. Two choices for βk+1 that possess attractive theoretical and computational properties are βk+1 ∇ f k+1 2 (∇ f k+1 − ∇ f k )T pk (5.49) (see [85]) and βk+1 ŷk − 2 pk ŷk 2 ŷkT pk T ∇ f k+1 , ŷkT pk with ŷk ∇ f k+1 − ∇ f k (5.50) 123 124 CHAPTER 5. CONJUGATE GRADIENT METHODS (see [161]). These two choices guarantee that pk is a descent direction, provided the steplength αk satisfies the Wolfe conditions. The CG algorithms based on (5.49) or (5.50) appear to be competitive with the Polak–Ribière method. QUADRATIC TERMINATION AND RESTARTS Implementations of nonlinear conjugate gradient methods usually preserve their close connections with the linear conjugate gradient method. Usually, a quadratic (or cubic) interpolation along the search direction pk is incorporated into the line search procedure; see Chapter 3. This feature guarantees that when f is a strictly convex quadratic, the step length αk is chosen to be the exact one-dimensional minimizer, so that the nonlinear conjugate gradient method reduces to the linear method, Algorithm 5.2. Another modification that is often used in nonlinear conjugate gradient procedures is to restart the iteration at every n steps by setting βk 0 in (5.41a), that is, by taking a steepest descent step. Restarting serves to periodically refresh the algorithm, erasing old information that may not be beneficial. We can even prove a strong theoretical result about restarting: It leads to n-step quadratic convergence, that is, xk+n − x O xk − x ∗ 2 . (5.51) After a little thought, this result is not so surprising. Consider a function f that is strongly convex quadratic in a neighborhood of the solution, but is nonquadratic everywhere else. Assuming that the algorithm is converging to the solution in question, the iterates will eventually enter the quadratic region. At some point, the algorithm will be restarted in that region, and from that point onward, its behavior will simply be that of the linear conjugate gradient method, Algorithm 5.2. In particular, finite termination will occur within n steps of the restart. The restart is important, because the finite-termination property and other appealing properties of Algorithm 5.2 hold only when its initial search direction p0 is equal to the negative gradient. Even if the function f is not exactly quadratic in the region of a solution, Taylor’s theorem (Theorem 2.1) implies that it can still be approximated quite closely by a quadratic, provided that it is smooth. Therefore, while we would not expect termination in n steps after the restart, it is not surprising that substantial progress is made toward the solution, as indicated by the expression (5.51). Though the result (5.51) is interesting from a theoretical viewpoint, it may not be relevant in a practical context, because nonlinear conjugate gradient methods can be recommended only for solving problems with large n. Restarts may never occur in such problems because an approximate solution may be located in fewer than n steps. Hence, nonlinear CG method are sometimes implemented without restarts, or else they include strategies for restarting that are based on considerations other than iteration counts. The most popular restart strategy makes use of the observation (5.16), which is that the gradients are mutually orthogonal when f is a quadratic function. A restart is performed whenever two consecutive 5.2. NONLINEAR CONJUGATE GRADIENT METHODS gradients are far from orthogonal, as measured by the test |∇ f kT ∇ f k−1 | ≥ ν, ∇ f k 2 (5.52) where a typical value for the parameter ν is 0.1. We could also think of formula (5.45) as a restarting strategy, because pk+1 will revert to the steepest descent direction whenever βkPR is negative. In contrast to (5.52), these restarts are rather infrequent because βkPR is positive most of the time. BEHAVIOR OF THE FLETCHER–REEVES METHOD We now investigate the Fletcher–Reeves algorithm, Algorithm 5.4, a little more closely, proving that it is globally convergent and explaining some of its observed inefficiencies. The following result gives conditions on the line search under which all search directions are descent directions. It assumes that the level set L {x : f (x) ≤ f (x0 )} is bounded and that f is twice continuously differentiable, so that we have from Lemma 3.1 that there exists a step length αk satisfying the strong Wolfe conditions. Lemma 5.6. Suppose that Algorithm 5.4 is implemented with a step length αk that satisfies the strong Wolfe conditions (5.43) with 0 < c2 < 12 . Then the method generates descent directions pk that satisfy the following inequalities: − ∇ f kT pk 2c2 − 1 1 ≤ ≤ , 1 − c2 ∇ f k 2 1 − c2 for all k 0, 1, . . . . (5.53) def PROOF. Note first that the function t(ξ ) (2ξ − 1)/(1 − ξ ) is monotonically increasing on the interval [0, 12 ] and that t(0) −1 and t( 21 ) 0. Hence, because of c2 ∈ (0, 12 ), we have −1< 2c2 − 1 < 0. 1 − c2 (5.54) The descent condition ∇ f kT pk < 0 follows immediately once we establish (5.53). The proof is by induction. For k 0, the middle term in (5.53) is −1, so by using (5.54), we see that both inequalities in (5.53) are satisfied. Next, assume that (5.53) holds for some k ≥ 1. From (5.41b) and (5.41a) we have T T T pk+1 ∇ f k+1 pk pk ∇ f k+1 ∇ f k+1 −1 + β −1 + . k+1 2 2 ∇ f k+1 ∇ f k+1 ∇ f k 2 (5.55) 125 126 CHAPTER 5. CONJUGATE GRADIENT METHODS By using the line search condition (5.43b), we have T pk | ≤ −c2 ∇ f kT pk , |∇ f k+1 so by combining with (5.55) and recalling (5.41a), we obtain −1 + c2 T pk+1 ∇ f k+1 ∇ f kT pk ∇ f kT pk ≤ ≤ −1 − c . 2 ∇ f k 2 ∇ f k+1 2 ∇ f k 2 Substituting for the term ∇ f kT pk /∇ f k 2 from the left-hand-side of the induction hypothesis (5.53), we obtain −1 − T pk+1 ∇ f k+1 c2 c2 ≤ ≤ −1 + , 2 1 − c2 ∇ f k+1 1 − c2 which shows that (5.53) holds for k + 1 as well. This result used only the second strong Wolfe condition (5.43b); the first Wolfe condition (5.43a) will be needed in the next section to establish global convergence. The bounds on ∇ f kT pk in (5.53) impose a limit on how fast the norms of the steps pk can grow, and they will play a crucial role in the convergence analysis given below. Lemma 5.6 can also be used to explain a weakness of the Fletcher–Reeves method. We will argue that if the method generates a bad direction and a tiny step, then the next direction and next step are also likely to be poor. As in Chapter 3, we let θk denote the angle between pk and the steepest descent direction −∇ f k , defined by cos θk −∇ f kT pk . ∇ f k pk (5.56) Suppose that pk is a poor search direction, in the sense that it makes an angle of nearly 90◦ with −∇ f k , that is, cos θk ≈ 0. By multiplying both sides of (5.53) by ∇ f k / pk and using (5.56), we obtain 1 ∇ f k 1 − 2c2 ∇ f k ≤ cos θk ≤ , 1 − c2 pk 1 − c2 pk for all k 0, 1, . . .. (5.57) From these inequalities, we deduce that cos θk ≈ 0 if and only if ∇ f k pk . Since pk is almost orthogonal to the gradient, it is likely that the step from xk to xk+1 is tiny, that is, xk+1 ≈ xk . If so, we have ∇ f k+1 ≈ ∇ f k , and therefore FR ≈ 1, βk+1 (5.58) 5.2. NONLINEAR CONJUGATE GRADIENT METHODS by the definition (5.41a). By using this approximation together with ∇ f k+1 ≈ ∇ f k pk in (5.41b), we conclude that pk+1 ≈ pk , so the new search direction will improve little (if at all) on the previous one. It follows that if the condition cos θk ≈ 0 holds at some iteration k and if the subsequent step is small, a long sequence of unproductive iterates will follow. The Polak–Ribière method behaves quite differently in these circumstances. If, as in the previous paragraph, the search direction pk satisfies cos θk ≈ 0 for some k, and if the PR ≈ 0. subsequent step is small, it follows by substituting ∇ f k ≈ ∇ f k+1 into (5.44) that βk+1 From the formula (5.41b), we find that the new search direction pk+1 will be close to the steepest descent direction −∇ f k+1 , and cos θk+1 will be close to 1. Therefore, Algorithm PR essentially performs a restart after it encounters a bad direction. The same argument can be applied to Algorithms PR+ and HS. For the FR-PR variant, defined by (5.48), we have FR PR PR ≈ 1, and βk+1 ≈ 0. The formula (5.48) thus sets βk+1 βk+1 , as noted already that βk+1 desired. Thus, the modification (5.48) seems to avoid the inefficiencies of the FR method, while falling back on this method for global convergence. The undesirable behavior of the Fletcher–Reeves method predicted by the arguments given above can be observed in practice. For example, the paper [123] describes a problem with n 100 in which cos θk is of order 10−2 for hundreds of iterations and the steps xk − xk−1 are of order 10−2 . Algorithm FR requires thousands of iterations to solve this problem, while Algorithm PR requires just 37 iterations. In this example, the Fletcher– Reeves method performs much better if it is periodically restarted along the steepest descent direction, since each restart terminates the cycle of bad steps. In general, Algorithm FR should not be implemented without some kind of restart strategy. GLOBAL CONVERGENCE Unlike the linear conjugate gradient method, whose convergence properties are well understood and which is known to be optimal as described above, nonlinear conjugate gradient methods possess surprising, sometimes bizarre, convergence properties. We now present a few of the main results known for the Fletcher–Reeves and Polak–Ribière methods using practical line searches. For the purposes of this section, we make the following (nonrestrictive) assumptions on the objective function. Assumptions 5.1. (i) The level set L : {x | f (x) ≤ f (x0 )} is bounded; (ii) In some open neighborhood N of L, the objective function f is Lipschitz continuously differentiable. 127 128 CHAPTER 5. CONJUGATE GRADIENT METHODS These assumptions imply that there is a constant γ̄ such that ∇ f (x) ≤ γ̄ , for all x ∈ L. (5.59) Our main analytical tool in this section is Zoutendijk’s theorem—Theorem 3.2 in Chapter 3. It states, that under Assumptions 5.1, any line search iteration of the form xk+1 xk + αk pk , where pk is a descent direction and αk satisfies the Wolfe conditions (5.43) gives the limit ∞ cos2 θk ∇ f k 2 < ∞. (5.60) k0 We can use this result to prove global convergence for algorithms that are periodically restarted by setting βk 0. If k1 , k2 , and so on denote the iterations on which restarts occur, we have from (5.60) that ∇ f k 2 < ∞. (5.61) kk1 ,k2 ,... If we allow no more than n̄ iterations between restarts, the sequence {k j }∞ j1 is infinite, and from (5.61) we have that lim j→∞ ∇ f k j 0. That is, a subsequence of gradients approaches zero, or equivalently, lim inf ∇ f k 0. k→∞ (5.62) This result applies equally to restarted versions of all the algorithms discussed in this chapter. It is more interesting, however, to study the global convergence of unrestarted conjugate gradient methods, because for large problems (say n ≥ 1000) we expect to find a solution in many fewer than n iterations—the first point at which a regular restart would take place. Our study of large sequences of unrestarted conjugate gradient iterations reveals some surprising patterns in their behavior. We can build on Lemma 5.6 and Zoutendijk’s result (5.60) to prove a global convergence result for the Fletcher–Reeves method. While we cannot show that the limit of the sequence of gradients {∇ f k } is zero, the following result shows that this sequence is not bounded away from zero. Theorem 5.7 (Al-Baali [3]). Suppose that Assumptions 5.1 hold, and that Algorithm 5.4 is implemented with a line search that satisfies the strong Wolfe conditions (5.43), with 0 < c1 < c2 < 12 . Then lim inf ∇ f k 0. k→∞ (5.63) 5.2. NONLINEAR CONJUGATE GRADIENT METHODS PROOF. The proof is by contradiction. It assumes that the opposite of (5.63) holds, that is, there is a constant γ > 0 such that ∇ f k ≥ γ , (5.64) for all k sufficiently large. By substituting the left inequality of (5.57) into Zoutendijk’s condition (5.60), we obtain ∞ ∇ f k 4 < ∞. pk 2 k0 (5.65) By using (5.43b) and (5.53), we obtain that T |∇ f kT pk−1 | ≤ −c2 ∇ f k−1 pk−1 ≤ c2 ∇ f k−1 2 . 1 − c2 (5.66) Thus, from (5.41b) and recalling the definition (5.41a) of βkFR we obtain pk 2 ≤ ∇ f k 2 + 2βkFR |∇ f kT pk−1 | + (βkFR )2 pk−1 2 2c2 FR ≤ ∇ f k 2 + β ∇ f k−1 2 + (βkFR )2 pk−1 2 1 − c2 k 1 + c2 ∇ f k 2 + (βkFR )2 pk−1 2 . 1 − c2 def Applying this relation repeatedly, and defining c3 (1 + c2 )/(1 − c2 ) ≥ 1, we have FR pk 2 ≤ c3 ∇ f k 2 + (βkFR )2 (c3 ∇ f k−1 2 + (βk−1 )2 (c3 ∇ f k−2 2 + · · · + (β1FR )2 p0 2 )) · · ·) c3 ∇ f k 4 k ∇ f j −2 , (5.67) j0 where we used the facts that FR FR (βkFR )2 (βk−1 )2 · · · (βk−i )2 ∇ f k 4 ∇ f k−i−1 4 and p0 −∇ f 0 . By using the bounds (5.59) and (5.64) in (5.67), we obtain pk 2 ≤ c3 γ̄ 4 k, γ2 (5.68) 129 130 CHAPTER 5. CONJUGATE GRADIENT METHODS which implies that ∞ k1 ∞ 1 1 , ≥ γ4 2 pk k k1 (5.69) for some positive constant γ4 . On the other hand, from (5.64) and (5.65), we have that ∞ k1 1 < ∞. pk 2 (5.70) However, if we combine this inequality with (5.69), we obtain that ∞ k1 1/k < ∞, which is not true. Hence, (5.64) does not hold, and the claim (5.63) is proved. This global convergence result can be extended to any choice of βk satisfying (5.47), and in particular to the FR-PR method given by (5.48). In general, if we can show that there exist constants c4 , c5 > 0 such that cos θk ≥ c4 ∇ f k , pk ∇ f k ≥ c5 > 0, pk k 1, 2, . . . , it follows from (5.60) that lim ∇ f k 0. k→∞ In fact, this result can be established for the Polak–Ribière method under the assumption that f is strongly convex and that an exact line search is used. For general (nonconvex) functions, however, is it not possible to prove a result like Theorem 5.7 for Algorithm PR. This fact is unexpected, since the Polak–Ribière method performs better in practice than the Fletcher–Reeves method. The following surprising result shows that the Polak–Ribière method can cycle infinitely without approaching a solution point, even if an ideal line search is used. (By “ideal” we mean that line search returns a value αk that is the first positive stationary point for the function t(α) f (xk + αpk ).) Theorem 5.8. Consider the Polak–Ribière method method (5.44) with an ideal line search. There exists a twice continuously differentiable objective function f : IR3 → IR and a starting point x0 ∈ IR3 such that the sequence of gradients {∇ f k } is bounded away from zero. The proof of this result, given in [253], is quite complex. It demonstrates the existence of the desired objective function without actually constructing this function explicitly. The result is interesting, since the step length assumed in the proof—the first stationary point— may be accepted by any of the practical line search algorithms currently in use. The proof 5.2. NONLINEAR CONJUGATE GRADIENT METHODS of Theorem 5.8 requires that some consecutive search directions become almost negatives of each other. In the case of ideal line searches, this happens only if βk < 0, so the analysis suggests Algorithm PR+ (see (5.45)), in which we reset βk to zero whenever it becomes negative. We mentioned earlier that a line search strategy based on a slight modification of the Wolfe conditions guarantees that all search directions generated by Algorithm PR+ are descent directions. Using these facts, it is possible to a prove global convergence result like Theorem 5.7 for Algorithm PR+. An attractive property of the formulae (5.49), (5.50) is that global convergence can be established without introducing any modification to a line search based on the Wolfe conditions. NUMERICAL PERFORMANCE Table 5.1 illustrates the performance of Algorithms FR, PR, and PR+ without restarts. For these tests, the parameters in the strong Wolfe conditions (5.43) were chosen to be c1 10−4 and c2 0.1. The iterations were terminated when ∇ f k ∞ < 10−5 (1 + | f k |). If this condition was not satisfied after 10,000 iterations, we declare failure (indicated by a ∗ in the table). The final column, headed “mod,” indicates the number of iterations of Algorithm PR+ for which the adjustment (5.45) was needed to ensure that βkPR ≥ 0. Algorithm FR on problem GENROS takes very short steps far from the solution that lead to tiny improvements in the objective function, and convergence was not achieved within the maximum number of iterations. The Polak–Ribière algorithm, or its variation PR+, are not always more efficient than Algorithm FR, and it has the slight disadvantage of requiring one more vector of storage. Nevertheless, we recommend that users choose Algorithm PR, PR+ or FR-PR, or the methods based on (5.49) and (5.50). Table 5.1 Iterations and function/gradient evaluations required by three nonlinear conjugate gradient methods on a set of test problems; see [123] Problem CALCVAR3 GENROS XPOWSING TRIDIA1 MSQRT1 XPOWELL TRIGON n 200 500 1000 1000 1000 1000 1000 Alg FR it/f-g Alg PR it/f-g 2808/5617 ∗ 533/1102 264/531 422/849 568/1175 231/467 2631/5263 1068/2151 212/473 262/527 113/231 212/473 40/92 Alg PR+ it/f-g mod 2631/5263 1067/2149 97/229 262/527 113/231 97/229 40/92 0 1 3 0 0 3 0 131 132 CHAPTER 5. CONJUGATE GRADIENT METHODS NOTES AND REFERENCES The conjugate gradient method was developed in the 1950s by Hestenes and Stiefel [168] as an alternative to factorization methods for finding solutions of symmetric positive definite systems. It was not until some years later, in one of the most important developments in sparse linear algebra, that this method came to be viewed as an iterative method that could give good approximate solutions to systems in many fewer than n steps. Our presentation of the linear conjugate gradient method follows that of Luenberger [195]. For a history of the development of the conjugate gradient and Lanczos methods see Golub and O’Leary [135]. Interestingly enough, the nonlinear conjugate gradient method of Fletcher and Reeves [107] was proposed after the linear conjugate gradient method had fallen out of favor, but several years before it was rediscovered as an iterative method for linear systems. The Polak–Ribière method was introduced in [237], and the example showing that it may fail to converge on nonconvex problems is given by Powell [253]. Restart procedures are discussed in Powell [248]. Hager and Zhang [161] report some of the best computational results obtained to date with a nonlinear CG method. Their implementation is based on formula (5.50) and uses a high-accuracy line search procedure. The results in Table 5.1 are taken from Gilbert and Nocedal [123]. This paper also describes a line search that guarantees that Algorithm PR+ always generates descent directions and proves global convergence. Analysis due to Powell [245] provides further evidence of the inefficiency of the Fletcher–Reeves method using exact line searches. He shows that if the iterates enter a region in which the function is the two-dimensional quadratic f (x) 12 x T x, then the angle between the gradient ∇ f k and the search direction pk stays constant. Since this angle can be arbitrarily close to 90◦ , the Fletcher–Reeves method can be slower than the steepest descent method. The Polak–Ribière method behaves quite differently in these circumstances: If a very small step is generated, the next search direction tends to the steepest descent direction, as argued above. This feature prevents a sequence of tiny steps. The global convergence of nonlinear conjugate gradient methods has received much attention; see for example Al-Baali [3], Gilbert and Nocedal [123], Dai and Yuan [85], and Hager and Zhang [161]. For recent surveys on CG methods see Gould et al. [147] and Hager and Zhang [162]. Most of the theory on the rate of convergence of conjugate gradient methods assumes that the line search is exact. Crowder and Wolfe [82] show that the rate of convergence is linear, and show by constructing an example that Q-superlinear convergence is not achievable. Powell [245] studies the case in which the conjugate gradient method enters a region where the objective function is quadratic, and shows that either finite termination occurs or the rate of convergence is linear. Cohen [63] and Burmeister [45] prove n-step 5.2. NONLINEAR CONJUGATE GRADIENT METHODS quadratic convergence (5.51) for general objective functions. Ritter [265] shows that in fact, the rate is superquadratic, that is, xk+n − x ∗ o(xk − x ∗ 2 ). Powell [251] gives a slightly better result and performs numerical tests on small problems to measure the rate observed in practice. He also summarizes rate-of-convergence results for asymptotically exact line searches, such as those obtained by Baptist and Stoer [11] and Stoer [282]. Even faster rates of convergence can be established (see Schuller [278], Ritter [265]), under the assumption that the search directions are uniformly linearly independent, but this assumption is hard to verify and does not often occur in practice. Nemirovsky and Yudin [225] devote some attention to the global efficiency of the Fletcher–Reeves and Polak–Ribière methods with exact line searches. For this purpose they define a measure of “laboriousness” and an “optimal bound” for it among a certain class of iterations. They show that on strongly convex problems not only do the Fletcher–Reeves and Polak–Ribière methods fail to attain the optimal bound, but they may also be slower than the steepest descent method. Subsequently, Nesterov [225] presented an algorithm that attains this optimal bound. It is related to PARTAN, the method of parallel tangents (see, for example, Luenberger [195]). We feel that this approach is unlikely to be effective in practice, but no conclusive investigation has been carried out, to the best of our knowledge. ✐ EXERCISES ✐ 5.1 Implement Algorithm 5.2 and use to it solve linear systems in which A is the Hilbert matrix, whose elements are Ai, j 1/(i + j − 1). Set the right-hand-side to b (1, 1, . . . , 1)T and the initial point to x0 0. Try dimensions n 5, 8, 12, 20 and report the number of iterations required to reduce the residual below 10−6 . ✐ 5.2 Show that if the nonzero vectors p0 , p1 , . . . , pl satisfy (5.5), where A is symmetric and positive definite, then these vectors are linearly independent. (This result implies that A has at most n conjugate directions.) ✐ 5.3 Verify the formula (5.7). ✐ def 5.4 Show that if f (x) is a strictly convex quadratic, then the function h(σ ) f (x0 + σ0 p0 + · · · + σk−1 pk−1 ) also is a strictly convex quadratic in the variable σ (σ0 , σ1 , . . . , σk−1 )T . ✐ 5.5 Verify from the formulae (5.14) that (5.17) and (5.18) hold for k 1. ✐ 5.6 Show that (5.24d) is equivalent to (5.14d). 133 134 CHAPTER 5. CONJUGATE GRADIENT METHODS ✐ 5.7 Let {λi , vi } i 1, 2, . . . , n be the eigenpairs of the symmetric matrix A. Show that the eigenvalues and eigenvectors of [I + Pk (A)A]T A[I + Pk (A)A] are λi [1+λi Pk (λi )]2 and vi , respectively. ✐ 5.8 Construct matrices with various eigenvalue distributions (clustered and nonclustered) and apply the CG method to them. Comment on whether the behavior can be explained from Theorem 5.5. ✐ 5.9 Derive Algorithm 5.3 by applying the standard CG method in the variables x̂ and then transforming back into the original variables. ✐ 5.10 Verify the modified conjugacy condition (5.40). ✐ 5.11 Show that when applied to a quadratic function, with exact line searches, both the Polak–Ribière formula given by (5.44) and the Hestenes–Stiefel formula given by (5.46) reduce to the Fletcher–Reeves formula (5.41a). ✐ 5.12 Prove that Lemma 5.6 holds for any choice of βk satisfying |βk | ≤ βkFR . This is page 135 Printer: Opaque this CHAPTER 6 Quasi-Newton Methods In the mid 1950s, W.C. Davidon, a physicist working at Argonne National Laboratory, was using the coordinate descent method (see Section 9.3) to perform a long optimization calculation. At that time computers were not very stable, and to Davidon’s frustration, the computer system would always crash before the calculation was finished. So Davidon decided to find a way of accelerating the iteration. The algorithm he developed—the first quasi-Newton algorithm—turned out to be one of the most creative ideas in nonlinear optimization. It was soon demonstrated by Fletcher and Powell that the new algorithm was much faster and more reliable than the other existing methods, and this dramatic 136 CHAPTER 6. QUASI-NEWTON METHODS advance transformed nonlinear optimization overnight. During the following twenty years, numerous variants were proposed and hundreds of papers were devoted to their study. An interesting historical irony is that Davidon’s paper [87] was not accepted for publication; it remained as a technical report for more than thirty years until it appeared in the first issue of the SIAM Journal on Optimization in 1991 [88]. Quasi-Newton methods, like steepest descent, require only the gradient of the objective function to be supplied at each iterate. By measuring the changes in gradients, they construct a model of the objective function that is good enough to produce superlinear convergence. The improvement over steepest descent is dramatic, especially on difficult problems. Moreover, since second derivatives are not required, quasi-Newton methods are sometimes more efficient than Newton’s method. Today, optimization software libraries contain a variety of quasi-Newton algorithms for solving unconstrained, constrained, and large-scale optimization problems. In this chapter we discuss quasi-Newton methods for small and medium-sized problems, and in Chapter 7 we consider their extension to the large-scale setting. The development of automatic differentiation techniques has made it possible to use Newton’s method without requiring users to supply second derivatives; see Chapter 8. Still, automatic differentiation tools may not be applicable in many situations, and it may be much more costly to work with second derivatives in automatic differentiation software than with the gradient. For these reasons, quasi-Newton methods remain appealing. 6.1 THE BFGS METHOD The most popular quasi-Newton algorithm is the BFGS method, named for its discoverers Broyden, Fletcher, Goldfarb, and Shanno. In this section we derive this algorithm (and its close relative, the DFP algorithm) and describe its theoretical properties and practical implementation. We begin the derivation by forming the following quadratic model of the objective function at the current iterate xk : m k ( p) f k + ∇ f kT p + 12 p T Bk p. (6.1) Here Bk is an n × n symmetric positive definite matrix that will be revised or updated at every iteration. Note that the function value and gradient of this model at p 0 match f k and ∇ f k , respectively. The minimizer pk of this convex quadratic model, which we can write explicitly as pk −Bk−1 ∇ f k , (6.2) 6.1. THE BFGS METHOD is used as the search direction, and the new iterate is xk+1 xk + αk pk , (6.3) where the step length αk is chosen to satisfy the Wolfe conditions (3.6). This iteration is quite similar to the line search Newton method; the key difference is that the approximate Hessian Bk is used in place of the true Hessian. Instead of computing Bk afresh at every iteration, Davidon proposed to update it in a simple manner to account for the curvature measured during the most recent step. Suppose that we have generated a new iterate xk+1 and wish to construct a new quadratic model, of the form T p + 12 p T Bk+1 p. m k+1 ( p) f k+1 + ∇ f k+1 What requirements should we impose on Bk+1 , based on the knowledge gained during the latest step? One reasonable requirement is that the gradient of m k+1 should match the gradient of the objective function f at the latest two iterates xk and xk+1 . Since ∇m k+1 (0) is precisely ∇ f k+1 , the second of these conditions is satisfied automatically. The first condition can be written mathematically as ∇m k+1 (−αk pk ) ∇ f k+1 − αk Bk+1 pk ∇ f k . By rearranging, we obtain Bk+1 αk pk ∇ f k+1 − ∇ f k . (6.4) To simplify the notation it is useful to define the vectors sk xk+1 − xk αk pk , yk ∇ f k+1 − ∇ f k , (6.5) so that (6.4) becomes Bk+1 sk yk . (6.6) We refer to this formula as the secant equation. Given the displacement sk and the change of gradients yk , the secant equation requires that the symmetric positive definite matrix Bk+1 map sk into yk . This will be possible only if sk and yk satisfy the curvature condition skT yk > 0, (6.7) as is easily seen by premultiplying (6.6) by skT . When f is strongly convex, the inequality (6.7) will be satisfied for any two points xk and xk+1 (see Exercise 6.1). However, this condition 137 138 CHAPTER 6. QUASI-NEWTON METHODS will not always hold for nonconvex functions, and in this case we need to enforce (6.7) explicitly, by imposing restrictions on the line search procedure that chooses the step length α. In fact, the condition (6.7) is guaranteed to hold if we impose the Wolfe (3.6) or strong Wolfe conditions (3.7) on the line search. To verify this claim, we note from (6.5) and (3.6b) T sk ≥ c2 ∇ f kT sk , and therefore that ∇ f k+1 ykT sk ≥ (c2 − 1)αk ∇ f kT pk . (6.8) Since c2 < 1 and since pk is a descent direction, the term on the right is positive, and the curvature condition (6.7) holds. When the curvature condition is satisfied, the secant equation (6.6) always has a solution Bk+1 . In fact, it admits an infinite number of solutions, since the n(n + 1)/2 degrees of freedom in a symmetric positive definite matrix exceed the n conditions imposed by the secant equation. The requirement of positive definiteness imposes n additional inequalities—all principal minors must be positive—but these conditions do not absorb the remaining degrees of freedom. To determine Bk+1 uniquely, we impose the additional condition that among all symmetric matrices satisfying the secant equation, Bk+1 is, in some sense, closest to the current matrix Bk . In other words, we solve the problem min B − Bk (6.9a) B B BT , subject to Bsk yk , (6.9b) where sk and yk satisfy (6.7) and Bk is symmetric and positive definite. Different matrix norms can be used in (6.9a), and each norm gives rise to a different quasi-Newton method. A norm that allows easy solution of the minimization problem (6.9) and gives rise to a scale-invariant optimization method is the weighted Frobenius norm AW ≡ W 1/2 AW 1/2 F , (6.10) n n 2 where · F is defined by C2F i1 j1 ci j . The weight matrix W can be chosen as any matrix satisfying the relation W yk sk . For concreteness, the reader can assume that W Ḡ −1 k where Ḡ k is the average Hessian defined by Ḡ k 1 ∇ f (xk + τ αk pk )dτ . 2 (6.11) 0 The property yk Ḡ k αk pk Ḡ k sk (6.12) follows from Taylor’s theorem, Theorem 2.1. With this choice of weighting matrix W , the 6.1. THE BFGS METHOD norm (6.10) is non-dimensional, which is a desirable property, since we do not wish the solution of (6.9) to depend on the units of the problem. With this weighting matrix and this norm, the unique solution of (6.9) is (DFP) Bk+1 I − ρk yk skT Bk I − ρk sk ykT + ρk yk ykT , (6.13) with ρk 1 ykT sk . (6.14) This formula is called the DFP updating formula, since it is the one originally proposed by Davidon in 1959, and subsequently studied, implemented, and popularized by Fletcher and Powell. The inverse of Bk , which we denote by Hk Bk−1 , is useful in the implementation of the method, since it allows the search direction (6.2) to be calculated by means of a simple matrix–vector multiplication. Using the Sherman– Morrison–Woodbury formula (A.28), we can derive the following expression for the update of the inverse Hessian approximation Hk that corresponds to the DFP update of Bk in (6.13): (DFP) Hk+1 Hk − Hk yk ykT Hk sk skT + . ykT Hk yk ykT sk (6.15) Note that the last two terms in the right-hand-side of (6.15) are rank-one matrices, so that Hk undergoes a rank-two modification. It is easy to see that (6.13) is also a rank-two modification of Bk . This is the fundamental idea of quasi-Newton updating: Instead of recomputing the approximate Hessians (or inverse Hessians) from scratch at every iteration, we apply a simple modification that combines the most recently observed information about the objective function with the existing knowledge embedded in our current Hessian approximation. The DFP updating formula is quite effective, but it was soon superseded by the BFGS formula, which is presently considered to be the most effective of all quasi-Newton updating formulae. BFGS updating can be derived by making a simple change in the argument that led to (6.13). Instead of imposing conditions on the Hessian approximations Bk , we impose similar conditions on their inverses Hk . The updated approximation Hk+1 must be symmetric and positive definite, and must satisfy the secant equation (6.6), now written as Hk+1 yk sk . The condition of closeness to Hk is now specified by the following analogue of (6.9): min H − Hk (6.16a) H subject to H HT, H yk sk . (6.16b) 139 140 CHAPTER 6. QUASI-NEWTON METHODS The norm is again the weighted Frobenius norm described above, where the weight matrix W is now any matrix satisfying W sk yk . (For concreteness, we assume again that W is given by the average Hessian Ḡ k defined in (6.11).) The unique solution Hk+1 to (6.16) is given by (BFGS) Hk+1 (I − ρk sk ykT )Hk (I − ρk yk skT ) + ρk sk skT , (6.17) with ρk defined by (6.14). Just one issue has to be resolved before we can define a complete BFGS algorithm: How should we choose the initial approximation H0 ? Unfortunately, there is no magic formula that works well in all cases. We can use specific information about the problem, for instance by setting it to the inverse of an approximate Hessian calculated by finite differences at x0 . Otherwise, we can simply set it to be the identity matrix, or a multiple of the identity matrix, where the multiple is chosen to reflect the scaling of the variables. Algorithm 6.1 (BFGS Method). Given starting point x0 , convergence tolerance > 0, inverse Hessian approximation H0 ; k ← 0; while ∇ f k > ; Compute search direction pk −Hk ∇ f k ; (6.18) Set xk+1 xk + αk pk where αk is computed from a line search procedure to satisfy the Wolfe conditions (3.6); Define sk xk+1 − xk and yk ∇ f k+1 − ∇ f k ; Compute Hk+1 by means of (6.17); k ← k + 1; end (while) Each iteration can be performed at a cost of O(n 2 ) arithmetic operations (plus the cost of function and gradient evaluations); there are no O(n 3 ) operations such as linear system solves or matrix–matrix operations. The algorithm is robust, and its rate of convergence is superlinear, which is fast enough for most practical purposes. Even though Newton’s method converges more rapidly (that is, quadratically), its cost per iteration usually is higher, because of its need for second derivatives and solution of a linear system. We can derive a version of the BFGS algorithm that works with the Hessian approximation Bk rather than Hk . The update formula for Bk is obtained by simply applying the Sherman–Morrison–Woodbury formula (A.28) to (6.17) to obtain (BFGS) Bk+1 Bk − Bk sk skT Bk yk y T + Tk . T sk Bk sk yk sk (6.19) 6.1. THE BFGS METHOD A naive implementation of this variant is not efficient for unconstrained minimization, because it requires the system Bk pk −∇ f k to be solved for the step pk , thereby increasing the cost of the step computation to O(n 3 ). We discuss later, however, that less expensive implementations of this variant are possible by updating Cholesky factors of Bk . PROPERTIES OF THE BFGS METHOD It is usually easy to observe the superlinear rate of convergence of the BFGS method on practical problems. Below, we report the last few iterations of the steepest descent, BFGS, and an inexact Newton method on Rosenbrock’s function (2.22). The table gives the value of xk − x ∗ . The Wolfe conditions were imposed on the step length in all three methods. From the starting point (−1.2, 1), the steepest descent method required 5264 iterations, whereas BFGS and Newton took only 34 and 21 iterations, respectively to reduce the gradient norm to 10−5 . steepest descent 1.827e-04 1.826e-04 1.824e-04 1.823e-04 BFGS Newton 1.70e-03 1.17e-03 1.34e-04 1.01e-06 3.48e-02 1.44e-02 1.82e-04 1.17e-08 A few points in the derivation of the BFGS and DFP methods merit further discussion. Note that the minimization problem (6.16) that gives rise to the BFGS update formula does not explicitly require the updated Hessian approximation to be positive definite. It is easy to show, however, that Hk+1 will be positive definite whenever Hk is positive definite, by using the following argument. First, note from (6.8) that ykT sk is positive, so that the updating formula (6.17), (6.14) is well-defined. For any nonzero vector z, we have z T Hk+1 z w T Hk w + ρk (z T sk )2 ≥ 0, where we have defined w z − ρk yk (skT z). The right hand side can be zero only if skT z 0, but in this case w z 0, which implies that the first term is greater than zero. Therefore, Hk+1 is positive definite. To make quasi-Newton updating formulae invariant to transformations in the variables (such as scaling transformations), it is necessary for the objectives (6.9a) and (6.16a) to be invariant under the same transformations. The choice of the weighting matrices W used to define the norms in (6.9a) and (6.16a) ensures that this condition holds. Many other choices of the weighting matrix W are possible, each one of them giving a different update formula. However, despite intensive searches, no formula has been found that is significantly more effective than BFGS. 141 142 CHAPTER 6. QUASI-NEWTON METHODS The BFGS method has many interesting properties when applied to quadratic functions. We discuss these properties later in the more general context of the Broyden family of updating formulae, of which BFGS is a special case. It is reasonable to ask whether there are situations in which the updating formula such as (6.17) can produce bad results. If at some iteration the matrix Hk becomes a poor approximation to the true inverse Hessian, is there any hope of correcting it? For example, when the inner product ykT sk is tiny (but positive), then it follows from (6.14), (6.17) that Hk+1 contains very large elements. Is this behavior reasonable? A related question concerns the rounding errors that occur in finite-precision implementation of these methods. Can these errors grow to the point of erasing all useful information in the quasi-Newton approximate Hessian? These questions have been studied analytically and experimentally, and it is now known that the BFGS formula has very effective self-correcting properties. If the matrix Hk incorrectly estimates the curvature in the objective function, and if this bad estimate slows down the iteration, then the Hessian approximation will tend to correct itself within a few steps. It is also known that the DFP method is less effective in correcting bad Hessian approximations; this property is believed to be the reason for its poorer practical performance. The self-correcting properties of BFGS hold only when an adequate line search is performed. In particular, the Wolfe line search conditions ensure that the gradients are sampled at points that allow the model (6.1) to capture appropriate curvature information. It is interesting to note that the DFP and BFGS updating formulae are duals of each other, in the sense that one can be obtained from the other by the interchanges s ↔ y, B ↔ H . This symmetry is not surprising, given the manner in which we derived these methods above. IMPLEMENTATION A few details and enhancements need to be added to Algorithm 6.1 to produce an efficient implementation. The line search, which should satisfy either the Wolfe conditions (3.6) or the strong Wolfe conditions (3.7), should always try the step length αk 1 first, because this step length will eventually always be accepted (under certain conditions), thereby producing superlinear convergence of the overall algorithm. Computational observations strongly suggest that it is more economical, in terms of function evaluations, to perform a fairly inaccurate line search. The values c1 10−4 and c2 0.9 are commonly used in (3.6). As mentioned earlier, the initial matrix H0 often is set to some multiple β I of the identity, but there is no good general strategy for choosing the multiple β. If β is too large, so that the first step p0 −βg0 is too long, many function evaluations may be required to find a suitable value for the step length α0 . Some software asks the user to prescribe a value δ for the norm of the first step, and then set H0 δg0 −1 I to achieve this norm. A heuristic that is often quite effective is to scale the starting matrix after the first step has been computed but before the first BFGS update is performed. We change the 6.1. THE BFGS METHOD provisional value H0 I by setting H0 ← ykT sk I, ykT yk (6.20) before applying the update (6.14) , (6.17) to obtain H1 . This formula attempts to make the size of H0 similar to that of ∇ 2 f (x0 )−1 , in the following sense. Assuming that the average 1/2 Hessian defined in (6.11) is positive definite, there exists a square root Ḡ k satisfying 1/2 1/2 1/2 Ḡ k Ḡ k Ḡ k (see Exercise 6.6). Therefore, by defining z k Ḡ k sk and using the relation (6.12), we have 1/2 1/2 ykT sk (Ḡ k sk )T Ḡ k sk z kT z k . 1/2 1/2 ykT yk z kT Ḡ k z k (Ḡ k sk )T Ḡ k Ḡ k sk (6.21) The reciprocal of (6.21) is an approximation to one of the eigenvalues of Ḡ k , which in turn is close to an eigenvalue of ∇ 2 f (xk ). Hence, the quotient (6.21) itself approximates an eigenvalue of ∇ 2 f (xk )−1 . Other scaling factors can be used in (6.20), but the one presented here appears to be the most successful in practice. In (6.19) we gave an update formula for a BFGS method that works with the Hessian approximation Bk instead of the the inverse Hessian approximation Hk . An efficient implementation of this approach does not store Bk explicitly, but rather the Cholesky factorization L k Dk L kT of this matrix. A formula that updates the factors L k and Dk directly in O(n 2 ) operations can be derived from (6.19). Since the linear system Bk pk −∇ f k also can be solved in O(n 2 ) operations (by performing triangular substitutions with L k and L kT and a diagonal substitution with Dk ), the total cost is quite similar to the variant described in Algorithm 6.1. A potential advantage of this alternative strategy is that it gives us the option of modifying diagonal elements in the Dk factor if they are not sufficiently large, to prevent instability when we divide by these elements during the calculation of pk . However, computational experience suggests no real advantages for this variant, and we prefer the simpler strategy of Algorithm 6.1. The performance of the BFGS method can degrade if the line search is not based on the Wolfe conditions. For example, some software implements an Armijo backtracking line search (see Section 3.1): The unit step length αk 1 is tried first and is successively decreased until the sufficient decrease condition (3.6a) is satisfied. For this strategy, there is no guarantee that the curvature condition ykT sk > 0 (6.7) will be satisfied by the chosen step, since a step length greater than 1 may be required to satisfy this condition. To cope with this shortcoming, some implementations simply skip the BFGS update by setting Hk+1 Hk when ykT sk is negative or too close to zero. This approach is not recommended, because the updates may be skipped much too often to allow Hk to capture important curvature information for the objective function f . In Chapter 18 we discuss a damped BFGS update that is a more effective strategy for coping with the case where the curvature condition (6.7) is not satisfied. 143 144 CHAPTER 6. 6.2 QUASI-NEWTON METHODS THE SR1 METHOD In the BFGS and DFP updating formulae, the updated matrix Bk+1 (or Hk+1 ) differs from its predecessor Bk (or Hk ) by a rank-2 matrix. In fact, as we now show, there is a simpler rank-1 update that maintains symmetry of the matrix and allows it to satisfy the secant equation. Unlike the rank-two update formulae, this symmetric-rank-1, or SR1, update does not guarantee that the updated matrix maintains positive definiteness. Good numerical results have been obtained with algorithms based on SR1, so we derive it here and investigate its properties. The symmetric rank-1 update has the general form Bk+1 Bk + σ vv T , where σ is either +1 or −1, and σ and v are chosen so that Bk+1 satisfies the secant equation (6.6), that is, yk Bk+1 sk . By substituting into this equation, we obtain yk Bk sk + σ v T sk v. (6.22) Since the term in brackets is a scalar, we deduce that v must be a multiple of yk − Bk sk , that is, v δ(yk − Bk sk ) for some scalar δ. By substituting this form of v into (6.22), we obtain (yk − Bk sk ) σ δ 2 skT (yk − Bk sk ) (yk − Bk sk ), (6.23) and it is clear that this equation is satisfied if (and only if) we choose the parameters δ and σ to be σ sign skT (yk − Bk sk ) , −1/2 δ ± skT (yk − Bk sk ) . Hence, we have shown that the only symmetric rank-1 updating formula that satisfies the secant equation is given by (SR1) Bk+1 Bk + (yk − Bk sk )(yk − Bk sk )T . (yk − Bk sk )T sk (6.24) By applying the Sherman–Morrison formula (A.27), we obtain the corresponding update formula for the inverse Hessian approximation Hk : (SR1) Hk+1 Hk + (sk − Hk yk )(sk − Hk yk )T . (sk − Hk yk )T yk (6.25) This derivation is so simple that the SR1 formula has been rediscovered a number of times. It is easy to see that even if Bk is positive definite, Bk+1 may not have the same property. (The same is, of course, true of Hk .) This observation was considered a major drawback 6.2. THE SR1 METHOD in the early days of nonlinear optimization when only line search iterations were used. However, with the advent of trust-region methods, the SR1 updating formula has proved to be quite useful, and its ability to generate indefinite Hessian approximations can actually be regarded as one of its chief advantages. The main drawback of SR1 updating is that the denominator in (6.24) or (6.25) can vanish. In fact, even when the objective function is a convex quadratic, there may be steps on which there is no symmetric rank-1 update that satisfies the secant equation. It pays to reexamine the derivation above in the light of this observation. By reasoning in terms of Bk (similar arguments can be applied to Hk ), we see that there are three cases: 1. If (yk − Bk sk )T sk 0, then the arguments above show that there is a unique rank-one updating formula satisfying the secant equation (6.6), and that it is given by (6.24). 2. If yk Bk sk , then the only updating formula satisfying the secant equation is simply Bk+1 Bk . 3. If yk Bk sk and (yk − Bk sk )T sk 0, then (6.23) shows that there is no symmetric rank-one updating formula satisfying the secant equation. The last case clouds an otherwise simple and elegant derivation, and suggests that numerical instabilities and even breakdown of the method can occur. It suggests that rank-one updating does not provide enough freedom to develop a matrix with all the desired characteristics, and that a rank-two correction is required. This reasoning leads us back to the BFGS method, in which positive definiteness (and thus nonsingularity) of all Hessian approximations is guaranteed. Nevertheless, we are interested in the SR1 formula for the following reasons. (i) A simple safeguard seems to adequately prevent the breakdown of the method and the occurrence of numerical instabilities. (ii) The matrices generated by the SR1 formula tend to be good approximations to the true Hessian matrix—often better than the BFGS approximations. (iii) In quasi-Newton methods for constrained problems, or in methods for partially separable functions (see Chapters 18 and 7), it may not be possible to impose the curvature condition ykT sk > 0, and thus BFGS updating is not recommended. Indeed, in these two settings, indefinite Hessian approximations are desirable insofar as they reflect indefiniteness in the true Hessian. We now introduce a strategy to prevent the SR1 method from breaking down. It has been observed in practice that SR1 performs well simply by skipping the update if the denominator is small. More specifically, the update (6.24) is applied only if T s (yk − Bk sk ) ≥ r sk yk − Bk sk , k (6.26) 145 146 CHAPTER 6. QUASI-NEWTON METHODS where r ∈ (0, 1) is a small number, say r 10−8 . If (6.26) does not hold, we set Bk+1 Bk . Most implementations of the SR1 method use a skipping rule of this kind. Why do we advocate skipping of updates for the SR1 method, when in the previous section we discouraged this strategy in the case of BFGS? The two cases are quite different. The condition skT (yk − Bk sk ) ≈ 0 occurs infrequently, since it requires certain vectors to be aligned in a specific way. When it does occur, skipping the update appears to have no negative effects on the iteration. This is not surprising, since the skipping condition implies that skT Ḡsk ≈ skT Bk sk , where Ḡ is the average Hessian over the last step—meaning that the curvature of Bk along sk is already correct. In contrast, the curvature condition skT yk ≥ 0 required for BFGS updating may easily fail if the line search does not impose the Wolfe conditions (for example, if the step is not long enough), and therefore skipping the BFGS update can occur often and can degrade the quality of the Hessian approximation. We now give a formal description of an SR1 method using a trust-region framework, which we prefer over a line search framework because it can accommodate indefinite Hessian approximations more easily. Algorithm 6.2 (SR1 Trust-Region Method). Given starting point x0 , initial Hessian approximation B0 , trust-region radius 0 , convergence tolerance > 0, parameters η ∈ (0, 10−3 ) and r ∈ (0, 1); k ← 0; while ∇ f k > ; Compute sk by solving the subproblem 1 min ∇ f kT s + s T Bk s s 2 subject to s ≤ k ; Compute yk ∇ f (xk + sk ) − ∇ f k , ared f k − f (xk + sk ) (actual reduction) 1 T T (predicted reduction); pred − ∇ f k sk + sk Bk sk 2 if ared/pred > η xk+1 xk + sk ; else xk+1 xk ; end (if) (6.27) 6.2. THE SR1 METHOD if ared/pred > 0.75 if sk ≤ 0.8k k+1 k ; else k+1 2k ; end (if) else if 0.1 ≤ ared/pred ≤ 0.75 k+1 k ; else k+1 0.5k ; end (if) if (6.26) holds Use (6.24) to compute Bk+1 (even if xk+1 xk ); else Bk+1 ← Bk ; end (if) k ← k + 1; end (while) This algorithm has the typical form of a trust region method (cf. Algorithm 4.1). For concreteness, we have specified a particular strategy for updating the trust region radius, but other heuristics can be used instead. To obtain a fast rate of convergence, it is important for the matrix Bk to be updated even along a failed direction sk . The fact that the step was poor indicates that Bk is an inadequate approximation of the true Hessian in this direction. Unless the quality of the approximation is improved, steps along similar directions could be generated on later iterations, and repeated rejection of such steps could prevent superlinear convergence. PROPERTIES OF SR1 UPDATING One of the main advantages of SR1 updating is its ability to generate good Hessian approximations. We demonstrate this property by first examining a quadratic function. For functions of this type, the choice of step length does not affect the update, so to examine the effect of the updates, we can assume for simplicity a uniform step length of 1, that is, pk −Hk ∇ f k , xk+1 xk + pk . (6.28) It follows that pk sk . Theorem 6.1. Suppose that f : IRn → IR is the strongly convex quadratic function f (x) b T x + 1 T x Ax, where A is symmetric positive definite. Then for any starting point x0 and any 2 147 148 CHAPTER 6. QUASI-NEWTON METHODS symmetric starting matrix H0 , the iterates {xk } generated by the SR1 method (6.25), (6.28) converge to the minimizer in at most n steps, provided that (sk − Hk yk )T yk 0 for all k. Moreover, if n steps are performed, and if the search directions pi are linearly independent, then Hn A−1 . PROOF. Because of our assumption (sk − Hk yk )T yk 0, the SR1 update is always welldefined. We start by showing inductively that Hk y j s j , j 0, 1, . . . , k − 1. (6.29) In other words, we claim that the secant equation is satisfied not only along the most recent search direction, but along all previous directions. By definition, the SR1 update satisfies the secant equation, so we have H1 y0 s0 . Let us now assume that (6.29) holds for some value k > 1 and show that it holds also for k + 1. From this assumption, we have from (6.29) that (sk − Hk yk )T y j skT y j − ykT (Hk y j ) skT y j − ykT s j 0, all j < k, (6.30) where the last equality follows because yi Asi for the quadratic function we are considering here. By using (6.30) and the induction hypothesis (6.29) in (6.25), we have Hk+1 y j Hk y j s j , for all j < k. Since Hk+1 yk sk by the secant equation, we have shown that (6.29) holds when k is replaced by k + 1. By induction, then, this relation holds for all k. If the algorithm performs n steps and if these steps {s j } are linearly independent, we have s j Hn y j Hn As j , j 0, 1, . . . , n − 1. It follows that Hn A I , that is, Hn A−1 . Therefore, the step taken at xn is the Newton step, and so the next iterate xn+1 will be the solution, and the algorithm terminates. Consider now the case in which the steps become linearly dependent. Suppose that sk is a linear combination of the previous steps, that is, sk ξ0 s0 + · · · + ξk−1 sk−1 , for some scalars ξi . From (6.31) and (6.29) we have that Hk yk Hk Ask ξ0 Hk As0 + · · · + ξk−1 Hk Ask−1 (6.31) 6.3. THE BROYDEN CLASS ξ0 Hk y0 + · · · + ξk−1 Hk yk−1 ξ0 s0 + · · · + ξk−1 sk−1 sk . Since yk ∇ f k+1 − ∇ f k and since sk pk −Hk ∇ f k from (6.28), we have that Hk (∇ f k+1 − ∇ f k ) −Hk ∇ f k , which, by the nonsingularity of Hk , implies that ∇ f k+1 0. Therefore, xk+1 is the solution point. The relation (6.29) shows that when f is quadratic, the secant equation is satisfied along all previous search directions, regardless of how the line search is performed. A result like this can be established for BFGS updating only under the restrictive assumption that the line search is exact, as we show in the next section. For general nonlinear functions, the SR1 update continues to generate good Hessian approximations under certain conditions. Theorem 6.2. Suppose that f is twice continuously differentiable, and that its Hessian is bounded and Lipschitz continuous in a neighborhood of a point x ∗ . Let {xk } be any sequence of iterates such that xk → x ∗ for some x ∗ ∈ IRn . Suppose in addition that the inequality (6.26) holds for all k, for some r ∈ (0, 1), and that the steps sk are uniformly linearly independent. Then the matrices Bk generated by the SR1 updating formula satisfy lim Bk − ∇ 2 f (x ∗ ) 0. k→∞ The term “uniformly linearly independent steps” means, roughly speaking, that the steps do not tend to fall in a subspace of dimension less than n. This assumption is usually, but not always, satisfied in practice (see the Notes and References at the end of this chapter). 6.3 THE BROYDEN CLASS So far, we have described the BFGS, DFP, and SR1 quasi-Newton updating formulae, but there are many others. Of particular interest is the Broyden class, a family of updates specified by the following general formula: Bk+1 Bk − Bk sk skT Bk yk y T + T k + φk (skT Bk sk )vk vkT , T sk Bk sk yk sk (6.32) 149 150 CHAPTER 6. QUASI-NEWTON METHODS where φk is a scalar parameter and vk yk Bk sk . − T ykT sk sk Bk sk (6.33) The BFGS and DFP methods are members of the Broyden class—we recover BFGS by setting φk 0 and DFP by setting φk 1 in (6.32). We can therefore rewrite (6.32) as a “linear combination” of these two methods, that is, BFGS DFP + φk Bk+1 . Bk+1 (1 − φk )Bk+1 This relationship indicates that all members of the Broyden class satisfy the secant equation (6.6), since the BGFS and DFP matrices themselves satisfy this equation. Also, since BFGS and DFP updating preserve positive definiteness of the Hessian approximations when skT yk > 0, this relation implies that the same property will hold for the Broyden family if 0 ≤ φk ≤ 1. Much attention has been given to the so-called restricted Broyden class, which is obtained by restricting φk to the interval [0, 1]. It enjoys the following property when applied to quadratic functions. Since the analysis is independent of the step length, we assume for simplicity that each iteration has the form pk −Bk−1 ∇ f k , xk+1 xk + pk . (6.34) Theorem 6.3. Suppose that f : IRn → IR is the strongly convex quadratic function f (x) b T x + 1 T x Ax, where A is symmetric and positive definite. Let x0 be any starting point for the iteration 2 (6.34) and B0 be any symmetric positive definite starting matrix, and suppose that the matrices Bk are updated by the Broyden formula (6.32) with φk ∈ [0, 1]. Define λk1 ≤ λk2 ≤ · · · ≤ λkn to be the eigenvalues of the matrix 1 1 A 2 Bk−1 A 2 . (6.35) Then for all k, we have min{λik , 1} ≤ λik+1 ≤ max{λik , 1}, i 1, 2, . . . , n. (6.36) Moreover, the property (6.36) does not hold if the Broyden parameter φk is chosen outside the interval [0, 1]. Let us discuss the significance of this result. If the eigenvalues λik of the matrix (6.35) are all 1, then the quasi-Newton approximation Bk is identical to the Hessian A of the quadratic objective function. This situation is the ideal one, so we should be hoping for these eigenvalues to be as close to 1 as possible. In fact, relation (6.36) tells us that the 6.3. THE BROYDEN CLASS eigenvalues {λik } converge monotonically (but not strictly monotonically) to 1. Suppose, for example, that at iteration k the smallest eigenvalue is λk1 0.7. Then (6.36) tells us that ∈ [0.7, 1]. We cannot be sure that this eigenvalue has actually at the next iteration λk+1 1 moved closer to 1, but it is reasonable to expect that it has. In contrast, the first eigenvalue can become smaller than 0.7 if we allow φk to be outside [0, 1]. Significantly, the result of Theorem 6.3 holds even if the line searches are not exact. Although Theorem 6.3 seems to suggest that the best update formulas belong to the restricted Broyden class, the situation is not at all clear. Some analysis and computational testing suggest that algorithms that allow φk to be negative (in a strictly controlled manner) may in fact be superior to the BFGS method. The SR1 formula is a case in point: It is a member of the Broyden class, obtained by setting φk skT yk , skT yk − skT Bk sk but it does not belong to the restricted Broyden class, because this value of φk may fall outside the interval [0, 1]. In the remaining discussion of this section, we determine more precisely the range of values of φk that preserve positive definiteness. The last term in (6.32) is a rank-one correction, which by the interlacing eigenvalue theorem (Theorem A.1) increases the eigenvalues of the matrix when φk is positive. Therefore Bk+1 is positive definite for all φk ≥ 0. On the other hand, by Theorem A.1 the last term in (6.32) decreases the eigenvalues of the matrix when φk is negative. As we decrease φk , this matrix eventually becomes singular and then indefinite. A little computation shows that Bk+1 is singular when φk has the value 1 , 1 − µk (6.37) (ykT Bk−1 yk )(skT Bk sk ) . (ykT sk )2 (6.38) φkc where µk By applying the Cauchy–Schwarz inequality (A.5) to (6.38), we see that µk ≥ 1 and therefore φkc ≤ 0. Hence, if the initial Hessian approximation B0 is symmetric and positive definite, and if skT yk > 0 and φk > φkc for each k, then all the matrices Bk generated by Broyden’s formula (6.32) remain symmetric and positive definite. When the line search is exact, all methods in the Broyden class with φk ≥ φkc generate the same sequence of iterates. This result applies to general nonlinear functions and is based on the observation that when all the line searches are exact, the directions generated by Broyden-class methods differ only in their lengths. The line searches identify the same 151 152 CHAPTER 6. QUASI-NEWTON METHODS minima along the chosen search direction, though the values of the step lengths may differ because of the different scaling. The Broyden class has several remarkable properties when applied with exact line searches to quadratic functions. We state some of these properties in the next theorem, whose proof is omitted. Theorem 6.4. Suppose that a method in the Broyden class is applied to the strongly convex quadratic function f (x) b T x + 12 x T Ax, where x0 is the starting point and B0 is any symmetric positive definite matrix. Assume that αk is the exact step length and that φk ≥ φkc for all k, where φkc is defined by (6.37). Then the following statements are true. (i) The iterates are independent of φk and converge to the solution in at most n iterations. (ii) The secant equation is satisfied for all previous search directions, that is, Bk s j y j , j k − 1, k − 2, . . . , 1. (iii) If the starting matrix is B0 I , then the iterates are identical to those generated by the conjugate gradient method (see Chapter 5). In particular, the search directions are conjugate, that is, siT As j 0, for i j. (iv) If n iterations are performed, we have Bn A. Note that parts (i), (ii), and (iv) of this result echo the statement and proof of Theorem 6.1, where similar results were derived for the SR1 update formula. We can generalize Theorem 6.4 slightly: It continues to hold if the Hessian approximations remain nonsingular but not necessarily positive definite. (Hence, we could allow φk to be smaller than φkc , provided that the chosen value did not produce a singular updated matrix.) We can also generalize point (iii) as follows. If the starting matrix B0 is not the identity matrix, then the Broyden-class method is identical to the preconditioned conjugate gradient method that uses B0 as preconditioner. We conclude by commenting that results like Theorem 6.4 would appear to be of mainly theoretical interest, since the inexact line searches used in practical implementations of Broyden-class methods (and all other quasi-Newton methods) cause their performance to differ markedly. Nevertheless, it is worth noting that this type of analysis guided much of the development of quasi-Newton methods. 6.4. 6.4 CONVERGENCE ANALYSIS CONVERGENCE ANALYSIS In this section we present global and local convergence results for practical implementations of the BFGS and SR1 methods. We give more details for BFGS because its analysis is more general and illuminating than that of SR1. The fact that the Hessian approximations evolve by means of updating formulas makes the analysis of quasi-Newton methods much more complex than that of steepest descent and Newton’s method. Although the BFGS and SR1 methods are known to be remarkably robust in practice, we will not be able to establish truly global convergence results for general nonlinear objective functions. That is, we cannot prove that the iterates of these quasi-Newton methods approach a stationary point of the problem from any starting point and any (suitable) initial Hessian approximation. In fact, it is not yet known if the algorithms enjoy such properties. In our analysis we will either assume that the objective function is convex or that the iterates satisfy certain properties. On the other hand, there are well known local, superlinear convergence results that are true under reasonable assumptions. Throughout this section we use · to denote the Euclidean vector or matrix norm, and denote the Hessian matrix ∇ 2 f (x) by G(x). GLOBAL CONVERGENCE OF THE BFGS METHOD We study the global convergence of the BFGS method, with a practical line search, when applied to a smooth convex function from an arbitrary starting point x0 and from any initial Hessian approximation B0 that is symmetric and positive definite. We state our precise assumptions about the objective function formally, as follows. Assumption 6.1. (i) The objective function f is twice continuously differentiable. (ii) The level set L {x ∈ IRn | f (x) ≤ f (x0 )} is convex, and there exist positive constants m and M such that mz2 ≤ z T G(x)z ≤ Mz2 (6.39) for all z ∈ IRn and x ∈ L. Part (ii) of this assumption implies that G(x) is positive definite on L and that f has a unique minimizer x ∗ in L. By using (6.12) and (6.39) we obtain ykT sk s T Ḡ k sk kT ≥ m, T sk sk sk sk (6.40) 153 154 CHAPTER 6. QUASI-NEWTON METHODS where Ḡ k is the average Hessian defined in (6.11). Assumption 6.1 implies that Ḡ k is positive definite, so its square root is well-defined. Therefore, as in (6.21), we have by 1/2 defining z k Ḡ k sk that ykT yk skT Ḡ 2k sk z kT Ḡ k z k ≤ M. ykT sk z kT z k skT Ḡ k sk (6.41) We are now ready to present the global convergence result for the BFGS method. It does not seem to be possible to establish a bound on the condition number of the Hessian approximations Bk , as is done in Section 3.2. Instead, we will introduce two new tools in the analysis, the trace and determinant, to estimate the size of the largest and smallest eigenvalues of the Hessian approximations. The trace of a matrix (denoted by trace(·)) is the sum of its eigenvalues, while the determinant (denoted by det(·)) is the product of the eigenvalues; see the Appendix for a brief discussion of their properties. Theorem 6.5. Let B0 be any symmetric positive definite initial matrix, and let x0 be a starting point for which Assumption 6.1 is satisfied. Then the sequence {xk } generated by Algorithm 6.1 (with 0) converges to the minimizer x ∗ of f . PROOF. We start by defining mk ykT sk , skT sk Mk ykT yk , ykT sk (6.42) and note from (6.40) and (6.41) that m k ≥ m, Mk ≤ M. (6.43) By computing the trace of the BFGS update (6.19), we obtain that trace(Bk+1 ) trace(Bk ) − Bk sk 2 yk 2 + T T sk Bk sk yk sk (6.44) (see Exercise 6.11). We can also show (Exercise 6.10) that det(Bk+1 ) det(Bk ) ykT sk . skT Bk sk (6.45) We now define cos θk skT Bk sk , sk Bk sk qk skT Bk sk , skT sk (6.46) 6.4. CONVERGENCE ANALYSIS so that θk is the angle between sk and Bk sk . We then obtain that Bk sk 2 Bk sk 2 sk 2 skT Bk sk qk . T T 2 2 sk cos2 θk sk Bk sk (sk Bk sk ) (6.47) In addition, we have from (6.42) that det(Bk+1 ) det(Bk ) ykT sk skT sk mk det(Bk ) . T T qk sk sk sk Bk sk (6.48) We now combine the trace and determinant by introducing the following function of a positive definite matrix B: ψ(B) trace(B) − ln(det(B)), (6.49) where ln(·) denotes the natural logarithm. It is not difficult to show that ψ(B) > 0; see Exercise 6.9. By using (6.42) and (6.44)–(6.49), we have that qk − ln(det(Bk )) − ln m k + ln qk cos2 θk ψ(Bk ) + (Mk − ln m k − 1) qk qk + ln cos2 θk . + 1− + ln cos2 θk cos2 θk ψ(Bk+1 ) trace(Bk ) + Mk − (6.50) Now, since the function h(t) 1 − t + ln t is nonpositive for all t > 0 (see Exercise 6.8), the term inside the square brackets is nonpositive, and thus from (6.43) and (6.50) we have 0 < ψ(Bk+1 ) ≤ ψ(B0 ) + c(k + 1) + k ln cos2 θ j , (6.51) j0 where we can assume the constant c M −ln m −1 to be positive, without loss of generality. We now relate these expressions to the results given in Section 3.2. Note from the form sk −αk Bk−1 ∇ f k of the quasi-Newton iteration that cos θk defined by (6.46) is the angle between the steepest descent direction and the search direction, which plays a crucial role in the global convergence theory of Chapter 3. From (3.22), (3.23) we know that the sequence ∇ f k generated by the line search algorithm is bounded away from zero only if cos θ j → 0. Let us then proceed by contradiction and assume that cos θ j → 0. Then there exists k1 > 0 such that for all j > k1 , we have ln cos2 θ j < −2c, 155 156 CHAPTER 6. QUASI-NEWTON METHODS where c is the constant defined above. Using this inequality in (6.51) we find the following relations to be true for all k > k1 : 0 < ψ(B0 ) + c(k + 1) + k1 ln cos2 θ j + j0 ψ(B0 ) + k1 k (−2c) jk1 +1 ln cos2 θ j + 2ck1 + c − ck. j0 However, the right-hand-side is negative for large k, giving a contradiction. Therefore, there exists a subsequence of indices { jk }k1,2,... such that cos θ jk ≥ δ > 0. By Zoutendijk’s result (3.14) this limit implies that lim inf ∇ f k → 0. Since the problem is strongly convex, the latter limit is enough to prove that xk → x ∗ . Theorem 6.5 has been generalized to the entire restricted Broyden class, except for the DFP method. In other words, Theorem 6.5 can be shown to hold for all φk ∈ [0, 1) in (6.32), but the argument seems to break down as φk approaches 1 because some of the self-correcting properties of the update are weakened considerably. An extension of the analysis just given shows that the rate of convergence of the iterates is linear. In particular, we can show that the sequence xk − x ∗ converges to zero rapidly enough that ∞ xk − x ∗ < ∞. (6.52) k1 We will not prove this claim, but rather establish that if (6.52) holds, then the rate of convergence is actually superlinear. SUPERLINEAR CONVERGENCE OF THE BFGS METHOD The analysis of this section makes use of the Dennis and Moré characterization (3.36) of superlinear convergence. It applies to general nonlinear—not just convex—objective functions. For the results that follow we need to make an additional assumption. Assumption 6.2. The Hessian matrix G is Lipschitz continuous at x ∗ , that is, G(x) − G(x ∗ ) ≤ Lx − x ∗ , for all x near x ∗ , where L is a positive constant. 6.4. CONVERGENCE ANALYSIS We start by introducing the quantities ỹk G −1/2 yk , ∗ s̃k G 1/2 ∗ sk , B̃k G −1/2 Bk G −1/2 , ∗ ∗ where G ∗ G(x ∗ ) and x ∗ is a minimizer of f . Similarly to (6.46), we define cos θ̃k s̃kT B̃k s̃k s̃k B̃k s̃k , q̃k s̃kT B̃k s̃k , s̃k 2 while we echo (6.42) and (6.43) in defining M̃k ỹk 2 , ỹkT s̃k m̃ k ỹkT s̃k . s̃kT s̃k −1/2 By pre- and postmultiplying the BFGS update formula (6.19) by G ∗ terms appropriately, we obtain B̃k+1 B̃k − B̃k s̃k s̃kT B̃k s̃kT B̃k s̃k + and grouping ỹk ỹkT . ỹkT s̃k Since this expression has precisely the same form as the BFGS formula (6.19), it follows from the argument leading to (6.50) that ψ( B̃k+1 ) ψ( B̃k ) + ( M̃k − ln m̃ k − 1) q̃k q̃k + 1− + ln cos2 θ̃k cos2 θ̃k 2 + ln cos θ̃k . Recalling (6.12), we have that yk − G ∗ sk (Ḡ k − G ∗ )sk , and thus (Ḡ k − G ∗ )G −1/2 s̃k . ỹk − s̃k G −1/2 ∗ ∗ By Assumption 6.2, and recalling the definition (6.11), we have 2 s˜k Ḡ k − G ∗ ≤ G −1/2 2 s̃k L k , ỹk − s̃k ≤ G −1/2 ∗ ∗ where k is defined by k max{xk+1 − x ∗ , xk − x ∗ }. (6.53) 157 158 CHAPTER 6. QUASI-NEWTON METHODS We have thus shown that ỹk − s̃k ≤ c̄ k , s̃k (6.54) for some positive constant c̄. This inequality and (6.52) play an important role in superlinear convergence, as we now show. Theorem 6.6. Suppose that f is twice continuously differentiable and that the iterates generated by the BFGS algorithm converge to a minimizer x ∗ at which Assumption 6.2 holds. Suppose also that (6.52) holds. Then xk converges to x ∗ at a superlinear rate. PROOF. From (6.54), we have from the triangle inequality (A.4a) that ỹk − s̃k ≤ c̄ k s̃k , s̃k − y˜k ≤ c̄ k s˜k , so that (1 − c̄ k )s̃k ≤ ỹk ≤ (1 + c̄ k )s̃k . (6.55) By squaring (6.54) and using (6.55), we obtain (1 − c̄ k )2 s̃k 2 − 2 ỹkT s̃k + s˜k 2 ≤ ỹk 2 − 2 ỹkT s̃k + s˜k 2 ≤ c̄2 k2 s̃k 2 , and therefore 2 ỹkT s̃k ≥ (1 − 2c̄ k + c̄2 + 1 − c̄2 k2 )s̃k 2 2(1 − c̄ k )s˜k 2 . 2 k It follows from the definition of m̃ k that m̃ k ỹkT s̃k ≥ 1 − c̄ k . s̃k 2 (6.56) By combining (6.55) and (6.56), we obtain also that M̃k y˜k 2 1 + c̄ k ≤ . 1 − c̄ k ỹkT s̃k (6.57) Since xk → x ∗ , we have that k → 0, and thus by (6.57) there exists a positive constant c > c̄ such that the following inequalities hold for all sufficiently large k: M̃k ≤ 1 + 2c̄ 1 − c̄ k k ≤ 1 + c k. (6.58) 6.4. CONVERGENCE ANALYSIS We again make use of the nonpositiveness of the function h(t) 1 − t + ln t. Therefore, we have −x − ln(1 − x) h 1−x Now, for k large enough we can assume that c̄ ln(1 − c̄ k ) ≥ k 1 1−x ≤ 0. < 12 , and therefore −c̄ k ≥ −2c̄ k . 1 − c̄ k This relation and (6.56) imply that for sufficiently large k, we have ln m̃ k ≥ ln(1 − c̄ k ) ≥ −2c̄ k > −2c k . (6.59) We can now deduce from (6.53), (6.58), and (6.59) that 0 < ψ( B̃k+1 ) ≤ ψ( B̃k ) + 3c k ˜ + ln cos θk + 1 − 2 q˜k cos2 θ˜k + ln q˜k . cos2 θ˜k (6.60) By summing this expression and making use of (6.52) we have that ∞ j0 ln 1 cos2 θ˜j − 1− q˜j cos2 θ˜j + ln q˜j ≤ ψ( B̃0 ) + 3c cos2 θ˜j ∞ j < +∞. j0 Since the term in the square brackets is nonpositive, and since ln 1/ cos2 θ̃ j ≥ 0 for all j, we obtain the two limits lim ln j→∞ 1 cos2 θ˜j 0, lim j→∞ 1− q˜j cos2 θ˜j + ln q˜j cos2 θ˜j 0, which imply that lim cos θ˜j 1, j→∞ lim q˜j 1. j→∞ (6.61) The essence of the result has now been proven; we need only to interpret these limits in terms of the Dennis–Moré characterization of superlinear convergence. 159 160 CHAPTER 6. QUASI-NEWTON METHODS Recalling (6.47), we have −1/2 G ∗ (Bk − G ∗ )sk 2 1/2 G ∗ sk 2 ( B̃k − I )s̃k 2 s̃k 2 B̃k s̃k 2 − 2s̃kT B̃k s̃k + s̃kT s̃k s̃kT s̃k q̃k2 cos θ̃k2 − 2q̃k + 1. Since by (6.61) the right-hand-side converges to 0, we conclude that (Bk − G ∗ )sk 0. k→∞ sk lim The limit (3.36) and Theorem 3.6 imply that the unit step length αk 1 will satisfy the Wolfe conditions near the solution, and hence that the rate of convergence is superlinear. CONVERGENCE ANALYSIS OF THE SR1 METHOD The convergence properties of the SR1 method are not as well understood as those of the BFGS method. No global results like Theorem 6.5 or local superlinear results like Theorem 6.6 have been established, except the results for quadratic functions discussed earlier. There is, however, an interesting result for the trust-region SR1 algorithm, Algorithm 6.2. It states that when the objective function has a unique stationary point and the condition (6.26) holds at every step (so that the SR1 update is never skipped) and the Hessian approximations Bk are bounded above, then the iterates converge to x ∗ at an (n + 1)-step superlinear rate. The result does not require exact solution of the trust-region subproblem (6.27). We state the result formally as follows. Theorem 6.7. Suppose that the iterates xk are generated by Algorithm 6.2. Suppose also that the following conditions hold: (c1) The sequence of iterates does not terminate, but remains in a closed, bounded, convex set D, on which the function f is twice continuously differentiable, and in which f has a unique stationary point x ∗ ; (c2) the Hessian ∇ 2 f (x ∗ ) is positive definite, and ∇ 2 f (x) is Lipschitz continuous in a neighborhood of x ∗ ; (c3) the sequence of matrices {Bk } is bounded in norm; (c4) condition (6.26) holds at every iteration, where r is some constant in (0, 1). 6.4. CONVERGENCE ANALYSIS Then limk→∞ xk x ∗ , and we have that xk+n+1 − x ∗ 0. k→∞ xk − x ∗ lim Note that the BFGS method does not require the boundedness assumption (c3) to hold. As we have mentioned already, the SR1 update does not necessarily maintain positive definiteness of the Hessian approximations Bk . In practice, Bk may be indefinite at any iteration, which means that the trust region bound may continue to be active for arbitrarily large k. Interestingly, however, it can be shown that the SR1 Hessian approximations tend to be positive definite most of the time. The precise result is that number of indices j 1, 2, . . . , k for which B j is positive semidefinite 1, k→∞ k lim under the assumptions of Theorem 6.7. This result holds regardless of whether the initial Hessian approximation is positive definite or not. NOTES AND REFERENCES For a comprehensive treatment of quasi-Newton methods see Dennis and Schnabel [92], Dennis and Moré [91], and Fletcher [101]. A formula for updating the Cholesky factors of the BFGS matrices is given in Dennis and Schnabel [92]. Several safeguards and modifications of the SR1 method have been proposed, but the condition (6.26) is favored in the light of the analysis of Conn, Gould, and Toint [71]. Computational experiments by Conn, Gould, and Toint [70, 73] and Khalfan, Byrd, and Schnabel [181], using both line search and trust-region approaches, indicate that the SR1 method appears to be competitive with the BFGS method. The proof of Theorem 6.7 is given in Byrd, Khalfan, and Schnabel [51]. A study of the convergence of BFGS matrices for nonlinear problems can be found in Ge and Powell [119] and Boggs and Tolle [32]; however, the results are not as satisfactory as for SR1 updating. The global convergence of the BFGS method was established by Powell [246]. This result was extended to the restricted Broyden class, except for DFP, by Byrd, Nocedal, and Yuan [53]. For a discussion of the self-correcting properties of quasi-Newton methods see Nocedal [229]. Most of the early analysis of quasi-Newton methods was based on the bounded deterioration principle. This is a tool for the local analysis that quantifies the worstcase behavior of quasi-Newton updating. Assuming that the starting point is sufficiently close to the solution x ∗ and that the initial Hessian approximation is sufficiently close to ∇ 2 f (x ∗ ), one can use the bounded deterioration bounds to prove that the iteration cannot stray away from the solution. This property can then be used to show that the quality of the quasi-Newton approximations is good enough to yield superlinear convergence. For details, see Dennis and Moré [91] or Dennis and Schnabel [92]. 161 162 CHAPTER 6. QUASI-NEWTON METHODS ✐ EXERCISES ✐ 6.1 (a) Show that if f is strongly convex, then (6.7) holds for any vectors xk and xk+1 . (b) Give an example of a function of one variable satisfying g(0) −1 and g(1) − 14 and show that (6.7) does not hold in this case. ✐ 6.2 Show that the second strong Wolfe condition (3.7b) implies the curvature condition (6.7). ✐ 6.3 Verify that (6.19) and (6.17) are inverses of each other. ✐ 6.4 Use the Sherman–Morrison formula (A.27) to show that (6.24) is the inverse of (6.25). ✐ 6.5 Prove the statements (ii) and (iii) given in the paragraph following (6.25). ✐ 6.6 The square root of a matrix A is a matrix A1/2 such that A1/2 A1/2 A. Show that any symmetric positive definite matrix A has a square root, and that this square root is itself symmetric and positive definite. (Hint: Use the factorization A U DU T (A.16), where U is orthogonal and D is diagonal with positive diagonal elements.) ✐ 6.7 Use the Cauchy-Schwarz inequality (A.5) to verify that µk ≥ 1, where µk is defined by (6.38). ✐ 6.8 Define h(t) 1 − t + ln t, and note that h (t) −1 + 1/t, h (t) −1/t 2 < 0, h(1) 0, and h (1) 0. Show that h(t) ≤ 0 for all t > 0. ✐ 6.9 Denote the eigenvalues of the positive definite matrix B by λ1 , λ2 , . . . , λn , where 0 < λ1 ≤ λ2 ≤ · · · ≤ λn . Show that the ψ function defined in (6.49) can be written as ψ(B) n (λi − ln λi ). i1 Use this form to show that ψ(B) > 0. ✐ 6.10 The object of this exercise is to prove (6.45). (a) Show that det(I + x y T ) 1 + y T x, where x and y are n-vectors. Hint: Assuming that x 0, we can find vectors w1 , w2 , . . . , wn−1 such that the matrix Q defined by Q [x, w1 , w2 , . . . , wn−1 ] 6.4. CONVERGENCE ANALYSIS is nonsingular and x Qe1 , where e1 (1, 0, 0, . . . , 0)T . If we define y T Q (z 1 , z 2 , . . . , z n ), then z 1 y T Qe1 y T Q(Q −1 x) y T x, and det(I + x y T ) det(Q −1 (I + x y T )Q) det(I + e1 y T Q). (b) Use a similar technique to prove that det(I + x y T + uv T ) (1 + y T x)(1 + v T u) − (x T v)(y T u). (c) Use this relation to establish (6.45). ✐ 6.11 Use the properties of the trace of a symmetric matrix and the formula (6.19) to prove (6.44). ✐ 6.12 Show that if f satisfies Assumption 6.1 and if the sequence of gradients satisfies lim inf ∇ f k 0, then the whole sequence of iterates x converges to the solution x ∗ . 163 This is pag Printer: O CHAPTER 7 Large-Scale Unconstrained Optimization Many applications give rise to unconstrained optimization problems with thousands or millions of variables. Problems of this size can be solved efficiently only if the storage and computational costs of the optimization algorithm can be kept at a tolerable level. A diverse collection of large-scale optimization methods has been developed to achieve this goal, each being particularly effective for certain problem types. Some of these methods are straightforward adaptations of the methods described in Chapters 3, 4, and 6. Other approaches are modifications of these basic methods that allow approximate steps to be calculated at lower cost in computation and storage. One set of approaches that we have already discussed—the nonlinear conjugate gradient methods of Section 5.2—can be applied 7.1. INEXACT NEWTON METHODS to large problems without modification, because of its minimal storage demands and its reliance on only first-order derivative information. The line search and trust-region Newton algorithms of Chapters 3 and 4 require matrix factorizations of the Hessian matrices ∇ 2 f k . In the large-scale case, these factorizations can be carried out using sparse elimination techniques. Such algorithms have received much attention, and high quality software implementations are available. If the computational cost and memory requirements of these sparse factorization methods are affordable for a given application, and if the Hessian matrix can be formed explicitly, Newton methods based on sparse factorizations constitute an effective approach for solving such problems. Often, however, the cost of factoring the Hessian is prohibitive, and it is preferable to compute approximations to the Newton step using iterative linear algebra techniques. Section 7.1 discusses inexact Newton methods that use these techniques, in both line search and trust-region frameworks. The resulting algorithms have attractive global convergence properties and may be superlinearly convergent for suitable choices of parameters. They find effective search directions when the Hessian ∇ 2 f k is indefinite, and may even be implemented in a “Hessian-free” manner, without explicit calculation or storage of the Hessian. The Hessian approximations generated by the quasi-Newton approaches of Chapter 6 are usually dense, even when the true Hessian is sparse, and the cost of storing and working with these approximations can be excessive for large n. Section 7.2 discusses limited-memory variants of the quasi-Newton approach, which use Hessian approximations that can be stored compactly by using just a few vectors of length n. These methods are fairly robust, inexpensive, and easy to implement, but they do not converge rapidly. Another approach, discussed briefly in Section 7.3, is to define quasi-Newton approximate Hessians Bk that preserve sparsity, for example by mimicking the sparsity pattern of the Hessian. In Section 7.4, we note that objective functions in large problems often possess a structural property known as partial separability, which means they can be decomposed into a sum of simpler functions, each of which depends on only a small subspace of IRn . Effective Newton and quasi-Newton methods that exploit this property have been developed. Such methods usually converge rapidly and are robust, but they require detailed information about the objective function, which can be difficult to obtain in some applications. We conclude the chapter with a discussion of software for large-scale unconstrained optimization problems. 7.1 INEXACT NEWTON METHODS Recall from (2.15) that the basic Newton step pkN is obtained by solving the symmetric n × n linear system ∇ 2 f k pkN −∇ f k . (7.1) In this section, we describe techniques for obtaining approximations to pkN that are 165 166 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION inexpensive to calculate but are good search directions or steps. These approaches are based on solving (7.1) by using the conjugate gradient (CG) method (see Chapter 5) or the Lanczos method, with modifications to handle negative curvature in the Hessian ∇ 2 f k . Both line search and trust-region approaches are described here. We refer to this family of methods by the general name inexact Newton methods. The use of iterative methods for (7.1) spares us from concerns about the expense of a direct factorization of the Hessian ∇ 2 f k and the fill-in that may occur during this process. Further, we can customize the solution strategy to ensure that the rapid convergence properties associated with Newton’s methods are not lost in the inexact version. In addition, as noted below, we can implement these methods in a Hessian-free manner, so that the Hessian ∇ 2 f k need not be calculated or stored explicitly at all. We examine first how the inexactness in the step calculation determines the local convergence properties of inexact Newton methods. We then consider line search and trust-region approaches based on using CG (possibly with preconditioning) to obtain an approximate solution of (7.1). Finally, we discuss the use of the Lanczos method for solving (7.1) approximately. LOCAL CONVERGENCE OF INEXACT NEWTON METHODS Most rules for terminating the iterative solver for (7.1) are based on the residual r k ∇ 2 f k pk + ∇ f k , (7.2) where pk is the inexact Newton step. Usually, we terminate the CG iterations when rk ≤ ηk ∇ f k , (7.3) where the sequence {ηk } (with 0 < ηk < 1 for all k) is called the forcing sequence. We now study how the rate of convergence of inexact Newton methods based on (7.1)–(7.3) is affected by the choice of the forcing sequence. The next two theorems apply not just to Newton–CG procedures but to all inexact Newton methods whose steps satisfy (7.2) and (7.3). Our first result says that local convergence is obtained simply by ensuring that ηk is bounded away from 1. Theorem 7.1. Suppose that ∇ 2 f (x) exists and is continuous in a neighborhood of a minimizer x ∗ , with 2 ∇ f (x ∗ ) is positive definite. Consider the iteration xk+1 xk + pk where pk satisfies (7.3), and assume that ηk ≤ η for some constant η ∈ [0, 1). Then, if the starting point x0 is sufficiently near x ∗ , the sequence {xk } converges to x ∗ and satisfies ∇ 2 f (x ∗ )(xk+1 − x ∗ ) ≤ η̂∇ 2 f (x ∗ )(xk − x ∗ ), for some constant η̂ with η < η̂ < 1. (7.4) 7.1. INEXACT NEWTON METHODS Rather than giving a rigorous proof of this theorem, we present an informal derivation that contains the essence of the argument and motivates the next result. Since the Hessian matrix ∇ 2 f is positive definite at x ∗ and continuous near x ∗ , there exists a positive constant L such that (∇ 2 f k )−1 ≤ L for all xk sufficiently close to x ∗ . We therefore have from (7.2) that the inexact Newton step satisfies pk ≤ L(∇ f k + rk ) ≤ 2L∇ f k , where the second inequality follows from (7.3) and ηk < 1. Using this expression together with Taylor’s theorem and the continuity of ∇ 2 f (x), we obtain ∇ f k+1 ∇ f k + ∇ 2 f k pk + 1 [∇ f (xk + t pk ) − ∇ f (xk )] pk dt 0 ∇ f k + ∇ 2 f k pk + o ( pk ) ∇ f k − (∇ f k − rk ) + o (∇ f k ) rk + o (∇ f k ) . (7.5) Taking norms and recalling (7.3), we have that ∇ f k+1 ≤ ηk ∇ f k + o (∇ f k ) ≤ (ηk + o(1)))∇ f k . (7.6) When xk is close enough to x ∗ that the o(1) term in the last estimate is bounded by (1−η)/2, we have ∇ f k+1 ≤ (ηk + (1 − η)/2)∇ f k ≤ 1+η ∇ f k , 2 (7.7) so the gradient norm decreases by a factor of (1 + η)/2 at this iteration. By choosing the initial point x0 sufficiently close to x ∗ , we can ensure that this rate of decrease occurs at every iteration. To prove (7.4), we note that under our smoothness assumptions, we have ∇ f k ∇ 2 f (x ∗ )(xk − x ∗ ) + o(xk − x ∗ ). Hence it can be shown that for xk close to x ∗ , the gradient ∇ f k differs from the scaled error ∇ 2 f (x ∗ )(xk − x ∗ ) by only a relatively small perturbation. A similar estimate holds at xk+1 , so (7.4) follows from (7.7). From (7.6), we have that ∇ f k+1 ≤ ηk + o(1). ∇ f k (7.8) 167 168 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION If limk→∞ ηk 0, we have from this expression that lim k→∞ ∇ f k+1 0, ∇ f k indicating Q-superlinear convergence of the gradient norms ∇ f k to zero. Superlinear convergence of the iterates {xk } to x ∗ can be proved as a consequence. We can obtain quadratic convergence by making the additional assumption that the Hessian ∇ 2 f (x) is Lipschitz continuous near x ∗ . In this case, the estimate (7.5) can be tightened to ∇ f k+1 rk + O ∇ f k 2 . By choosing the forcing sequence so that ηk O(∇ f k ), we have from this expression that ∇ f k+1 O(∇ f k 2 ), indicating Q-quadratic convergence of the gradient norms to zero (and thus also Q-quadratic convergence of the iterates xk to x ∗ ). The last two observations are summarized in the following theorem. Theorem 7.2. Suppose that the conditions of Theorem 7.1 hold, and assume that the iterates {xk } generated by the inexact Newton method converge to x ∗ . Then the rate of convergence is superlinear if ηk → 0. If in addition, ∇ 2 f (x) is Lipschitz continuous for x near x ∗ and if ηk O(∇ f k ), then the convergence is quadratic. √ To obtain superlinear convergence, we can set, for example, ηk min 0.5, ∇ f k ; the choice ηk min(0.5, ∇ f k ) would yield quadratic convergence. All the results presented in this section, which are proved by Dembo, Eisenstat, and Steihaug [89], are local in nature: They assume that the sequence {xk } eventually enters the near vicinity of the solution x ∗ . They also assume that the unit step length αk 1 is taken and hence that globalization strategies do not interfere with rapid convergence. In the following pages we show that inexact Newton strategies can, in fact, be incorporated in practical line search and trust-region implementations of Newton’s method, yielding algorithms with good local and global convergence properties. We start with a line search approach. LINE SEARCH NEWTON–CG METHOD In the line search Newton–CG method, also known as the truncated Newton method, we compute the search direction by applying the CG method to the Newton equations (7.1) and 7.1. INEXACT NEWTON METHODS attempt to satisfy a termination test of the form (7.3). However, the CG method is designed to solve positive definite systems, and the Hessian ∇ 2 f k may have negative eigenvalues when xk is not close to a solution. Therefore, we terminate the CG iteration as soon as a direction of negative curvature is generated. This adaptation of the CG method produces a search direction pk that is a descent direction. Moreover, the adaptation guarantees that the fast convergence rate of the pure Newton method is preserved, provided that the step length αk 1 is used whenever it satisfies the acceptance criteria. We now describe Algorithm 7.1, a line search algorithm that uses a modification of Algorithm 5.2 as the inner iteration to compute each search direction pk . For purposes of this algorithm, we write the linear system (7.1) in the form Bk p −∇ f k , (7.9) where Bk represents ∇ 2 f k . For the inner CG iteration, we denote the search directions by d j and the sequence of iterates that it generates by z j . When Bk is positive definite, the inner iteration sequence {z j } will converge to the Newton step pkN that solves (7.9). At each major iteration, we define a tolerance k that specifies the required accuracy of the computed √ solution. For concreteness, we choose the forcing sequence to be ηk min(0.5, ∇ f k ) to obtain a superlinear convergence rate, but other choices are possible. Algorithm 7.1 (Line Search Newton–CG). Given initial point x0 ; for k 0, 1, 2, . . . √ Define tolerance k min(0.5, ∇ f k )∇ f k ; Set z 0 0, r0 ∇ f k , d0 −r0 −∇ f k ; for j 0, 1, 2, . . . if d Tj Bk d j ≤ 0 if j 0 return pk −∇ f k ; else return pk z j ; Set α j r Tj r j /d Tj Bk d j ; Set z j+1 z j + α j d j ; Set r j+1 r j + α j Bk d j ; if r j+1 < k return pk z j+1 ; Set β j+1 r Tj+1r j+1 /r Tj r j ; Set d j+1 −r j+1 + β j+1 d j ; end (for) Set xk+1 xk + αk pk , where αk satisfies the Wolfe, Goldstein, or Armijo backtracking conditions (using αk 1 if possible); end 169 170 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION The main differences between the inner loop of Algorithm 7.1 and Algorithm 5.2 are that the specific starting point z 0 0 is used; the use of a positive tolerance k allows the CG iterations to terminate at an inexact solution; and the negative curvature test d Tj Bk d j ≤ 0 ensures that pk is a descent direction for f at xk . If negative curvature is detected on the first inner iteration j 0, the returned direction pk −∇ f k is both a descent direction and a direction of nonpositive curvature for f at xk . We can modify the CG iterations in Algorithm 7.1 by introducing preconditioning, in the manner described in Chapter 5. Algorithm 7.1 is well suited for large problems, but it has a weakness. When the Hessian ∇ 2 f k is nearly singular, the line search Newton–CG direction can be long and of poor quality, requiring many function evaluations in the line search and giving only a small reduction in the function. To alleviate this difficulty, we can try to normalize the Newton step, but good rules for doing so are difficult to determine. They run the risk of undermining the rapid convergence of Newton’s method in the case where the pure Newton step is well scaled. It is preferable to introduce a threshold value into the test d Tj Bd j ≤ 0, but good choices of the threshold are difficult to determine. The trust-region Newton–CG method described below deals more effectively with this problematic situation and is therefore preferable, in our opinion. The line search Newton–CG method does not require explicit knowledge of the Hessian Bk ∇ 2 f k . Rather, it requires only that we can supply Hessian–vector products of the form ∇ 2 f k d for any given vector d. When the user cannot easily supply code to calculate second derivatives, or where the Hessian requires too much storage, the techniques of Chapter 8 (automatic differentiation and finite differencing) can be used to calculate these Hessian–vector products. Methods of this type are known as Hessian-free Newton methods. To illustrate the finite-differencing technique briefly, we use the approximation ∇ 2 fk d ≈ ∇ f (xk + hd) − ∇ f (xk ) , h (7.10) for some small differencing interval h. It is easy to prove that the accuracy of this approximation is O(h); appropriate choices of h are discussed in Chapter 8. The price we pay for bypassing the computation of the Hessian is one new gradient evaluation per CG iteration. TRUST-REGION NEWTON–CG METHOD In Chapter 4, we discussed approaches for finding an approximate solution of the trust-region subproblem (4.3) that produce improvements on the Cauchy point. Here we define a modified CG algorithm for solving the subproblem with these properties. This algorithm, due to Steihaug [281], is specified below as Algorithm 7.2. A complete algorithm for minimizing f is obtained by using Algorithm 7.2 to generate the step pk required by Algorithm 4.1 of Chapter 4, for some choice of tolerance k at each iteration. 7.1. INEXACT NEWTON METHODS We use notation similar to (7.9) to define the trust-region subproblem for which Steihaug’s method finds an approximate solution: def minn m k ( p) f k + (∇ f k )T p + 12 p T Bk p p∈IR subject to p ≤ k , (7.11) where Bk ∇ 2 f k . As in Algorithm 7.1, we use d j to denote the search directions of this modified CG iteration and z j to denote the sequence of iterates that it generates. Algorithm 7.2 (CG–Steihaug). Given tolerance k > 0; Set z 0 0, r0 ∇ f k , d0 −r0 −∇ f k ; if r0 < k return pk z 0 0; for j 0, 1, 2, . . . if d Tj Bk d j ≤ 0 Find τ such that pk z j + τ d j minimizes m k ( pk ) in (4.5) and satisfies pk k ; return pk ; Set α j r Tj r j /d Tj Bk d j ; Set z j+1 z j + α j d j ; if z j+1 ≥ k Find τ ≥ 0 such that pk z j + τ d j satisfies pk k ; return pk ; Set r j+1 r j + α j Bk d j ; if r j+1 < k return pk z j+1 ; Set β j+1 r Tj+1r j+1 /r Tj r j ; Set d j+1 −r j+1 + β j+1 d j ; end (for). The first if statement inside the loop stops the method if its current search direction d j is a direction of nonpositive curvature along Bk , while the second if statement inside the loop causes termination if z j+1 violates the trust-region bound. In both cases, the method returns the step pk obtained by intersecting the current search direction with the trust-region boundary. The choice of the tolerance k at each call to Algorithm 7.2 is important in keeping the overall cost of the trust-region Newton–CG method low. Near a well-behaved solution x ∗ , the trust-region bound becomes inactive, and the method reduces to the inexact Newton method analyzed in Theorems 7.1 and 7.2. Rapid convergence can be obtained in these circumstances by choosing k in a similar fashion to Algorithm 7.1. 171 172 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION The essential differences between Algorithm 5.2 and the inner loop of Algorithm 7.2 are that the latter terminates when it violates the trust-region bound p ≤ , when it encounters a direction of negative curvature in ∇ 2 f k , or when it satisfies a convergence tolerance defined by a parameter k . In these respects, Algorithm 7.2 is quite similar to the inner loop of Algorithm 7.1. The initialization of z 0 to zero in Algorithm 7.2 is a crucial feature of the algorithm. Provided ∇ f k 2 ≥ k , Algorithm 7.2 terminates at a point pk for which m k ( pk ) ≤ m k ( pkC ), that is, when the reduction in model function equals or exceeds that of the Cauchy point. To demonstrate this fact, we consider several cases. First, if d0T Bk d0 (∇ f k )T Bk ∇ f k ≤ 0, then the condition in the first if statement is satisfied, and the algorithm returns the Cauchy point p −k (∇ f k )/∇ f k . Otherwise, Algorithm 7.2 defines z 1 as follows: z 1 α0 d0 r0T r0 (∇ f k )T ∇ f k d − ∇ fk . 0 (∇ f k )T Bk ∇ f k d0T Bk d0 If z 1 < k , then z 1 is exactly the Cauchy point. Subsequent steps of Algorithm 7.2 ensure that the final pk satisfies m k ( pk ) ≤ m k (z 1 ). When z 1 ≥ k , on the other hand, the second if statement is activated, and Algorithm 7.2 terminates at the Cauchy point, proving our claim. This property is important for global convergence: Since each step is at least as good as the Cauchy point in reducing the model m k , Algorithm 7.2 is globally convergent. Another crucial property of the method is that each iterate z j is larger in norm than its predecessor. This property is another consequence of the initialization z 0 0. Its main implication is that it is acceptable to stop iterating as soon as the trust-region boundary is reached, because no further iterates giving a lower value of the model function m k will lie inside the trust region. We state and prove this property formally in the following theorem, which makes use of the expanding subspace property of the conjugate gradient algorithm, described in Theorem 5.2. Theorem 7.3. The sequence of vectors {z j } generated by Algorithm 7.2 satisfies 0 z 0 2 < · · · < z j 2 < z j+1 2 < · · · < pk 2 ≤ k . PROOF. We first show that the sequences of vectors generated by Algorithm 7.2 satisfy z Tj r j 0 for j ≥ 0 and z Tj d j > 0 for j ≥ 1. Algorithm 7.2 computes z j+1 recursively in terms of z j ; but when all the terms of this recursion are written explicitly, we see that z j z0 + j−1 i0 αi di j−1 i0 αi di , 7.1. INEXACT NEWTON METHODS since z 0 0. Multiplying by r j and applying the expanding subspace property of conjugate gradients (see Theorem 5.2), we obtain z Tj r j j−1 αi diT r j 0. (7.12) i0 An induction proof establishes the relation z Tj d j > 0. By applying the expanding subspace property again, we obtain z 1T d1 (α0 d0 )T (−r1 + β1 d0 ) α0 β1 d0T d0 > 0. We now make the inductive hypothesis that z Tj d j > 0 and deduce that z Tj+1 d j+1 > 0. From (7.12), we have z Tj+1r j+1 0, and therefore z Tj+1 d j+1 z Tj+1 (−r j+1 + β j+1 d j ) β j+1 z Tj+1 d j β j+1 (z j + α j d j )T d j β j+1 z Tj d j + α j β j+1 d Tj d j . Because of the inductive hypothesis and positivity of β j+1 and α j , the last expression is positive. We now prove the theorem. If Algorithm 7.2 terminates because d Tj Bk d j ≤ 0 or z j+1 2 ≥ k , then the final point pk is chosen to make pk 2 k , which is the largest possible length. To cover all other possibilities in the algorithm, we must show that z j 2 < z j+1 2 when z j+1 z j + α j d j and j ≥ 1. Observe that z j+1 22 (z j + α j d j )T (z j + α j d j ) z j 22 + 2α j z Tj d j + α 2j d j 22 . It follows from this expression and our intermediate result that z j 2 < z j+1 2 , so our proof is complete. From this theorem we see that Algorithm 7.2 sweeps out points z j that move on some interpolating path from z 1 to the final solution pk , a path in which every step increases its total distance from the start point. When Bk ∇ 2 f k is positive definite, this path may be compared to the path of the dogleg method: Both methods start by minimizing m k along the negative gradient direction −∇ f k and subsequently progress toward pkN , until the trust-region boundary intervenes. One can show that, when Bk ∇ 2 f k is positive definite, Algorithm 7.2 provides a decrease in the model (7.11) that is at least half as good as the optimal decrease [320]. 173 174 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION PRECONDITIONING THE TRUST-REGION NEWTON–CG METHOD As discussed in Chapter 5, preconditioning can be used to accelerate the CG iteration. Preconditioning techniques are based on finding a nonsingular matrix D such that the eigenvalues of D −T ∇ 2 f k D −1 have a more favorable distribution. By generalizing Theorem 7.3, we can show that the iterates z j generated by a preconditioned variant of Algorithm 7.2 will grow monotonically in the weighted norm D · . To be consistent, we should redefine the trust-region subproblem in terms of the same norm, as follows: def minn m k ( p) f k + ∇ f k T p + 12 p T Bk p p∈IR subject to Dp ≤ k . (7.13) Making the change of variables p̂ Dp and defining ĝk D −T ∇ f k , B̂k D −T (∇ 2 f k )D −1 , we can write (7.13) as minn f k + ĝkT p̂ + 12 p̂ T B̂k p̂ p̂∈IR subject to p̂ ≤ , which has exactly the form of (7.11). We can apply Algorithm 7.2 without any modification to this subproblem, which is equivalent to applying a preconditioned version of Algorithm 7.2 to the problem (7.13). Many preconditioners can be used within this framework; we discuss some of them in Chapter 5. Of particular interest is incomplete Cholesky factorization, which has proved useful in a wide range of optimization problems. The incomplete Cholesky factorization of a positive definite matrix B finds a lower triangular matrix L such that B L L T − R, where the amount of fill-in in L is restricted in some way. (For instance, it is constrained to have the same sparsity structure as the lower triangular part of B or is allowed to have a number of nonzero entries similar to that in B.) The matrix R accounts for the inexactness in the approximate factorization. The situation is complicated somewhat by the possible indefiniteness of the Hessian ∇ 2 f k ; we must be able to handle this indefiniteness as well as maintain the sparsity. The following algorithm combines incomplete Cholesky and a form of modified Cholesky to define a preconditioner for the trust-region Newton–CG approach. Algorithm 7.3 (Inexact Modified Cholesky). Compute T diag(Be1 , Be2 , . . . , Ben ), where ei is the ith coordinate vector; Set B̄ ← T −1/2 BT −1/2 ; Set β ← B̄; 7.1. INEXACT NEWTON METHODS (compute a shift to ensure positive definiteness) if mini bii > 0 α0 ← 0 else α0 ← β/2; for k 0, 1, 2, . . . Attempt to apply incomplete Cholesky algorithm to obtain L L T B̄ + αk I ; if the factorization is completed successfully stop and return L; else αk+1 ← max(2αk , β/2); end (for) We can then set the preconditioner to be D L T , where L is the lower triangular matrix output from Algorithm 7.3. A trust-region Newton–CG method using this preconditioner is implemented in the LANCELOT [72] and TRON [192] codes. TRUST-REGION NEWTON–LANCZOS METHOD A limitation of Algorithm 7.2 is that it accepts any direction of negative curvature, even when this direction gives an insignificant reduction in the model. Consider, for example, the case where the subproblem (7.11) is min m( p) 10−3 p1 − 10−4 p12 − p22 p subject to p ≤ 1, where subscripts indicate elements of the vector p. The steepest descent direction at p 0 is (−10−3 , 0)T , which is a direction of negative curvature for the model. Algorithm 7.2 would follow this direction to the boundary of the trust region, yielding a reduction in model function m of about 10−3 . A step along e2 —also a direction of negative curvature—would yield a much greater reduction of 1. Several remedies have been proposed. We have seen in Chapter 4 that when the Hessian ∇ 2 f k contains negative eigenvalues, the search direction should have a significant component along the eigenvector corresponding to the most negative eigenvalue of ∇ 2 f k . This feature would allow the algorithm to move away rapidly from stationary points that are not minimizers. One way to achieve this is to compute a nearly exact solution of the trust-region subproblem (7.11) using the techniques described in Section 4.3. This approach requires the solution of a few linear systems with coefficient matrices of the form 175 176 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION Bk + λI . Although this approach is perhaps too expensive in the large-scale case, it generates productive search directions in all cases. A more practical alternative is to use the Lanczos method (see, for example, [136]) rather than the CG method to solve the linear system Bk p −∇ f k . The Lanczos method can be seen as a generalization of the CG method that is applicable to indefinite systems, and we can use it to continue the CG process while gathering negative curvature information. After j steps, the Lanczos method generates an n × j matrix Q j with orthogonal columns that span the Krylov subspace (5.15) generated by this method. This matrix has the property that Q Tj B Q j T j , where T j is an tridiagonal. We can take advantage of this tridiagonal structure and seek to find an approximate solution of the trust-region subproblem in the range of the basis Q j . To do so, we solve the problem min f k + e1T Q j (∇ f k )e1T w + 12 w T T j w w∈IR j subject to w ≤ k , (7.14) where e1 (1, 0, 0, . . . , 0)T , and we define the approximate solution of the trust-region subproblem as pk Q j w. Since T j is tridiagonal, problem (7.14) can be solved by factoring the system T j + λI and following the (nearly) exact approach of Section 4.3. The Lanczos iteration may be terminated, as in the Newton–CG methods, by a test of the form (7.3). Preconditioning can also be incorporated to accelerate the convergence of the Lanczos iteration. The additional robustness in this trust-region algorithm comes at the cost of a more expensive solution of the subproblem than in the Newton–CG approach. A sophisticated implementation of the Newton–Lanczos approach has been implemented in the GLTR package [145]. 7.2 LIMITED-MEMORY QUASI-NEWTON METHODS Limited-memory quasi-Newton methods are useful for solving large problems whose Hessian matrices cannot be computed at a reasonable cost or are not sparse. These methods maintain simple and compact approximations of Hessian matrices: Instead of storing fully dense n × n approximations, they save only a few vectors of length n that represent the approximations implicitly. Despite these modest storage requirements, they often yield an acceptable (albeit linear) rate of convergence. Various limited-memory methods have been proposed; we focus mainly on an algorithm known as L-BFGS, which, as its name suggests, is based on the BFGS updating formula. The main idea of this method is to use curvature information from only the most recent iterations to construct the Hessian approximation. Curvature information from earlier iterations, which is less likely to be relevant to the actual behavior of the Hessian at the current iteration, is discarded in the interest of saving storage. Following our discussion of L-BFGS and its convergence behavior, we discuss its relationship to the nonlinear conjugate gradient methods of Chapter 5. We then discuss 7.2. LIMITED-MEMORY QUASI-NEWTON METHODS implementations of limited-memory schemes that make use of a compact representation of approximate Hessian information. These techniques can be applied not only to L-BFGS but also to limited-memory versions of other quasi-Newton procedures such as SR1. Finally, we discuss quasi-Newton updating schemes that impose a particular sparsity pattern on the approximate Hessian. LIMITED-MEMORY BFGS We begin our description of the L-BFGS method by recalling its parent, the BFGS method, which was described in Algorithm 8.1. Each step of the BFGS method has the form xk+1 xk − αk Hk ∇ f k , (7.15) where αk is the step length and Hk is updated at every iteration by means of the formula Hk+1 VkT Hk Vk + ρk sk skT (7.16) (see (6.17)), where ρk 1 , ykT sk Vk I − ρk yk skT , (7.17) and sk xk+1 − xk , yk ∇ f k+1 − ∇ f k . (7.18) Since the inverse Hessian approximation Hk will generally be dense, the cost of storing and manipulating it is prohibitive when the number of variables is large. To circumvent this problem, we store a modified version of Hk implicitly, by storing a certain number (say, m) of the vector pairs {si , yi } used in the formulas (7.16)–(7.18). The product Hk ∇ f k can be obtained by performing a sequence of inner products and vector summations involving ∇ f k and the pairs {si , yi }. After the new iterate is computed, the oldest vector pair in the set of pairs {si , yi } is replaced by the new pair {sk , yk } obtained from the current step (7.18). In this way, the set of vector pairs includes curvature information from the m most recent iterations. Practical experience has shown that modest values of m (between 3 and 20, say) often produce satisfactory results. We now describe the updating process in a little more detail. At iteration k, the current iterate is xk and the set of vector pairs is given by {si , yi } for i k − m, . . . , k − 1. We first choose some initial Hessian approximation Hk0 (in contrast to the standard BFGS iteration, this initial approximation is allowed to vary from iteration to iteration) and find by repeated application of the formula (7.16) that the L-BFGS approximation Hk satisfies the following 177 178 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION formula: 0 T T Hk Vk−1 Hk (Vk−m · · · Vk−1 ) · · · Vk−m T T T sk−m sk−m + ρk−m Vk−1 · · · Vk−m+1 (Vk−m+1 · · · Vk−1 ) T T T + ρk−m+1 Vk−1 · · · Vk−m+2 sk−m+1 sk−m+1 (Vk−m+2 · · · Vk−1 ) + ··· T . + ρk−1 sk−1 sk−1 (7.19) From this expression we can derive a recursive procedure to compute the product Hk ∇ f k efficiently. Algorithm 7.4 (L-BFGS two-loop recursion). q ← ∇ fk ; for i k − 1, k − 2, . . . , k − m αi ← ρi siT q; q ← q − αi yi ; end (for) r ← Hk0 q; for i k − m, k − m + 1, . . . , k − 1 β ← ρi yiT r ; r ← r + si (αi − β) end (for) stop with result Hk ∇ f k r . Without considering the multiplication Hk0 q, the two-loop recursion scheme requires 4mn multiplications; if Hk0 is diagonal, then n additional multiplications are needed. Apart from being inexpensive, this recursion has the advantage that the multiplication by the initial matrix Hk0 is isolated from the rest of the computations, allowing this matrix to be chosen freely and to vary between iterations. We may even use an implicit choice of Hk0 by defining some initial approximation Bk0 to the Hessian (not its inverse) and obtaining r by solving the system Bk0r q. A method for choosing Hk0 that has proved effective in practice is to set Hk0 γk I , where γk T yk−1 sk−1 T yk−1 yk−1 . (7.20) As discussed in Chapter 6, γk is the scaling factor that attempts to estimate the size of the true Hessian matrix along the most recent search direction (see (6.21)). This choice helps to ensure that the search direction pk is well scaled, and as a result the step length αk 1 is accepted in most iterations. As discussed in Chapter 6, it is important that the line search be 7.2. LIMITED-MEMORY QUASI-NEWTON METHODS based on the Wolfe conditions (3.6) or strong Wolfe conditions (3.7), so that BFGS updating is stable. The limited-memory BFGS algorithm can be stated formally as follows. Algorithm 7.5 (L-BFGS). Choose starting point x0 , integer m > 0; k ← 0; repeat Choose Hk0 (for example, by using (7.20)); Compute pk ← −Hk ∇ f k from Algorithm 7.4; Compute xk+1 ← xk + αk pk , where αk is chosen to satisfy the Wolfe conditions; if k > m Discard the vector pair {sk−m , yk−m } from storage; Compute and save sk ← xk+1 − xk , yk ∇ f k+1 − ∇ f k ; k ← k + 1; until convergence. The strategy of keeping the m most recent correction pairs {si , yi } works well in practice; indeed no other strategy has yet proved to be consistently better. During its first m − 1 iterations, Algorithm 7.5 is equivalent to the BFGS algorithm of Chapter 6 if the initial matrix H0 is the same in both methods, and if L-BFGS chooses Hk0 H0 at each iteration. Table 7.1 presents results illustrating the behavior of Algorithm 7.5 for various levels of memory m. It gives the number of function and gradient evaluations (nfg) and the total CPU time. The test problems are taken from the CUTE collection [35], the number of variables is indicated by n, and the termination criterion ∇ f k ≤ 10−5 is used. The table shows that the algorithm tends to be less robust when m is small. As the amount of storage increases, the number of function evaluations tends to decrease; but since the cost of each iteration increases with the amount of storage, the best CPU time is often obtained for small values of m. Clearly, the optimal choice of m is problem dependent. Because some rival algorithms are inefficient, Algorithm 7.5 is often the approach of choice for large problems in which the true Hessian is not sparse. In particular, a Newton Table 7.1 Performance of Algorithm 7.5. Problem DIXMAANL EIGENALS FREUROTH TRIDIA n 1500 110 1000 1000 L-BFGS m3 nfg time 146 821 >999 876 16.5 21.5 — 46.6 L-BFGS m5 nfg time 134 569 >999 611 17.4 15.7 — 41.4 L-BFGS m 17 nfg time L-BFGS m 29 nfg time 120 363 69 531 125 168 38 462 28.2 16.2 8.1 84.6 44.4 12.5 6.3 127.1 179 180 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION method in which the exact Hessian is computed and factorized is not practical in such circumstances. The L-BFGS approach may also outperform Hessian-free Newton methods such as Newton–CG approaches, in which Hessian–vector products are calculated by finite differences or automatic differentiation. The main weakness of the L-BFGS method is that it converges slowly on ill-conditioned problems—specifically, on problems where the Hessian matrix contains a wide distribution of eigenvalues. On certain applications, the nonlinear conjugate gradient methods discussed in Chapter 5 are competitive with limited-memory quasi-Newton methods. RELATIONSHIP WITH CONJUGATE GRADIENT METHODS Limited-memory methods evolved as an attempt to improve nonlinear conjugate gradient methods, and early implementations resembled conjugate gradient methods more than quasi-Newton methods. The relationship between the two classes is the basis of a memoryless BFGS iteration, which we now outline. We start by considering the Hestenes–Stiefel form of the nonlinear conjugate gradient method (5.46). Recalling that sk αk pk , we have that the search direction for this method is given by pk+1 −∇ f k+1 + T yk ∇ f k+1 ykT pk sk y T pk − I − T k yk sk ∇ f k+1 ≡ − Ĥk+1 ∇ f k+1 . (7.21) This formula resembles a quasi-Newton iteration, but the matrix Ĥk+1 is neither symmetric T Ĥk+1 , but this matrix does not satisfy nor positive definite. We could symmetrize it as Ĥk+1 the secant equation Ĥk+1 yk sk and is, in any case, singular. An iteration matrix that is symmetric, positive definite, and satisfies the secant equation is given by Hk+1 I− sk ykT ykT sk I− yk skT ykT sk + sk skT . ykT sk (7.22) This matrix is exactly the one obtained by applying a single BFGS update (7.16) to the identity matrix. Hence, an algorithm whose search direction is given by pk+1 −Hk+1 ∇ f k+1 , with Hk+1 defined by (7.22), can be thought of as a “memoryless” BFGS method, in which the previous Hessian approximation is always reset to the identity matrix before updating it and where only the most recent correction pair (sk , yk ) is kept at every iteration. Alternatively, we can view the method as a variant of Algorithm 7.5 in which m 1 and Hk0 I at each iteration. A more direct connection with conjugate gradient methods can be seen if we consider the memoryless BFGS formula (7.22) in conjunction with an exact line search, for which 7.2. LIMITED-MEMORY QUASI-NEWTON METHODS T ∇ f k+1 pk 0 for all k. We then obtain pk+1 −Hk+1 ∇ f k+1 −∇ f k+1 + T yk ∇ f k+1 ykT pk pk , (7.23) which is none other than the Hestenes–Stiefel conjugate gradient method. Moreover, it is T pk 0, the Hestenes–Stiefel formula reduces to the Polak– easy to verify that when ∇ f k+1 Ribière formula (5.44). Even though the assumption of exact line searches is unrealistic, it is intriguing that the BFGS formula is related in this way to the Polak–Ribière and Hestenes–Stiefel methods. GENERAL LIMITED-MEMORY UPDATING Limited-memory quasi-Newton approximations are useful in a variety of optimization methods. L-BFGS, Algorithm 7.5, is a line search method for unconstrained optimization that (implicitly) updates an approximation Hk to the inverse of the Hessian matrix. Trustregion methods, on the other hand, require an approximation Bk to the Hessian matrix, not to its inverse. We would also like to develop limited-memory methods based on the SR1 formula, which is an attractive alternative to BFGS; see Chapter 6. In this section we consider limited-memory updating in a general setting and show that by representing quasi-Newton matrices in a compact (or outer product) form, we can derive efficient implementations of all popular quasi-Newton update formulas, and their inverses. These compact representations will also be useful in designing limited-memory methods for constrained optimization, where approximations to the Hessian or reduced Hessian of the Lagrangian are needed; see Chapter 18 and Chapter 19. We will consider only limited-memory methods (such as L-BFGS) that continuously refresh the correction pairs by removing and adding information at each stage. A different approach saves correction pairs until the available storage is exhausted and then discards all correction pairs (except perhaps one) and starts the process anew. Computational experience suggests that this second approach is less effective in practice. Throughout this chapter we let Bk denote an approximation to a Hessian matrix and Hk the approximation to the inverse. In particular, we always have that Bk−1 Hk . COMPACT REPRESENTATION OF BFGS UPDATING We now describe an approach to limited-memory updating that is based on representing quasi-Newton matrices in outer-product form. We illustrate it for the case of a BFGS approximation Bk to the Hessian. Theorem 7.4. k−1 Let B0 be symmetric and positive definite, and assume that the k vector pairs {si , yi }i0 T satisfy si yi > 0. Let Bk be obtained by applying k BFGS updates with these vector pairs to B0 , 181 182 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION using the formula (6.19). We then have that Bk B0 − B0 Sk Yk SkT B0 Sk Lk L kT −Dk −1 SkT B0 , YkT (7.24) where Sk and Yk are the n × k matrices defined by Sk [s0 , . . . , sk−1 ] , Yk [y0 , . . . , yk−1 ] , (7.25) while L k and Dk are the k × k matrices (L k )i, j T si−1 y j−1 if i > j, 0 otherwise, (7.26) T Dk diag s0T y0 , . . . , sk−1 yk−1 . (7.27) This result can be proved by induction. We note that the conditions siT yi > 0, i 0, 1, . . . , k − 1, ensure that the middle matrix in (7.24) is nonsingular, so that this expression is well defined. The utility of this representation becomes apparent when we consider limited-memory updating. As in the L-BFGS algorithm, we keep the m most recent correction pairs {si , yi } and refresh this set at every iteration by removing the oldest pair and adding a newly generated pair. During the first m iterations, the update procedure described in Theorem 7.4 can be used without modification, except that usually we make the specific choice Bk0 δk I for the basic matrix, where δk 1/γk and γk is defined by (7.20). At subsequent iterations k > m, the update procedure needs to be modified slightly to reflect the changing nature of the set of vector pairs {si , yi } for i k−m, k−m+1, . . . , k−1. Defining the n × m matrices Sk and Yk by Sk [sk−m , . . . , sk−1 ] , Yk [yk−m , . . . , yk−1 ] , (7.28) we find that the matrix Bk resulting from m updates to the basic matrix B0(k) δk I is given by Bk δk I − δk Sk Yk δk SkT Sk Lk L kT −Dk −1 δk SkT YkT where L k and Dk are now the m × m matrices defined by (L k )i, j (sk−m−1+i )T (yk−m−1+ j ) if i > j, 0 otherwise, Dk diag T T sk−m yk−m , . . . , sk−1 yk−1 . , (7.29) 7.2. Bk = δk I+ LIMITED-MEMORY QUASI-NEWTON METHODS Figure 7.1 Compact (or outer product) representation of Bk in (7.29). After the new iterate xk+1 is generated, we obtain Sk+1 by deleting sk−m from Sk and adding the new displacement sk , and we update Yk+1 in a similar fashion. The new matrices L k+1 and Dk+1 are obtained in an analogous way. Since the middle matrix in (7.29) is small—of dimension 2m—its factorization requires a negligible amount of computation. The key idea behind the compact representation (7.29) is that the corrections to the basic matrix can be expressed as an outer product of two long and narrow matrices—[δk Sk Yk ] and its transpose—with an intervening multiplication by a small 2m × 2m matrix. See Figure 7.1 for a graphical illustration. The limited-memory updating procedure of Bk requires approximately 2mn + O(m 3 ) operations, and matrix–vector products of the form Bk v can be performed at a cost of (4m + 1)n + O(m 2 ) multiplications. These operation counts indicate that updating and manipulating the direct limited-memory BFGS matrix Bk is quite economical when m is small. This approximation Bk can be used in a trust-region method for unconstrained optimization or, more significantly, in methods for bound-constrained and general-constrained optimization. The program L-BFGS-B [322] makes extensive use of compact limited-memory approximations to solve large nonlinear optimization problems with bound constraints. In this situation, projections of Bk into subspaces defined by the constraint gradients must be calculated repeatedly. Several codes for general-constrained optimization, including KNITRO and IPOPT, make use of the compact limited-memory matrix Bk to approximate the Hessian of the Lagrangians; see Section 19.3 We can derive a formula, similar to (7.24), that provides a compact representation of the inverse BFGS approximation Hk ; see [52] for details. An implementation of the unconstrained L-BFGS algorithm based on this expression requires a similar amount of computation as the algorithm described in the previous section. Compact representations can also be derived for matrices generated by the symmetric rank-one (SR1) formula. If k updates are applied to the symmetric matrix B0 using the k−1 and the SR1 formula (6.24), the resulting matrix Bk can be expressed vector pairs {si , yi }i0 as Bk B0 + (Yk − B0 Sk )(Dk + L k + L kT − SkT B0 Sk )−1 (Yk − B0 Sk )T , (7.30) 183 184 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION where Sk , Yk , Dk , and L k are as defined in (7.25), (7.26), and (7.27). Since the SR1 method is self-dual, the inverse formula Hk can be obtained simply by replacing B, s, and y by H , y, and s, respectively. Limited-memory SR1 methods can be derived in the same way as the BFGS method. We replace B0 with the basic matrix Bk0 at the kth iteration, and we redefine Sk and Yk to contain the m most recent corrections, as in (7.28). We note, however, that limited-memory SR1 updating is sometimes not as effective as L-BFGS updating because it may not produce positive definite approximations near a solution. UNROLLING THE UPDATE The reader may wonder whether limited-memory updating can be implemented in simpler ways. In fact, as we show here, the most obvious implementation of limitedmemory BFGS updating is considerably more expensive than the approach based on compact representations discussed in the previous section. The direct BFGS formula (6.19) can be written as Bk+1 Bk − ak akT + bk bkT , (7.31) where the vectors ak and bk are defined by ak Bk sk (skT Bk sk ) 1 2 , bk yk 1 (ykT sk ) 2 . (7.32) We could continue to save the vector pairs {si , yi } but use the formula (7.31) to compute matrix–vector products. A limited-memory BFGS method that uses this approach would proceed by defining the basic matrix Bk0 at each iteration and then updating according to the formula Bk Bk0 + k−1 bi biT − ai aiT . (7.33) ik−m The vector pairs {ai , bi }, i k − m, k − m + 1, . . . , k − 1, would then be recovered from the stored vector pairs {si , yi }, i k − m, k − m + 1, . . . , k − 1, by the following procedure: Procedure 7.6 (Unrolling the BFGS formula). for i k − m, k − m + 1, . . . , k − 1 bi ← yi /(yiT si )1/2 ; ) * T T (b ; s )b − (a s )a ai ← Bk0 si + i−1 i j i j jk−m j j ai ← ai /(siT ai )1/2 ; end (for) 7.3. SPARSE QUASI-NEWTON UPDATES Note that the vectors ai must be recomputed at each iteration because they all depend on the vector pair {sk−m , yk−m }, which is removed at the end of iteration k. On the other hand, the vectors bi and the inner products b Tj si can be saved from the previous iteration, so only the new values bk−1 and b Tj sk−1 need to be computed at the current iteration. By taking all these computations into account, and assuming that Bk0 I , we find that approximately 32 m 2 n operations are needed to determine the limited-memory matrix. The actual computation of the inner product Bm v (for arbitrary v ∈ IRn ) requires 4mn multiplications. Overall, therefore, this approach is less efficient than the one based on the compact matrix representation described previously. Indeed, while the product Bk v costs the same in both cases, updating the representation of the limited-memory matrix by using the compact form requires only 2mn multiplications, compared to 32 m 2 n multiplications needed when the BFGS formula is unrolled. 7.3 SPARSE QUASI-NEWTON UPDATES We now discuss a quasi-Newton approach to large-scale problems that has intuitive appeal: We demand that the quasi-Newton approximations Bk have the same (or similar) sparsity pattern as the true Hessian. This approach would reduce the storage requirements of the algorithm and perhaps give rise to more accurate Hessian approximations. Suppose that we know which components of the Hessian may be nonzero at some point in the domain of interest. That is, we know the contents of the set defined by def {(i, j) | [∇ 2 f (x)]i j 0 for some x in the domain of f }. Suppose also that the current Hessian approximation Bk mirrors the nonzero structure of / . In updating Bk to Bk+1 , then, we the exact Hessian, that is, (Bk )i j 0 for (i, j) ∈ could try to find the matrix Bk+1 that satisfies the secant condition, has the same sparsity pattern, and is as close as possible to Bk . Specifically, we define Bk+1 to be the solution of the following quadratic program: min B − Bk 2F B [Bi j − (Bk )i j ]2 , (7.34a) (i, j)∈ / . subject to Bsk yk , B B T , and Bi j 0 for (i, j) ∈ (7.34b) One can show that the solution Bk+1 of this problem can be obtained by solving an n × n linear system whose sparsity pattern is , the same as the sparsity of the true Hessian. Once Bk+1 has been computed, we can use it, within a trust-region method, to obtain the new iterate xk+1 . We note that Bk+1 is not guaranteed to be positive definite. We omit further details of this approach because it has several drawbacks. The updating process does not possess scale invariance under linear transformations of the variables and, 185 186 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION more significantly, its practical performance has been disappointing. The fundamental weakness of this approach is that (7.34a) is an inadequate model and can produce poor Hessian approximations. An alternative approach is to relax the secant equation, making sure that it is approximately satisfied along the last few steps rather than requiring it to hold strictly on the latest step. To do so, we define Sk and Yk by (7.28) so that they contain the m most recent difference pairs. We can then define the new Hessian approximation Bk+1 to be the solution of min B Sk − Yk 2F B subject to B B T and Bi j 0 for (i, j) ∈ / . This convex optimization problem has a solution, but it is not easy to compute. Moreover, this approach can produce singular or poorly conditioned Hessian approximations. Even though it frequently outperforms methods based on (7.34a), its performance on large problems has not been impressive. 7.4 ALGORITHMS FOR PARTIALLY SEPARABLE FUNCTIONS In a separable unconstrained optimization problem, the objective function can be decomposed into a sum of simpler functions that can be optimized independently. For example, if we have f (x) f 1 (x1 , x3 ) + f 2 (x2 , x4 , x6 ) + f 3 (x5 ), we can find the optimal value of x by minimizing each function f i , i 1, 2, 3, independently, since no variable appears in more than one function. The cost of performing m lower-dimensional optimizations is much less in general than the cost of optimizing an n-dimensional function. In many large problems the objective function f : IRn → IR is not separable, but it can still be written as the sum of simpler functions, known as element functions. Each element function has the property that it is unaffected when we move along a large number of linearly independent directions. If this property holds, we say that f is partially separable. All functions whose Hessians ∇ 2 f are sparse are partially separable, but so are many functions whose Hessian is not sparse. Partial separability allows for economical problem representation, efficient automatic differentiation, and effective quasi-Newton updating. The simplest form of partial separability arises when the objective function can be written as f (x) ne i1 f i (x), (7.35) 7.4. ALGORITHMS FOR PARTIALLY SEPARABLE FUNCTIONS where each of the element functions f i depends on only a few components of x. It follows that the gradients ∇ f i and Hessians ∇ 2 f i of each element function contain just a few nonzeros. By differentiating (7.35), we obtain ∇ f (x) ne ∇ f i (x), ∇ 2 f (x) i1 ne ∇ 2 f i (x). i1 A natural question is whether it is more effective to maintain quasi-Newton approximations to each of the element Hessians ∇ 2 f i (x) separately, rather than approximating the entire Hessian ∇ 2 f (x). We will show that the answer is affirmative, provided that the quasi-Newton approximation fully exploits the structure of each element Hessian. We introduce the concept by means of a simple example. Consider the objective function f (x) (x1 − x32 )2 + (x2 − x42 )2 + (x3 − x22 )2 + (x4 − x12 )2 (7.36) ≡ f 1 (x) + f 2 (x) + f 3 (x) + f 4 (x). The Hessians of the element functions f i are 4 × 4 sparse, singular matrices with 4 nonzero entries. Let us focus on f 1 ; all other element functions have exactly the same form. Even though f 1 is formally a function of all components of x, it depends only on x1 and x3 , which we call the element variables for f 1 . We assemble the element variables into a vector that we call x[1] , that is, x[1] x1 , x3 and note that x[1] U1 x with U1 1 0 0 0 0 0 1 0 . If we define the function φ1 by φ1 (z 1 , z 2 ) (z 1 − z 22 )2 , then we can write f 1 (x) φ1 (U1 x). By applying the chain rule to this representation, we obtain ∇ f 1 (x) U1T ∇φ1 (U1 x), ∇ 2 f 1 (x) U1T ∇ 2 φ1 (U1 x)U1 . (7.37) 187 188 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION In our case, we have ⎡ ∇ φ1 (U1 x) 2 2 −4x3 −4x3 12x32 − 4x1 2 ⎢ ⎢ 0 ∇ f 1 (x) ⎢ ⎢ −4x 3 ⎣ 0 , 2 0 −4x3 0 0 0 12x32 − 4x1 0 0 0 ⎤ ⎥ 0 ⎥ ⎥. 0 ⎥ ⎦ 0 The matrix U1 , known as a compactifying matrix, allows us to map the derivative information for the low-dimensional function φ1 into the derivative information for the element function f1 . Now comes the key idea: Instead of maintaining a quasi-Newton approximation to ∇ 2 f 1 , we maintain a 2 × 2 quasi-Newton approximation B[1] of ∇ 2 φ1 and use the relation (7.37) to transform it into a quasi-Newton approximation to ∇ 2 f 1 . To update B[1] after a typical step from x to x + , we record the information + − x[1] , s[1] x[1] + y[1] ∇φ1 (x[1] ) − ∇φ1 (x[1] ), (7.38) + . We therefore update and use BFGS or SR1 updating to obtain the new approximation B[1] small, dense quasi-Newton approximations with the property B[1] ≈ ∇ 2 φ1 (U1 x) ∇ 2 φ1 (x[1] ). (7.39) To obtain an approximation of the element Hessian ∇ 2 f 1 , we use the transformation suggested by the relationship (7.37); that is, ∇ 2 f 1 (x) ≈ U1T B[1] U1 . This operation has the effect of mapping the elements of B[1] to the correct positions in the full n × n Hessian approximation. The previous discussion concerned only the first element function f 1 , but we can treat all other functions f i in the same way. The full objective function can now be written as f (x) ne φi (Ui x), (7.40) i1 and we maintain a quasi-Newton approximation B[i] for each of the functions φi . To obtain a complete approximation to the full Hessian ∇ 2 f , we simply sum the element Hessian approximations as follows: B ne i1 UiT B[i] Ui . (7.41) 7.5. PERSPECTIVES AND SOFTWARE We may use this approximate Hessian in a trust-region algorithm, obtaining an approximate solution pk of the system Bk pk −∇ f k . (7.42) We need not assemble Bk explicitly but rather use the conjugate gradient approach to solve (7.42), computing matrix–vector products of the form Bk v by performing operations with the matrices Ui and B[i] . To illustrate the usefulness of this element-by-element updating technique, let us consider a problem of the form (7.36) but this time involving 1000 variables, not just 4. The functions φi still depend on only two internal variables, so that each Hessian approximation B[i] is a 2 × 2 matrix. After just a few iterations, we will have sampled enough directions s[i] to make each B[i] an accurate approximation to ∇ 2 φi . Hence the full quasi-Newton approximation (7.41) will tend to be a very good approximation to ∇ 2 f (x). By contrast, a quasi-Newton method that ignores the partially separable structure of the objective function will attempt to estimate the total average curvature—the sum of the individual curvatures of the element functions—by approximating the 1000 × 1000 Hessian matrix. When the number of variables n is large, many iterations will be required before this quasi-Newton approximation is of good quality. Hence an algorithm of this type (for example, standard BFGS or L-BFGS) will require many more iterations than a method based on the partially separable approximate Hessian. It is not always possible to use the BFGS formula to update the partial Hessian B[i] , T y[i] > 0 will be satisfied. That because there is no guarantee that the curvature condition s[i] 2 is, even though the full Hessian ∇ f (x) is at least positive semidefinite at the solution x ∗ , some of the individual Hessians ∇ 2 φi (·) may be indefinite. One way to overcome this obstacle is to apply the SR1 update to each of the element Hessians. This approach has proved effective in the LANCELOT package [72], which is designed to take full advantage of partial separability. The main limitations of this quasi-Newton approach are the cost of the step computation (7.42), which is comparable to the cost of a Newton step, and the difficulty of identifying the partially separable structure of a function. The performance of quasi-Newton methods is satisfactory provided that we find the finest partially separable decomposition of the problem; see [72]. Furthermore, even when the partially separable structure is known, it may be more efficient to compute a Newton step. For example, the modeling language AMPL automatically detects the partially separable structure of a function f and uses it to compute the Hessian ∇ 2 f (x). 7.5 PERSPECTIVES AND SOFTWARE Newton–CG methods have been used successfully to solve large problems in a variety of applications. Many of these implementations are developed by engineers and 189 190 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION scientists and use problem-specific preconditioners. Freely available packages include TN/TNBC [220] and TNPACK [275]. Software for more general problems, such as LANCELOT [72], KNITRO/CG [50], and TRON [192], employ Newton–CG methods when applied to unconstrained problems. Other packages, such as LOQO [294] implement Newton methods with a sparse factorization modified to ensure positive definiteness. GLTR [145] offers a Newton–Lanczos method. There is insufficient experience to date to say whether the Newton–Lanczos method is significantly better in practice than the Steihaug strategy given in Algorithm 7.2. Software for computing incomplete Cholesky preconditioners includes the ICFS [193] and MA57 [166] packages. A preconditioner for Newton–CG based on limited-memory BFGS approximations is provided in PREQN [209]. Limited-memory BFGS methods are implemented in LBFGS [194] and M1QN3 [122]; see Gill and Leonard [125] for a variant that requires less storage and appears to be quite efficient. The compact limited-memory representations of Section 7.2 are used in LBFGS-B [322], IPOPT [301], and KNITRO. The LANCELOT package exploits partial separability. It provides SR1 and BFGS quasiNewton options as well as a Newton methods. The step computation is obtained by a preconditioned conjugate gradient iteration using trust regions. If f is partially separable, a general affine transformation will not in general preserve the partially separable structure. The quasi-Newton method for partially separable functions described in Section 7.4 is not invariant to affine transformations of the variables, but this is not a drawback because the method is invariant under transformations that preserve separability. NOTES AND REFERENCES A complete study of inexact Newton methods is given in [74]. For a discussion of the Newton–Lanczos method see [145]. Other iterative methods for the solution of a trust-region problem have been proposed by Hager [160], and by Rendl and Wolkowicz [263]. For further discussion on the L-BFGS method see Nocedal [228], Liu and Nocedal [194], and Gilbert and Lemaréchal [122]. The last paper also discusses various ways in which the scaling parameter can be chosen. Algorithm 7.4, the two-loop L-BFGS recursion, constitutes an economical procedure for computing the product Hk ∇ f k . It is based, however, on the specific form of the BFGS update formula (7.16), and recursions of this type have not yet been developed (and may not exist) for other members of the Broyden class (for instance, the SR1 and DFP methods). Our discussion of compact representations of limited-memory matrices is based on Byrd, Nocedal, and Schnabel [52]. Sparse quasi-Newton updates have been studied by Toint [288, 289] and Fletcher et al. [102, 104], among others. The concept of partial separability was introduced by Griewank and Toint [156, 155]. For an extensive treatment of the subject see Conn, Gould, and Toint [72]. 7.5. PERSPECTIVES AND SOFTWARE ✐ EXERCISES ✐ 7.1 Code Algorithm 7.5, and test it on the extended Rosenbrock function f (x) n/2 2 α(x2i − x2i−1 )2 + (1 − x2i−1 )2 , i1 where α is a parameter that you can vary (for example, 1 or 100). The solution is x ∗ (1, 1, . . . , 1)T , f ∗ 0. Choose the starting point as (−1, −1, . . . , −1)T . Observe the behavior of your program for various values of the memory parameter m. ✐ 7.2 Show that the matrix Ĥk+1 in (7.21) is singular. ✐ 7.3 Derive the formula (7.23) under the assumption that line searches are exact. ✐ 7.4 Consider limited-memory SR1 updating based on (7.30). Explain how the storage can be cut in half if the basic matrix Bk0 is kept fixed for all k. (Hint: Consider the matrix Q k [q0 , . . . , qk−1 ] Yk − B0 Sk .) ✐ 7.5 Write the function defined by f (x) x2 x3 e x1 +x3 −x4 + (x2 x3 )2 + (x3 − x4 ) in the form (7.40). In particular, give the definition of each of the compactifying transformations Ui . ✐ 7.6 Does the approximation B obtained by the partially separable quasi-Newton updating (7.38), (7.41) satisfy the secant equation Bs y? ✐ 7.7 The minimum surface problem is a classical application of the calculus of variations and can be found in many textbooks. We wish to find the surface of minimum area, defined on the unit square, that interpolates a prescribed continuous function on the boundary of the square. In the standard discretization of this problem, the unknowns are the values of the sought-after function z(x, y) on a q × q rectangular mesh of points over the unit square. More specifically, we divide each edge of the square into q intervals of equal length, yielding (q + 1)2 grid points. We label the grid points as x(i−1)(q+1)+1 , . . . , xi(q+1) for i 1, 2, ..., q + 1, so that each value of i generates a line. With each point we associate a variable z i that represents the height of the surface at this point. For the 4q grid points on the boundary of the unit square, the values of these variables are determined by the given function. The 191 192 CHAPTER 7. LARGE-SCALE UNCONSTRAINED OPTIMIZATION optimization problem is to determine the other (q + 1)2 − 4q variables z i so that the total surface area is minimized. A typical subsquare in this partition looks as follows: x j+q+1 x j+q+2 xj x j+1 We denote this square by A j and note that its area is q 2 . The desired function is z(x, y), and we wish to compute its surface over A j . Calculus books show that the area of the surface is given by + f j (x) ≡ 1+ (x,y)∈A j ∂z ∂x 2 + ∂z ∂y 2 d x d y. Approximate the derivatives by finite differences, and show that f j has the form 1 2 q2 1 2 2 f j (x) 2 1 + [(x j − x j+q+1 ) + (x j+1 − x j+q ) ] . q 2 ✐ (7.43) 7.8 Compute the gradient of the element function (7.43) with respect to the full vector x. Show that it contains at most four nonzeros, and that two of these four nonzero components are negatives of the other two. Compute the Hessian of f j , and show that, among the 16 nonzeros, only three different magnitudes are represented. Also show that this Hessian is singular. This is page 193 Printer: Opaque this CHAPTER 8 Calculating Derivatives Most algorithms for nonlinear optimization and nonlinear equations require knowledge of derivatives. Sometimes the derivatives are easy to calculate by hand, and it is reasonable to expect the user to provide code to compute them. In other cases, the functions are too complicated, so we look for ways to calculate or approximate the derivatives automatically. A number of interesting approaches are available, of which the most important are probably the following. Finite Differencing. This technique has its roots in Taylor’s theorem (see Chapter 2). By observing the change in function values in response to small perturbations of the unknowns 194 CHAPTER 8. CALCULATING DERIVATIVES near a given point x, we can estimate the response to infintesimal perturbations, that is, the derivatives. For instance, the partial derivative of a smooth function f : IRn → IR with respect to the ith variable xi can be approximated by the central-difference formula ∂f f (x + ei ) − f (x − ei ) , ≈ ∂ xi 2 where is a small positive scalar and ei is the ith unit vector, that is, the vector whose elements are all 0 except for a 1 in the ith position. Automatic Differentiation. This technique takes the view that the computer code for evaluating the function can be broken down into a composition of elementary arithmetic operations, to which the chain rule (one of the basic rules of calculus) can be applied. Some software tools for automatic differentiation (such as ADIFOR [25]) produce new code that calculates both function and derivative values. Other tools (such as ADOL-C [154]) keep a record of the elementary computations that take place while the function evaluation code for a given point x is executing on the computer. This information is processed to produce the derivatives at the same point x. Symbolic Differentiation. In this technique, the algebraic specification for the function f is manipulated by symbolic manipulation tools to produce new algebraic expressions for each component of the gradient. Commonly used symbolic manipulation tools can be found in the packages Mathematica [311], Maple [304], and Macsyma [197]. In this chapter we discuss the first two approaches: finite differencing and automatic differentiation. The usefulness of derivatives is not restricted to algorithms for optimization. Modelers in areas such as design optimization and economics are often interested in performing post-optimal sensitivity analysis, in which they determine the sensitivity of the optimum to small perturbations in the parameter or constraint values. Derivatives are also important in other areas such as nonlinear differential equations and simulation. 8.1 FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS Finite differencing is an approach to the calculation of approximate derivatives whose motivation (like that of so many algorithms in optimization) comes from Taylor’s theorem. Many software packages perform automatic calculation of finite differences whenever the user is unable or unwilling to supply code to calculate exact derivatives. Although they yield only approximate values for the derivatives, the results are adequate in many situations. By definition, derivatives are a measure of the sensitivity of the function to infinitesimal changes in the values of the variables. Our approach in this section is to make small, finite perturbations in the values of x and examine the resulting differences in the function values. 8.1. FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS By taking ratios of the function difference to variable difference, we obtain approximations to the derivatives. APPROXIMATING THE GRADIENT An approximation to the gradient vector ∇ f (x) can be obtained by evaluating the function f at (n + 1) points and performing some elementary arithmetic. We describe this technique, along with a more accurate variant that requires additional function evaluations. A popular formula for approximating the partial derivative ∂ f /∂ xi at a given point x is the forward-difference, or one-sided-difference, approximation, defined as ∂f f (x + ei ) − f (x) (x) ≈ . ∂ xi (8.1) The gradient can be built up by simply applying this formula for i 1, 2, . . . , n. This process requires evaluation of f at the point x as well as the n perturbed points x + ei , i 1, 2, . . . , n: a total of (n + 1) points. The basis for the formula (8.1) is Taylor’s theorem, Theorem 2.1 in Chapter 2. When f is twice continuously differentiable, we have f (x + p) f (x) + ∇ f (x)T p + 12 p T ∇ 2 f (x + t p) p, some t ∈ (0, 1) (8.2) (see (2.6)). If we choose L to be a bound on the size of ∇ 2 f (·) in the region of interest, it follows directly from this formula that the last term in this expression is bounded by (L/2) p2 , so that f (x + p) − f (x) − ∇ f (x)T p ≤ (L/2) p2 . (8.3) We now choose the vector p to be ei , so that it represents a small change in the value of a single component of x (the ith component). For this p, we have that ∇ f (x)T p ∇ f (x)T ei ∂ f /∂ xi , so by rearranging (8.3), we conclude that f (x + ei ) − f (x) ∂f +δ , (x) ∂ xi where |δ | ≤ (L/2) . (8.4) We derive the forward-difference formula (8.1) by simply ignoring the error term δ in this expression, which becomes smaller and smaller as approaches zero. An important issue in implementing the formula (8.1) is the choice of the parameter . The error expression (8.4) suggests that we should choose as small as possible. Unfortunately, this expression ignores the roundoff errors that are introduced when the function f is evaluated on a real computer, in floating-point arithmetic. From our discussion in the Appendix (see (A.30) and (A.31)), we know that the quantity u known as unit roundoff 195 196 CHAPTER 8. CALCULATING DERIVATIVES is crucial: It is a bound on the relative error that is introduced whenever an arithmetic operation is performed on two floating-point numbers. (u is about 1.1 × 10−16 in doubleprecision IEEE floating-point arithmetic.) The effect of these errors on the final computed value of f depends on the way in which f is computed. It could come from an arithmetic formula, or from a differential equation solver, with or without refinement. As a rough estimate, let us assume simply that the relative error in the computed f is bounded by u, so that the computed values of f (x) and f (x + ei ) are related to the exact values in the following way: |comp( f (x)) − f (x)| ≤ uL f , |comp( f (x + ei )) − f (x + ei )| ≤ uL f , where comp(·) denotes the computed value, and L f is a bound on the value of | f (·)| in the region of interest. If we use these computed values of f in place of the exact values in (8.4) and (8.1), we obtain an error that is bounded by (L/2) + 2uL f / . (8.5) Naturally, we would like to choose to make this error as small as possible; it is easy to see that the minimizing value is 2 4L f u . L If we assume that the problem is well scaled, then the ratio L f /L (the ratio of function values to second derivative values) does not exceed a modest size. We can conclude that the following choice of is fairly close to optimal: √ u. (8.6) (In fact, this value is used in many of the optimization software packages that use finite differencing as an option for estimating derivatives.) For this value of , we have from (8.5) √ that the total error in the forward-difference approximation is fairly close to u. A more accurate approximation to the derivative can be obtained by using the centraldifference formula, defined as ∂f f (x + ei ) − f (x − ei ) . (x) ≈ ∂ xi 2 (8.7) As we show below, this approximation is more accurate than the forward-difference approximation (8.1). It is also about twice as expensive, since we need to evaluate f at the points x and x ± ei , i 1, 2, . . . , n: a total of 2n + 1 points. 8.1. FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS The basis for the central difference approximation is again Taylor’s theorem. When the second derivatives of f exist and are Lipschitz continuous, we have from (8.2) that f (x + p) f (x) + ∇ f (x)T p + 12 p T ∇ 2 f (x + t p) p for some t ∈ (0, 1) f (x) + ∇ f (x) p + p ∇ f (x) p + O p3 . T 1 2 T 2 (8.8) By setting p ei and p − ei , respectively, we obtain f (x + ei ) f (x) + ∂f 1 + ∂ xi 2 2∂ f (x − ei ) f (x) − ∂f 1 + ∂ xi 2 2∂ 2 f ∂ xi2 2 f ∂ xi2 +O +O 3 3 , . (Note that the final error terms in these two expressions are generally not the same, but they are both bounded by some multiple of 3 .) By subtracting the second equation from the first and dividing by 2 , we obtain the expression f (x + ei ) − f (x − ei ) ∂f +O 2 . (x) ∂ xi 2 We see from this expression that the error is O 2 , as compared to the O( ) error in the forward-difference formula (8.1). However, when we take evaluation error in f into account, the accuracy that can be achieved in practice is less impressive; the same assumptions that were used to derive (8.6) lead to an optimal choice of of about u1/3 and an error of about u2/3 . In some situations, the extra few digits of accuracy may improve the performance of the algorithm enough to make the extra expense worthwhile. APPROXIMATING A SPARSE JACOBIAN Consider now the case of a vector function r : IRn → IRm , such as the residual vector that we consider in Chapter 10 or the system of nonlinear equations from Chapter 11. The matrix J (x) of first derivatives for this function is defined as follows: ⎡ ∂r j J (x) ∂ xi j1,2,...,m i1,2,...,n ∇r1 (x)T ⎢ ⎢ ∇r2 (x)T ⎢ ⎢ .. ⎢ . ⎣ ∇rm (x)T ⎤ ⎥ ⎥ ⎥ ⎥, ⎥ ⎦ (8.9) where r j , j 1, 2, . . . , m are the components of r . The techniques described in the previous 197 198 CHAPTER 8. CALCULATING DERIVATIVES section can be used to evaluate the full Jacobian J (x) one column at a time. When r is twice continuously differentiable, we can use Taylor’s theorem to deduce that r (x + p) − r (x) − J (x) p ≤ (L/2) p2 , (8.10) where L is a Lipschitz constant for J in the region of interest. If we require an approximation to the Jacobian–vector product J (x) p for a given vector p (as is the case with inexact Newton methods for nonlinear systems of equations; see Section 11.1), this expression immediately suggests choosing a small nonzero and setting J (x) p ≈ r (x + p) − r (x) , (8.11) an approximation that is accurate to O( ). A two-sided approximation can be derived from the formula (8.7). If an approximation to the full Jacobian J (x) is required, we can compute it a column at a time, analogously to (8.1), by setting set p ei in (8.10) to derive the following estimate of the ith column: ∂r r (x + ei ) − r (x) (x) ≈ . ∂ xi (8.12) A full Jacobian estimate can be obtained at a cost of n + 1 evaluations of the function r . When the Jacobian is sparse, however, we can often obtain the estimate at a much lower cost, sometimes just three or four evaluations of r . The key is to estimate a number of different columns of the Jacobian simultaneously, by judicious choices of the perturbation vector p in (8.10). We illustrate the technique with a simple example. Consider the function r : IRn → IRn defined by ⎡ 2(x23 − x12 ) ⎢ ⎢ 3(x23 − x12 ) + 2(x33 − x22 ) ⎢ ⎢ 3(x33 − x22 ) + 2(x43 − x32 ) r (x) ⎢ ⎢ ⎢ .. ⎢ . ⎣ 3 2 3(xn − xn−1 ) ⎤ ⎥ ⎥ ⎥ ⎥ ⎥. ⎥ ⎥ ⎥ ⎦ (8.13) Each component of r depends on just two or three components of x, so that each row of the Jacobian contains only two or three nonzero elements. For the case of n 6, the Jacobian 8.1. FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS has the following structure: ⎡ × ⎢ ⎢ × ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎤ × × × × × × × × × × × ⎥ ⎥ ⎥ ⎥ ⎥ ⎥, ⎥ ⎥ ⎥ × ⎦ × × (8.14) where each cross represents a nonzero element, with zeros represented by a blank space. Staying for the moment with the case n 6, suppose that we wish to compute a finitedifference approximation to the Jacobian. (Of course, it is easy to calculate this particular Jacobian by hand, but there are complicated functions with similar structure for which hand calculation is more difficult.) A perturbation p e1 to the first component of x will affect only the first and second components of r . The remaining components will be unchanged, so that the right-hand-side of formula (8.12) will correctly evaluate to zero in the components 3, 4, 5, 6. It is wasteful, however, to reevaluate these components of r when we know in advance that their values are not affected by the perturbation. Instead, we look for a way to modify the perturbation vector so that it does not have any further effect on components 1 and 2, but does produce a change in some of the components 3, 4, 5, 6, which we can then use as the basis of a finite-difference estimate for some other column of the Jacobian. It is not hard to see that the additional perturbation e4 has the desired property: It alters the 3rd, 4th, and 5th elements of r , but leaves the 1st and 2nd elements unchanged. The changes in r as a result of the perturbations e1 and e4 do not interfere with each other. To express this discussion in mathematical terms, we set p (e1 + e4 ), and note that r (x + p)1,2 r (x + (e1 + e4 ))1,2 r (x + e1 )1,2 (8.15) (where the notation [·]1,2 denotes the subvector consisting of the first and second elements), while r (x + p)3,4,5 r (x + (e1 + e4 ))3,4,5 r (x + e4 )3,4,5 . By substituting (8.15) into (8.10), we obtain r (x + p)1,2 r (x)1,2 + [J (x)e1 ]1,2 + O( 2 ). (8.16) 199 200 CHAPTER 8. CALCULATING DERIVATIVES By rearranging this expression, we obtain the following difference formula for estimating the (1, 1) and (2, 1) elements of the Jacobian matrix: ⎤ ∂r1 ⎢ ∂ x1 (x) ⎥ ⎥ [J (x)e1 ]1,2 ≈ r (x + p)1,2 − r (x)1,2 . ⎢ ⎦ ⎣ ∂r2 (x) ∂ x1 ⎡ (8.17) A similar argument shows that the nonzero elements of the fourth column of the Jacobian can be estimated by substituting (8.16) into (8.10); we obtain ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∂r4 (x) ∂ x3 ∂r4 (x) ∂ x4 ∂r4 (x) ∂ x5 ⎤ ⎥ ⎥ ⎥ ⎥ [J (x)e4 ]3,4,5 ≈ r (x + p)3,4,5 − r (x)3,4,5 . ⎥ ⎥ ⎦ (8.18) To summarize: We have been able to estimate two columns of the Jacobian J (x) by evaluating the function r at the single extra point x + (e1 + e4 ). We can approximate the remainder of J (x) in an economical manner as well. Columns 2 and 5 can be approximated by choosing p (e2 + e5 ), while we can use p (e3 + e6 ) to approximate columns 3 and 6. In total, we need 3 evaluations of the function r (after the initial evaluation at x) to estimate the entire Jacobian matrix. In fact, for any choice of n in (8.13) (no matter how large), three extra evaluations of r are sufficient to approximate the entire Jacobian. The corresponding choices of perturbation vectors p are p (e1 + e4 + e7 + e10 + · · ·), p (e2 + e5 + e8 + e11 + · · ·), p (e3 + e6 + e9 + e12 + · · ·). In the first of these vectors, the nonzero components are chosen so that no two of the columns 1, 4, 7, . . . have a nonzero element in the same row. The same property holds for the other two vectors and, in fact, points the way to the criterion that we can apply to general problems to decide on a valid set of perturbation vectors. Algorithms for choosing the perturbation vectors can be expressed conveniently in the language of graphs and graph coloring. For any function r : IRn → IRm , we can construct a column incidence graph G with n nodes by drawing an arc between nodes i and k if there is some component of r that depends on both xi and xk . In other words, the ith and kth columns of the Jacobian J (x) each have a nonzero element in some row j, for some j 1, 2, . . . , m and some value of x. (The intersection graph for the function defined in 8.1. FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS 1 2 3 4 5 6 Figure 8.1 Column incidence graph for r (x) defined in (8.13). (8.13), with n 6, is shown in Figure 8.1.) We now assign each node a “color” according to the following rule: Two nodes can have the same color if there is no arc that connects them. Finally, we choose one perturbation vector corresponding to each color: If nodes i 1 , i 2 , . . . , i have the same color, the corresponding p is (ei1 + ei2 + · · · + ei ). Usually, there are many ways to assign colors to the n nodes in the graph in a way that satisfies the required condition. The simplest way is just to assign each node a different color, but since that scheme produces n perturbation vectors, it is usually not the most efficient approach. It is generally very difficult to find the coloring scheme that uses the fewest possible colors, but there are simple algorithms that do a good job of finding a near-optimal coloring at low cost. Curtis, Powell, and Reid [83] and Coleman and Moré [68] provide descriptions of some methods and performance comparisons. Newsam and Ramsdell [227] show that by considering a more general class of perturbation vectors p, it is possible to evaluate the full Jacobian using no more than n z evaluations of r (in addition to the evaluation at the point x), where n z is the maximum number of nonzeros in each row of J (x). For some functions r with well-studied structures (those that arise from discretizations of differential operators, or those that give rise to banded Jacobians, as in the example above), optimal coloring schemes are known. For the tridiagonal Jacobian of (8.14) and its associated graph in Figure 8.1, the scheme with three colors is optimal. APPROXIMATING THE HESSIAN In some situations, the user may be able to provide a routine to calculate the gradient ∇ f (x) but not the Hessian ∇ 2 f (x). We can obtain the Hessian by applying the techniques described above for the vector function r to the gradient ∇ f . By using the graph coloring techniques discussed above, sparse Hessians often can be approximated in this manner by using considerably fewer than n perturbation vectors. This approach ignores symmetry of the Hessian, and will usually produce a nonsymmetric approximation. We can recover 201 202 CHAPTER 8. CALCULATING DERIVATIVES symmetry by adding the approximation to its transpose and dividing the result by 2. Alternative differencing approaches that take symmetry of ∇ 2 f (x) explicitly into account are discussed below. Some important algorithms—most notably the Newton–CG methods described in Chapter 7—do not require knowledge of the full Hessian. Instead, each iteration requires us to supply the Hessian–vector product ∇ 2 f (x) p, for a given vector p. We can obtain an approximation to this matrix-vector product by appealing once again to Taylor’s theorem. When second derivatives of f exist and are Lipschitz continuous near x, we have ∇ f (x + p) ∇ f (x) + ∇ 2 f (x) p + O( 2 ), (8.19) so that ∇ 2 f (x) p ≈ ∇ f (x + p) − ∇ f (x) (8.20) (see also (7.10)). The approximation error is O( ), and the cost of obtaining the approximation is a single gradient evaluation at the point x + p. The formula (8.20) corresponds to the forward-difference approximation (8.1). A central-difference formula like (8.7) can be derived by evaluating ∇ f (x − p) as well. For the case in which even gradients are not available, we can use Taylor’s theorem once again to derive formulae for approximating the Hessian that use only function values. The main tool is the formula (8.8): By substituting the vectors p ei , p e j , and p (ei + e j ) into this formula and combining the results appropriately, we obtain f (x + ei + e j ) − f (x + ei ) − f (x + e j ) + f (x) ∂2 f (x) + O( ). 2 ∂ xi ∂ x j (8.21) If we wished to approximate every element of the Hessian with this formula, then we would need to evaluate f at x + (ei + e j ) for all possible i and j (a total of n(n + 1)/2 points) as well as at the n points x + ei , i 1, 2, . . . , n. If the Hessian is sparse, we can, of course, reduce this operation count by skipping the evaluation whenever we know the element ∂ 2 f /∂ xi ∂ x j to be zero. APPROXIMATING A SPARSE HESSIAN We noted above that a Hessian approximation can be obtained by applying finitedifference Jacobian estimation techniques to the gradient ∇ f , treated as a vector function. We now show how symmetry of the Hessian ∇ 2 f can be used to reduce the number of perturbation vectors p needed to obtain a complete approximation, when the Hessian is sparse. The key observation is that, because of symmetry, any estimate of the element [∇ 2 f (x)]i, j ∂ 2 f (x)/∂ xi ∂ x j is also an estimate of its symmetric counterpart [∇ 2 f (x)] j,i . 8.1. FINITE-DIFFERENCE DERIVATIVE APPROXIMATIONS We illustrate the point with the simple function f : IRn → IR defined by f (x) x1 n i 2 xi2 . (8.22) i1 It is easy to show that the Hessian ∇ 2 f has the “arrowhead” structure depicted below, for the case of n 6: ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ × × × × × × × × × × × × × × × ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥. ⎥ ⎥ ⎥ ⎦ (8.23) × If we were to construct the intersection graph for the function ∇ f (analogous to Figure 8.1), we would find that every node is connected to every other node, for the simple reason that row 1 has a nonzero in every column. According to the rule for coloring the graph, then, we would have to assign a different color to every node, which implies that we would need to evaluate ∇ f at the n + 1 points x and x + ei for i 1, 2, . . . , n. We can construct a much more efficient scheme by taking the symmetry into account. Suppose we first use the perturbation vector p e1 to estimate the first column of ∇ 2 f (x). Because of symmetry, the same estimates apply to the first row of ∇ 2 f . From (8.23), we see that all that remains is to find the diagonal elements ∇ 2 f (x)22 , ∇ 2 f (x)33 , . . . , ∇ 2 f (x)66 . The intersection graph for these remaining elements is completely disconnected, so we can assign them all the same color and choose the corresponding perturbation vector to be p (e2 + e3 + · · · + e6 ) (0, 1, 1, 1, 1, 1)T . (8.24) Note that the second component of ∇ f is not affected by the perturbations in components 3, 4, 5, 6 of the unknown vector, while the third component of ∇ f is not affected by perturbations in components 2, 4, 5, 6 of x, and so on. As in (8.15) and (8.16), we have for each component i that ∇ f (x + p)i ∇ f (x + (e2 + e3 + · · · + e6 ))i ∇ f (x + ei )i . By applying the forward-difference formula (8.1) to each of these individual components, we then obtain ∂2 f ∇ f (x + ei )i − ∇ f (x)i ∇ f (x + p)i − ∇ f (x)i (x) ≈ , ∂ xi2 i 2, 3, . . . , 6. 203 204 CHAPTER 8. CALCULATING DERIVATIVES By exploiting symmetry, we have been able to estimate the entire Hessian by evaluating ∇ f only at x and two other points. Again, graph-coloring techniques can be used to choose the perturbation vectors p economically. We use the adjacency graph in place of the intersection graph described earlier. The adjacency graph has n nodes, with arcs connecting nodes i and k whenever i k and ∂ 2 f (x)/(∂ xi ∂ xk ) 0 for some x. The requirements on the coloring scheme are a little more complicated than before, however. We require not only that connected nodes have different colors, but also that any path of length 3 through the graph contain at least three colors. In other words, if there exist nodes i 1 , i 2 , i 3 , i 4 in the graph that are connected by arcs (i 1 , i 2 ), (i 2 , i 3 ), and (i 3 , i 4 ), then at least three different colors must be used in coloring these four nodes. See Coleman and Moré [69] for an explanation of this rule and for algorithms to compute valid colorings. The perturbation vectors are constructed as before: Whenever the nodes i 1 , i 2 , . . . , i have the same color, we set the corresponding perturbation vector to be p (ei1 + ei2 + · · · + ei ). 8.2 AUTOMATIC DIFFERENTIATION Automatic differentiation is the generic name for techniques that use the computational representation of a function to produce analytic values for the derivatives. Some techniques produce code for the derivatives at a general point x by manipulating the function code directly. Other techniques keep a record of the computations made during the evaluation of the function at a specific point x and then review this information to produce a set of derivatives at x. Automatic differentiation techniques are founded on the observation that any function, no matter how complicated, is evaluated by performing a sequence of simple elementary operations involving just one or two arguments at a time. Two-argument operations include addition, multiplication, division, and the power operation a b . Examples of single-argument operations include the trigonometric, exponential, and logarithmic functions. Another common ingredient of the various automatic differentiation tools is their use of the chain rule. This is the well-known rule from elementary calculus that says that if h is a function of the vector y ∈ IRm , which is in turn a function of the vector x ∈ IRn , we can write the derivative of h with respect to x as follows: ∇x h(y(x)) m ∂h ∇ yi (x). ∂ yi i1 (8.25) See Appendix A for further details. There are two basic modes of automatic differentiation: the forward and reverse modes. The difference between them can be illustrated by a simple example. We work through such 8.2. AUTOMATIC DIFFERENTIATION an example below, and indicate how the techniques can be extended to general functions, including vector functions. AN EXAMPLE Consider the following function of 3 variables: f (x) (x1 x2 sin x3 + e x1 x2 )/x3 . (8.26) Figure 8.2 shows how the evaluation of this function can be broken down into its elementary operations and also indicates the partial ordering associated with these operations. For instance, the multiplication x1 ∗ x2 must take place prior to the exponentiation e x1 x2 , or else we would obtain the incorrect result (e x1 )x2 . This graph introduces the intermediate variables x4 , x5 , . . . that contain the results of intermediate computations; they are distinguished from the independent variables x1 , x2 , x3 that appear at the left of the graph. We can express the evaluation of f in arithmetic terms as follows: x4 x1 ∗ x2 , x5 sin x3 , x 6 e x4 , (8.27) x7 x4 ∗ x5 , x8 x6 + x7 , x9 x8 /x3 . The final node x9 in Figure 8.2 contains the function value f (x). In the terminology of graph theory, node i is the parent of node j, and node j the child of node i, whenever there is a directed arc from i to j. Any node can be evaluated when the values of all its parents are known, so computation flows through the graph from left to right. Flow of x1 * x4 exp x6 x2 x3 Figure 8.2 sin x 5 * x7 + x8 / Computational graph for f (x) defined in (8.26). x9 205 206 CHAPTER 8. CALCULATING DERIVATIVES computation in this direction is known as a forward sweep. It is important to emphasize that software tools for automatic differentiation do not require the user to break down the code for evaluating the function into its elements, as in (8.27). Identification of intermediate quantities and construction of the computational graph is carried out, explicitly or implicitly, by the software tool itself. THE FORWARD MODE In the forward mode of automatic differentiation, we evaluate and carry forward a directional derivative of each intermediate variable xi in a given direction p ∈ IRn , simultaneously with the evaluation of xi itself. For the three-variable example above, we use the following notation for the directional derivative for p associated with each variable: def D p xi (∇xi )T p 3 ∂ xi pj, ∂x j j1 i 1, 2, . . . , 9, (8.28) where ∇ indicates the gradient with respect to the three independent variables. Our goal is to evaluate D p x9 , which is the same as the directional derivative ∇ f (x)T p. We note immediately that initial values D p xi for the independent variables xi , i 1, 2, 3, are simply the components p1 , p2 , p3 of p. The direction p is referred to as the seed vector. As soon as the value of xi at any node is known, we can find the corresponding value of D p xi from the chain rule. For instance, suppose we know the values of x4 , D p x4 , x5 , and D p x5 , and we are about to calculate x7 in Figure 8.2. We have that x7 x4 x5 ; that is, x7 is a function of the two variables x4 and x5 , which in turn are functions of x1 , x2 , x3 . By applying the rule (8.25), we have that ∇x7 ∂ x7 ∂ x7 ∇x4 + ∇x5 x5 ∇x4 + x4 ∇x5 . ∂ x4 ∂ x5 By taking the inner product of both sides of this expression with p and applying the definition (8.28), we obtain D p x7 ∂ x7 ∂ x7 D p x4 + D p x5 x5 D p x4 + x4 D p x5 . ∂ x4 ∂ x5 (8.29) The directional derivatives D p xi are therefore evaluated side by side with the intermediate results xi , and at the end of the process we obtain D p x9 D p f ∇ f (x)T p. The principle of the forward mode is straightforward enough, but what of its practical implementation and computational requirements? First, we repeat that the user does not need to construct the computational graph, break the computation down into elementary operations as in (8.27), or identify intermediate variables. The automatic differentiation software should perform these tasks implicitly and automatically. Nor is it necessary to store 8.2. AUTOMATIC DIFFERENTIATION the information xi and D p xi for every node of the computation graph at once (which is just as well, since this graph can be very large for complicated functions). Once all the children of any node have been evaluated, its associated values xi and D p xi are not needed further and may be overwritten in storage. The key to practical implementation is the side-by-side evaluation of xi and D p xi . The automatic differentiation software associates a scalar D p w with any scalar w that appears in the evaluation code. Whenever w is used in an arithmetic computation, the software performs an associated operation (based on the chain rule) with the gradient vector D p w. For instance, if w is combined in a division operation with another value y to produce a new value z, that is, z← w , y we use w, z, D p w, and D p y to evaluate the directional derivative D p z as follows: Dpz ← 1 w D p w − 2 D p y. y y (8.30) To obtain the complete gradient vector, we can carry out this procedure simultaneously for the n seed vectors p e1 , e2 , . . . , en . By the definition (8.28), we see that p e j implies that D p f ∂ f /∂ x j , j 1, 2, . . . , n. We note from the example (8.30) that the additional cost of evaluating f and ∇ f (over the cost of evaluating f alone) may be significant. In this example, the single division operation on w and y needed to calculate z gives rise to approximately 2n multiplications and n additions in the computation of the gradient elements De j z, j 1, 2, . . . , n. It is difficult to obtain an exact bound on the increase in computation, since the costs of retrieving and storing the data should also be taken into account. The storage requirements may also increase by a factor as large as n, since we now have to store n additional scalars De j xi , j 1, 2, . . . , n, alongside each intermediate variable xi . It is usually possible to make savings by observing that many of these quantities are zero, particularly in the early stages of the computation (that is, toward the left of the computational graph), so sparse data structures can be used to store the vectors De j xi , j 1, 2, . . . , n (see [27]). The forward mode of automatic differentiation can be implemented by means of a precompiler, which transforms function evaluation code into extended code that evaluates the derivative vectors as well. An alternative approach is to use the operator-overloading facilities available in languages such as C++ to transparently extend the data structures and operations in the manner described above. THE REVERSE MODE The reverse mode of automatic differentiation does not perform function and gradient evaluations concurrently. Instead, after the evaluation of f is complete, it recovers the partial 207 208 CHAPTER 8. CALCULATING DERIVATIVES derivatives of f with respect to each variable xi —independent and intermediate variables alike—by performing a reverse sweep of the computational graph. At the conclusion of this process, the gradient vector ∇ f can be assembled from the partial derivatives ∂ f /∂ xi with respect to the independent variables xi , i 1, 2, . . . , n. Instead of the gradient vectors D p xi used in the forward mode, the reverse mode associates a scalar variable x̄i with each node in the graph; information about the partial derivative ∂ f /∂ xi is accumulated in x̄i during the reverse sweep. The x̄i are sometimes called the adjoint variables, and we initialize their values to zero, with the exception of the rightmost node in the graph (node N , say), for which we set x̄ N 1. This choice makes sense because x N contains the final function value f , so we have ∂ f / ∂ x N 1. The reverse sweep makes use of the following observation, which is again based on the chain rule (8.25): For any node i, the partial derivative ∂ f /∂ xi can be built up from the partial derivatives ∂ f /∂ x j corresponding to its child nodes j according to the following formula: ∂f ∂ xi j a child of i ∂ f ∂x j . ∂ x j ∂ xi (8.31) For each node i, we add the right-hand-side term in (8.31) to x̄i as soon as it becomes known; that is, we perform the operation x̄i + ∂ f ∂x j . ∂ x j ∂ xi (8.32) (In this expression and the ones below, we use the arithmetic notation of the programming language C, in which x+ a means x ← x + a.) Once contributions have been received from all the child nodes of i, we have x̄i ∂ f /∂ xi , so we declare node i to be “finalized.” At this point, node i is ready to contribute a term to the summation for each of its parent nodes according to the formula (8.31). The process continues in this fashion until all nodes are finalized. Note that for derivative evaluation, the flow of computation in the graph is from children to parents—the opposite direction to the computation flow for function evaluation. During the reverse sweep, we work with numerical values, not with formulae or computer code involving the variables xi or the partial derivatives ∂ f /∂ xi . During the forward sweep—the evaluation of f —we not only calculate the values of each variable xi , but we also calculate and store the numerical values of each partial derivative ∂ x j /∂ xi . Each of these partial derivatives is associated with a particular arc of the computational graph. The numerical values of ∂ x j /∂ xi computed during the forward sweep are then used in the formula (8.32) during the reverse sweep. We illustrate the reverse mode for the example function (8.26). In Figure 8.3 we fill in the graph of Figure 8.2 for a specific evaluation point x (1, 2, π/2)T , indicating the 8.2. 1 AUTOMATIC DIFFERENTIATION p(4,1)=2 * 2 p(4,2)=1 π /2 sin p(5,3)=0 2 exp p(6,4)=e e2 p(8,6)=1 p(7,4)=1 1 * p(7,5)=2 2 + p(8,7)=1 2+e 2 p(9,8)=2/π / 4+2e2/ π p(9,3)=(84e 2)/π 2 Figure 8.3 Computational graph for f (x) defined in (8.26) showing numerical values of intermediate values and partial derivatives for the point x (1, 2, π/2)T . Notation: p( j, i) ∂ x j /∂ xi . numerical values of the intermediate variables x4 , x5 , . . . , x9 associated with each node and the partial derivatives ∂ x j /∂ xi associated with each arc. As mentioned above, we initialize the reverse sweep by setting all the adjoint variables x̄i to zero, except for the rightmost node, for which we have x̄9 1. Since f (x) x9 and since node 9 has no children, we have x̄9 ∂ f /∂ x9 , and so we can immediately declare node 9 to be finalized. Node 9 is the child of nodes 3 and 8, so we use formula (8.32) to update the values of x̄3 and x̄8 as follows: ∂ f ∂ x9 2 + e2 −8 − 4e2 − , ∂ x9 ∂ x3 (π/2)2 π2 2 ∂ f ∂ x9 1 . x̄8 + ∂ x9 ∂ x8 π/2 π x̄3 + (8.33a) (8.33b) Node 3 is not finalized after this operation; it still awaits a contribution from its other child, node 5. On the other hand, node 9 is the only child of node 8, so we can declare node 8 to be finalized with the value ∂∂xf8 2/π. We can now update the values of x̄i at the two parent nodes of node 8 by applying the formula (8.32) once again; that is, ∂ f ∂ x8 2 ; ∂ x8 ∂ x6 π ∂ f ∂ x8 2 x̄7 + . ∂ x8 ∂ x7 π x̄6 + At this point, nodes 6 and 7 are finalized, so we can use them to update nodes 4 and 5. At 209 210 CHAPTER 8. CALCULATING DERIVATIVES the end of this process, when all nodes are finalized, nodes 1, 2, and 3 contain ⎡ x̄1 ⎤ ⎡ ⎢ ⎥ ⎢ ⎣ x̄2 ⎦ ∇ f (x) ⎣ x̄3 (4 + 4e2 )/π (2 + 2e2 )/π ⎤ ⎥ ⎦, (−8 − 4e2 )/π 2 and the derivative computation is complete. The main appeal of the reverse mode is that its computational complexity is low for the scalar functions f : IRn → IR discussed here. The extra arithmetic associated with the gradient computation is at most four or five times the arithmetic needed to evaluate the function alone. Taking the division operation in (8.33) as an example, we see that two multiplications, a division, and an addition are required for (8.33a), while a division and an addition are required for (8.33b). This is about five times as much work as the single division involving these nodes that was performed during the forward sweep. As we noted above, the forward mode may require up to n times more arithmetic to compute the gradient ∇ f than to compute the function f alone, making it appear uncompetitive with the reverse mode. When we consider vector functions r : IRn → IRm , the relative costs of the forward and reverse modes become more similar as m increases, as we describe in the next section. An apparent drawback of the reverse mode is the need to store the entire computational graph, which is needed for the reverse sweep. In principle, storage of this graph is not too difficult to implement. Whenever an elementary operation is performed, we can form and store a new node containing the intermediate result, pointers to the (one or two) parent nodes, and the partial derivatives associated with these arcs. During the reverse sweep, the nodes can be read in the reverse order to that in which they were written, giving a particularly simple access pattern. The process of forming and writing the graph can be implemented as a straightforward extension to the elementary operations via operator overloading (as in ADOL-C [154]). The reverse sweep/gradient evaluation can be invoked as a simple function call. Unfortunately, the computational graph may require a huge amount of storage. If each node can be stored in 20 bytes, then a function that requires one second of evaluation time on a 100 megaflop computer may produce a graph of up to 2 gigabytes in size. The storage requirements can be reduced, at the cost of some extra arithmetic, by performing partial forward and reverse sweeps on pieces of the computational graph, reevaluating portions of the graph as needed rather than storing the whole structure. Descriptions of this approach, sometimes known as checkpointing, can be found in Griewank [150] and Grimm, Pottier, and Rostaing-Schmidt [157]. An implementation of checkpointing in the context of variational data assimilation can be found in Restrepo, Leaf, and Griewank [264] . VECTOR FUNCTIONS AND PARTIAL SEPARABILITY So far, we have looked at automatic differentiation of general scalar-valued functions f : IRn → IR. In nonlinear least-squares problems (Chapter 10) and nonlinear equations 8.2. AUTOMATIC DIFFERENTIATION (Chapter 11), we have to deal with vector functions r : IRn → IRm with m components r j , j 1, 2, . . . , m. The rightmost column of the computational graph then consists of m nodes, none of which has any children, in place of the single node described above. The forward and reverse modes can be adapted in straightforward ways to find the Jacobian J (x), the m × n matrix defined in (8.9). Besides their applications to least-squares and nonlinear-equations problems, automatic differentiation of vector functions is a useful technique for dealing with partially separable functions. We recall that partial separability is commonly observed in large-scale optimization, and we saw in Chapter 7 that there exist efficient quasi-Newton procedures for the minimization of objective functions with this property. Since an automatic procedure for detecting the decomposition of a given function f into its partially separable representation was developed recently by Gay [118], it has become possible to exploit the efficiencies that accrue from this property without asking much information from the user. In the simplest sense, a function f is partially separable if we can express it in the form f (x) ne f i (x), (8.34) i1 where each element function f i (·) depends on just a few components of x. If we construct the vector function r from the partially separable components, that is, ⎡ ⎢ ⎢ ⎢ r (x) ⎢ ⎢ ⎣ f 1 (x) f 2 (x) .. . ⎤ ⎥ ⎥ ⎥ ⎥, ⎥ ⎦ f ne (x) it follows from (8.34) that ∇ f (x) J (x)T e, (8.35) where, as usual, e (1, 1, . . . , 1)T . Because of the partial separability property, most columns of J (x) contain just a few nonzeros. This structure makes it possible to calculate J (x) efficiently by applying graph-coloring techniques, as we discuss below. The gradient ∇ f (x) can then be recovered from the formula (8.35). In constrained optimization, it is often beneficial to evaluate the objective function f and the constraint functions ci , i ∈ I ∪E, simultaneously. By doing so, we can take advantage of common expressions (which show up as shared intermediate nodes in the computation graph) and thus can reduce the total workload. In this case, the vector function r can be 211 212 CHAPTER 8. CALCULATING DERIVATIVES defined as f (x) r (x) c j (x) . j∈I∪E An example of shared intermediate nodes was seen in Figure 8.2, where x4 is shared during the computation of x6 and x7 . CALCULATING JACOBIANS OF VECTOR FUNCTIONS The forward mode is the same for vector functions as for scalar functions. Given a seed vector p, we continue to associate quantities D p xi with the node that calculates each intermediate variable xi . At each of the rightmost nodes (containing r j , j 1, 2, . . . , m), this variable contains the quantity D p r j (∇r j )T p, j 1, 2, . . . , m. By assembling these m quantities, we obtain J (x) p, the product of the Jacobian and our chosen vector p. As in the case of scalar functions (m 1), we can evaluate the complete Jacobian by setting p e1 , e2 , . . . , en and evaluating the n quantities De j xi simultaneously. For sparse Jacobians, we can use the coloring techniques outlined above in the context of finitedifference methods to make more intelligent and economical choices of the seed vectors p. The factor of increase in cost of arithmetic, when compared to a single evaluation of r , is about equal to the number of seed vectors used. The key to applying the reverse mode to a vector function r (x) is to choose seed vectors q ∈ IRm and apply the reverse mode to the scalar functions r (x)T q. The result of this process is the vector ⎡ ∇[r (x)T q] ∇ ⎣ m ⎤ q j r j (x)⎦ J (x)T q. j1 Instead of the Jacobian–vector product that we obtain with the forward mode, the reverse mode yields a Jacobian-transpose–vector product. The technique can be implemented by seeding the variables x̄i in the m dependent nodes that contain r1 , r2 , . . . , rm , with the components q1 , q2 , . . . , qm of the vector q. At the end of the reverse sweep, the node for independent variables x1 , x2 , . . . , xn will contain d r (x)T q , d xi i 1, 2, . . . , n, which are simply the components of J (x)T q. As usual, we can obtain the full Jacobian by carrying out the process above for the m unit vectors q e1 , e2 , . . . , em . Alternatively, for sparse Jacobians, we can apply the usual coloring techniques to find a smaller number of seed vectors q—the only difference being 8.2. AUTOMATIC DIFFERENTIATION that the graphs and coloring strategies are defined with reference to the transpose J (x)T rather than to J (x) itself. The factor of increase in the number of arithmetic operations required, in comparison to an evaluation of r alone, is no more than 5 times the number of seed vectors. (The factor of 5 is the usual overhead from the reverse mode for a scalar function.) The space required for storage of the computational graph is no greater than in the scalar case. As before, we need only store the graph topology information together with the partial derivative associated with each arc. The forward- and reverse-mode techniques can be combined to cumulatively reveal all the elements of J (x). We can choose a set of seed vectors p for the forward mode to reveal some columns of J , then perform the reverse mode with another set of seed vectors q to reveal the rows that contain the remaining elements. Finally, we note that for some algorithms, we do not need full knowledge of the Jacobian J (x). For instance, iterative methods such as the inexact Newton method for nonlinear equations (see Section 11.1) require repeated calculation of J (x) p for a succession of vectors p. Each such matrix–vector product can be computed using the forward mode by using a single forward sweep, at a similar cost to evaluation of the function alone. CALCULATING HESSIANS: FORWARD MODE So far, we have described how the forward and reverse modes can be applied to obtain first derivatives of scalar and vector functions. We now outline extensions of these techniques to the computation of the Hessian ∇ 2 f of a scalar function f , and evaluation of the Hessian–vector product ∇ 2 f (x) p for a given vector p. Recall that the forward mode makes use of the quantities D p xi , each of which stores (∇xi )T p for each node i in the computational graph and a given vector p. For a given pair of seed vectors p and q (both in IRn ) we now define another scalar quantity by D pq xi p T (∇ 2 xi )q, (8.36) for each node i in the computational graph. We can evaluate these quantities during the forward sweep through the graph, alongside the function values xi and the first-derivative values D p xi . The initial values of D pq at the independent variable nodes xi , i 1, 2 . . . , n, will be 0, since the second derivatives of xi are zero at each of these nodes. When the forward sweep is complete, the value of D pq xi in the rightmost node of the graph will be p T ∇ 2 f (x)q. The formulae for transformation of the D pq xi variables during the forward sweep can once again be derived from the chain rule. For instance, if xi is obtained by adding the values at its two parent nodes, xi x j + xk , the corresponding accumulation operations on D p xi and D pq xi are as follows: D p xi D p x j + D p xk , D pq xi D pq x j + D pq xk . (8.37) 213 214 CHAPTER 8. CALCULATING DERIVATIVES The other binary operations −, ×, / are handled similarly. If xi is obtained by applying the unitary transformation L to x j , we have xi L(x j ), (8.38a) D p xi L (x j )(D p x j ), (8.38b) D pq xi L (x j )(D p x j )(Dq x j ) + L (x j )D pq x j . (8.38c) We see in (8.38c) that computation of D pq xi can rely on the first-derivative quantities D p xi and Dq xi , so both these quantities must be accumulated during the forward sweep as well. We could compute a general dense Hessian by choosing the pairs ( p, q) to be all possible pairs of unit vectors (e j , ek ), for j 1, 2, . . . , n and k 1, 2, . . . , j, a total of n(n + 1)/2 vector pairs. (Note that we need only evaluate the lower triangle of ∇ 2 f (x), because of symmetry.) When we know the sparsity structure of ∇ 2 f (x), we need evaluate De j ek xi only for the pairs (e j , ek ) for which the ( j, k) component of ∇ 2 f (x) is possibly nonzero. The total increase factor for the number of arithmetic operations, compared with the amount of arithmetic to evaluate f alone, is a small multiple of 1 + n + Nz (∇ 2 f ), where Nz (∇ 2 f ) is the number of elements of ∇ 2 f that we choose to evaluate. This number reflects the evaluation of the quantities xi , De j xi ( j 1, 2, . . . , n), and De j ek xi for the Nz (∇ 2 f ) vector pairs (e j , ek ). The “small multiple” results from the fact that the update operations for D p xi and D pq xi may require a few times more operations than the update operation for xi alone; see, for example, (8.38). One storage location per node of the graph is required for each of the 1 + n + Nz (∇ 2 f ) quantities that are accumulated, but recall that storage of node i can be overwritten once all its children have been evaluated. When we do not need the complete Hessian, but only a matrix–vector product involving the Hessian (as in the Newton–CG algorithm of Chapter 7), the amount of arithmetic is, of course, smaller. Given a vector q ∈ IRn , we use the techniques above to compute the first-derivative quantities De1 xi , . . . Den xi and Dq xi , as well as the second-derivative quantities De1 q xi , . . . , Den q xi , during the forward sweep. The final node will contain the quantities e Tj ∇ 2 f (x) q ∇ 2 f (x)q j , j 1, 2, . . . , n, which are the components of the vector ∇ 2 f (x)q. Since 2n + 1 quantities in addition to xi are being accumulated during the forward sweep, the increase factor in the number of arithmetic operations increases by a small multiple of 2n. An alternative technique for evaluating sparse Hessians is based on the forwardmode propagation of first and second derivatives of univariate functions. To motivate this 8.2. AUTOMATIC DIFFERENTIATION approach, note that the (i, j) element of the Hessian can be expressed as follows: [∇ 2 f (x)]i j eiT ∇ 2 f (x)e j 1 (ei + e j )T ∇ 2 f (x)(ei + e j ) − eiT ∇ 2 f (x)ei − e Tj ∇ 2 f (x)e j . 2 (8.39) We can use this interpolation formula to evaluate [∇ 2 f (x)]i j , provided that the second derivatives D pp xk , for p ei , p e j , p ei + e j , and all nodes xk , have been evaluated during the forward sweep through the computational graph. In fact, we can evaluate all the nonzero elements of the Hessian, provided that we use the forward mode to evaluate D p xk and D pp xk for a selection of vectors p of the form ei + e j , where i and j are both indices in {1, 2, . . . , n}, possibly with i j. One advantage of this approach is that it is no longer necessary to propagate “cross terms” of the form D pq xk for p q (see, for example, (8.37) and (8.38c)). The propagation formulae therefore simplify somewhat. Each D pp xk is a function of x , D p x , and D pp x for all parent nodes of node k. Note, too, that if we define the univariate function ψ by ψ(t) f (x + t p), (8.40) then the values of D p f and D pp f , which emerge at the completion of the forward sweep, are simply the first two derivatives of ψ evaluated at t 0; that is, D p f p T ∇ f (x) ψ (t)|t0 , D pp f p T ∇ 2 f (x) p ψ (t)|t0 . Extension of this technique to third, fourth, and higher derivatives is possible. Interpolation formulae analogous to (8.39) can be used in conjunction with higher derivatives of the univariate functions ψ defined in (8.40), again for a suitably chosen set of vectors p, where each p is made up of a sum of unit vectors ei . For details, see Bischof, Corliss, and Griewank [26]. CALCULATING HESSIANS: REVERSE MODE We can also devise schemes based on the reverse mode for calculating Hessian– vector products ∇ 2 f (x)q, or the full Hessian ∇ 2 f (x). A scheme for obtaining ∇ 2 f (x)q proceeds as follows. We start by using the forward mode to evaluate both f and ∇ f (x)T q, by accumulating the two variables xi and Dq xi during the forward sweep in the manner described above. We then apply the reverse mode in the normal fashion to the computed function ∇ f (x)T q. At the end of the reverse sweep, the nodes i 1, 2, . . . , n of the computational graph that correspond to the independent variables will contain ∂ (∇ f (x)T q) ∇ 2 f (x)q i , ∂ xi i 1, 2, . . . , n. 215 216 CHAPTER 8. CALCULATING DERIVATIVES The number of arithmetic operations required to obtain ∇ 2 f (x)q by this procedure increases by only a modest factor, independent of n, over the evaluation of f alone. By the usual analysis for the forward mode, we see that the computation of f and ∇ f (x)T q jointly requires a small multiple of the operation count for f alone, while the reverse sweep introduces a further factor of at most 5. The total increase factor is approximately 12 over the evaluation of f alone. If the entire Hessian ∇ 2 f (x) is required, we could apply the procedure just described with q e1 , e2 , . . . , en . This approach would introduce an additional factor of n into the operation count, leading to an increase of at most 12n over the cost of f alone. Once again, when the Hessian is sparse with known structure, we may be able to use graph-coloring techniques to evaluate this entire matrix using many fewer than n seed vectors. The choices of q are similar to those used for finite-difference evaluation of the Hessian, described above. The increase in operation count over evaluating f alone is a multiple of up to 12Nc (∇ 2 f ), where Nc is the number of seed vectors q used in calculating ∇2 f . CURRENT LIMITATIONS The current generation of automatic differentiation tools has proved its worth through successful application to some large and difficult design optimization problems. However, these tools can run into difficulties with some commonly used programming constructs and some implementations of computer arithmetic. As an example, if the evaluation of f (x) depends on the solution of a partial differential equation (PDE), then the computed value of f may contain truncation error arising from the finite-difference or the finite-element technique that is used to solve the PDE numerically. That is, we have fˆ(x) f (x) + τ (x), where fˆ(·) is the computed value of f (·) and τ (·) is the truncation error. Though |τ (x)| is usually small, its derivative τ (x) may not be, so the error in the computed derivative fˆ (x) is potentially large. (The finite-difference approximation techniques discussed in Section 8.1 experience the same difficulty.) Similar problems arise when the computer uses piecewise rational functions to approximate trigonometric functions. Another source of potential difficulty is the presence of branching in the code to improve the speed or accuracy of function evaluation in certain domains. A pathological example is provided by the linear function f (x) x − 1. If we used the following (perverse, but valid) piece of code to evaluate this function, if (x 1.0) then f 0.0 else f x − 1.0, then by applying automatic differentiation to this procedure we would obtain the derivative value f (1) 0. For a discussion of such issues and an approach to dealing with them, see Griewank [151, 152]. In conclusion, automatic differentiation should be regarded as a set of increasingly sophisticated techniques that enhances optimization algorithms, allowing them to be applied more widely to practical problems involving complicated functions. By providing sensitivity information, it helps the modeler to extract more information from the results of the 8.2. AUTOMATIC DIFFERENTIATION computation. Automatic differentiation should not be regarded as a panacea that absolves the user altogether from the responsibility of thinking about derivative calculations. NOTES AND REFERENCES A comprehensive and authoritative reference on automatic differentiation is the book of Griewank [152]. The web site www.autodiff.org contains a wealth of current information about theory, software, and applications. A number of edited collections of papers on automatic differentiation have appeared since 1991; see Griewank and Corliss [153], Berz et al. [20], and Bücker et al. [40]. An historical paper of note is Corliss and Rall [78], which includes an extensive bibliography. Software tool development in automatic differentiation makes use not only of forward and reverse modes but also includes “mixed modes” and “cross-country algorithms” that combine the two approaches; see for example Naumann [222]. The field of automatic differentiation grew considerably during the 1990s, and and a number of good software tools appeared. These included ADIFOR [25] and ADIC [28], and ADOL-C [154]. Tools developed in more recent years include TAPENADE, which accepts Fortran code through a web server and returns differentiated code; TAF, a commercial tool that also performs source-to-source automatic differentiation of Fortran codes; OpenAD, which works with Fortran, C, and C++; and TOMLAB/MAD, which works with MATLAB code. The technique for calculating the gradient of a partially separable function was described by Bischof et al. [24], whereas the computation of the Hessian matrix has been considered by several authors; see, for example, Gay [118]. The work of Coleman and Moré [69] on efficient estimation of Hessians was predated by Powell and Toint [261], who did not use the language of graph coloring but nevertheless devised highly effective schemes. Software for estimating sparse Hessians and Jacobians is described by Coleman, Garbow, and Moré [66, 67]. The recent paper of Gebremedhin, Manne, and Pothen [120] contains a comprehensive discussion of the application of graph coloring to both finite difference and automatic differentiation techniques. ✐ EXERCISES ✐ 8.1 Show that a suitable value for the perturbation in the central-difference formula is u1/3 , and that the accuracy achievable by this formula when the values of f contain roundoff errors of size u is approximately u2/3 . (Use similar assumptions to the ones used to derive the estimate (8.6) for the forward-difference formula.) ✐ 8.2 Derive a central-difference analogue of the Hessian–vector approximation formula (8.20). 217 218 CHAPTER 8. CALCULATING DERIVATIVES ✐ 8.3 Verify the formula (8.21) for approximating an element of the Hessian using only function values. ✐ 8.4 Verify that if the Hessian of a function f has nonzero diagonal elements, then its adjacency graph is a subgraph of the intersection graph for ∇ f . In other words, show that any arc in the adjacency graph also belongs to the intersection graph. ✐ 8.5 Draw the adjacency graph for the function f defined by (8.22). Show that the coloring scheme in which node 1 has one color while nodes 2, 3, . . . , n have another color is valid. Draw the intersection graph for ∇ f . ✐ 8.6 Construct the adjacency graph for the function whose Hessian has the nonzero structure ⎡ × ⎢ ⎢ × ⎢ ⎢ × ⎢ ⎢ ⎢ × ⎢ ⎢ ⎣ × × × × × × ⎤ × × × × × × ⎥ ⎥ ⎥ × ⎥ ⎥ ⎥, ⎥ ⎥ ⎥ ⎦ × and find a valid coloring scheme with just four colors. ✐ 8.7 Trace the computations performed in the forward mode for the function f (x) in (8.26), expressing the intermediate derivatives ∇xi , i 4, 5, . . . , 9 in terms of quantities available at their parent nodes and then in terms of the independent variables x1 , x2 , x3 . ✐ 8.8 Formula (8.30) showed the gradient operations associated with scalar division. Derive similar formulae for the following operations: (s, t) → s + t addition; t → et exponentiation; t → tan(t) tangent; (s, t) → s . t ✐ 8.9 By calculating the partial derivatives ∂ x j /∂ xi for the function (8.26) from the expressions (8.27), verify the numerical values for the arcs in Figure 8.3 for the evaluation point x (1, 2, π/2)T . Work through the remaining details of the reverse sweep process, indicating the order in which the nodes become finalized. 8.2. AUTOMATIC DIFFERENTIATION ✐ 8.10 Using (8.33) as a guide, describe the reverse sweep operations corresponding to the following elementary operations in the forward sweep: xk ← xi x j xk ← cos(xi ) multiplication; cosine. In each case, compare the arithmetic workload in the reverse sweep to the workload required for the forward sweep. ✐ 8.11 Define formulae similar to (8.37) for accumulating the first derivatives D p xi and the second derivatives D pq xi when xi is obtained from the following three binary operations: xi x j − xk , xi x j xk , and xi x j /xk . ✐ 8.12 By using the definitions (8.28) of D p xi and (8.36) of D pq xi , verify the differentiation formulae (8.38) for the unitary operation xi L(x j ). ✐ 8.13 Let a ∈ IRn be a fixed vector and define f as f (x) 12 x T x + a T x 2 . Count the number of operations needed to evaluate f , ∇ f , ∇ 2 f , and the Hessian–vector product ∇ 2 f (x) p for an arbitrary vector p. 219 This is pag Printer: O CHAPTER 9 Derivative-Free Optimization Many practical applications require the optimization of functions whose derivatives are not available. Problems of this kind can be solved, in principle, by approximating the gradient (and possibly the Hessian) using finite differences (see Chapter 8), and using these approximate gradients within the algorithms described in earlier chapters. Even though this finite-difference approach is effective in some applications, it cannot be regarded a general-purpose technique for derivative-free optimization because the number of function evaluations required can be excessive and the approach can be unreliable in the presence of noise. (For the purposes of this chapter we define noise to be inaccuracy in the function evaluation.) Because of these shortcomings, various algorithms have been developed that 9.1. FINITE DIFFERENCES AND NOISE do not attempt to approximate the gradient. Rather, they use the function values at a set of sample points to determine a new iterate by some other means. Derivative-free optimization (DFO) algorithms differ in the way they use the sampled function values to determine the new iterate. One class of methods constructs a linear or quadratic model of the objective function and defines the next iterate by seeking to minimize this model inside a trust region. We pay particular attention to these model-based approaches because they are related to the unconstrained minimization methods described in earlier chapters. Other widely used DFO methods include the simplex-reflection method of Nelder and Mead, pattern-search methods, conjugate-direction methods, and simulated annealing. In this chapter we briefly discuss these methods, with the exception of simulated annealing, which is a nondeterministic approach and has little in common with the other techniques discussed in this book. Derivative-free optimization methods are not as well developed as gradient-based methods; current algorithms are effective only for small problems. Although most DFO methods have been adapted to handle simple types of constraints, such as bounds, the efficient treatment of general constraints is still the subject of investigation. Consequently, we limit our discussion to the unconstrained optimization problem minn f (x). x∈IR (9.1) Problems in which derivatives are not available arise often in practice. The evaluation of f (x) can, for example, be the result of an experimental measurement or a stochastic simulation, with the underlying analytic form of f unknown. Even if the objective function f is known in analytic form, coding its derivatives may be time consuming or impractical. Automatic differentiation tools (Chapter 8) may not be applicable if f (x) is provided only in the form of binary computer code. Even when the source code is available, these tools cannot be applied if the code is written in a combination of languages. Methods for derivative-free optimization are often used (with mixed success) to minimize problems with nondifferentiable functions or to try to locate the global minimizer of a function. Since we do not treat nonsmooth optimization or global optimization in this book, we will restrict our attention to smooth problems in which f has a continuous derivative. We do, however, discuss the effects of noise in Sections 9.1 and 9.6. 9.1 FINITE DIFFERENCES AND NOISE As mentioned above, an obvious DFO approach is to estimate the gradient by using finite differences and then employ a gradient-based method. This approach is sometimes successful and should always be considered, but the finite-difference estimates can be inaccurate when the objective function contains noise. We quantify the effect of noise in this section. Noise can arise in function evaluations for various reasons. If f (x) depends on a stochastic simulation, there will be a random error in the evaluated function because of the 221 222 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION finite number of trials in the simulation. When a differential equation solver or some other complex numerical procedure is needed to calculate f , small but nonzero error tolerances that are used during the calculations will produce noise in the value of f . In many applications, then, the objective function f has the form f (x) h(x) + φ(x), (9.2) where h is a smooth function and φ represents the noise. Note that we have written φ to be a function of x but in practice it need not be. For instance, if the evaluation of f depends on a simulation, the value of φ will generally differ at each evaluation, even at the same x. The form (9.2) is, however, useful for illustrating some of the difficulties caused by noise in gradient estimates and for developing algorithms for derivative-free optimization. Given a difference interval , recall that the centered finite-difference approximation (8.7) to the gradient of f at x is defined as follows: ∇ f (x) f (x + ei ) − f (x − ei ) 2 , (9.3) i1,2,...,n where ei is the ith unit vector (the vector whose only nonzero element is a 1 in the ith position). We wish to relate ∇ f (x) to the gradient of the underlying smooth function h(x), as a function of and the noise level. For this purpose we define the noise level η to be the largest value of φ in a box of edge length 2 centered at x, that is, η(x; ) sup z−x∞ ≤ |φ(z)|. (9.4) By applying to the central difference formula (9.3) the argument that led to (8.5), we can establish the following result. Lemma 9.1. Suppose that ∇ 2 h is Lipschitz continuous in a neighborhood of the box {z | z −x∞ ≤ } with Lipschitz constant L h . Then we have ∇ f (x) − ∇h(x)∞ ≤ L h 2 + η(x; ) . (9.5) Thus the error in the approximation (9.3) comes from both the intrinsic finite difference approximation error (the O( 2 ) term) and the noise (the η(x; )/ term). If the noise dominates the difference interval , we cannot expect any accuracy at all in ∇ f (x), so it will only be pure luck if −∇ f (x) turns out to be a direction of descent for f . Instead of computing a tight cluster of function values around the current iterate, as required by a finite-difference approximation to the gradient, it may be preferable to separate these points more widely and use them to construct a model of the objective function. This 9.2. MODEL-BASED METHODS approach, which we consider in the next section and in Section 9.6, may be more robust to the presence of noise. 9.2 MODEL-BASED METHODS Some of the most effective algorithms for unconstrained optimization described in the previous chapters compute steps by minimizing a quadratic model of the objective function f . The model is formed by using function and derivative information at the current iterate. When derivatives are not available, we may define the model m k as the quadratic function that interpolates f at a set of appropriately chosen sample points. Since such a model is usually nonconvex, the model-based methods discussed in this chapter use a trust-region approach to compute the step. Suppose that at the current iterate xk we have a set of sample points Y {y 1 , y 2 , . . . , y q }, with y i ∈ IRn , i 1, 2, . . . , q. We assume that xk is an element of this set and that no point in Y has a lower function value than xk . We wish to construct a quadratic model of the form m k (xk + p) c + g T p + 12 p T Gp. (9.6) We cannot define g ∇ f (xk ) and G ∇ 2 f (xk ) because these derivatives are not available. Instead, we determine the scalar c, the vector g ∈ R n , and the symmetric matrix G ∈ R n×n by imposing the interpolation conditions m k (y l ) f (y l ), l 1, 2, . . . , q. (9.7) Since there are 12 (n + 1)(n + 2) coefficients in the model (9.6) (that is, the components of c, g, and G, taking into account the symmetry of G), the interpolation conditions (9.7) determine m k uniquely only if q 12 (n + 1)(n + 2). (9.8) In this case, (9.7) can be written as a square linear system of equations in the coefficients of the model. If we choose the interpolation points y 1 , y 2 , . . . , y q so that this linear system is nonsingular, the model m k will be uniquely determined. Once m k has been formed, we compute a step p by approximately solving the trustregion subproblem min m k (xk + p), p subject to p2 ≤ , (9.9) for some trust-region radius > 0. We can use one of the techniques described in Chapter 4 to solve this subproblem. If xk + p gives a sufficient reduction in the objective function, 223 224 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION the new iterate is defined as xk+1 xk + p, the trust region radius is updated, and a new iteration commences. Otherwise the step is rejected, and the interpolation set Y may be improved or the trust region shrunk. To reduce the cost of the algorithm, we update the model m k at every iteration, rather than recomputing it from scratch. In practice, we choose a convenient basis for the space of quadratic polynomials, the most common choices being Lagrange and Newton polynomials. The properties of these bases can be used both to measure appropriateness of the sample set Y and to change this set if necessary. A complete algorithm that treats all these issues effectively is far more complicated than the quasi-Newton methods discussed in Chapter 6. Consequently, we will provide only a broad outline of model-based DFO methods. As is common in trust-region algorithms, the step-acceptance and trust-region update strategies are based on the ratio between the actual reduction in the function and the reduction predicted by the model, that is, ρ f (xk ) − f (xk+ ) , m k (xk ) − m k (xk+ ) (9.10) where xk+ denotes the trial point. Throughout this section, the integer q is defined by (9.8). Algorithm 9.1 (Model-Based Derivative-Free Method). Choose an interpolation set Y {y 1 , y 2 , . . . , y q } such that the linear system defined by (9.7) is nonsingular, and select x0 as a point in this set such that f (x0 ) ≤ f (y i ) for all y i ∈ Y . Choose an initial trust region radius 0 , a constant η ∈ (0, 1), and set k ← 0. repeat until a convergence test is satisfied: Form the quadratic model m k (xk + p) that satisfies the interpolation conditions (9.7); Compute a step p by approximately solving subproblem (9.9); Define the trial point as xk+ xk + p; Compute the ratio ρ defined by (9.10); if ρ ≥ η Replace an element of Y by xk+ ; Choose k+1 ≥ k ; Set xk+1 ← xk+ ; Set k ← k + 1 and go to the next iteration; else if the set Y need not be improved Choose k+1 < k ; Set xk+1 ← xk ; Set k ← k + 1 and go to the next iteration; end (if) 9.2. MODEL-BASED METHODS Invoke a geometry-improving procedure to update Y : at least one of the points in Y is replaced by some other point, with the goal of improving the conditioning of (9.7); Set k+1 ← k ; Choose x̂ as an element in Y with lowest function value; Set xk+ ← x̂ and recompute ρ by (9.10); if ρ ≥ η Set xk+1 ← xk+ ; else Set xk+1 ← xk ; end (if) Set k ← k + 1; end (repeat) The case of ρ ≥ η, in which we obtain sufficient reduction in the merit function, is the simplest. In this case we always accept the trial point xk+ as the new iterate, include xk+ in Y , and remove an element from Y . When sufficient reduction is not achieved (ρ < η), we look at two possible causes: inadequacy of the interpolation set Y and a trust region that is too large. The first cause can arise when the iterates become restricted to a low-dimensional surface of IRn that does not contain the solution. The algorithm could then be converging to a minimizer in this subset. Behavior such as this can be detected by monitoring the conditioning of the linear system defined by the interpolation conditions (9.7). If the condition number is too high, we change Y to improve it, typically by replacing one element of Y with a new element so as to move the interpolation system (9.7) as far away from singularity as possible. If Y seems adequate, we simply decrease the trust region radius , as is done in the methods of Chapter 4. A good initial choice for Y is given by the vertices and the midpoints of the edges of a simplex in IRn . The use of quadratic models limits the size of problems that can be solved in practice. Performing O(n 2 ) function evaluations just to start the algorithm is onerous, even for moderate values of n (say, n 50). In addition, the cost of the iteration is high. Even by updating the model m k at every iteration, rather than recomputing it from scratch, the number of operations required to construct m k and compute a step is O(n 4 ) [257]. To alleviate these drawbacks, we can replace the quadratic model by a linear model in which the matrix G in (9.6) is set to zero. Since such a model contains only n + 1 parameters, we need to retain only n + 1 interpolation points in the set Y , and the cost of each iteration is O(n 3 ). Algorithm 9.1 can be applied with little modification when the model is linear, but it is not rapidly convergent because linear models cannot represent curvature of the problem. Therefore, some model-based algorithms start with n + 1 initial points and compute steps 225 226 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION using a linear model, but after q 12 (n + 1)(n + 2) function values become available, they switch to using quadratic models. INTERPOLATION AND POLYNOMIAL BASES We now consider in more detail how to form a model of the objective function using interpolation techniques. We begin by considering a linear model of the form m k (xk + p) f (xk ) + g T p. (9.11) To determine the vector g ∈ IRn , we impose the interpolation conditions m k (y l ) f (y l ), l 1, 2, . . . , n, which can be written as (s l )T g f (y l ) − f (xk ), l 1, 2, . . . , n, (9.12) where s l yl − xk , l 1, 2, . . . , n. (9.13) Conditions (9.12) represent a linear system of equations in which the rows of the coefficient matrix are given by the vectors (s l )T . It follows that the model (9.11) is determined uniquely by (9.12) if and only if the interpolation points {y 1 , y 2 , . . . , y n } are such that the set {s l : l 1, 2, . . . , n} is linearly independent. If this condition holds, the simplex formed by the points xk , y 1 , y 2 , . . . , y n is said to be nondegenerate. Let us now consider how to construct a quadratic model of the form (9.6), with f f (xk ). We rewrite the model as m k (xk + p) f (xk ) + g T p + G i j pi p j + i< j 1 2 G ii pi2 (9.14) i def f (xk ) + ĝ T p̂, (9.15) where we have collected the elements of g and G in the (q − 1)-vector of unknowns -T , , ĝ ≡ g T , {G i j }i< j , √12 G ii (9.16) and where the (q − 1)-vector p̂ is given by -T , p̂ ≡ p T , { pi p j }i< j , √12 pi2 . The model (9.15) has the same form as (9.11), and the determination of the vector of unknown coefficients ĝ can be done as in the linear case. 9.2. MODEL-BASED METHODS Multivariate quadratic functions can be represented in various ways. The monomial basis (9.14) has the advantage that known structure in the Hessian can be imposed easily by setting appropriate elements in G to zero. Other bases are, however, more convenient when one is developing mechanisms for avoiding singularity of the system (9.7). q We denote by {φi (·)}i1 a basis for the linear space of n-dimensional quadratic functions. The function (9.6) can therefore be expressed as m k (x) q αi φi (x), i1 for some coefficients αi . The interpolation set Y {y 1 , y 2 , . . . , y q } determines the coefficients αi uniquely if the determinant ⎛ φ1 (y 1 ) ⎜ def .. δ(Y ) det ⎜ . ⎝ ··· φq (y 1 ) ··· ⎞ φ1 (y q ) ⎟ .. ⎟ . ⎠ (9.17) φq (y q ) is nonzero. As model-based algorithms iterate, the determinant δ(Y ) may approach zero, leading to numerical difficulties or even failure. Several algorithms therefore contain a mechanism for keeping the interpolation points well placed. We now describe one of those mechanisms. UPDATING THE INTERPOLATION SET Rather than waiting until the determinant δ(Y ) becomes smaller than a threshold, we may invoke a geometry-improving procedure whenever a trial point does not provide sufficient decrease in f . The goal in this case is to replace one of the interpolation points so that the determinant (9.17) increases in magnitude. To guide us in this exchange, we use the following property of δ(Y ), which we state in terms of Lagrange functions. For every y ∈ Y , we define the Lagrangian function L(·, y) to be a polynomial of degree at most 2 such that L(y, y) 1 and L( ŷ, y) 0 for ŷ y, ŷ ∈ Y . Suppose that the set Y is updated by removing a point y− and replacing it by some other point y+ , to give the new set Y + . One can show that (after a suitable normalization and given certain conditions [256]) |δ(Y + )| ≤ |L(y+ , y− )| |δ(Y )|. (9.18) Algorithm 9.1 can make good use of this inequality to update the interpolation set. Consider first the case in which trial point x + provides sufficient reduction in the objective function (ρ ≥ η). We include x + in Y and remove another point y− from Y . 227 228 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION Motivated by (9.18), we select the outgoing point as follows: y− arg max |L(x + , y)|. y∈Y Next, let us consider the case in which the reduction in f is not sufficient (ρ < η). We first determine whether the set Y should be improved, and for this purpose we use the following rule. We consider Y to be adequate at the current iterate xk if for all y i ∈ Y such that xk − y i ≤ we have that |δ(Y )| cannot be doubled by replacing one of these interpolation points y i with any point y inside the trust region. If Y is adequate but the reduction in f was not sufficient, we decrease the trust-region radius and begin a new iteration. If Y is inadequate, the geometry-improving mechanism is invoked. We choose a point y− ∈ Y and replace it by some other point y + that is chosen solely with the objective of improving the determinant (9.17). For every point y i ∈ Y , we define its potential replacement yri as yri arg max |L(y, y i )|. y−xk ≤ The outgoing point y− is selected as the point for which |L(yri , y i )| is maximized over all indices y i ∈ Y . Implementing these rules efficiently in practice is not simple, and one must also consider several possible difficulties we have not discussed; see [76]. Strategies for improving the position of the interpolation set are the subject of ongoing investigation and new developments are likely in the coming years. A METHOD BASED ON MINIMUM-CHANGE UPDATING We now consider a method that be viewed as an extension of the quasi-Newton approach discussed in Chapter 6. The method uses quadratic models but requires only O(n 3 ) operations per iteration, substantially fewer than the O(n 4 ) operations required by the methods described above. To achieve this economy, the method retains only O(n) points for the interpolation conditions (9.7) and absorbs the remaining degrees of freedom in the model (9.6) by requiring that the Hessian of the model change as little as possible from one iteration to the next. This least-change property is one of the key ingredients in quasiNewton methods, the other ingredient being the requirement that the model interpolate the gradient ∇ f at the two most recent points. The method we describe now combines the least-change property with interpolation of function values. At the kth iteration of the algorithm, a new quadratic model m k+1 of the form (9.6) is constructed after taking a step from xk to xk+1 . The coefficients f k+1 , gk+1 , G k+1 of the 9.3. COORDINATE AND PATTERN-SEARCH METHODS model m k+1 are determined as the solution of the problem min f,g,G subject to G − G k 2F (9.19a) G symmetric m(y l ) f (y l ) l 1, 2, . . . , q̂, (9.19b) where · F denotes the Frobenius norm (see (A.9)), G k is the Hessian of the previous model m k , and q̂ is an integer comparable to n. One can show that the integer q̂ must be chosen larger than n + 1 to guarantee that G k+1 is not equal to G k . An appropriate value in practice is q̂ 2n + 1; for this choice the number of interpolation points is roughly twice that used for linear models. Problem (9.19) is an equality-constrained quadratic program whose KKT conditions can be expressed as a system of equations. Once the model m k+1 is determined, we compute a new step by solving a trust-region problem of the form (9.9). In this approach, too, it is necessary to ensure that the geometry of the interpolation set Y is adequate. We therefore impose two minimum requirements. First, the set Y should be such that the equations (9.19b) can be satisfied for any right-hand side. Second, the points y i should not all lie in a hyperplane. If these two conditions hold, problem (9.19) has a unique solution. A practical algorithm based on the subproblem (9.19) resembles Algorithm 9.1 in that it contains procedures both for generating new iterates and for improving the geometry of the set Y . The implementation described in [260] contains other features to ensure that the interpolation points are well separated and that steps are not too small. A strength of this method is that it requires only O(n) interpolation points to start producing productive steps. In practice the method often approaches a solution with fewer than 12 (n + 1)(n + 2) function evaluations. However, since this approach has been developed only recently, there is insufficient numerical experience to assess its full potential. 9.3 COORDINATE AND PATTERN-SEARCH METHODS Rather than constructing a model of f explicitly based on function values, coordinate search and pattern-search methods look along certain specified directions from the current iterate for a point with a lower function value. If such a point is found, they step to it and repeat the process, possibly modifying the directions of search for the next iteration. If no satisfactory new point is found, the step length along the current search directions may be adjusted, or new search directions may be generated. We describe first a simple approach of this type that has been used often in practice. We then consider a generalized approach that is potentially more efficient and has stronger theoretical properties. 229 230 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION x* x0 x 1 Figure 9.1 Coordinate search method makes slow progress on this function of two variables. COORDINATE SEARCH METHOD The coordinate search method (also known as the coordinate descent method or the alternating variables method) cycles through the n coordinate directions e1 , e2 , . . . , en , obtaining new iterates by performing a line search along each direction in turn. Specifically, at the first iteration, we fix all components of x except the first one x1 and find a new value of this component that minimizes (or at least reduces) the objective function. On the next iteration, we repeat the process with the second component x2 , and so on. After n iterations, we return to the first variable and repeat the cycle. Though simple and somewhat intuitive, this method can be quite inefficient in practice, as we illustrate in Figure 9.1 for a quadratic function in two variables. Note that after a few iterations, neither the vertical (x2 ) nor the horizontal (x1 ) move makes much progress toward the solution at each iteration. In general, the coordinate search method can iterate infinitely without ever approaching a point where the gradient of the objective function vanishes, even when exact line searches are used. (By contrast, as we showed in Section 3.2, the steepest descent method produces a sequence of iterates {xk } for which ∇ f k → 0, under reasonable assumptions.) In fact, a cyclic search along any set of linearly independent directions does not guarantee global convergence [243]. Technically speaking, this difficulty arises because the steepest descent search direction −∇ f k may become more and more perpendicular to the coordinate search direction. In such circumstances, the Zoutendijk condition (3.14) is satisfied because cos θk approaches zero rapidly, even when ∇ f k does not approach zero. When the coordinate search method does converge to a solution, it often converges much more slowly than the steepest descent method, and the difference between the two approaches tends to increase with the number of variables. However, coordinate search may 9.3. COORDINATE AND PATTERN-SEARCH METHODS still be useful because it does not require calculation of the gradient ∇ f k , and the speed of convergence can be quite acceptable if the variables are loosely coupled in the objective function f . Many variants of the coordinate search method have been proposed, some of which allow a global convergence property to be proved. One simple variant is a “back-and-forth” approach in which we search along the sequence of directions e1 , e2 , . . . , en−1 , en , en−1 , . . . , e2 , e1 , e2 , . . . (repeats). Another approach, suggested by Figure 9.1, is first to perform a sequence of coordinate descent steps and then search along the line joining the first and last points in the cycle. Several algorithms, such as that of Hooke and Jeeves, are based on these ideas; see Fletcher [101] and Gill, Murray, and Wright [130]. The pattern-search approach, described next, generalizes coordinate search in that it allows the use of a richer set of search directions at each iteration. PATTERN-SEARCH METHODS We consider pattern-search methods that choose a certain set of search directions at each iterate and evaluate f at a given step length along each of these directions. These candidate points form a “frame,” or “stencil,” around the current iterate. If a point with a significantly lower function value is found, it is adopted as the new iterate, and the center of the frame is shifted to this new point. Whether shifted or not, the frame may then be altered in some way (the set of search directions may be changed, or the step length may grow or shrink), and the process repeats. For certain methods of this type it is possible to prove global convergence results—typically, that there exists a stationary accumulation point. The presence of noise or other forms of inexactness in the function values may affect the performance of pattern-search algorithms and certainly impacts the convergence theory. Nonsmoothness may also cause undesirable behavior, as can be shown by simple examples, although satisfactory convergence is often observed on nonsmooth problems. To define pattern-search methods, we introduce some notation. For the current iterate xk , we define Dk to be the set of possible search directions and γk to be the line search parameter. The frame consists of the points xk + γk pk , for all pk ∈ Dk . When one of the points in the frame yields a significant decrease in f , we take the step and may also increase γk , so as to expand the frame for the next iteration. If none of the points in the frame has a significantly better function value than f k , we reduce γk (contract the frame), set xk+1 xk , and repeat. In either case, we may change the direction set Dk prior to the next iteration, subject to certain restrictions. A more precise description of the algorithm follows. 231 232 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION Algorithm 9.2 (Pattern-Search). Given convergence tolerance γtol , contraction parameter θmax , sufficient decrease function ρ : [0, ∞) → IR with ρ(t) an increasing function of t and ρ(t)/t → 0 as t ↓ 0; Choose initial point x0 , initial step length γ0 > γtol , initial direction set D0 ; for k 1, 2, . . . if γk ≤ γtol stop; if f (xk + γk pk ) < f (xk ) − ρ(γk ) for some pk ∈ Dk Set xk+1 ← xk + γk pk for some such pk ; Set γk+1 ← φk γk for some φk ≥ 1; (∗ increase step length ∗ ) else Set xk+1 ← xk ; Set γk+1 ← θk γk , where 0 < θk ≤ θmax < 1; end (if) end (for) A wise choice of the direction set Dk is crucial to the practical behavior of this approach and to the theoretical results that can be proved about it. A key condition is that at least one direction in this set should give a direction of descent for f whenever ∇ f (xk ) 0 (that is, whenever xk is not a stationary point). To make this condition specific, we refer to formula (3.12), where we defined the angle between a possible search direction d and the gradient ∇ f k as follows: cos θ −∇ f kT p . ∇ f k p (9.20) Recall from Theorem 3.2 that global convergence of a line-search method to a stationary point of f could be ensured if the search direction d at each iterate xk satisfied cos θ ≥ δ, for some constant δ > 0, and if the line search parameter satisfied certain conditions. In the same spirit, we choose Dk so that at least one direction p ∈ Dk will yield cos θ > δ, regardless of the value of ∇ f k . This condition is as follows: def κ(Dk ) minn max v∈IR p∈Dk vT p ≥ δ. v p (9.21) A second condition on Dk is that the lengths of the vectors in this set are all roughly similar, so that the diameter of the frame formed by this set is captured adequately by the step length parameter γk . Thus, we impose the condition βmin ≤ p ≤ βmax , for all p ∈ Dk , (9.22) for some positive constants βmin and βmax and all k. If the conditions (9.21) and (9.22) hold, 9.3. COORDINATE AND PATTERN-SEARCH METHODS we have for any k that −∇ f kT p ≥ κ(Dk )∇ f k p ≥ δβmin ∇ f k , for some p ∈ Dk . Examples of sets Dk that satisfy the properties (9.21) and (9.22) include the coordinate direction set {e1 , e2 , . . . , en , −e1 , −e2 , . . . , −en }, (9.23) and the set of n + 1 vectors defined by pi 1 e − ei , i 1, 2, . . . , n; 2n pn+1 1 e, 2n (9.24) where e (1, 1, . . . , 1)T . For n 3 these direction sets are sketched in Figure 9.2. The coordinate descent method described above is similar to the special case of Algorithm 9.2 obtained by setting Dk {ei , −ei } for some i 1, 2, . . . , n at each iteration. Note that for this choice of Dk , we have κ(Dk ) 0 for all k. Hence, as noted above, cos θ can be arbitrarily close to zero at each iteration. Often, the directions that satisfy the properties (9.21) and (9.22) form only a subset of the direction set Dk , which may contain other directions as well. These additional directions could be chosen heuristically, according to some knowledge of the function f and its scaling, or according to experience on previous iterations. They could also be chosen as linear combinations of the core set of directions (the ones that ensure δ > 0). Note that Algorithm 9.2 does not require us to choose the point xk + γk pk , pk ∈ Dk , with the smallest objective value. Indeed, we may save on function evaluations by not evaluating f at all points in the frame, but rather performing the evaluations one at a time and accepting the first candidate point that satisfies the sufficient decrease condition. e3 p4 e2 p 1 1 e1 2 p 2 p 3 3 Figure 9.2 Generating search sets in IR3 : coordinate direction set (left) and simplex set (right). 233 234 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION Another important detail in the implementation of Algorithm 9.2 is the choice of sufficient decrease function ρ(t). If ρ(·) is chosen to be identically zero, then any candidate point that produces a decrease in f is acceptable as a new iterate. As we have seen in Chapter 3, such a weak condition does not lead to strong global convergence results in general. A more appropriate choice might be ρ(t) Mt 3/2 , where M is some positive constant. 9.4 A CONJUGATE-DIRECTION METHOD We have seen in Chapter 5 that the minimizer of a strictly convex quadratic function f (x) 12 x T Ax − b T x (9.25) can be located by performing one-dimensional minimizations along a set of n conjugate directions. These directions were defined in Chapter 5 as a linear combination of gradients. In this section, we show how to construct conjugate directions using only function values, and we therefore devise an algorithm for minimizing (9.25) that requires only function value calculations. Naturally, we also consider an extension of this approach to the case of a nonlinear objective f . We use the parallel subspace property, which we describe first for the case n 2. Consider two parallel lines l1 (α) x1 + αp and l2 (α) x2 + αp, where x1 , x2 , and p are given vectors in IR2 and α is the scalar parameter that defines the lines. We show below that if x1∗ and x2∗ denote the minimizers of f (x) along l1 and l2 , respectively, then x1∗ − x2∗ is conjugate to p. Hence, if we perform a one-dimensional minimization along the line joining x1∗ and x2∗ , we will reach the minimizer of f , because we have successively minimized along the two conjugate directions p and x2∗ − x1∗ . This process is illustrated in Figure 9.3. This observation suggests the following algorithm for minimizing a two-dimensional quadratic function f . We choose a set of linearly independent directions, say the coordinate directions e1 and e2 . From any initial point x0 , we first minimize f along e2 to obtain the point x1 . We then perform successive minimizations along e1 and e2 , starting from x1 , to obtain the point z. It follows from the parallel subspace property that z − x1 is conjugate to e2 because x1 and z are minimizers along two lines parallel to e2 . Thus, if we perform a one-dimensional search from x1 along the direction z −x1 , we will locate the minimizer of f . We now state the parallel subspace minimization property in its most general form. Suppose that x1 , x2 are two distinct points in IRn and that { p1 , p2 , . . . , pl } is a set of linearly independent directions in IRn . Let us define the two parallel linear varieties S1 x1 + S2 x2 + l i1 l i1 αi pi | αi ∈ IR, i 1, 2, . . . , l , αi pi | αi ∈ IR, i 1, 2, . . . , l . 9.4. A CONJUGATE-DIRECTION METHOD x *2 l2 x* Figure 9.3 Geometric construction of conjugate directions. (The minimizer of f is denoted by x ∗ .) x1* l1 If we denote the minimizers of f on S1 and S2 by x1∗ and x2∗ , respectively, then x2∗ − x1∗ is conjugate to p1 , p2 , . . . , pl . It is easy to verify this claim. By the minimization property, we have that ∂ f (x1∗ + αi pi ) ∇ f (x1∗ )T pi 0, i 1, 2, . . . , l, ∂αi αi 0 and similarly for x2 . Therefore we have from (9.25) that 0 (∇ f (x1∗ ) − ∇ f (x2∗ ))T pi (Ax1∗ − b − Ax2∗ + b)T pi (x1∗ − x2∗ )T Api , i 1, 2, . . . , l. (9.26) We now consider the case n 3 and show how the parallel subspace property can be used to generate a set of three conjugate directions. We choose a set of linearly independent directions, say e1 , e2 , e3 . From any starting point x0 we first minimize f along the last direction e3 to obtain a point x1 . We then perform three successive one-dimensional minimizations, starting from x1 , along the directions e1 , e2 , e3 and denote the resulting point by z. Next, we minimize f along the direction p1 z − x1 to obtain x2 . As noted earlier, p1 z − x1 is conjugate to e3 . We note also that x2 is the minimizer of f on the set S1 {y + α1 e3 + α2 p1 | α1 ∈ IR, α2 ∈ IR}, where y is the intermediate point obtained after minimizing along e1 and e2 . A new iteration now commences. We discard e1 and define the new set of search directions as e2 , e3 , p1 . We perform one-dimensional minimizations along e2 , e3 , p1 , starting 235 236 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION from x2 , to obtain the point ẑ. Note that ẑ can be viewed as the minimizer of f on the set S2 { ŷ + α1 e3 + α2 p1 | α1 ∈ IR, α2 ∈ IR}, for some intermediate point ŷ. Therefore, by applying the parallel subspace minimization property to the sets S1 and S2 just defined, we have that p2 ẑ − x2 is conjugate to both e3 and p1 . We then minimize f along p2 to obtain a point x3 , which is the minimizer of f . This procedure thus generates the conjugate directions e3 , p1 , p2 . We can now state the general algorithm, which consists of an inner and an outer iteration. In the inner iteration, n one-dimensional minimizations are performed along a set of linearly independent directions. Upon completion of the inner iteration, a new conjugate direction is generated, which replaces one of the previously stored search directions. Algorithm 9.3 (DFO Method of Conjugate Directions). Choose an initial point x0 and set pi ei , for i 1, 2, . . . , n; Compute x1 as the minimizer of f along the line x0 + αpn ; Set k ← 1. repeat until a convergence test is satisfied Set z 1 ← xk ; for j 1, 2, . . . , n Calculate α j so that f (z j + α j p j ) is minimized; Set z j+1 ← z j + α j p j ; end (for) Set p j ← p j+1 for j 1, 2, . . . , n − 1 and pn ← z n+1 − z 1 ; Calculate αn so that f (z n+1 + αn pn ) is minimized; Set xk+1 ← z n+1 + αn pn ; Set k ← k + 1; end (repeat) The line searches can be performed by quadratic interpolation using three function values along each search direction. Since the restriction of (9.25) to a line is a (strictly convex) quadratic, the interpolating quadratic matches it exactly, and the one-dimensional minimizer can easily be computed. Note that at the end of (the outer) iteration k, the directions pn−k , pn−k+1 , . . . , pn are conjugate by the property mentioned above. Thus the algorithm terminates at the minimizer of (9.25) after n − 1 iterations, provided none of the conjugate directions is zero. Unfortunately, this possibility cannot be ruled out, and some safeguards described below must be incorporated to improve robustness. In the (usual) case that Algorithm 9.3 terminates after n − 1 iterations, it will perform O(n 2 ) function evaluations. Algorithm 9.3 can be extended to minimize nonquadratic objective functions. The only change is in the line search, which must be performed approximately, using interpolation. Because of the possible nonconvexity, this one-dimensional search must be done with care; see Brent [39] for a treatment of this subject. Numerical experience indicates that this 9.4. A CONJUGATE-DIRECTION METHOD extension of Algorithm 9.3 performs adequately for small-dimensional problems but that sometimes the directions { pi } tend to become linearly dependent. Several modifications of the algorithm have been proposed to guard against this possibility. One such modification measures the degree to which the directions { pi } are conjugate. To do so, we define the scaled directions p̂i 0 pi piT Api , i 1, 2, . . . , n. (9.27) One can show [239] that the quantity | det( p̂1 , p̂2 , . . . , p̂n )| (9.28) is maximized if and only if the vectors pi are conjugate with respect to A. This result suggests that we should not replace one of the existing search directions in the set { p1 , p2 , . . . , pn } by the most recently generated conjugate direction if this action causes the quantity (9.28) to decrease. Procedure 9.4 implements this strategy for the case of the quadratic objective function (9.25). Some algebraic manipulations (which we do not present here) show that we can compute the scaled directions p̂i without using the Hessian A because the terms piT Api are available from the line search along pi . Further, only comparisons using computed function values are needed to ensure that (9.28) does not increase. The following procedure is invoked immediately after the execution of the inner iteration (or for-loop) of Algorithm 9.3. Procedure 9.4 (Updating of the Set of Directions). Find the integer m ∈ {1, 2, . . . , n} such that ψm f (xm−1 ) − f (xm ) is maximized; Let f 1 f (z 1 ), f 2 f (z n+1 ), and f 3 f (2z n+1 − z 1 ); if f 3 ≥ f 1 or ( f 1 − 2 f 2 + f 3 )( f 1 − f 2 − ψm )2 ≥ 12 ψm ( f 1 − f 3 )2 Keep the set p1 , p2 , . . . , pn unchanged and set xk+1 ← z n+1 ; else Set p̂ ← z n+1 − z 1 and calculate α̂ so that f (z n+1 + α̂ p̂) is minimized; Set xk+1 ← z n+1 + α p̂; Remove pm from the set of directions and add p̂ to this set; end (if) This procedure can be applied to general objective functions by implementing inexact one-dimensional line searches. The resulting conjugate-gradient method has been found to be useful for solving small dimensional problems. 237 238 CHAPTER 9. 9.5 DERIVATIVE-FREE OPTIMIZATION NELDER–MEAD METHOD The Nelder–Mead simplex-reflection method has been a popular DFO method since its introduction in 1965 [223]. It takes its name from the fact that at any stage of the algorithm, we keep track of n + 1 points of interest in IRn , whose convex hull forms a simplex. (The method has nothing to do with the simplex method for linear programming discussed in Chapter 13.) Given a simplex S with vertices {z 1 , z 2 , . . . , z n+1 }, we can define an associated matrix V (S) by taking the n edges along V from one of its vertices (z 1 , say), as follows: V (S) [z 2 − z 1 , z 3 − z 1 , . . . , z n+1 − z 1 ] . The simplex is said to be nondegenerate or nonsingular if V is a nonsingular matrix. (For example, a simplex in IR3 is nondegenerate if its four vertices are not coplanar.) In a single iteration of the Nelder–Mead algorithm, we seek to remove the vertex with the worst function value and replace it with another point with a better value. The new point is obtained by reflecting, expanding, or contracting the simplex along the line joining the worst vertex with the centroid of the remaining vertices. If we cannot find a better point in this manner, we retain only the vertex with the best function value, and we shrink the simplex by moving all other vertices toward this value. We specify a single step of the algorithm after some defining some notation. The n + 1 vertices of the current simplex are denoted by {x1 , x2 , . . . , xn+1 }, where we choose the ordering so that f (x1 ) ≤ f (x2 ) ≤ · · · ≤ f (xn+1 ). The centroid of the best n points is denoted by x̄ n xi . i1 Points along the line joining x̄ and the “worst” vertex xn+1 are denoted by x̄(t) x̄ + t(xn+1 − x̄). Procedure 9.5 (One Step of Nelder–Mead Simplex). Compute the reflection point x̄(−1) and evaluate f −1 f (x̄(−1)); if f (x1 ) ≤ f −1 < f (xn ) (∗ reflected point is neither best nor worst in the new simplex ∗ ) replace xn+1 by x̄(−1) and go to next iteration; else if f −1 < f (x1 ) 9.5. NELDER–MEAD METHOD (∗ reflected point is better than the current best; try to go farther along this direction ∗ ) Compute the expansion point x̄(−2) and evaluate f −2 f (x̄(−2)); if f −2 < f −1 replace xn+1 by x−2 and go to next iteration; else replace xn+1 by x−1 and go to next iteration; else if f −1 ≥ f (xn ) (∗ reflected point is still worse than xn ; contract ∗ ) if f (xn ) ≤ f −1 < f (xn+1 ) (∗ try to perform “outside” contraction ∗ ) evaluate f −1/2 x̄(−1/2); if f −1/2 ≤ f −1 replace xn+1 by x−1/2 and go to next iteration; else (∗ try to perform “inside” contraction ∗ ) evaluate f 1/2 x̄(1/2); if f 1/2 < f n+1 replace xn+1 by x1/2 and go to next iteration; ∗ ( neither outside nor inside contraction was acceptable; shrink the simplex toward x1 ∗ ) replace xi ← (1/2)(x1 + xi ) for i 2, 3, . . . , n + 1; Procedure 9.5 is illustrated on a three-dimensional example in Figure 9.4. The worst current vertex is x3 , and the possible replacement points are x̄(−1), x̄(−2), x̄(− 12 ), x̄( 12 ). If none of the replacement points proves to be satisfactory, the simplex is shrunk to the smaller triangle indicated by the dotted line, which retains the best vertex x1 . The scalars t used in defining the candidate points x̄(t) have been assigned the specific (and standard) values −1, −2, − 12 , and 12 in our description above. Different choices are also possible, subject to certain restrictions. Practical performance of the Nelder–Mead algorithm is often reasonable, though stagnation has been observed to occur at nonoptimal points. Restarting can be used when stagnation is detected; see Kelley [178]. Note that unless the final shrinkage step is performed, the average function value 1 f (xi ) n + 1 i1 n+1 (9.29) will decrease at each step. When f is convex, even the shrinkage step is guaranteed not to increase the average function value. 239 240 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION x2 x (−2) x (−1) x (−1/2) x (1/2) x3 x1 Figure 9.4 One step of the Nelder–Mead simplex method in IR3 , showing current simplex (solid triangle with vertices x1 , x2 , x3 ), reflection point x̄(−1), expansion point x̄(−2), inside contraction point x̄( 12 ), outside contraction point x̄(− 12 ), and shrunken simplex (dotted triangle). A limited amount of convergence theory has been developed for the Nelder–Mead method in recent years; see, for example, Kelley [179] and Lagarias et al. [186]. 9.6 IMPLICIT FILTERING We now describe an algorithm designed for functions whose evaluations are modeled by (9.2), where h is smooth. This implicit filtering approach is, in its simplest form, a variant of the steepest descent algorithm with line search discussed in Chapter 3, in which the gradient ∇ f k is replaced by a finite difference estimate such as (9.3), with a difference parameter that may not be particularly small. Implicit filtering works best on functions for which the noise level decreases as the iterates approach a solution. This situation may occur when we have control over the noise level, as is the case when f is obtained by solving a differential equation to a user-specified tolerance, or by running a stochastic simulation for a user-specified number of trials (where an increase in the number of trials usually produces a decrease in the noise). The implicit filtering algorithm decreases systematically (but, one hopes, not as rapidly as the decay in error) so as to maintain reasonable accuracy in ∇ f (x), given the noise level at the current value of x. For each value of , it performs an inner loop that is simply an Armijo line search using the search direction −∇ f (x). If the inner loop is unable to find a satisfactory step length after backtracking at least amax times, we return to the outer loop, choose a smaller value of , and repeat. A formal specification follows. 9.6. IMPLICIT FILTERING Algorithm 9.6 (Implicit Filtering). Choose a sequence { k } ↓ 0, Armijo parameters c and ρ in (0, 1), maximum backtracking parameter amax ; Set k ← 1, Choose initial point x x0 ; repeat increment k ← false; repeat Compute f (x) and ∇ k f (x); if ∇ k f (x) ≤ k increment k ← true; else Find the smallest integer m between 0 and amax such that 2 f x − ρ m ∇ k f (x) ≤ f (x) − cρ m ∇ k f (x)2 ; if no such m exists increment k ← true; else x ← x − ρ m ∇ f (x); until increment k; xk ← x; k ← k + 1; until a termination test is satisfied. Note that the inner loop in Algorithm 9.6 is essentially the backtracking line search algorithm—Algorithm 3.1 of Chapter 3—with a convergence criterion added to detect whether the minimum appears to have been found to within the accuracy implied by the difference parameter k . If the gradient estimate ∇ k f is small, or if the line search fails to find a satisfactory new iterate (indicating that the gradient approximation ∇ k f (x) is insufficiently accurate to produce descent in f ), we decrease the difference parameter to k+1 and proceed. A basic convergence result for Algorithm 9.6 is the following. Theorem 9.2. Suppose that ∇ 2 h is Lipschitz continuous, that Algorithm 9.6 generates an infinite sequence of iterates {xk }, and that lim k→∞ 2 k + η(xk ; k) 0. k Suppose, too, that all but a finite number of inner loops in Algorithm 9.6 terminate with ∇ f (xk ) ≤ k . Then all limit points of the sequence {xk } are stationary. k PROOF. Using { k } ↓ 0, we have under our assumptions on inner loop termination that ∇ k f (xk ) → 0. By invoking the error bound (9.5) and noting that the right-hand side of this expression is approaching zero, we conclude that ∇h(xk ) → 0. Hence all limit points satisfy ∇h(x) 0, as claimed. 241 242 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION More sophisticated versions of implicit filtering methods can be derived by using the gradient estimate ∇ k f to construct quasi-Newton approximate Hessians, and thus generating quasi-Newton search directions instead of the negative-approximate-gradient search direction used in Algorithm 9.6. NOTES AND REFERENCES A classical reference on derivative-free methods is Brent [39], which focuses primarily on one-dimensional problems and includes discussion of roundoff errors and global minimization. Recent surveys on derivative-free methods include Wright [314], Powell [256], Conn, Scheinberg, and Toint [76], and Kolda, Lewis, and Torczon [183]. The first model-based method for derivative-free optimization was proposed by Winfield [307]. It uses quadratic models, which are determined by the interpolation conditions (9.7), and computes steps by solving a subproblem of the form (9.9). Practical procedures for improving the geometry of the interpolation points were first developed by Powell in the context of model-based methods using linear and quadratic polynomials; see [256] for a review of this work. Conn, Scheinberg, and Toint [75] propose and analyze model-based methods and study the use of Newton fundamental polynomials. Methods that combine minimum change updating and interpolation are discussed by Powell [258, 260]. Our presentation of modelbased methods in Section 9.2 is based on [76, 259, 258]. For a comprehensive discussion of pattern-search methods of the type discussed here, we refer the reader to the review paper of Kolda, Lewis, and Torczon [183], and the references therein. The method of conjugate directions given in Algorithm 9.3 was proposed by Powell [239]. For a discussion on the rate of convergence of the coordinate descent method and for more references about this method, see Luenberger [195]. For further information on implicit filtering, see Kelley [179] and Choi and Kelley [60] and the references therein. Software packages that implement model-based methods include COBYLA [258], DFO [75], UOBYQA [257], WEDGE [200], and NEWUOA [260]. The earliest code is COBYLA, which employs linear models. DFO, UOBYQA, and WEDGE use quadratic models, whereas the method based on minimum change updating (9.19) is implemented in NEWUOA. A pattern-search method is implemented in APPS [171], while DIRECT [173] is designed to find a global solution. ✐ EXERCISES ✐ 9.1 Prove Lemma 9.1. ✐ 9.2 (a) Verify that the number of interpolation conditions to uniquely determine the coefficients in (9.6) are q 12 (n + 1)(n + 2). 9.6. IMPLICIT FILTERING (b) Verify that the number of vertices and midpoints of the edges of a nondegenerate simplex in R n add up to q 12 (n + 1)(n + 2) and can therefore be used as the initial interpolation set in a DFO algorithm. (c) How many interpolation conditions would be required to determine the coefficients in (9.6) if the matrix G were identically 0? How many if G were diagonal? How many if G were tridiagonal? ✐ 9.3 Describe conditions on the vectors s l that guarantee that the model (9.14) is uniquely determined. ✐ 9.4 Consider the determination of a quadratic function in two variables. (a) Show that six points on a line do not determine the quadratic. (b) Show that six points in a circle in the plane do not uniquely determine the quadratic. ✐ 9.5 Use induction to show that at the end of the outer iteration k of Algorithm 9.3, the directions pn−k , pn−k+1 , . . . , pn are conjugate. Use this fact to show that if the step lengths αi in Algorithm 9.3 are never zero, the iteration terminates at the minimizer of (9.25) after at most n outer iterations. ✐ 9.6 Write a program that computes the one-dimensional minimizer of a strictly convex quadratic function f along a direction p using quadratic interpolation. Describe the formulas used in your program. ✐ 9.7 Find the quadratic function 1 1 m(x1 , x2 ) f + g1 x1 + g2 x2 + G 211 x12 + G 12 x1 x2 + G 222 x22 2 2 that interpolates the following data: x0 y 1 (0, 0)T , y 2 (1, 0)T , y 3 (2, 0)T , y 4 (1, 1)T , y 5 (0, 2)T , y 6 (0, 1)T , and f (y 1 ) 1, f (y 2 ) 2.0084, f (y 3 ) 7.0091, f (y 4 ) 1.0168, f (y 5 ) −0.9909, and f (y 6 ) −0.9916. ✐ 9.8 Find the value of δ for which the coordinate generating set (9.23) satisfies the property (9.21). ✐ 9.9 Show that κ(Dk ) 0, where κ(·) is defined by (9.21) and Dk {ei , −ei } for any i 1, 2, . . . , n. ✐ 9.10 (Hard) Prove that the generating set (9.24) satisfies the property (9.21) for a certain value δ > 0, and find this value of δ. ✐ 9.11 Justify the statement that the average function value at the Nelder–Mead simplex points will decrease over one step if any of the points x̄(−1), x̄(−2), x̄(− 12 ), x̄( 21 ) are adopted as a replacement for xn+1 . 243 244 CHAPTER 9. DERIVATIVE-FREE OPTIMIZATION ✐ 9.12 Show that if f is a convex function, the shrinkage step in the Nelder–Mead simplex method will not increase the average value of the function over the simplex vertices defined by (9.29). Show that unless f (x1 ) f (x2 ) · · · f (xn+1 ), the average value will in fact decrease. ✐ 9.13 Suppose for the f defined in (9.2), we define the approximate gradient ∇ f (x) by the forward-difference formula ∇ f (x) f (x + ei ) − f (x) , i1,2,...,n rather than the central-difference formula (9.3). (This formula requires only half as many function evaluations but is less accurate.) For this definition, prove the following variant of Lemma 9.1: Suppose that ∇h(x) is Lipschitz continuous in a neighborhood of the box {z | z ≥ x, z − x∞ ≤ } with Lipschitz constant L h . Then we have ∇ f (x) − ∇h(x)∞ ≤ L h + η(x; ) where η(x; ) is redefined as follows: η(x; ) sup z≥x, z−x∞ ≤ |φ(z)|. , This is page 245 Printer: Opaque this 10 CHAPTER Least-Squares Problems In least-squares problems, the objective function f has the following special form: f (x) 1 2 m r 2j (x), (10.1) j1 where each r j is a smooth function from IRn to IR. We refer to each r j as a residual, and we assume throughout this chapter that m ≥ n. Least-squares problems arise in many areas of applications, and may in fact be the largest source of unconstrained optimization problems. Many who formulate a parametrized 246 CHAPTER 10. LEAST-SQUARES PROBLEMS model for a chemical, physical, financial, or economic application use a function of the form (10.1) to measure the discrepancy between the model and the observed behavior of the system (see Example 2.1, for instance). By minimizing this function, they select values for the parameters that best match the model to the data. In this chapter we show how to devise efficient, robust minimization algorithms by exploiting the special structure of the function f and its derivatives. To see why the special form of f often makes least-squares problems easier to solve than general unconstrained minimization problems, we first assemble the individual components r j from (10.1) into a residual vector r : IRn → IRm , as follows r (x) (r1 (x), r2 (x), . . . , rm (x))T . (10.2) Using this notation, we can rewrite f as f (x) 12 r (x)22 . The derivatives of f (x) can be expressed in terms of the Jacobian J (x), which is the m × n matrix of first partial derivatives of the residuals, defined by ⎡ ∂r j J (x) ∂ xi j1,2,...,m i1,2,...,n ∇r1 (x)T ⎢ ⎢ ∇r2 (x)T ⎢ ⎢ .. ⎢ . ⎣ ∇rm (x)T ⎤ ⎥ ⎥ ⎥ ⎥, ⎥ ⎦ (10.3) where each ∇r j (x), j 1, 2, . . . , m is the gradient of r j . The gradient and Hessian of f can then be expressed as follows: ∇ f (x) m r j (x)∇r j (x) J (x)T r (x), (10.4) j1 ∇ 2 f (x) m ∇r j (x)∇r j (x)T + j1 J (x)T J (x) + m r j (x)∇ 2r j (x) j1 m r j (x)∇ 2r j (x). (10.5) j1 In many applications, the first partial derivatives of the residuals and hence the Jacobian matrix J (x) are relatively easy or inexpensive to calculate. We can thus obtain the gradient ∇ f (x) as written in formula (10.4). Using J (x), we also can calculate the first term J (x)T J (x) in the Hessian ∇ 2 f (x) without evaluating any second derivatives of the functions r j . This availability of part of ∇ 2 f (x) “for free” is the distinctive feature of least-squares problems. Moreover, this term J (x)T J (x) is often more important than the second summation term in (10.5), either because the residuals r j are close to affine near the solution (that is, the ∇ 2r j (x) are relatively small) or because of small residuals (that 10.1. BACKGROUND is, the r j (x) are relatively small). Most algorithms for nonlinear least-squares exploit these structural properties of the Hessian. The most popular algorithms for minimizing (10.1) fit into the line search and trust-region frameworks described in earlier chapters. They are based on the Newton and quasi-Newton approaches described earlier, with modifications that exploit the particular structure of f . Section 10.1 contains some background on applications. Section 10.2 discusses linear least-squares problems, which provide important motivation for algorithms for the nonlinear problem. Section 10.3 describes the major algorithms, while Section 10.4 briefly describes a variant of least squares known as orthogonal distance regression. Throughout this chapter, we use the notation · to denote the Euclidean norm · 2 , unless a subscript indicates that some other norm is intended. 10.1 BACKGROUND We discuss a simple parametrized model and show how least-squares techniques can be used to choose the parameters that best fit the model to the observed data. ❏ EXAMPLE 10.1 We would like to study the effect of a certain medication on a patient. We draw blood samples at certain times after the patient takes a dose, and measure the concentration of the medication in each sample, tabulating the time t j and concentration y j for each sample. Based on our previous experience in such experiments, we find that the following function φ(x; t) provides a good prediction of the concentration at time t, for appropriate values of the five-dimensional parameter vector x (x1 , x2 , x3 , x4 , x5 ): φ(x; t) x1 + t x2 + t 2 x3 + x4 e−x5 t . (10.6) We choose the parameter vector x so that this model best agrees with our observation, in some sense. A good way to measure the difference between the predicted model values and the observations is the following least-squares function: 1 2 m [φ(x; t j ) − y j ]2 , (10.7) j1 which sums the squares of the discrepancies between predictions and observations at each t j . This function has precisely the form (10.1) if we define r j (x) φ(x; t j ) − y j . (10.8) 247 248 CHAPTER 10. LEAST-SQUARES PROBLEMS y t1 t2 t3 t4 t5 t6 t7 t Figure 10.1 Model (10.7) (smooth curve) and the observed measurements, with deviations indicated by vertical dotted lines. Graphically, each term in (10.7) represents the square of the vertical distance between the curve φ(x; t) (plotted as a function of t) and the point (t j , y j ), for a fixed choice of parameter vector x; see Figure 10.1. The minimizer x ∗ of the least-squares problem is the parameter vector for which the sum of squares of the lengths of the dotted lines in Figure 10.1 is minimized. Having obtained x ∗ , we use φ(x ∗ ; t) to estimate the concentration of medication remaining in the patient’s bloodstream at any time t. ❐ This model is an example of what statisticians call a fixed-regressor model. It assumes that the times t j at which the blood samples are drawn are known to high accuracy, while the observations y j may contain more or less random errors due to the limitations of the equipment (or the lab technician!) In general data-fitting problems of the type just described, the ordinate t in the model φ(x; t) could be a vector instead of a scalar. (In the example above, for instance, t could have two dimensions, with the first dimension representing the time since the drug was admistered and the second dimension representing the weight of the patient. We could then use observations for an entire population of patients, not just a single patient, to obtain the “best” parameters for this model.) The sum-of-squares function (10.7) is not the only way of measuring the discrepancy between the model and the observations. Other common measures include the maximum absolute value max j1,2,...,m |φ(x; t j ) − y j | (10.9) 10.1. BACKGROUND and the sum of absolute values m |φ(x; t j ) − y j |. (10.10) j1 By using the definitions of the ∞ and 1 norms, we can rewrite these two measures as f (x) r (x)∞ , f (x) r (x)1 , (10.11) respectively. As we discuss in Chapter 17, the problem of minimizing the functions (10.11) can be reformulated a smooth constrained optimization problem. In this chapter we focus only on the 2 -norm formulation (10.1). In some situations, there are statistical motivations for choosing the least-squares criterion. Changing the notation slightly, let the discrepancies between model and observation be denoted by j , that is, j φ(x; t j ) − y j . It often is reasonable to assume that the j ’s are independent and identically distributed with a certain variance σ 2 and probability density function gσ (·). (This assumption will often be true, for instance, when the model accurately reflects the actual process, and when the errors made in obtaining the measurements y j do not contain a systematic bias.) Under this assumption, the likelihood of a particular set of observations y j , j 1, 2, . . . , m, given that the actual parameter vector is x, is given by the function p(y; x, σ ) m 1 gσ ( j ) j1 m 1 gσ (φ(x; t j ) − y j ). (10.12) j1 Given the observations y1 , y2 , . . . , ym , the “most likely” value of x is obtained by maximizing p(y; x, σ ) with respect to x. The resulting value of x is called the maximum likelihood estimate. When we assume that the discrepancies follow a normal distribution, we have 1 gσ ( ) √ 2π σ 2 exp − 2 2σ 2 . Substitution in (10.12) yields ⎛ ⎞ m 1 p(y; x, σ ) (2π σ 2 )−m/2 exp ⎝− 2 [φ(x; t j ) − y j ]2 ⎠ . 2σ j1 249 250 CHAPTER 10. LEAST-SQUARES PROBLEMS For any fixed value of the variance σ 2 , it is obvious that p is maximized when the sum of squares (10.7) is minimized. To summarize: When the discrepancies are assumed to be independent and identically distributed with a normal distribution function, the maximum likelihood estimate is obtained by minimizing the sum of squares. The assumptions on j in the previous paragraph are common, but they do not describe the only situation for which the minimizer of the sum of squares makes good statistical sense. Seber and Wild [280] describe many instances in which minimization of functions like (10.7), or generalizations of this function such as r (x)T W r (x), where W ∈ IRm×m is symmetric, is the crucial step in obtaining estimates of the parameters x from observed data. 10.2 LINEAR LEAST-SQUARES PROBLEMS Many models φ(x; t) in data-fitting problems are linear functions of x. In these cases, the residuals r j (x) defined by (10.8) also are linear, and the problem of minimizing (10.7) is called a linear least-squares problem. We can write the residual vector as r (x) J x − y for some matrix J and vector y, both independent of x, so that the objective is f (x) 12 J x − y2 , (10.13) where y r (0). We also have ∇ f (x) J T (J x − y), ∇ 2 f (x) J T J. (Note that the second term in ∇ 2 f (x) (see (10.5)) disappears, because ∇ 2r j 0 for all j 1, 2, . . . , m.) It is easy to see that the f (x) in (10.13) is convex—a property that does not necessarily hold for the nonlinear problem (10.1). Theorem 2.5 tells us that any point x ∗ for which ∇ f (x ∗ ) 0 is the global minimizer of f . Therefore, x ∗ must satisfy the following linear system of equations: J T J x ∗ J T y. (10.14) These are known as the normal equations for (10.13). We outline briefly three major algorithms for the unconstrained linear least-squares problem. We assume in most of our discussion that m ≥ n and that J has full column rank. 10.2. LINEAR LEAST-SQUARES PROBLEMS The first and most obvious algorithm is simply to form and solve the system (10.14) by the following three-step procedure: • compute the coefficient matrix J T J and the right-hand-side J T y; • compute the Cholesky factorization of the symmetric matrix J T J ; • perform two triangular substitutions with the Cholesky factors to recover the solution x ∗. The Cholesky factorization J T J R̄ T R̄ (10.15) (where R̄ is an n × n upper triangular with positive diagonal elements) is guaranteed to exist when m ≥ n and J has rank n. This method is frequently used in practice and is often effective, but it has one significant disadvantage, namely, that the condition number of J T J is the square of the condition number of J . Since the relative error in the computed solution of a problem is usually proportional to the condition number, the Cholesky-based method may result in less accurate solutions than those obtained from methods that avoid this squaring of the condition number. When J is ill conditioned, the Cholesky factorization process may even break down, since roundoff errors may cause small negative elements to appear on the diagonal during the factorization process. A second approach is based on a QR factorization of the matrix J . Since the Euclidean norm of any vector is not affected by orthogonal transformations, we have J x − y Q T (J x − y) (10.16) for any m × m orthogonal matrix Q. Suppose we perform a QR factorization with column pivoting on the matrix J (see (A.24)) to obtain J Q R 0 Q1 Q2 R 0 Q 1 R, where is an n × n permutation matrix (hence, orthogonal); Q is m × m orthogonal; Q 1 is the first n columns of Q, while Q 2 contains the last m − n columns; R is n × n upper triangular with positive diagonal elements. (10.17) 251 252 CHAPTER 10. LEAST-SQUARES PROBLEMS By combining (10.16) and (10.17), we obtain 2 QT 1 T J x − y22 x − y) (J Q 2T 2 T 2 R Q1 y (T x) − T 0 Q2 y 2 2 R(T x) − Q 1T y 2 + Q 2T y . (10.18) No choice of x has any effect on the second term of this last expression, but we can minimize J x − y by driving the first term to zero, that is, by setting x ∗ R −1 Q 1T y. (In practice, we perform a triangular substitution to solve Rz Q 1T y, then permute the components of z to obtain x ∗ z.) This QR-based approach does not degrade the conditioning of the problem unnecessarily. The relative error in the final computed solution x ∗ is usually proportional to the condition number of J , not its square, and this method is usually reliable. Some situations, however, call for greater robustness or more information about the sensitivity of the solution to perturbations in the data (J or y). A third approach, based on the singular-value decomposition (SVD) of J , can be used in these circumstances. Recall from (A.15) that the SVD of J is given by J U S 0 V T U1 U2 S 0 V T U1 SV T , (10.19) where U is m × m orthogonal; U1 contains the first n columns of U , U2 the last m − n columns; V is n × n orthogonal; S is n × n diagonal, with diagonal elements σ1 ≥ σ2 ≥ · · · ≥ σn > 0. (Note that J T J V S 2 V T , so that the columns of V are eigenvectors of J T J with eigenvalues σ j2 , j 1, 2, . . . , n.) By following the same logic that led to (10.18), we obtain T 2 S U1 (V T x) − J x − y2 y T 0 U2 S(V T x) − U1T y2 + U2T y2 . (10.20) 10.2. LINEAR LEAST-SQUARES PROBLEMS Again, the optimum is found by choosing x to make the first term equal to zero; that is, x ∗ V S −1 U1T y. Denoting the ith columns of U and V by u i ∈ IRm and vi ∈ IRn , respectively, we have x∗ n uT y i i1 σi vi . (10.21) This formula yields useful information about the sensitivity of x ∗ . When σi is small, x ∗ is particularly sensitive to perturbations in y that affect u iT y, and also to perturbations in J that affect this same quantity. Such information is particularly useful when J is nearly rank-deficient, that is, when σn /σ1 1. It is sometimes worth the extra cost of the SVD algorithm to obtain this sensitivity information. All three approaches above have their place. The Cholesky-based algorithm is particularly useful when m n and it is practical to store J T J but not J itself. It can also be less expensive than the alternatives when m n and J is sparse. However, this approach must be modified when J is rank-deficient or ill conditioned to allow pivoting of the diagonal elements of J T J . The QR approach avoids squaring of the condition number and hence may be more numerically robust. While potentially the most expensive, the SVD approach is the most robust and reliable of all. When J is actually rank-deficient, some of the singular values σi are exactly zero, and any vector x ∗ of the form x∗ uT y i vi + τi vi σi σ 0 σ 0 i (10.22) i (for arbitrary coefficients τi ) is a minimizer of (10.20). Frequently, the solution with smallest norm is the most desirable, and we obtain it by setting each τi 0 in (10.22). When J has full rank but is ill conditioned, the last few singular values σn , σn−1 , . . . are small relative to σ1 . The coefficients u iT y/σi in (10.22) are particularly sensitive to perturbations in u iT y when σi is small, so an approximate solution that is less sentitive to perturbations than the true solution can be obtained by omitting these terms from the summation. When the problem is very large, it may be efficient to use iterative techniques, such as the conjugate gradient method, to solve the normal equations (10.14). A direct implementation of conjugate gradients (Algorithm 5.2) requires one matrix vector multiplication with J T J to be performed at each iteration. This operation can be performed by means of successive multiplications by J and J T ; we need only the ability to perform matrix-vector multiplications with these two matrices to implement this algorithm. Several modifications of the conjugate gradient approach have been proposed that involve a similar amount of work per iteration (one matrix-vector multiplication each with J and J T ) but that have superior numerical properties. Some alternatives are described by Paige and Saunders [234], 253 254 CHAPTER 10. LEAST-SQUARES PROBLEMS who propose in particular an algorithm called LSQR which has become the basis of a highly successful code. 10.3 ALGORITHMS FOR NONLINEAR LEAST-SQUARES PROBLEMS THE GAUSS–NEWTON METHOD We now describe methods for minimizing the nonlinear objective function (10.1) that exploit the structure in the gradient ∇ f (10.4) and Hessian ∇ 2 f (10.5). The simplest of these methods—the Gauss–Newton method—can be viewed as a modified Newton’s method with line search. Instead of solving the standard Newton equations ∇ 2 f (xk ) p −∇ f (xk ), we solve instead the following system to obtain the search direction pkGN : JkT Jk pkGN −JkT rk . (10.23) This simple modification gives a number of advantages over the plain Newton’s method. First, our use of the approximation ∇ 2 f k ≈ JkT Jk (10.24) saves us the trouble of computing the individual residual Hessians ∇ 2r j , j 1, 2, . . . , m, which are needed in the second term in (10.5). In fact, if we calculated the Jacobian Jk in the course of evaluating the gradient ∇ f k JkT rk , the approximation (10.24) does not require any additional derivative evaluations, and the savings in computational time can be quite significant in some applications. Second, there are many interesting situations in which the first term J T J in (10.5) dominates the second term (at least close to the solution x ∗ ), so that JkT Jk is a close approximation to ∇ 2 f k and the convergence rate of Gauss–Newton is similar to that of Newton’s method. The first term in (10.5) will be dominant when the norm of each second-order term (that is, |r j (x)|∇ 2r j (x)) is significantly smaller than the eigenvalues of J T J . As mentioned in the introduction, we tend to see this behavior when either the residuals r j are small or when they are nearly affine (so that the ∇ 2r j are small). In practice, many least-squares problems have small residuals at the solution, leading to rapid local convergence of Gauss–Newton. A third advantage of Gauss–Newton is that whenever Jk has full rank and the gradient ∇ f k is nonzero, the direction pkGN is a descent direction for f , and therefore a suitable direction for a line search. From (10.4) and (10.23) we have ( pkGN )T ∇ f k ( pkGN )T JkT rk −( pkGN )T JkT Jk pkGN −Jk pkGN 2 ≤ 0. (10.25) 10.3. ALGORITHMS FOR NONLINEAR LEAST-SQUARES PROBLEMS The final inequality is strict unless Jk pkGN 0, in which case we have by (10.23) and full rank of Jk that JkT rk ∇ f k 0; that is, xk is a stationary point. Finally, the fourth advantage of Gauss–Newton arises from the similarity between the equations (10.23) and the normal equations (10.14) for the linear least-squares problem. This connection tells us that pkGN is in fact the solution of the linear least-squares problem min 21 Jk p + rk 2 . (10.26) p Hence, we can find the search direction by applying linear least-squares algorithms to the subproblem (10.26). In fact, if the QR or SVD-based algorithms are used, there is no need to calculate the Hessian approximation JkT Jk in (10.23) explicitly; we can work directly with the Jacobian Jk . The same is true if we use a conjugate-gradient technique to solve (10.26). For this method we need to perform matrix-vector multiplications with JkT Jk , which can be done by first multiplying by Jk and then by JkT . If the number of residuals m is large while the number of variables n is relatively small, it may be unwise to store the Jacobian J explicitly. A preferable strategy may be to calculate the matrix J T J and gradient vector J T r by evaluating r j and ∇r j successively for j 1, 2, . . . , m and performing the accumulations JT J m i1 (∇r j )(∇r j )T , JTr m r j (∇r j ). (10.27) i1 The Gauss–Newton steps can then be computed by solving the system (10.23) of normal equations directly. The subproblem (10.26) suggests another motivation for the Gauss–Newton search direction. We can view this equation as being obtained from a linear model for the the vector function r (xk + p) ≈ rk + Jk p, substituted into the function 12 · 2 . In other words, we use the approximation f (xk + p) 12 r (xk + p)2 ≈ 12 Jk p + rk 2 , and choose pkGN to be the minimizer of this approximation. Implementations of the Gauss–Newton method usually perform a line search in the direction pkGN , requiring the step length αk to satisfy conditions like those discussed in Chapter 3, such as the Armijo and Wolfe conditions; see (3.4) and (3.6). CONVERGENCE OF THE GAUSS–NEWTON METHOD The theory of Chapter 3 can applied to study the convergence properties of the Gauss–Newton method. We prove a global convergence result under the assumption that the Jacobians J (x) have their singular values uniformly bounded away from zero in the 255 256 CHAPTER 10. LEAST-SQUARES PROBLEMS region of interest; that is, there is a constant γ > 0 such that J (x)z ≥ γ z (10.28) for all x in a neighborhood N of the level set L {x | f (x) ≤ f (x0 )}, (10.29) where x0 is the starting point for the algorithm. We assume here and in the rest of the chapter that L is bounded. Our result is a consequence of Theorem 3.2. Theorem 10.1. Suppose each residual function r j is Lipschitz continuously differentiable in a neighborhood N of the bounded level set (10.29), and that the Jacobians J (x) satisfy the uniform full-rank condition (10.28) on N . Then if the iterates xk are generated by the Gauss–Newton method with step lengths αk that satisfy (3.6), we have lim JkT rk 0. k→∞ PROOF. First, we note that the neighborhood N of the bounded level set L can be chosen small enough that the following properties are satisfied for some positive constants L and β: |r j (x)| ≤ β and ∇r j (x) ≤ β, |r j (x) − r j (x̃)| ≤ Lx − x̃ and ∇r j (x) − ∇r j (x̃) ≤ Lx − x̃, for all x, x̃ ∈ N and all j 1, 2, . . . , m. It is easy to deduce that there exists a constant β̄ > 0 such that J (x)T J (x) ≤ β̄ for all x ∈ L. In addition, by applying the results concerning Lipschitz continuity of products and sums (see for example (A.43)) to the gradient ∇ f (x) mj1 r j (x)∇r j (x), we can show that ∇ f is Lipschitz continuous. Hence, the assumptions of Theorem 3.2 are satisfied. We check next that the angle θk between the search direction pkGN and the negative gradient −∇ f k is uniformly bounded away from π/2. From (3.12), (10.25), and (10.28), we have for x xk ∈ L and p GN pkGN that cos θk − J p GN 2 γ 2 p GN 2 (∇ f )T p GN γ2 ≥ 2 GN 2 2 > 0. GN GN GN T p ∇ f p J J p β̄ p β̄ It follows from (3.14) in Theorem 3.2 that ∇ f (xk ) → 0, giving the result. If Jk is rank-deficient for some k (so that a condition like (10.28) is not satisfied), the coefficient matrix in (10.23) is singular. The system (10.23) still has a solution, however, because of the equivalence between this linear system and the minimization problem (10.26). 10.3. ALGORITHMS NONLINEAR LEAST-SQUARES PROBLEMS FOR In fact, there are infinitely many solutions for pkGN in this case; each of them has the form of (10.22). However, there is no longer an assurance that cos θk is uniformly bounded away from zero, so we cannot prove a result like Theorem 10.1. The convergence of Gauss–Newton to a solution x ∗ can be rapid if the leading term T Jk Jk dominates the second-order term in the Hessian (10.5). Suppose that xk is close to x ∗ and that assumption (10.28) is satisfied. Then, applying an argument like the Newton’s method analysis (3.31), (3.32), (3.33) in Chapter 3, we have for a unit step in the Gauss– Newton direction that xk + pkGN − x ∗ xk − x ∗ − [J T J (xk )]−1 ∇ f (xk ) [J T J (xk )]−1 J T J (xk )(xk − x ∗ ) + ∇ f (x ∗ ) − ∇ f (xk ) , where J T J (x) is shorthand notation for J (x)T J (x). Using H (x) to denote the second-order term in (10.5), we have from (A.57) that ∇ f (xk ) − ∇ f (x ∗ ) 1 0 J T J (x ∗ + t(xk − x ∗ ))(xk − x ∗ ) dt 1 + H (x ∗ + t(xk − x ∗ ))(xk − x ∗ ) dt. 0 A similar argument as in (3.32), (3.33), assuming Lipschitz continuity of H (·) near x ∗ , shows that xk + pkGN − x ∗ 1 [J T J (xk )]−1 H (x ∗ + t(xk − x ∗ ))xk − x ∗ dt + O(xk − x ∗ 2 ) ≤ 0 ≈ [J T J (x ∗ )]−1 H (x ∗ ) xk − x ∗ + O(xk − x ∗ 2 ). (10.30) Hence, if [J T J (x ∗ )]−1 H (x ∗ ) 1, we can expect a unit step of Gauss–Newton to move us much closer to the solution x ∗ , giving rapid local convergence. When H (x ∗ ) 0, the convergence is actually quadratic. When n and m are both large and the Jacobian J (x) is sparse, the cost of computing steps exactly by factoring either Jk or JkT Jk at each iteration may become quite expensive relative to the cost of function and gradient evaluations. In this case, we can design inexact variants of the Gauss–Newton algorithm that are analogous to the inexact Newton algorithms discussed in Chapter 7. We simply replace the Hessian ∇ 2 f (xk ) in these methods by its approximation JkT Jk . The positive semidefiniteness of this approximation simplifies the resulting algorithms in several places. 257 258 CHAPTER 10. LEAST-SQUARES PROBLEMS THE LEVENBERG–MARQUARDT METHOD Recall that the Gauss–Newton method is like Newton’s method with line search, except that we use the convenient and often effective approximation (10.24) for the Hessian. The Levenberg–Marquardt method can be obtained by using the same Hessian approximation, but replacing the line search with a trust-region strategy. The use of a trust region avoids one of the weaknesses of Gauss–Newton, namely, its behavior when the Jacobian J (x) is rank-deficient, or nearly so. Since the same Hessian approximations are used in each case, the local convergence properties of the two methods are similar. The Levenberg–Marquardt method can be described and analyzed using the trustregion framework of Chapter 4. (In fact, the Levenberg–Marquardt method is sometimes considered to be the progenitor of the trust-region approach for general unconstrained optimization discussed in Chapter 4.) For a spherical trust region, the subproblem to be solved at each iteration is min 12 Jk p + rk 2 , subject to p ≤ k , p (10.31) where k > 0 is the trust-region radius. In effect, we are choosing the model function m k (·) in (4.3) to be m k ( p) 12 rk 2 + p T JkT rk + 12 p T JkT Jk p. (10.32) We drop the iteration counter k during the rest of this section and concern ourselves with the subproblem (10.31). The results of Chapter 4 allow us to characterize the solution of (10.31) in the following way: When the solution p GN of the Gauss–Newton equations (10.23) lies strictly inside the trust region (that is, p GN < ), then this step p GN also solves the subproblem (10.31). Otherwise, there is a λ > 0 such that the solution p p LM of (10.31) satisfies p and J T J + λI p −J T r. (10.33) This claim is verified in the following lemma, which is a straightforward consequence of Theorem 4.1 from Chapter 4. Lemma 10.2. The vector p LM is a solution of the trust-region subproblem min J p + r 2 , subject to p ≤ , p if and only if p LM is feasible and there is a scalar λ ≥ 0 such that (J T J + λI ) p LM −J T r, λ( − p ) 0. LM (10.34a) (10.34b) 10.3. ALGORITHMS FOR NONLINEAR LEAST-SQUARES PROBLEMS PROOF. In Theorem 4.1, the semidefiniteness condition (4.8c) is satisfied automatically, since J T J is positive semidefinite and λ ≥ 0. The two conditions (10.34a) and (10.34b) follow from (4.8a) and (4.8b), respectively. Note that the equations (10.33) are just the normal equations for the following linear least-squares problem: min p 1 2 2 J r p+ √ . 0 λI (10.35) Just as in the Gauss–Newton case, the equivalence between (10.33) and (10.35) gives us a way of solving the subproblem without computing the matrix–matrix product J T J and its Cholesky factorization. IMPLEMENTATION OF THE LEVENBERG–MARQUARDT METHOD To find a value of λ that approximately matches the given in Lemma 10.2, we can use the rootfinding algorithm described in Chapter 4. It is easy to safeguard this procedure: The Cholesky factor R is guaranteed to exist whenever the current estimate λ() is positive, since the approximate Hessian B J T J is already positive semidefinite. Because of the special structure of B, we do not need to compute the Cholesky factorization of B + λI from scratch in each iteration of Algorithm 4.1. Rather, we present an efficient technique for finding the following QR factorization of the coefficient matrix in (10.35): Rλ 0 Q λT J √ λI (10.36) (Q λ orthogonal, Rλ upper triangular). The upper triangular factor Rλ satisfies RλT Rλ (J T J + λI ). We can save computer time in the calculation of the factorization (10.36) by using a combination of Householder and Givens transformations. Suppose we use Householder transformations to calculate the QR factorization of J alone as JQ R . 0 (10.37) We then have ⎡ ⎢ ⎣ R 0 √ λI ⎤ ⎥ ⎦ QT I J √ λI . (10.38) 259 260 CHAPTER 10. LEAST-SQUARES PROBLEMS The leftmost matrix in this formula is upper triangular except for the n nonzero terms of the matrix λI . These can be eliminated by a sequence of n(n + 1)/2 Givens rotations, in which the diagonal elements of the upper triangular part are used to eliminate the nonzeros of λI and the fill-in terms that arise in the process. The first few steps of this process are as follows: √ √ rotate row n of R with row n of λI , to eliminate the (n, n) element of λI ; √ rotate row n − 1 of R with row n − 1 of λI to eliminate the (n − 1, n −√1) element of the latter matrix. This step introduces fill-in in position √ (n − 1, n) of λI , which is eliminated by rotating row n of R with row n − 1 of λI , to eliminate the fill-in element at position (n − 1, n); √ rotate row n − 2 of R with row n − 2 of λI , to eliminate the (n − 2) diagonal in the latter matrix. This step introduces fill-in in the (n − 2, n − 1) and (n − 2, n) positions, which we eliminate by · · · and so on. If we gather all the Givens rotations into a matrix Q̄ λ , we obtain from (10.38) that ⎡ ⎢ Q̄ λT ⎣ R ⎤ ⎡ Rλ ⎤ ⎥ ⎢ ⎥ 0 ⎦ ⎣ 0 ⎦, √ 0 λI and hence (10.36) holds with Qλ Q I Q̄ λ . The advantage of this combined approach is that when the value of λ is changed in the rootfinding algorithm, we need only recalculate Q̄ λ and not the Householder part of the factorization (10.38). This feature can save a lot of computation in the case of m n, since just O(n 3 ) operations are required to recalculate Q̄ λ and Rλ for each value of λ, after the initial cost of O(mn 2 ) operations needed to calculate Q in (10.37). Least-squares problems are often poorly scaled. Some of the variables could have values of about 104 , while other variables could be of order 10−6 . If such wide variations are ignored, the algorithms above may encounter numerical difficulties or produce solutions of poor quality. One way to reduce the effects of poor scaling is to use an ellipsoidal trust region in place of the spherical trust region defined above. The step is confined to an ellipse in which the lengths of the principal axes are related to the typical values of the corresponding variables. Analytically, the trust-region subproblem becomes min 12 Jk p + rk 2 , p subject to Dk p ≤ k , (10.39) 10.3. ALGORITHMS FOR NONLINEAR LEAST-SQUARES PROBLEMS where Dk is a diagonal matrix with positive diagonal entries (cf. (7.13)). Instead of (10.33), the solution of (10.39) satisfies an equation of the form JkT Jk + λDk2 pkLM −JkT rk , (10.40) and, equivalently, solves the linear least-squares problem 2 Jk rk min √ p+ . p 0 λDk (10.41) The diagonals of the scaling matrix Dk can change from iteration to iteration, as we gather information about the typical range of values for each component of x. If the variation in these elements is kept within certain bounds, then the convergence theory for the spherical case continues to hold, with minor modifications. Moreover, the technique described above for calculating Rλ needs no modification. Seber and Wild [280] suggest choosing the diagonals of Dk2 to match those of JkT Jk , to make the algorithm invariant under diagonal scaling of the components of x. This approach is analogous to the technique of scaling by diagonal elements of the Hessian, which was described in Section 4.5 in the context of trust-region algorithms for unconstrained optimization. For problems in which m and n are large and J (x) is sparse, we may prefer to solve (10.31) or (10.39) approximately using the CG-Steihaug algorithm, Algorithm 7.2 from Chapter 7, with JkT Jk replacing the exact Hessian ∇ 2 f k . Positive semidefiniteness of the matrix JkT Jk makes for some simplification of this algorithm, because negative curvature cannot arise. It is not necessary to calculate JkT Jk explicitly to implement Algorithm 7.2; the matrix-vector products required by the algorithm can be found by forming matrix-vector products with Jk and JkT separately. CONVERGENCE OF THE LEVENBERG–MARQUARDT METHOD It is not necessary to solve the trust-region problem (10.31) exactly in order for the Levenberg–Marquardt method to enjoy global convergence properties. The following convergence result can be obtained as a direct consequence of Theorem 4.6. Theorem 10.3. Let η ∈ 0, 14 in Algorithm 4.1 of Chapter 4, and suppose that the level set L defined in (10.29) is bounded and that the residual functions r j (·), j 1, 2, . . . , m are Lipschitz continuously differentiable in a neighborhood N of L. Assume that for each k, the approximate solution pk of (10.31) satisfies the inequality J T rk m k (0) − m k ( pk ) ≥ c1 JkT rk min k , kT , Jk Jk (10.42) 261 262 CHAPTER 10. LEAST-SQUARES PROBLEMS for some constant c1 > 0, and in addition pk ≤ γ k for some constant γ ≥ 1. We then have that lim ∇ f k lim JkT rk 0. k→∞ k→∞ PROOF. The smoothness assumption on r j (·) implies that we can choose a constant M > 0 such that JkT Jk ≤ M for all iterates k. Note too that the objective f is bounded below (by zero). Hence, the assumptions of Theorem 4.6 are satisfied, and the result follows immediately. As in Chapter 4, there is no need to calculate the right-hand-side in the inequality (10.42) or to check it explicitly. Instead, we can simply require the decrease given by our approximate solution pk of (10.31) to at least match the decrease given by the Cauchy point, which can be calculated inexpensively in the same way as in Chapter 4. If we use the iterative CG-Steihaug approach, Algorithm 7.2, the condition (10.42) is satisfied automatically for c1 1/2, since the Cauchy point is the first estimate of pk computed by this approach, while subsequent estimates give smaller values for the model function. The local convergence behavior of Levenberg–Marquardt is similar to the Gauss– Newton method. Near a solution x ∗ at which the first term of the Hessian ∇ 2 f (x ∗ ) (10.5) dominates the second term, the model function in (10.31), the trust region becomes inactive and the algorithm takes Gauss–Newton steps, giving the rapid local convergence expression (10.30). METHODS FOR LARGE-RESIDUAL PROBLEMS In large-residual problems, the quadratic model in (10.31) is an inadequate representation of the function f because the second-order part of the Hessian ∇ 2 f (x) is too significant to be ignored. In data-fitting problems, the presence of large residuals may indicate that the model is inadequate or that errors have been made in monitoring the observations. Still, the practitioner may need to solve the least-squares problem with the current model and data, to indicate where improvements are needed in the weighting of observations, modeling, or data collection. On large-residual problems, the asymptotic convergence rate of Gauss–Newton and Levenberg–Marquardt algorithms is only linear—slower than the superlinear convergence rate attained by algorithms for general unconstrained problems, such as Newton or quasiNewton. If the individual Hessians ∇ 2r j are easy to calculate, it may be better to ignore the structure of the least-squares objective and apply Newton’s method with trust region or line search to the problem of minimizing f . Quasi-Newton methods, which attain a superlinear convergence rate without requiring calculation of ∇ 2r j , are another option. However, the behavior of both Newton and quasi-Newton on early iterations (before reaching a neighborhood of the solution) may be inferior to Gauss–Newton and Levenberg–Marquardt. 10.3. ALGORITHMS FOR NONLINEAR LEAST-SQUARES PROBLEMS Of course, we often do not know beforehand whether a problem will turn out to have small or large residuals at the solution. It seems reasonable, therefore, to consider hybrid algorithms, which would behave like Gauss–Newton or Levenberg–Marquardt if the residuals turn out to be small (and hence take advantage of the cost savings associated with these methods) but switch to Newton or quasi-Newton steps if the residuals at the solution appear to be large. There are a couple of ways to construct hybrid algorithms. One approach, due to Fletcher and Xu (see Fletcher [101]), maintains a sequence of positive definite Hessian approximations Bk . If the Gauss–Newton step from xk reduces the function f by a certain fixed amount (say, a factor of 5), then this step is taken and Bk is overwritten by JkT Jk . Otherwise, a direction is computed using Bk , and the new point xk+1 is obtained by performing a line search. In either case, a BFGS-like update is applied to Bk to obtain a new approximation Bk+1 . In the zero-residual case, the method eventually always takes Gauss– Newton steps (giving quadratic convergence), while it eventually reduces to BFGS in the nonzero-residual case (giving superlinear convergence). Numerical results in Fletcher [101, Tables 6.1.2, 6.1.3] show good results for this approach on small-, large-, and zero-residual problems. A second way to combine Gauss–Newton and quasi-Newton ideas is to maintain approximations to just the second-order part of the Hessian. That is, we maintain a sequence of matrices Sk that approximate the summation term mj1 r j (xk )∇ 2r j (xk ) in (10.5), and then use the overall Hessian approximation Bk JkT Jk + Sk in a trust-region or line search model for calculating the step pk . Updates to Sk are devised so that the approximate Hessian Bk , or its constituent parts, mimics the behavior of the corresponding exact quantities over the step just taken. The update formula is based on a secant equation, which arises also in the context of unconstrained minimization (6.6) and nonlinear equations (11.27). In the present instance, there are a number of different ways to define the secant equation and to specify the other conditions needed for a complete update formula for Sk . We describe the algorithm of Dennis, Gay, and Welsch [90], which is probably the best-known algorithm in this class because of its implementation in the well-known NL2SOL package. In [90], the secant equation is motivated in the following way. Ideally, Sk+1 should be a close approximation to the exact second-order term at x xk+1 ; that is, Sk+1 ≈ m r j (xk+1 )∇ 2r j (xk+1 ). j1 Since we do not want to calculate the individual Hessians ∇ 2r j in this formula, we could replace each of them with an approximation (B j )k+1 and impose the condition that (B j )k+1 263 264 CHAPTER 10. LEAST-SQUARES PROBLEMS should mimic the behavior of its exact counterpart ∇ 2r j over the step just taken; that is, (B j )k+1 (xk+1 − xk ) ∇r j (xk+1 ) − ∇r j (xk ) (row j of J (xk+1 ))T − (row j of J (xk ))T . This condition leads to a secant equation on Sk+1 , namely, Sk+1 (xk+1 − xk ) m r j (xk+1 )(B j )k+1 (xk+1 − xk ) j1 m r j (xk+1 ) (row j of J (xk+1 ))T − (row j of J (xk ))T j1 T Jk+1 rk+1 − JkT rk+1 . As usual, this condition does not completely specify the new approximation Sk+1 . Dennis, Gay, and Welsch add requirements that Sk+1 be symmetric and that the difference Sk+1 − Sk from the previous estimate Sk be minimized in a certain sense, and derive the following update formula: Sk+1 Sk + (y − Sk s)T s T (y − Sk s)y T + y(y − Sk s)T − yy , yT s (y T s)2 (10.43) where s xk+1 − xk , T rk+1 − JkT rk , y Jk+1 T y Jk+1 rk+1 − JkT rk+1 . Note that (10.43) is a slight variant on the DFP update for unconstrained minimization. It would be identical if y and y were the same. Dennis, Gay, and Welsch use their approximate Hessian JkT Jk + Sk in conjunction with a trust-region strategy, but a few more features are needed to enhance its performance. One deficiency of its basic update strategy for Sk is that this matrix is not guaranteed to vanish as the iterates approach a zero-residual solution, so it can interfere with superlinear convergence. This problem is avoided by scaling Sk prior to its update; we replace Sk by τk Sk on the right-hand-side of (10.43), where |s T y | . τk min 1, T |s Sk s| 10.4. ORTHOGONAL DISTANCE REGRESSION A final modification in the overall algorithm is that the Sk term is omitted from the Hessian approximation when the resulting Gauss–Newton model produces a sufficiently good step. 10.4 ORTHOGONAL DISTANCE REGRESSION In Example 10.1 we assumed that no errors were made in noting the time at which the blood samples were drawn, so that the differences between the model φ(x; t j ) and the observation y j were due to inadequacy in the model or measurement errors in y j . We assumed that any errors in the ordinates—the times t j —are tiny by comparison with the errors in the observations. This assumption often is reasonable, but there are cases where the answer can be seriously distorted if we fail to take possible errors in the ordinates into account. Models that take these errors into account are known in the statistics literature as errors-in-variables models [280, Chapter 10], and the resulting optimization problems are referred to as total least squares in the case of a linear model (see Golub and Van Loan [136, Chapter 5]) or as orthogonal distance regression in the nonlinear case (see Boggs, Byrd, and Schnabel [30]). We formulate this problem mathematically by introducing perturbations δ j for the ordinates t j , as well as perturbations j for y j , and seeking the values of these 2m perturbations that minimize the discrepancy between the model and the observations, as measured by a weighted least-squares objective function. To be precise, we relate the quantities t j , y j , δ j , and j by y j φ(x; t j + δ j ) + j, j 1, 2, . . . , m, (10.44) subject to (10.44). (10.45) and define the minimization problem as min x,δ j , j 1 2 m w 2j 2 j + d 2j δ 2j , j1 The quantities wi and di are weights, selected either by the modeler or by some automatic estimate of the relative significance of the error terms. It is easy to see how the term “orthogonal distance regression” originates when we graph this problem; see Figure 10.2. If all the weights wi and di are equal, then each term in the summation (10.45) is simply the shortest distance between the point (t j , y j ) and the curve φ(x; t) (plotted as a function of t). The shortest path between each point and the curve is orthogonal to the curve at the point of intersection. Using the constraints (10.44) to eliminate the variables j from (10.45), we obtain the unconstrained least-squares problem min F(x, δ) x,δ 1 2 m j1 w 2j [y j − φ(x; t j + δ j )]2 + d 2j δ 2j 1 2 2m j1 r 2j (x, δ), (10.46) 265 266 CHAPTER 10. LEAST-SQUARES PROBLEMS y t1 t2 t3 t4 t5 t6 t7 t Figure 10.2 Orthogonal distance regression minimizes the sum of squares of the distance from each point to the curve. where δ (δ1 , δ2 , . . . , δm )T and we have defined r j (x, δ) w j [φ(x; t j + δ j ) − y j ], j 1, 2, . . . , m, d j−m δ j−m , j m + 1, . . . , 2m. (10.47) Note that (10.46) is now a standard least-squares problem with 2m residuals and m + n unknowns, which we can solve by using the techniques in this chapter. A naive implementation of this strategy may, however, be quite expensive, since the number of parameters (2n) and the number of observations (m + n) may both be much larger than for the original problem. Fortunately, the Jacobian matrix for (10.46) has a special structure that can be exploited in implementing the Gauss–Newton or Levenberg–Marquardt methods. Many of its components are zero; for instance, we have ∂[φ(t j + δ j ; x) − y j ] ∂r j 0, ∂δi ∂δi i, j 1, 2, . . . , m, i j, and ∂r j 0, ∂ xi j m + 1, . . . , 2m, i 1, 2, . . . , n. 10.4. ORTHOGONAL DISTANCE REGRESSION Additionally, we have for j 1, 2, . . . , m and i 1, 2, . . . , m that ∂rm+ j ∂δi dj if i j, 0 otherwise. Hence, we can partition the Jacobian of the residual function r defined by (10.47) into blocks and write J (x, δ) Jˆ V 0 D , (10.48) where V and D are m × m diagonal matrices and Jˆ is the m × n matrix of partial derivatives of the functions w j φ(t j + δ j ; x) with respect to x. Boggs, Byrd, and Schnabel [30]) apply the Levenberg–Marquardt algorithm to (10.46) and note that block elimination can be used to solve the subproblems (10.33), (10.35) efficiently. Given the partitioning (10.48), we can partition the step vector p and the residual vector r accordingly as p px pδ , r r̂1 r̂2 , and write the normal equations (10.33) in the partitioned form JˆT Jˆ + λI V Jˆ JˆT V V 2 + D 2 + λI px pδ − JˆT r̂1 V r̂1 + Dr̂2 . (10.49) Since the lower right submatrix V 2 + D 2 + λI is diagonal, it is easy to eliminate pδ from this system and obtain a smaller n × n system to be solved for px alone. The total cost of finding a step is only marginally greater than for the m × n problem arising from the standard least-squares model. NOTES AND REFERENCES Algorithms for linear least squares are discussed comprehensively by Björck [29], who includes detailed error analyses of the different algorithms and software listings. He considers not just the basic problem (10.13) but also the situation in which there are bounds (for example, x ≥ 0) or linear constraints (for example, Ax ≥ b) on the variables. Golub and Van Loan [136, Chapter 5] survey the state of the art, including discussion of the suitability of the different approaches (for example, normal equations vs. QR factorization) for different problem types. A classical reference on linear least-squares is Lawson and Hanson [188]. 267 268 CHAPTER 10. LEAST-SQUARES PROBLEMS Very large nonlinear least-squares problems arise in numerous areas of application, such as medical imaging, geophysics, economics, and engineering design. In many instances, both the number of variables n and the number of residuals m is large, but it is also quite common that only m is large. The original description of the Levenberg–Marquardt algorithm [190, 203] did not make the connection with the trust-region concept. Rather, it adjusted the value of λ in (10.33) directly, increasing or decreasing it by a certain factor according to whether or not the previous trial step was effective in decreasing f (·). (The heuristics for adjusting λ were analogous to those used for adjusting the trust-region radius k in Algorithm 4.1.) Similar convergence results to Theorem 10.3 can be proved for algorithms that use this approach (see, for instance, Osborne [231]), independently of trust-region analysis. The connection with trust regions was firmly established by Moré [210]. Wright and Holt [318] present an inexact Levenberg–Marquardt approach for large-scale nonlinear least squares that manipulates the parameter λ directly rather than making use of the connection to trust-region algorithms. This method takes steps p̄k that, analogously to (7.2) and (7.3) in Chapter 7, satisfy the system T J Jk + λk I p̄k + J T rk ≤ ηk J T rk , k k k for some ηk ∈ [0, η], where η ∈ (0, 1) is a constant and {ηk } is a forcing sequence. A ratio of actual to predicted decrease is used to decide whether the step p̄k should be taken, and convergence to stationary points can be proved under certain assumptions. The method can be implemented efficiently by using Algorithm LSQR of Paige and Saunders [234] to calculate the approximate solution of (10.35) since, for a small marginal cost, this algorithm can compute approximate solutions for a number of different values of λk simultaneously. Hence, we can compute values of p̄k corresponding to a range of values of λk , and choose the actual step to be the one corresponding to the smallest λk for which the actual-predicted decrease ratio is satisfactory. Nonlinear least squares software is fairly prevalent because of the high demand for it. Major numerical software libraries such as IMSL, HSL, NAG, and SAS, as well as programming environments such as Mathematica and Matlab, contain robust nonlinear least-squares implementations. Other high quality implmentations include DFNLP, MINPACK, NL2SOL, and NLSSOL; see Moré and Wright [217, Chapter 3]. The nonlinear programming packages LANCELOT, KNITRO, and SNOPT provide large-scale implementions of the Gauss– Newton and Levenberg–Marquardt methods. The orthogonal distance regression algorithm is implemented by ORDPACK [31]. All these routines (which can be accessed through the web) give the user the option of either supplying Jacobians explicitly or else allowing the code to compute them by finite differencing. (In the latter case, the user need only write code to compute the residual vector r (x); see Chapter 8.) Seber and Wild [280, Chapter 15] describe some of the important practical issues in selecting software for statistical applications. 10.4. ORTHOGONAL DISTANCE REGRESSION ✐ EXERCISES ✐ 10.1 Let J be an m × n matrix with m ≥ n, and let y ∈ IRm be a vector. (a) Show that J has full column rank if and only if J T J is nonsingular. (b) Show that J has full column rank if and only if J T J is positive definite. ✐ 10.2 Show that the function f (x) in (10.13) is convex. ✐ 10.3 Show that (a) if Q is an orthogonal matrix, then Qx x for any vector x; (b) the matrices R̄ in (10.15) and R in (10.17) are identical if I , provided that J has full column rank n. ✐ 10.4 (a) Show that x ∗ defined in (10.22) is a minimizer of (10.13). (b) Find x ∗ and conclude that this norm is minimized when τi 0 for all i with σi 0. ✐ 10.5 Suppose that each residual function r j and its gradient are Lipschitz continuous with Lipschitz constant L, that is, r j (x) − r j (x̃) ≤ Lx − x̃, ∇r j (x) − ∇r j (x̃) ≤ Lx − x̃ for all j 1, 2, . . . , m and all x, x̃ ∈ D, where D is a compact subset of IRn . Assume also that the r j are bounded on D, that is, there exists M > 0 such that |r j (x)| ≤ M for all j 1, 2, . . . , m and all x ∈ D. Find Lipschitz constants for the Jacobian J (10.3) and the gradient ∇ f (10.4) over D. ✐ 10.6 Express the solution p of (10.33) in terms of the singular-value decomposition of J (x) and the scalar λ. Express its squared-norm p2 in these same terms, and show that lim p λ→0 uT r i vi . σ i σ 0 i 269 This is pag Printer: O 11 CHAPTER Nonlinear Equations In many applications we do not need to optimize an objective function explicitly, but rather to find values of the variables in a model that satisfy a number of given relationships. When these relationships take the form of n equalities—the same number of equality conditions as variables in the model—the problem is one of solving a system of nonlinear equations. We write this problem mathematically as r (x) 0, (11.1) CHAPTER 11. NONLINEAR EQUATIONS where r : IRn → IRn is a vector function, that is, ⎡ r1 (x) ⎢ ⎢ r2 (x) ⎢ r (x) ⎢ .. ⎢ . ⎣ rn (x) ⎤ ⎥ ⎥ ⎥ ⎥. ⎥ ⎦ In this chapter, we assume that each function ri : IRn → IR, i 1, 2, . . . , n, is smooth. A vector x ∗ for which (11.1) is satisfied is called a solution or root of the nonlinear equations. A simple example is the system r (x) x22 − 1 sin x1 − x2 0, which is a system of n 2 equations with infinitely many solutions, two of which are x ∗ (3π/2, −1)T and x ∗ (π/2, 1)T . In general, the system (11.1) may have no solutions, a unique solution, or many solutions. The techniques for solving nonlinear equations overlap in their motivation, analysis, and implementation with optimization techniques discussed in earlier chapters. In both optimization and nonlinear equations, Newton’s method lies at the heart of many important algorithms. Features such as line searches, trust regions, and inexact solution of the linear algebra subproblems at each iteration are important in both areas, as are other issues such as derivative evaluation and global convergence. Because some important algorithms for nonlinear equations proceed by minimizing a sum of squares of the equations, that is, min x n ri2 (x), i1 there are particularly close connections with the nonlinear least-squares problem discussed in Chapter 10. The differences are that in nonlinear equations, the number of equations equals the number of variables (instead of exceeding the number of variables, as is typically the case in Chapter 10), and that we expect all equations to be satisfied at the solution, rather than just minimizing the sum of squares. This point is important because the nonlinear equations may represent physical or economic constraints such as conservation laws or consistency principles, which must hold exactly in order for the solution to be meaningful. Many applications require us to solve a sequence of closely related nonlinear systems, as in the following example. 271 272 CHAPTER 11. NONLINEAR EQUATIONS ❏ EXAMPLE 11.1 (RHEINBOLDT; SEE [212]) An interesting problem in control is to analyze the stability of an aircraft in response to the commands of the pilot. The following is a simplified model based on force-balance equations, in which gravity terms have been neglected. The equilibrium equations for a particular aircraft are given by a system of 5 equations in 8 unknowns of the form F(x) ≡ Ax + φ(x) 0, (11.2) where F : IR8 → IR5 , the matrix A is given by ⎡ ⎢ ⎢ ⎢ A⎢ ⎢ ⎢ ⎣ −3.933 0.107 0.126 0 −9.99 0 −45.83 −7.64 0 −0.987 0 −22.95 0 −28.37 0 0 0.002 0 −0.235 0 5.67 0 −0.921 0 1.0 0 −1.0 0 −0.168 0 0 0 −1.0 0 −0.196 0 −0.0071 ⎤ ⎥ ⎥ ⎥ −6.51 ⎥ ⎥, ⎥ 0 ⎦ 0 and the nonlinear part is defined by ⎡ ⎢ ⎢ ⎢ ⎢ φ(x) ⎢ ⎢ ⎢ ⎣ −0.727x2 x3 + 8.39x3 x4 − 684.4x4 x5 + 63.5x4 x2 0.949x1 x3 + 0.173x1 x5 −0.716x1 x2 − 1.578x1 x4 + 1.132x4 x2 −x1 x5 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥. ⎥ ⎥ ⎦ x1 x4 The first three variables x1 , x2 , x3 , represent the rates of roll, pitch, and yaw, respectively, while x4 is the incremental angle of attack and x5 the sideslip angle. The last three variables x6 , x7 , x8 are the controls; they represent the deflections of the elevator, aileron, and rudder, respectively. For a given choice of the control variables x6 , x7 , x8 we obtain a system of 5 equations and 5 unknowns. If we wish to study the behavior of the aircraft as the controls are changed, we need to solve a system of nonlinear equations with unknowns x1 , x2 , . . . , x5 for each setting of the controls. ❐ Despite the many similarities between nonlinear equations and unconstrained and least-squares optimization algorithms, there are also some important differences. To obtain quadratic convergence in optimization we require second derivatives of the objective function, whereas knowledge of the first derivatives is sufficient in nonlinear equations. CHAPTER 11. NONLINEAR EQUATIONS 4 3 2 1 0 −1 −2 −3 −4 −3 −2 −1 0 1 2 3 Figure 11.1 The function r (x) sin(5x) − x has three roots. Quasi-Newton methods are perhaps less useful in nonlinear equations than in optimization. In unconstrained optimization, the objective function is the natural choice of merit function that gauges progress towards the solution, but in nonlinear equations various merit functions can be used, all of which have some drawbacks. Line search and trust-region techniques play an equally important role in optimization, but one can argue that trust-region algorithms have certain theoretical advantages in solving nonlinear equations. Some of the difficulties that arise in trying to solve nonlinear equations can be illustrated by a simple scalar example (n 1). Suppose we have r (x) sin(5x) − x, (11.3) as plotted in Figure 11.1. From this figure we see that there are three solutions of the problem r (x) 0, also known as roots of r , located at zero and approximately ±0.519148. This situation of multiple solutions is similar to optimization problems where, for example, a function may have more than one local minimum. It is not quite the same, however: In the case of optimization, one of the local minima may have a lower function value than the others (making it a “better” solution), while in nonlinear equations all solutions are equally good from a mathematical viewpoint. (If the modeler decides that the solution 273 274 CHAPTER 11. NONLINEAR EQUATIONS found by the algorithm makes no sense on physical grounds, their model may need to be reformulated.) In this chapter we start by outlining algorithms related to Newton’s method and examining their local convergence properties. Besides Newton’s method itself, these include Broyden’s quasi-Newton method, inexact Newton methods, and tensor methods. We then address global convergence, which is the issue of trying to force convergence to a solution from a remote starting point. Finally, we discuss a class of methods in which an “easy” problem—one to which the solution is well known—is gradually transformed into the problem F(x) 0. In these so-called continuation (or homotopy) methods, we track the solution as the problem changes, with the aim of finishing up at a solution of F(x) 0. Throughout this chapter we make the assumption that the vector function r is continuously differentiable in the region D containing the values of x we are interested in. In other words, the Jacobian J (x) (the matrix of first partial derivatives of r (x) defined in the Appendix and in (10.3)) exists and is continuous. We say that x ∗ satisfying r (x ∗ ) 0 is a degenerate solution if J (x ∗ ) is singular, and a nondegenerate solution otherwise. 11.1 LOCAL ALGORITHMS NEWTON’S METHOD FOR NONLINEAR EQUATIONS Recall from Theorem 2.1 that Newton’s method for minimizing f : IRn → IR forms a quadratic model function by taking the first three terms of the Taylor series approximation of f around the current iterate xk . The Newton step is the vector that minimizes this model. In the case of nonlinear equations, Newton’s method is derived in a similar way, but with a linear model, one that involves function values and first derivatives of the functions ri (x), i 1, 2, . . . , m at the current iterate xk . We justify this strategy by referring to the following multidimensional variant of Taylor’s theorem. Theorem 11.1. Suppose that r : IRn → IRn is continuously differentiable in some convex open set D and that x and x + p are vectors in D. We then have that r (x + p) r (x) + 1 J (x + t p) p dt. (11.4) 0 We can define a linear model Mk ( p) of r (xk + p) by approximating the second term on the right-hand-side of (11.4) by J (x) p, and writing def Mk ( p) r (xk ) + J (xk ) p. (11.5) 11.1. LOCAL ALGORITHMS Newton’s method, in its pure form, chooses the step pk to be the vector for which Mk ( pk ) 0, that is, pk −J (xk )−1r (xk ). We define it formally as follows. Algorithm 11.1 (Newton’s Method for Nonlinear Equations). Choose x0 ; for k 0, 1, 2, . . . Calculate a solution pk to the Newton equations J (xk ) pk −r (xk ); (11.6) xk+1 ← xk + pk ; end (for) We use a linear model to derive the Newton step, rather than a quadratic model as in unconstrained optimization, because the linear model normally has a solution and yields an algorithm with rapid convergence properties. In fact, Newton’s method for unconstrained optimization (see (2.15)) can be derived by applying Algorithm 11.1 to the nonlinear equations ∇ f (x) 0. We see also in Chapter 18 that sequential quadratic programming for equality-constrained optimization can be derived by applying Algorithm 11.1 to the nonlinear equations formed by the first-order optimality conditions (18.3) for this problem. Another connection is with the Gauss–Newton method for nonlinear least squares; the formula (11.6) is equivalent to (10.23) in the usual case in which J (xk ) is nonsingular. When the iterate xk is close to a nondegenerate root x ∗ , Newton’s method converges superlinearly, as we show in Theorem 11.2 below. Potential shortcomings of the method include the following. • When the starting point is remote from a solution, Algorithm 11.1 can behave erratically. When J (xk ) is singular, the Newton step may not even be defined. • First-derivative information (the Jacobian matrix J ) may be difficult to obtain. • It may be too expensive to find and calculate the Newton step pk exactly when n is large. • The root x ∗ in question may be degenerate, that is, J (x ∗ ) may be singular. An example of a degenerate problem is the scalar function r (x) x 2 , which has a single degenerate root at x ∗ 0. Algorithm 11.1, when started from any nonzero x0 , generates the sequence of iterates xk 1 x0 , 2k which converges to the solution 0, but only at a linear rate. As we show later in this chapter, Newton’s method can be modified and enhanced in various ways to get around most of these problems. The variants we describe form the basis of much of the available software for solving nonlinear equations. 275 276 CHAPTER 11. NONLINEAR EQUATIONS We summarize the local convergence properties of Algorithm 11.1 in the following theorem. For part of this result, we make use of a Lipschitz continuity assumption on the Jacobian, by which we mean that there is a constant β L such that J (x0 ) − J (x1 ) ≤ β L x0 − x1 , (11.7) for all x0 and x1 in the domain in question. Theorem 11.2. Suppose that r is continuously differentiable in a convex open set D ⊂ IRn . Let x ∗ ∈ D be a nondegenerate solution of r (x) 0, and let {xk } be the sequence of iterates generated by Algorithm 11.1. Then when xk ∈ D is sufficiently close to x ∗ , we have xk+1 − x ∗ o(xk − x ∗ ), (11.8) indicating local Q-superlinear convergence. When r is Lipschitz continuously differentiable near x ∗ , we have for all xk sufficiently close to x ∗ that xk+1 − x ∗ O(xk − x ∗ 2 ), (11.9) indicating local Q-quadratic convergence. PROOF. Since r (x ∗ ) 0, we have from Theorem 11.1 that r (xk ) r (xk ) − r (x ∗ ) J (xk )(xk − x ∗ ) + w(xk , x ∗ ), (11.10) where w(xk , x ∗ ) 1 J (xk + t(x ∗ − xk )) − J (xk ) (xk − x ∗ ). (11.11) 0 From (A.12) and continuity of J , we have 1 ∗ ∗ ∗ w(xk , x ) [J (x + t(x − xk )) − J (xk )](xk − x ) dt 0 1 ≤ J (x ∗ + t(x ∗ − xk )) − J (xk ) xk − x ∗ dt ∗ (11.12) 0 o(xk − x ∗ ). Since J (x ∗ ) is nonsingular, there is a radius δ > 0 and a positive constant β ∗ such that for all x in the ball B(x ∗ , δ) defined by B(x ∗ , δ) {x | x − x ∗ ≤ δ}, (11.13) 11.1. LOCAL ALGORITHMS x ∈ D. (11.14) we have that J (x)−1 ≤ β ∗ and Assuming that xk ∈ B(x ∗ , δ), and recalling the definition (11.6), we multiply both sides of (11.10) by J (xk )−1 to obtain − pk (xk − x ∗ ) + J (xk )−1 o(xk − x ∗ ), ⇒ xk + pk − x ∗ o(xk − x ∗ ), ⇒ xk+1 − x ∗ o(xk − x ∗ ), (11.15) which yields (11.8). When the Lipschitz continuity assumption (11.7) is satisfied, we can obtain a sharper estimate for the remainder term w(xk , x ∗ ) defined in (11.11). By using (11.7) in (11.12), we obtain w(xk , x ∗ ) O(xk − x ∗ 2 ). (11.16) By multiplying (11.10) by J (xk )−1 as above, we obtain − pk − (xk − x ∗ ) J (xk )−1 w(xk , x ∗ ), so the estimate (11.9) follows as in (11.15). INEXACT NEWTON METHODS Instead of solving (11.6) exactly, inexact Newton methods use search directions pk that satisfy the condition rk + Jk pk ≤ ηk rk , for some ηk ∈ [0, η], (11.17) where η ∈ [0, 1) is a constant. As in Chapter 7, we refer to {ηk } as the forcing sequence. Different methods make different choices of the forcing sequence, and they use different algorithms for finding the approximate solutions pk . The general framework for this class of methods can be stated as follows. Framework 11.2 (Inexact Newton for Nonlinear Equations). Given η ∈ [0, 1); Choose x0 ; for k 0, 1, 2, . . . Choose forcing parameter ηk ∈ [0, η]; Find a vector pk that satisfies (11.17); xk+1 ← xk + pk ; end (for) 277 278 CHAPTER 11. NONLINEAR EQUATIONS The convergence theory for these methods depends only on the condition (11.17) and not on the particular technique used to calculate pk . The most important methods in this class, however, make use of iterative techniques for solving linear systems of the form J p −r , such as GMRES (Saad and Schultz [273], Walker [302]) or other Krylovspace methods. Like the conjugate-gradient algorithm of Chapter 5 (which is not directly applicable here, since the coefficient matrix J is not symmetric positive definite), these methods typically require us to perform a matrix–vector multiplication of the form J d for some d at each iteration, and to store a number of work vectors of length n. GMRES requires an additional vector to be stored at each iteration, so must be restarted periodically (often every 10 or 20 iterations) to keep memory requirements at a reasonable level. The matrix–vector products J d can be computed without explicit knowledge of the Jacobian J . A finite-difference approximation to J d that requires one evaluation of r (·) is given by the formula (8.11). Calculation of J d exactly (at least, to within the limits of finite-precision arithmetic) can be performed by using the forward mode of automatic differentiation, at a cost of at most a small multiple of an evaluation of r (·). Details of this procedure are given in Section 8.2. We do not discuss the iterative methods for sparse linear systems here, but refer the interested reader to Kelley [177] and Saad [272] for comprehensive descriptions and implementations of the most interesting techniques. We prove a local convergence theorem for the method, similar to Theorem 11.2. Theorem 11.3. Suppose that r is continuously differentiable in a convex open set D ⊂ IRn . Let x ∗ ∈ D be a nondegenerate solution of r (x) 0, and let {xk } be the sequence of iterates generated by the Framework 11.2. Then when xk ∈ D is sufficiently close to x ∗ , the following are true: (i) If η in (11.17) is sufficiently small, the convergence of {xk } to x ∗ is Q-linear. (ii) If ηk → 0, the convergence is Q-superlinear. (iii) If, in addition, J (·) is Lipschitz continuous in a neighborhood of x ∗ and ηk O(rk ), the convergence is Q-quadratic. PROOF. We first rewrite (11.17) as J (xk ) pk + r (xk ) vk , where vk ≤ ηk r (xk ). (11.18) Since x ∗ is a nondegenerate root, we have as in (11.14) that there is a radius δ > 0 such that J (x)−1 ≤ β ∗ for some constant β ∗ and all x ∈ B(x ∗ , δ). By multiplying both sides of (11.18) by J (xk )−1 and rearranging, we find that pk + J (xk )−1r (xk ) J (xk )−1 vk ≤ β ∗ ηk r (xk ). (11.19) 11.1. LOCAL ALGORITHMS r (x) J (x)(x − x ∗ ) + w(x, x ∗ ), (11.20) As in (11.10), we have that def where ρ(x) w(x, x ∗ )/x − x ∗ → 0 as x → x ∗ . By reducing δ if necessary, we have from this expression that the following bound holds for all x ∈ B(x ∗ , δ): r (x) ≤ 2J (x ∗ ) x − x ∗ + o(x − x ∗ ) ≤ 4J (x ∗ ) x − x ∗ . (11.21) We now set x xk in (11.20), and use (11.19) and (11.21) to obtain xk + pk − x ∗ pk + J (xk )−1 (r (xk ) − w(xk , x ∗ )) ≤ β ∗ ηk r (xk ) + J (xk )−1 w(xk , x ∗ ) ≤ 4J (x ∗ )β ∗ ηk + β ∗ ρ(xk ) xk − x ∗ . (11.22) By choosing xk close enough to x ∗ that ρ(xk ) ≤ 1/(4β ∗ ), and choosing η 1/(8J (x ∗ )β ∗ ), we have that the term in square brackets in (11.22) is at most 1/2. Hence, since xk+1 xk + pk , this formula indicates Q-linear convergence of {xk } to x ∗ , proving part (i). Part (ii) follows immediately from the fact that the term in brackets in (11.22) goes to zero as xk → x ∗ and ηk → 0. For part (iii), we combine the techniques above with the logic of the second part of the proof of Theorem 11.2. Details are left as an exercise. BROYDEN’S METHOD Secant methods, also known as quasi-Newton methods, do not require calculation of the Jacobian J (x). Instead, they construct their own approximation to this matrix, updating it at each iteration so that it mimics the behavior of the true Jacobian J over the step just taken. The approximate Jacobian, which we denote at iteration k by Bk , is then used to construct a linear model analogous to (11.5), namely Mk ( p) r (xk ) + Bk p. (11.23) We obtain the step by setting this model to zero. When Bk is nonsingular, we have the following explicit formula (cf. (11.6)): pk −Bk−1r (xk ). (11.24) The requirement that the approximate Jacobian should mimic the behavior of the true Jacobian can be specified as follows. Let sk denote the step from xk to xk+1 , and let yk 279 280 CHAPTER 11. NONLINEAR EQUATIONS be the corresponding change in r , that is, sk xk+1 − xk , yk r (xk+1 ) − r (xk ). (11.25) From Theorem 11.1, we have that sk and yk are related by the expression yk 1 J (xk + tsk )sk dt ≈ J (xk+1 )sk + o(sk ). (11.26) 0 We require the updated Jacobian approximation Bk+1 to satisfy the following equation, which is known as the secant equation, yk Bk+1 sk , (11.27) which ensures that Bk+1 and J (xk+1 ) have similar behavior along the direction sk . (Note the similarity with the secant equation (6.6) in quasi-Newton methods for unconstrained optimization; the motivation is the same in both cases.) The secant equation does not say anything about how Bk+1 should behave along directions orthogonal to sk . In fact, we can view (11.27) as a system of n linear equations in n 2 unknowns, where the unknowns are the components of Bk+1 , so for n > 1 the equation (11.27) does not determine all the components of Bk+1 uniquely. (The scalar case of n 1 gives rise to the scalar secant method; see (A.60).) The most successful practical algorithm is Broyden’s method, for which the update formula is Bk+1 Bk + (yk − Bk sk )skT . skT sk (11.28) The Broyden update makes the smallest possible change to the Jacobian (as measured by the Euclidean norm Bk − Bk+1 2 ) that is consistent with (11.27), as we show in the following Lemma. Lemma 11.4 (Dennis and Schnabel [92, Lemma 8.1.1]). Among all matrices B satisfying Bsk yk , the matrix Bk+1 defined by (11.28) minimizes the difference B − Bk . PROOF. Let B be any matrix that satisfies Bsk yk . By the properties of the Euclidean norm (see (A.10)) and the fact that ss T /s T s 1 for any vector s (see Exercise 11.1), we have (yk − Bk sk )skT Bk+1 − Bk skT sk T (B − Bk )sk skT ≤ B − Bk sk sk B − Bk . T T s s s s k k k k 11.1. LOCAL ALGORITHMS Hence, we have that Bk+1 ∈ arg min B : yk Bsk B − Bk , and the result is proved. In the specification of the algorithm below, we allow a line search to be performed along the search direction pk , so that sk αpk for some α > 0 in the formula (11.25). (See below for details about line-search methods.) Algorithm 11.3 (Broyden). Choose x0 and a nonsingular initial Jacobian approximation B0 ; for k 0, 1, 2, . . . Calculate a solution pk to the linear equations Bk pk −r (xk ); (11.29) Choose αk by performing a line search along pk ; xk+1 ← xk + αk pk ; sk ← xk+1 − xk ; yk ← r (xk+1 ) − r (xk ); Obtain Bk+1 from the formula (11.28); end (for) Under certain assumptions, Broyden’s method converges superlinearly, that is, xk+1 − x ∗ o(xk − x ∗ ). (11.30) This local convergence rate is fast enough for most practical purposes, though not as fast as the Q-quadratic convergence of Newton’s method. We illustrate the difference between the convergence rates of Newton’s and Broyden’s method with a small example. The function r : IR2 → IR2 defined by r (x) (x1 + 3)(x23 − 7) + 18 sin(x2 e x1 − 1) (11.31) has a nondegenerate root at x ∗ (0, 1)T . We start both methods from the point x0 (−0.5, 1.4)T , and use the exact Jacobian J (x0 ) at this point as the initial Jacobian approximation B0 . Results are shown in Table 11.1. Newton’s method clearly exhibits Q-quadratic convergence, which is characterized by doubling of the exponent of the error at each iteration. Broyden’s method takes twice as 281 282 CHAPTER 11. NONLINEAR EQUATIONS Table 11.1 Convergence of Iterates in Broyden and Newton Methods Iteration k 0 1 2 3 4 5 6 7 8 xk − x ∗ 2 Broyden Newton 0.64 × 100 0.64 × 100 −1 0.62 × 10 0.62 × 10−1 −3 0.52 × 10 0.21 × 10−3 −3 0.25 × 10 0.18 × 10−7 0.43 × 10−4 0.12 × 10−15 −6 0.14 × 10 0.57 × 10−9 0.18 × 10−11 0.87 × 10−15 Table 11.2 Convergence of Function Norms in Broyden and Newton Methods Iteration k 0 1 2 3 4 5 6 7 8 r (xk )2 Broyden Newton 0.74 × 101 0.74 × 101 0 0.59 × 10 0.59 × 100 −2 0.20 × 10 0.23 × 10−2 −2 0.21 × 10 0.16 × 10−6 0.37 × 10−3 0.22 × 10−15 −5 0.12 × 10 0.49 × 10−8 0.15 × 10−10 0.11 × 10−18 many iterations as Newton’s, and reduces the error at a rate that accelerates slightly towards the end. The function norms r (xk ) approach zero at a similar rate to the iteration errors xk − x ∗ . As in (11.10), we have that r (xk ) r (xk ) − r (x ∗ ) ≈ J (x ∗ )(xk − x ∗ ), so by nonsingularity of J (x ∗ ), the norms of r (xk ) and (xk − x ∗ ) are bounded above and below by multiples of each other. For our example problem (11.31), convergence of the sequence of function norms in the two methods is shown in Table 11.2. The convergence analysis of Broyden’s method is more complicated than that of Newton’s method. We state the following result without proof. Theorem 11.5. Suppose the assumptions of Theorem 11.2 hold. Then there are positive constants and δ such that if the starting point x0 and the starting approximate Jacobian B0 satisfy x0 − x ∗ ≤ δ, B0 − J (x ∗ ) ≤ , (11.32) 11.1. LOCAL ALGORITHMS the sequence {xk } generated by Broyden’s method (11.24), (11.28) is well-defined and converges Q-superlinearly to x ∗ . The second condition in (11.32)—that the initial Jacobian approximation B0 must be close to the true Jacobian at the solution J (x ∗ )—is difficult to guarantee in practice. In contrast to the case of unconstrained minimization, a good choice of B0 can be critical to the performance of the algorithm. Some implementations of Broyden’s method recommend choosing B0 to be J (x0 ), or some finite-difference approximation to this matrix. The Broyden matrix Bk will be dense in general, even if the true Jacobian J is sparse. Therefore, when n is large, an implementation of Broyden’s method that stores Bk as a full n × n matrix may be inefficient. Instead, we can use limited-memory methods in which Bk is stored implicitly in the form of a number of vectors of length n, while the system (11.29) is solved by a technique based on application of the Sherman–Morrison–Woodbury formula (A.28). These methods are similar to the ones described in Chapter 7 for large-scale unconstrained optimization. TENSOR METHODS In tensor methods, the linear model Mk ( p) used by Newton’s method (11.5) is augmented with an extra term that aims to capture some of the nonlinear, higher-order, behavior of r . By doing so, it achieves more rapid and reliable convergence to degenerate roots, in particular, to roots x ∗ for which the Jacobian J (x ∗ ) has rank n − 1 or n − 2. We give a broad outline of the method here, and refer to Schnabel and Frank [277] for details. We use M̂k ( p) to denote the model function on which tensor methods are based; this function has the form M̂k ( p) r (xk ) + J (xk ) p + 12 Tk pp, (11.33) where Tk is a tensor defined by n 3 elements (Tk )i jl whose action on a pair of arbitrary vectors u and v in IRn is defined by (Tk uv)i n n (Tk )i jl u j vl . j1 l1 If we followed the reasoning behind Newton’s method, we could consider building Tk from the second derivatives of r at the point xk , that is, (Tk )i jl [∇ 2ri (xk )] jl . 283 284 CHAPTER 11. NONLINEAR EQUATIONS For instance, in the example (11.31), we have that (T (x)uv)1 u ∇ r1 (x)v u T 2 T 0 3x22 3x22 6x2 (x1 + 3) v 3x22 (u 1 v2 + u 2 v1 ) + 6x2 (x1 + 3)u 2 v2 . However, use of the exact second derivatives is not practical in most instances. If we were to store this information explicitly, about n 3 /2 memory locations would be needed, about n times the requirements of Newton’s method. Moreover, there may be no vector p for which M̂k ( p) 0, so the step may not even be defined. Instead, the approach described in [277] defines Tk in a way that requires little additional storage, but which gives M̂k some potentially appealing properties. Specifically, Tk is chosen so that M̂k ( p) interpolates the function r (xk + p) at some previous iterates visited by the algorithm. That is, we require that M̂k (xk− j − xk ) r (xk− j ), for j 1, 2, . . . , q, (11.34) for some integer q > 0. By substituting from (11.33), we see that Tk must satisfy the condition 1 Ts s 2 k jk jk r (xk− j ) − r (xk ) − J (xk )s jk , where def s jk xk− j − xk , j 1, 2, . . . , q. In [277] it is shown that this condition can be ensured by choosing Tk so that its action on arbitrary vectors u and v is Tk uv q a j (s Tjk u)(s Tjk v), j1 where a j , j 1, 2, . . . , q, are vectors of length n. The number of interpolating points q √ is typically chosen to be quite modest, usually less than n. This Tk can be stored in 2nq locations, which contain the vectors a j and s jk for j 1, 2, . . . , q. Note the connection between this idea and Broyden’s method, which also chooses information in the model (albeit in the first-order part of the model) to interpolate the function value at the previous iterate. This technique can be refined in various ways. The points of interpolation can be chosen to make the collection of directions s jk more linearly independent. There may still not be a vector p for which M̂k ( p) 0, but we can instead take the step to be the vector that 11.2. PRACTICAL METHODS minimizes M̂k ( p)22 , which can be found by using a specialized least-squares technique. There is no assurance that the step obtained in this way is a descent direction for the merit function 12 r (x)2 (which is discussed in the next section), and in this case it can be replaced by the standard Newton direction −Jk−1 rk . 11.2 PRACTICAL METHODS We now consider practical variants of the Newton-like methods discussed above, in which line-search and trust-region modifications to the steps are made in order to ensure better global convergence behavior. MERIT FUNCTIONS As mentioned above, neither Newton’s method (11.6) nor Broyden’s method (11.24), (11.28) with unit step lengths can be guaranteed to converge to a solution of r (x) 0 unless they are started close to that solution. Sometimes, components of the unknown or function vector or the Jacobian will blow up. Another, more exotic, kind of behavior is cycling, where the iterates move between distinct regions of the parameter space without approaching a root. An example is the scalar function r (x) −x 5 + x 3 + 4x, which has five nondegenerate roots. When started from the point x0 1, Newton’s method produces a sequence of iterates that oscillates between 1 and −1 (see Exercise 11.3) without converging to any of the roots. The Newton and Broyden methods can be made more robust by using line-search and trust-region techniques similar to those described in Chapters 3 and 4. Before describing these techniques, we need to define a merit function, which is a scalar-valued function of x that indicates whether a new iterate is better or worse than the current iterate, in the sense of making progress toward a root of r . In unconstrained optimization, the objective function f is itself a natural merit function; most algorithms for minimizing f require a decrease in f at each iteration. In nonlinear equations, the merit function is obtained by combining the n components of the vector r in some way. The most widely used merit function is the sum of squares, defined by f (x) 12 r (x)2 1 2 n ri2 (x). (11.35) i1 (The factor 1/2 is introduced for convenience.) Any root x ∗ of r obviously has f (x ∗ ) 0, and since f (x) ≥ 0 for all x, each root is a minimizer of f . However, local minimizers of f are not roots of r if f is strictly positive at the point in question. Still, the merit function 285 286 CHAPTER 11. NONLINEAR EQUATIONS 6 5 4 3 2 1 0 −3 Figure 11.2 −2 −1 0 1 2 3 Plot of 12 [sin(5x) − x]2 , showing its many local minima. (11.35) has been used successfully in many applications and is implemented in a number of software packages. The merit function for the example (11.3) is plotted in Figure 11.2. It shows three local minima corresponding to the three roots, but there are many other local minima (for example, those at around ±1.53053). Local minima like these that are not roots of f satisfy an interesting property. Since ∇ f (x ∗ ) J (x ∗ )T r (x ∗ ) 0, (11.36) we can have r (x ∗ ) 0 only if J (x ∗ ) is singular. Since local minima for the sum-of-squares merit function may be points of attraction for the algorithms described in this section, global convergence results for the algorithms discussed here are less satisfactory than for similar algorithms applied to unconstrained optimization. Other merit functions are also used in practice. One such is the 1 norm merit function defined by f 1 (x) r (x)1 m |ri (x)|. i1 This function is studied in Chapters 17 and 18 in the context of algorithms for constrained optimization. 11.2. PRACTICAL METHODS LINE SEARCH METHODS We can obtain algorithms with global convergence properties by applying the linesearch approach of Chapter 3 to the sum-of-squares merit function f (x) 12 r (x)2 . When it is well defined, the Newton step J (xk ) pk −r (xk ) (11.37) is a descent direction for f (·) whenever rk 0, since pkT ∇ f (xk ) − pkT JkT rk −rk 2 < 0. (11.38) Step lengths αk are chosen by one of the procedures of Chapter 3, and the iterates are defined by the formula xk+1 xk + αk pk , k 0, 1, 2, . . . . (11.39) For the case of line searches that choose αk to satisfy the Wolfe conditions (3.6), we have the following convergence result, which follows directly from Theorem 3.2. Theorem 11.6. Suppose that J (x) is Lipschitz continuous in a neighborhood D of the level set L {x : f (x) ≤ f (x0 )}, and that J (x) and r (x) are bounded above on D. Suppose that a line-search algorithm (11.39) is applied to f , where the search directions pk satisfy pkT ∇ f k < 0 while the step lengths αk satisfy the Wolfe conditions (3.6). Then we have that the Zoutendijk condition holds, that is, cos2 θk JkT rk 2 < ∞, k≥0 where cos θk − pkT ∇ f (xk ) . pk ∇ f (xk ) (11.40) We omit the proof, which verifies that ∇ f is Lipschitz continuous on D and that f is bounded below (by 0) on D, and then applies Theorem 3.2. Provided that the sequence of iterates satisfies cos θk ≥ δ, for some δ ∈ (0, 1) and all k sufficiently large, (11.41) Theorem 11.6 guarantees that JkT rk → 0, meaning that the iterates approach stationarity of the merit function f . Moreover, if we know that J (xk )−1 is bounded then we must have rk → 0. 287 288 CHAPTER 11. NONLINEAR EQUATIONS We now investigate the values of cos θk for the directions generated by the Newton and inexact Newton methods. From (11.40) and (11.38), we have for the exact Newton step (11.6) that cos θk − pkT ∇ f (xk ) rk 2 1 1 . ≥ −1 pk ∇ f (xk ) κ(Jk ) Jk rk JkT rk JkT Jk−1 (11.42) When pk is an inexact Newton direction—that is, one that satisfies the condition (11.17)—we have that rk + Jk pk 2 ≤ ηk2 rk 2 ⇒ 2 pkT JkT rk + rk 2 + Jk pk 2 ≤ η2 rk 2 ⇒ pkT ∇ f k pkT JkT rk ≤ [(η2 − 1)/2]rk 2 . Meanwhile, pk ≤ Jk−1 [rk + Jk pk + rk ] ≤ Jk−1 (η + 1)rk , and ∇ f k JkT rk ≤ Jk rk . By combining these estimates, we obtain cos θk − pkT ∇ f k 1 − η2 1−η ≥ . ≥ −1 pk ∇ f k 2κ(J 2Jk Jk (1 + η) k) We conclude that a bound of the form (11.41) is satisfied both for the exact and inexact Newton methods, provided that the condition number κ(Jk ) is bounded. When κ(Jk ) is large, however, this lower bound is close to zero, and use of the Newton direction may cause poor performance of the algorithm. In fact, the following example shows that condition cos θk can converge to zero, causing the algorithm to fail. This example highlights a fundamental weakness of the line-search approach. ❏ EXAMPLE 11.2 (POWELL [241]) Consider the problem of finding a solution of the nonlinear system ⎡ r (x) ⎣ x1 ⎤ ⎦, 10x1 + 2x22 (x1 + 0.1) (11.43) 11.2. PRACTICAL METHODS with unique solution x ∗ 0. We try to solve this problem using the Newton iteration (11.37), (11.39) where αk is chosen to minimize f along pk . It is proved in [241] that, starting from the point (3, 1)T , the iterates converge to (1.8016, 0)T (to four digits of accuracy). However, this point is not a solution of (11.43). In fact, it is not even a stationary point of f , and a step from this point in the direction −∇ f will produce a decrease in both components of r . To verify these claims, note that the Jacobian of r , which is ⎡ 1 J (x) ⎣ 1 (x1 + 0.1)2 0 4x2 ⎤ ⎦, is singular at all x for which x2 0. For such points, we have ⎡ ∇ f (x) ⎣ x1 + ⎤ 10x1 (x1 + 0.1)3 ⎦ , 0 so that the gradient points in the direction of the positive x1 axis whenever x1 > 0. The point (1.8016, 0)T is therefore not a stationary point of f . For this example, a calculation shows that the Newton step generated from an iterate that is close to (but not quite on) the x1 axis tends to be parallel to the x2 axis, making it nearly orthogonal to the gradient ∇ f (x). That is, cos θk for the Newton direction may be arbitrarily close to zero. ❐ In this example, a Newton method with exact line searches is attracted to a point of no interest at which the Jacobian is singular. Since systems of nonlinear equations often contain singular points, this behavior gives cause for concern. To prevent this undesirable behavior and ensure that (11.41) holds, we may have to modify the Newton direction. One possibility is to add some multiple λk I of the identity to JkT Jk , and define the step pk to be pk −(JkT Jk + λk I )−1 JkT rk . (11.44) For any λk > 0 the matrix in parentheses is nonsingular, and if λk is bounded away from zero, a condition of the form (11.41) is satisfied. Therefore, some practical algorithms choose λk adaptively to ensure that the matrix in (11.44) does not approach singularity. This approach is analogous to the classical Levenberg-Marquardt algorithm discussed in Chapter 10. To implement it without forming JkT Jk explicitly and performing trial Cholesky factorizations of the matrices (JkT Jk + λI ), we can use the technique (10.36) illustrated earlier for the least-squares case. This technique uses the fact that the Cholesky factor of (JkT Jk + λI ) is 289 290 CHAPTER 11. NONLINEAR EQUATIONS identical to R T , where R is the upper triangular factor from the QR factorization of the matrix Jk √ . (11.45) λI A combination of Householder and Givens transformations can be used, as for (10.36), and the savings noted in the discussion following (10.36) continue to hold if we need to perform this calculation for several candidate values of λk . The drawback of this Levenberg-Marquardt approach is that it is difficult to choose λk . If too large, we can destroy the fast rate of convergence of Newton’s method. (Note that pk approaches a multiple of −JkT rk as λk ↑ ∞, so the step becomes small and tends to point in the steepest-descent direction for f .) If λk is too small, the algorithm can be inefficient in the presence of Jacobian singularities. A more satisfactory approach is to follow the trust-region approach described below, which chooses λk indirectly. We conclude by specifying an algorithm based on Newton-like steps and line searches that regularizes the step calculations where necessary. Several details are deliberately left vague; we refer the reader to the papers cited above for details. Algorithm 11.4 (Line Search Newton-like Method). Given c1 , c2 with 0 < c1 < c2 < 12 ; Choose x0 ; for k 0, 1, 2, . . . Calculate a Newton-like step from (11.6) (regularizing with (11.44) if Jk appears to be near-singular), or (11.17) or (11.24); if α 1 satisfies the Wolfe conditions (3.6) Set αk 1; else Perform a line search to find αk > 0 that satisfies (3.6); end (if) xk+1 ← xk + αk pk ; end (for) TRUST-REGION METHODS The most widely used trust-region methods for nonlinear equations simply apply Algorithm 4.1 from Chapter 4 to the merit function f (x) 12 r (x)22 , using Bk J (xk )T J (xk ) as the approximate Hessian in the model function m k ( p), which is defined as follows: m k ( p) 12 rk + Jk p22 f k + p T JkT rk + 12 p T JkT Jk pk . 11.2. PRACTICAL METHODS The step pk is generated by finding an approximate solution of the subproblem min m k ( p), p subject to p ≤ k , (11.46) where k is the radius of the trust region. The ratio ρk of actual to predicted reduction (see (4.4)), which plays a critical role in many trust-region algorithms, is therefore ρk r (xk )2 − r (xk + pk )2 . r (xk )2 − r (xk ) + J (xk ) pk 2 (11.47) We can state the trust-region framework that results from this model as follows. Algorithm 11.5 (Trust-Region Method for Nonlinear Equations). ¯ > 0, 0 ∈ (0, ), ¯ and η ∈ 0, 1 : Given 4 for k 0, 1, 2, . . . Calculate pk as an (approximate) solution of (11.46); Evaluate ρk from (11.47); if ρk < 14 k+1 14 pk ; else if ρk > 34 and pk k ¯ k+1 min(2k , ); else k+1 k ; end (if) end (if) if ρk > η xk+1 xk + pk ; else xk+1 xk ; end (if) end (for). The dogleg method is a special case of the trust-region algorithm, Algorithm 4.1, that constructs an approximate solution to (11.46) based on the Cauchy point pkC and the unconstrained minimizer of m k . The Cauchy point is pkC −τk (k /JkT rk )JkT rk , (11.48) 2 3 τk min 1, JkT rk 3 /(k rkT Jk (JkT Jk )JkT rk ) ; (11.49) where 291 292 CHAPTER 11. NONLINEAR EQUATIONS By comparing with the general definition (4.11), (4.12) we see that it is not necessary to consider the case of an indefinite Hessian approximation in m k ( p), since the model Hessian JkT Jk that we use is positive semidefinite. The unconstrained minimizer of m k ( p) is unique when Jk is nonsingular. In this case, we denote it by pkJ and write pkJ −(JkT Jk )−1 (JkT rk ) −Jk−1 rk . The selection of pk in the dogleg method proceeds as follows. Procedure 11.6 (Dogleg). Calculate pkC ; if pkC k pk ← pkC ; else Calculate pkJ ; pk ← pkC + τ ( pkJ − pkC ), where τ is the largest value in [0, 1] such that pk ≤ k ; end (if). Lemma 4.2 shows that when Jk is nonsingular, the vector pk chosen above is the minimizer of m k along the piecewise linear path that leads from the origin to the Cauchy point and then to the unconstrained minimizer pkJ . Hence, the reduction in model function at least matches the reduction obtained by the Cauchy point, which can be estimated by specializing the bound (4.20) to the least-squares case by writing J T rk , m k (0) − m k ( pk ) ≥ c1 JkT rk min k , kT Jk Jk (11.50) where c1 is some positive constant. From Theorem 4.1, we know that the exact solution of (11.46) has the form pk −(JkT Jk + λk I )−1 JkT rk , (11.51) for some λk ≥ 0, and that λk 0 if the unconstrained solution pkJ satisfies pkJ ≤ k . (Note that (11.51) is identical to the formula (10.34a) from Chapter 10. In fact, the Levenberg– Marquardt approach for nonlinear equations is a special case of the same algorithm for nonlinear least-squares problems.) The Levenberg–Marquardt algorithm uses the techniques of Section 4.3 to search for the value of λk that satisfies (11.51). The procedure described in the “exact” trust-region algorithm, Algorithm 4.3, is based on Cholesky factorizations, but as in Chapter 10, we can replace these by specialized algorithms to compute the QR factorization of the matrix (11.45). Even if the exact λk corresponding to the solution of (11.46) is not found, the pk calculated from (11.51) will still yield global convergence if it 11.2. PRACTICAL METHODS satisfies the condition (11.50) for some value of c1 , together with pk ≤ γ k , for some constant γ ≥ 1. (11.52) The dogleg method requires just one linear system to be solved per iteration, whereas methods that search for the exact solution of (11.46) require several such systems to be solved. As in Chapter 4, there is a tradeoff to be made between the amount of effort to spend on each iteration and the total number of function and derivative evaluations required. We can also consider alternative trust-region approaches that are based on different merit functions and different definitions of the trust region. An algorithm based on the 1 merit function with an ∞ -norm trust region gives rise to subproblems of the form min Jk p + rk 1 p subject to p∞ ≤ , (11.53) which can be formulated and solved using linear programming techniques. This approach is closely related to the S1 QP and SLQP approaches for nonlinear programming discussed in Section 18.5. Global convergence results of Algorithm 11.5 when the steps pk satisfy (11.50) and (11.52) are given in the following theorem, which can be proved by referring directly to Theorems 4.5 and 4.6. The first result is for η 0, in which the algorithm accepts all steps that produce a decrease in the merit function f k , while the second (stronger) result requires a strictly positive choice of η. Theorem 11.7. Suppose that J (x) is Lipschitz continuous and that J (x) is bounded above in a neighborhood D of the level set L {x : f (x) ≤ f (x0 )}. Suppose in addition that all approximate solutions of (11.46) satisfy the bounds (11.50) and (11.52). Then if η 0 in Algorithm 11.5, we have that lim inf JkT rk 0, k→∞ while if η ∈ 0, 14 , we have lim JkT rk 0. k→∞ We turn now to local convergence of the trust-region algorithm for the case in which the subproblem (11.46) is solved exactly. We assume that the sequence {xk } converges to a nondegenerate solution x ∗ of the nonlinear equations r (x) 0. The significance of this result is that the algorithmic enhancements needed for global convergence do not, in well-designed algorithms, interfere with the fast local convergence properties described in Section 11.1. 293 294 CHAPTER 11. NONLINEAR EQUATIONS Theorem 11.8. Suppose that the sequence {xk } generated by Algorithm 11.5 converges to a nondegenerate solution x ∗ of the problem r (x) 0. Suppose also that J (x) is Lipschitz continuous in an open neighborhood D of x ∗ and that the trust-region subproblem (11.46) is solved exactly for all sufficiently large k. Then the sequence {xk } converges quadratically to x ∗ . PROOF. We prove this result by showing that there is an index K such that the trust-region radius is not reduced further after iteration K ; that is, k ≥ K for all k ≥ K . We then show that the algorithm eventually takes the pure Newton step at every iteration, so that quadratic convergence follows from Theorem 11.2. Let pk denote the exact solution of (11.46). Note first that pk will simply be the unconstrained Newton step −Jk−1 rk whenever this step satisfies the trust-region bound. Otherwise, we have Jk−1 rk > k , while the solution pk satisfies pk ≤ k . In either case, we have pk ≤ Jk−1 rk . (11.54) We consider the ratio ρk of actual to predicted reduction defined by (11.47). We have directly from the definition that rk + Jk pk 2 − r (xk + pk )2 . |1 − ρk | ≤ r (xk )2 − r (xk ) + J (xk ) pk 2 (11.55) From Theorem 11.1, we have for the second term in the numerator that r (xk + pk )2 [r (xk ) + J (xk ) pk ] + w(xk , xk + pk )2 , (11.56) where w(·, ·) is defined as in (11.11). Because of Lipschitz continuity of J with Lipschitz constant β L (11.7), we have 1 w(xk , xk + pk ) ≤ J (xk + t pk ) − J (xk ) pk dt 0 1 ≤ β L pk 2 dt (β L /2) pk 2 , 0 so that using (11.56) and the fact that rk + Jk pk ≤ rk f (xk )1/2 (since pk is the solution of (11.46)), we can bound the numerator as follows: rk + Jk pk 2 − r (xk + pk )2 ≤ 2rk + Jk pk w(xk , xk + pk ) + w(xk , xk + pk )2 ≤ f (xk )1/2 β L pk 2 + (β L /2)2 pk 4 ≤ (xk ) pk 2 , (11.57) 11.2. PRACTICAL METHODS where we define (xk ) f (xk )1/2 β L + (β L /2)2 pk 2 . Since xk → x ∗ by assumption, it follows that f (xk ) → 0 and rk → 0. Because x ∗ is a nondegenerate root, we have as in (11.14) that J (xk )−1 ≤ β ∗ for all k sufficiently large, so from (11.54), we have pk ≤ Jk−1 rk ≤ β ∗ rk → 0. (11.58) Hence, (xk ) → 0. Turning now to the denominator of (11.55), we define p̄k to be a step of the same length as the solution pk in the Newton direction −Jk−1rk , that is, p̄k − pk −1 J rk . Jk−1rk k Since p̄k is feasible for (11.46), and since pk is optimal for this subproblem, we have rk − rk + Jk pk ≥ rk − rk − 2 2 2 2 pk rk −1 Jk rk pk pk 2 rk 2 − −1 2 rk 2 −1 Jk rk Jk rk pk ≥ rk 2 , Jk−1 rk 2 where for the last inequality we have used (11.54). By using (11.58) again, we have from this bound that rk 2 − rk + Jk pk 2 ≥ pk 1 rk 2 ≥ ∗ pk rk . β Jk−1rk (11.59) By substituting (11.57) and (11.59) into (11.55), and then applying (11.58) again, we have |1 − ρk | ≤ β ∗ (xk ) pk 2 ≤ (β ∗ )2 (xk ) → 0. pk rk (11.60) Therefore, for all k sufficiently large, we have ρk > 14 , and so the trust region radius k will not be increased beyond this point. As claimed, there is an index K such that k ≥ K , for all k ≥ K . 295 296 CHAPTER 11. NONLINEAR EQUATIONS Since Jk−1rk ≤ β ∗ rk → 0, the Newton step −Jk−1 rk will eventually be smaller than K (and hence k ), so it will eventually always be accepted as the solution of (11.46). The result now follows from Theorem 11.2. We can replace the assumption that xk → x ∗ with an assumption that the nondegenerate solution x ∗ is just one of the limit points of the sequence. (In fact, this condition implies that xk → x ∗ ; see Exercise 11.9.) 11.3 CONTINUATION/HOMOTOPY METHODS MOTIVATION We mentioned above that Newton-based methods all suffer from one shortcoming: Unless J (x) is nonsingular in the region of interest—a condition that often cannot be guaranteed—they are in danger of converging to a local minimum of the merit function rather that is not a solution of the nonlinear system. Continuation methods, which we outline in this section, are more likely to converge to a solution of r (x) 0 in difficult cases. Their underlying motivation is simple to describe: Rather than dealing with the original problem r (x) 0 directly, we set up an “easy” system of equations for which the solution is obvious. We then gradually transform the easy system into the original system r (x), and follow the solution as it moves from the solution of the easy problem to the solution of the original problem. One simple way to define the so-called homotopy map H (x, λ) is as follows: H (x, λ) λr (x) + (1 − λ)(x − a), (11.61) where λ is a scalar parameter and a ∈ IRn is a fixed vector. When λ 0, (11.61) defines the artificial, easy problem H (x, 0) x − a, whose solution is obviously x a. When λ 1, we have H (x, 1) r (x), the original system of equations. To solve r (x) 0, consider the following algorithm: First, set λ 0 in (11.61) and set x a. Then, increase λ from 0 to 1 in small increments, and for each value of λ, calculate the solution of the system H (x, λ) 0. The final value of x corresponding to λ 1 will solve the original problem r (x) 0. This naive approach sounds plausible, and Figure 11.3 illustrates a situation in which it would be successful. In this figure, there is a unique solution x of the system H (x, λ) 0 for each value of λ in the range [0, 1]. The trajectory of points (x, λ) for which H (x, λ) 0 is called the zero path. Unfortunately, however, the approach often fails, as illustrated in Figure 11.4. Here, the algorithm follows the lower branch of the curve from λ 0 to λ λT , but it then loses the trail unless it is lucky enough to jump to the top branch of the path. The value λT is 11.3. CONTINUATION/HOMOTOPY METHODS x λ 0 Figure 11.3 1 Plot of a zero path: Trajectory of points (x, λ) with H (x, λ) 0. . . (x, λ ) x 0 λ λT 1 Figure 11.4 Zero path with turning points. The path joining (a, 0) to (x ∗ , 1) cannot be followed by increasing λ monotonically from 0 to 1. known as a turning point, since at this point we can follow the path smoothly only if we no longer insist on increasing λ at every step. In fact, practical continuation methods work by doing exactly as Figure 11.4 suggests, that is, they follow the zero path explicitly, even if this means allowing λ to decrease from time to time. PRACTICAL CONTINUATION METHODS In one practical technique, we model the zero path by allowing both x and λ to be functions of an independent variable s that represents arc length along the path. That is, 297 298 CHAPTER 11. NONLINEAR EQUATIONS (x(s), λ(s)) is the point that we arrive at by traveling a distance s along the path from the initial point (x(0), λ(0)) (a, 0). Because we have that H (x(s), λ(s)) 0, for all s ≥ 0, we can take the total derivative of this expression with respect to s to obtain ∂ ∂ H (x, λ)ẋ + H (x, λ)λ̇ 0, ∂x ∂λ where (ẋ, λ̇) d x dλ . , ds ds (11.62) The vector (ẋ(s), λ̇(s)) is the tangent vector to the zero path, as we illustrate in Figure 11.4. From (11.62), we see that it lies in the null space of the n × (n + 1) matrix ∂ H (x, λ) ∂x ∂ H (x, λ) ∂λ . (11.63) When this matrix has full rank, its null space has dimension 1, so to complete the definition of (ẋ, λ̇) in this case, we need to assign it a length and direction. The length is fixed by imposing the normalization condition ẋ(s)2 + |λ̇(s)|2 1, for all s, (11.64) which ensures that s is the true arc length along the path from (0, a) to (x(s), λ(s)). We need to choose the sign to ensure that we keep moving forward along the zero path. A heuristic that works well is to choose the sign so that the tangent vector (ẋ, λ̇) at the current value of s makes an angle of less than π/2 with the tangent point at the previous value of s. We can outline the complete procedure for computing (ẋ, λ̇) as follows: Procedure 11.7 (Tangent Vector Calculation). Compute a vector in the null space of (11.63) by performing a QR factorization with column pivoting, QT ∂ H (x, λ) ∂x ∂ H (x, λ) ∂λ R w where Q is n × n orthogonal, R is n × n upper triangular, is an (n + 1) × (n + 1) permutation matrix, and w ∈ IRn . Set v R −1 w −1 ; , 11.3. CONTINUATION/HOMOTOPY METHODS Set (ẋ, λ̇) ±v/v2 , where the sign is chosen to satisfy the angle criterion mentioned above. Details of the QR factorization procedure are given in the Appendix. Since we can obtain the tangent at any given point (x, λ) and since we know the initial point (x(0), λ(0)) (a, 0), we can trace the zero path by calling a standard initial-value first-order ordinary differential equation solver, terminating the algorithm when it finds a value of s for which λ(s) 1. A second approach for following the zero path is quite similar to the one just described, except that it takes an algebraic viewpoint instead of a differential-equations viewpoint. Given a current point (x, λ), we compute the tangent vector (ẋ, λ̇) as above, and take a small step (of length , say) along this direction to produce a “predictor” point (x P , λ P ); that is, (x P , λ P ) (x, λ) + (ẋ, λ̇). Usually, this new point will not lie exactly on the zero path, so we apply some “corrector” iterations to bring it back to the path, thereby identifying a new iterate (x + , λ+ ) that satisfies H (x + , λ+ ) 0. (This process is illustrated in Figure 11.5.) During the corrections, we choose a component of the predictor step (x P , λ P )—one of the components that has been changing most rapidly during the past few steps—and hold this component fixed during the correction process. If the index of this component is i, and if we use a pure Newton corrector process (often adequate, since (x P , λ P ) is usually quite close to the target point x (x+, λ+) (x, λ ) (x P, λP) λ Figure 11.5 The algebraic predictor–corrector procedure, using λ as the fixed variable in the correction process. 299 300 CHAPTER 11. NONLINEAR EQUATIONS (x + , λ+ )), the steps will have the form ⎡ ∂H ⎣ ∂x ⎤ ∂H δx −H , ∂λ ⎦ δλ 0 ei where the quantities ∂ H/∂ x, ∂ H/∂λ, and H are evaluated at the latest point of the corrector process. The last row of this system serves to fix the ith component of (δx, δλ) at zero; the vector ei ∈ IRn+1 is a vector with n + 1 components containing all zeros, except for a 1 in the location i that corresponds to the fixed component. Note that in Figure 11.5 the λ component is chosen to be fixed on the current iteration. On the following iteration, it may be more appropriate to choose x as the fixed component, as we reach the turning point in λ. The two variants on path-following described above are able to follow curves like those depicted in Figure 11.4 to a solution of the nonlinear system. They rely, however, on the n × (n + 1) matrix in (11.63) having full rank for all (x, λ) along the path, so that the tangent vector is well-defined. The following result shows that full rank is guaranteed under certain assumptions. Theorem 11.9 (Watson [305]). Suppose that r is twice continuously differentiable. Then for almost all vectors a ∈ IRn , there is a zero path emanating from (0, a) along which the n × (n + 1) matrix (11.63) has full rank. If this path is bounded for λ ∈ [0, 1), then it has an accumulation point (x̄, 1) such that r (x̄) 0. Furthermore, if the Jacobian J (x̄) is nonsingular, the zero path between (a, 0) and (x̄, 1) has finite arc length. The theorem assures us that unless we are unfortunate in the choice of a, the algorithms described above can be applied to obtain a path that either diverges or else leads to a point x̄ that is a solution of the original nonlinear system if J (x̄) is nonsingular. More detailed convergence results can be found in Watson [305] and the references therein. We conclude with an example to show that divergence of the zero path—the less desirable outcome of Theorem 11.9—can happen even for innocent-looking problems. ❏ EXAMPLE 11.3 Consider the system r (x) x 2 − 1, for which there are two nondegenerate solutions +1 and −1. Suppose we choose a −2 and attempt to apply a continuation method to the function H (x, λ) λ(x 2 − 1) + (1 − λ)(x + 2) λx 2 + (1 − λ)x + (2 − 3λ), (11.65) obtained by substituting into (11.61). The zero paths for this function are plotted in Figure 11.6. As can be seen from that diagram, there is no zero path that joins (−2, 0) 11.3. CONTINUATION/HOMOTOPY METHODS 2 0 −2 x −4 −6 −8 −10 −12 0 0.2 0.4 0.6 lambda 0.8 1 Figure 11.6 Zero paths for the example in which H (x, λ) λ(x 2 −1)+(1−λ)(x+2). There is no continuous zero path from λ 0 to λ 1. to either (1, 1) or (−1, 1), so the continuation methods fail on this example. We can find the values of λ for which no solution exists by using the formula for a quadratic root to obtain x −(1 − λ) ± (1 − λ)2 − 4λ(2 − 3λ) . 2λ Now, when the term in the square root is negative, the corresponding values of x are complex, that is, there are no real roots x. It is easy to verify that such is the case when λ∈ √ √ 5−2 3 5+2 3 , ≈ (0.118, 0.651). 13 13 Note that the zero path starting from (−2, 0) becomes unbounded, which is one of the possible outcomes of Theorem 11.9. ❐ This example indicates that continuation methods may fail to produce a solution even to a fairly simple system of nonlinear equations. However, it is generally true that they are more reliable than the merit-function methods described earlier in the chapter. The extra robustness comes at a price, since continuation methods typically require significantly more computational effort than the merit-function methods. 301 302 CHAPTER 11. NONLINEAR EQUATIONS NOTES AND REFERENCES Nonlinear differential equations and integral equations are a rich source of nonlinear equations. When formulated as finite-dimensional nonlinear equations, the unknown vector x is a discrete approximation to the (infinite-dimensional) solution. In other applications, the vector x is intrinsically finite-dimensional; it may represent the quantities of materials to be transported between pairs of cities in a distribution network, for instance. In all cases, the equations ri enforce consistency, conservation, and optimality principles in the model. Moré [212] and Averick et al. [10] discuss a number of interesting practical applications. For analysis of the convergence of Broyden’s method, including proofs of Theorem 11.5, see Dennis and Schnabel [92, Chapter 8] and Kelley [177, Chapter 6]. Details on a limited-memory implementation of Broyden’s method are given by Kelley [177, Section 7.3]. Example 11.2 and the algorithm described by Powell [241] have been influential beyond the field of nonlinear equations. The example shows that a line-search method may not be able to achieve sufficient decrease, whereas the Cauchy step in the trust-region approach is designed to guarantee that this condition holds and hence that reasonable convergence properties are guaranteed. The dogleg algorithm proposed in [241] can be viewed as one of the first modern trust-region methods. ✐ EXERCISES ✐ 11.1 Show that for any vector s ∈ IRn , we have T ss s T s 1, where · denotes the Euclidean matrix norm. ✐ 11.2 Consider the function r : IR → IR defined by r (x) x q , where q is an integer greater than 2. Note that x ∗ 0 is the sole root of this function and that it is degenerate. Show that Newton’s method converges Q-linearly, and find the value of the convergence ratio r in (A.34). ✐ 11.3 Show that Newton’s method applied to the function r (x) −x 5 + x 3 + 4x starting from x0 1 produces the cyclic behavior described in the text. Find the roots of this function, and check that they are nondegenerate. ✐ 11.4 For the scalar function r (x) sin(5x) − x, show that the sum-of-squares merit function has infinitely many local minima, and find a general formula for such points. ✐ 11.5 When r : IRn → IRn , show that the function φ(λ) (J T J + λI )−1 J T r 11.3. CONTINUATION/HOMOTOPY METHODS is monotonically decreasing in λ unless J T r 0. (Hint: Use the singular-value decomposition of J .) ✐ 11.6 Prove part (iii) of Theorem 11.3. ✐ 11.7 Consider a line-search Newton method in which the step length αk is chosen to be the exact minimizer of the merit function f (·); that is, αk arg min f (xk − α Jk−1rk ). α Show that if J (x) is nonsingular at the solution x ∗ , then αk → 1 as xk → x ∗ . ✐ 11.8 Let J ∈ IRn×m and r ∈ IRn and suppose that J J T r 0. Show that J T r 0. (Hint: This doesn’t even take one line!) ✐ 11.9 Suppose we replace the assumption of xk → x ∗ in Theorem 11.8 by an assumption that the nondegenerate solution x ∗ is a limit point of x ∗ . By adding some logic to the proof of this result, show that in fact x ∗ is the only possible limit point of the sequence. −1 rk+1 ≤ 12 Jk−1 rk for all k sufficiently large, and hence that for any (Hint: Show that Jk+1 constant > 0, the sequence {xk } satisfies xk − x ∗ ≤ for all k sufficiently large.) ✐ 11.10 Consider the following modification of our example of failure of continuation methods: r (x) x 2 − 1, a 12 . Show that for this example there is a zero path for H (x, λ) λ(x 2 − 1) + (1 − λ)(x − a) that connects ( 12 , 0) to (1, 1), so that continuation methods should work for this choice of starting point. 303 This is pag Printer: O 12 CHAPTER Theory of Constrained Optimization The second part of this book is about minimizing functions subject to constraints on the variables. A general formulation for these problems is minn f (x) x∈IR subject to ci (x) 0, i ∈ E, ci (x) ≥ 0, i ∈ I, (12.1) where f and the functions ci are all smooth, real-valued functions on a subset of IRn , and I and E are two finite sets of indices. As before, we call f the objective function, while ci , CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION i ∈ E are the equality constraints and ci , i ∈ I are the inequality constraints. We define the feasible set to be the set of points x that satisfy the constraints; that is, {x | ci (x) 0, i ∈ E; ci (x) ≥ 0, i ∈ I}, (12.2) so that we can rewrite (12.1) more compactly as min f (x). x∈ (12.3) In this chapter we derive mathematical characterizations of the solutions of (12.3). As in the unconstrained case, we discuss optimality conditions of two types. Necessary conditions are conditions that must be satisfied by any solution point (under certain assumptions). Sufficient conditions are those that, if satisfied at a certain point x ∗ , guarantee that x ∗ is in fact a solution. For the unconstrained optimization problem of Chapter 2, the optimality conditions were as follows: Necessary conditions: Local unconstrained minimizers have ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) positive semidefinite. Sufficient conditions: Any point x ∗ at which ∇ f (x ∗ ) 0 and ∇ 2 f (x ∗ ) is positive definite is a strong local minimizer of f . In this chapter, we derive analogous conditions to characterize the solutions of constrained optimization problems. LOCAL AND GLOBAL SOLUTIONS We have seen already that global solutions are difficult to find even when there are no constraints. The situation may be improved when we add constraints, since the feasible set might exclude many of the local minima and it may be comparatively easy to pick the global minimum from those that remain. However, constraints can also make things more difficult. As an example, consider the problem min (x2 + 100)2 + 0.01x12 , subject to x2 − cos x1 ≥ 0, (12.4) illustrated in Figure 12.1. Without the constraint, the problem has the unique solution (0, −100)T . With the constraint, there are local solutions near the points x (k) (kπ, −1)T , for k ±1, ±3, ±5, . . .. Definitions of the different types of local solutions are simple extensions of the corresponding definitions for the unconstrained case, except that now we restrict consideration to the feasible points in the neighborhood of x ∗ . We have the following definition. 305 306 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION contours of f x (2) x (1) x (3) x (4) x (5) feasible region Figure 12.1 Constrained problem with many isolated local solutions. A vector x ∗ is a local solution of the problem (12.3) if x ∗ ∈ and there is a neighborhood N of x ∗ such that f (x) ≥ f (x ∗ ) for x ∈ N ∩ . Similarly, we can make the following definitions: A vector x ∗ is a strict local solution (also called a strong local solution) if x ∗ ∈ and there is a neighborhood N of x ∗ such that f (x) > f (x ∗ ) for all x ∈ N ∩ with x x ∗ . A point x ∗ is an isolated local solution if x ∗ ∈ and there is a neighborhood N of x ∗ such that x ∗ is the only local solution in N ∩ . Note that isolated local solutions are strict, but that the reverse is not true (see Exercise 12.2). SMOOTHNESS Smoothness of objective functions and constraints is an important issue in characterizing solutions, just as in the unconstrained case. It ensures that the objective function and the constraints all behave in a reasonably predictable way and therefore allows algorithms to make good choices for search directions. We saw in Chapter 2 that graphs of nonsmooth functions contain “kinks" or “jumps” where the smoothness breaks down. If we plot the feasible region for any given constrained optimization problem, we usually observe many kinks and sharp edges. Does this mean that the constraint functions that describe these regions are nonsmooth? The answer is often no, because the nonsmooth boundaries can often be described by a collection of smooth constraint functions. Figure 12.2 shows a diamond-shaped feasible region in IR2 that could be described by the single nonsmooth constraint x1 |x1 | + |x2 | ≤ 1. (12.5) It can also be described by the following set of smooth (in fact, linear) constraints: x1 + x2 ≤ 1, x1 − x2 ≤ 1, −x1 + x2 ≤ 1, −x1 − x2 ≤ 1. (12.6) Each of the four constraints represents one edge of the feasible polytope. In general, the constraint functions are chosen so that each one represents a smooth piece of the boundary of . 12.1. EXAMPLES Figure 12.2 A feasible region with a nonsmooth boundary can be described by smooth constraints. Nonsmooth, unconstrained optimization problems can sometimes be reformulated as smooth constrained problems. An example is the unconstrained minimization of a function f (x) max(x 2 , x), (12.7) which has kinks at x 0 and x 1, and the solution at x ∗ 0. We obtain a smooth, constrained formulation of this problem by adding an artificial variable t and writing min t s.t. t ≥ x, t ≥ x 2. (12.8) Reformulation techniques such as (12.6) and (12.8) are used often in cases where f is a maximum of a collection of functions or when f is a 1-norm or ∞-norm of a vector function. In the examples above we expressed inequality constraints in a slightly different way from the form ci (x) ≥ 0 that appears in the definition (12.1). However, any collection of inequality constraints with ≥ and ≤ and nonzero right-hand-sides can be expressed in the form ci (x) ≥ 0 by simple rearrangement of the inequality. 12.1 EXAMPLES To introduce the basic principles behind the characterization of solutions of constrained optimization problems, we work through three simple examples. The discussion here is informal; the ideas introduced will be made rigorous in the sections that follow. We start by noting one important item of terminology that recurs throughout the rest of the book. 307 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION Definition 12.1. The active set A(x) at any feasible x consists of the equality constraint indices from E together with the indices of the inequality constraints i for which ci (x) 0; that is, A(x) E ∪ {i ∈ I | ci (x) 0}. At a feasible point x, the inequality constraint i ∈ I is said to be active if ci (x) 0 and inactive if the strict inequality ci (x) > 0 is satisfied. A SINGLE EQUALITY CONSTRAINT ❏ EXAMPLE 12.1 Our first example is a two-variable problem with a single equality constraint: min x1 + x2 x12 + x22 − 2 0 s.t. (12.9) (see Figure 12.3). In the language of (12.1), we have f (x) x1 + x2 , I ∅, E {1}, and 2 c1 (x) x12 + x√ 2 − 2. We can see by inspection that the feasible set for this problem is the circle of radius 2 centered at the origin—just the boundary of this circle, not its interior. The solution x ∗ is obviously (−1, −1)T . From any other point on the circle, it is easy to find a way to move that stays feasible √ (that is, remains on the circle) while decreasing f . For instance, from the point x ( 2, 0)T any move in the clockwise direction around the circle has the desired effect. x2 c1 ∆ c1 ∆ f x1 ∆ x* c1 f f ∆ ∆ ∆ ∆ 308 f Figure 12.3 Problem (12.9), showing constraint and function gradients at various feasible points. 12.1. EXAMPLES We also see from Figure 12.3 that at the solution x ∗ , the constraint normal ∇c1 (x ∗ ) is parallel to ∇ f (x ∗ ). That is, there is a scalar λ∗1 (in this case λ∗1 −1/2) such that ∇ f (x ∗ ) λ∗1 ∇c1 (x ∗ ). (12.10) ❐ We can derive (12.10) by examining first-order Taylor series approximations to the objective and constraint functions. To retain feasibility with respect to the function c1 (x) 0, we require any small (but nonzero) step s to satisfy that c1 (x + s) 0; that is, 0 c1 (x + s) ≈ c1 (x) + ∇c1 (x)T s ∇c1 (x)T s. (12.11) Hence, the step s retains feasibility with respect to c1 , to first order, when it satisfies ∇c1 (x)T s 0. (12.12) Similarly, if we want s to produce a decrease in f , we would have so that 0 > f (x + s) − f (x) ≈ ∇ f (x)T s, or, to first order, ∇ f (x)T s < 0. (12.13) Existence of a small step s that satisfies both (12.12) and (12.13) strongly suggests existence of a direction d (where the size of d is not small; we could have d ≈ s/s to ensure that the norm of d is close to 1) with the same properties, namely ∇c1 (x)T d 0 and ∇ f (x)T d < 0. (12.14) If, on the other hand, there is no direction d with the properties (12.14), then is it likely that we cannot find a small step s with the properties (12.12) and (12.13). In this case, x ∗ would appear to be a local minimizer. By drawing a picture, the reader can check that the only way that a d satisfying (12.14) does not exist is if ∇ f (x) and ∇c1 (x) are parallel, that is, if the condition ∇ f (x) λ1 ∇c1 (x) holds at x, for some scalar λ1 . If in fact ∇ f (x) and ∇c1 (x) are not parallel, we can set ∇c1 (x)∇c1 (x)T ∇ f (x); d̄ − I − ∇c1 (x)2 It is easy to verify that this d satisfies (12.14). d d̄ . d̄ (12.15) 309 310 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION By introducing the Lagrangian function L(x, λ1 ) f (x) − λ1 c1 (x), (12.16) and noting that ∇x L(x, λ1 ) ∇ f (x) − λ1 ∇c1 (x), we can state the condition (12.10) equivalently as follows: At the solution x ∗ , there is a scalar λ∗1 such that ∇x L(x ∗ , λ∗1 ) 0. (12.17) This observation suggests that we can search for solutions of the equality-constrained problem (12.9) by seeking stationary points of the Lagrangian function. The scalar quantity λ1 in (12.16) is called a Lagrange multiplier for the constraint c1 (x) 0. Though the condition (12.10) (equivalently, (12.17)) appears to be necessary for an optimal solution of the problem (12.9), it is clearly not sufficient. For instance, in Example 12.1, condition (12.10) is satisfied at the point x (1, 1)T (with λ1 12 ), but this point is obviously not a solution—in fact, it maximizes the function f on the circle. Moreover, in the case of equality-constrained problems, we cannot turn the condition (12.10) into a sufficient condition simply by placing some restriction on the sign of λ1 . To see this, consider replacing the constraint x12 + x22 − 2 0 by its negative 2 − x12 − x22 0 in Example 12.1. The solution of the problem is not affected, but the value of λ∗1 that satisfies the condition (12.10) changes from λ∗1 − 12 to λ∗1 12 . A SINGLE INEQUALITY CONSTRAINT ❏ EXAMPLE 12.2 This is a slight modification of Example 12.1, in which the equality constraint is replaced by an inequality. Consider min x1 + x2 s.t. 2 − x12 − x22 ≥ 0, (12.18) for which the feasible region consists of the circle of problem (12.9) and its interior (see Figure 12.4). Note that the constraint normal ∇c1 points toward the interior of the feasible region at each point on the boundary of the circle. By inspection, we see that the solution is still (−1, −1)T and that the condition (12.10) holds for the value λ∗1 12 . However, this inequality-constrained problem differs from the equality-constrained problem (12.9) of Example 12.1 in that the sign of the Lagrange multiplier plays a significant role, as we now argue. ❐ 12.1. EXAMPLES As before, we conjecture that a given feasible point x is not optimal if we can find a small step s that both retains feasibility and decreases the objective function f to first order. The main difference between problems (12.9) and (12.18) comes in the handling of the feasibility condition. As in (12.13), the step s improves the objective function, to first order, if ∇ f (x)T s < 0. Meanwhile, s retains feasibility if 0 ≤ c1 (x + s) ≈ c1 (x) + ∇c1 (x)T s, so, to first order, feasibility is retained if c1 (x) + ∇c1 (x)T s ≥ 0. (12.19) In determining whether a step s exists that satisfies both (12.13) and (12.19), we consider the following two cases, which are illustrated in Figure 12.4. Case I: Consider first the case in which x lies strictly inside the circle, so that the strict inequality c1 (x) > 0 holds. In this case, any step vector s satisfies the condition (12.19), provided only that its length is sufficiently small. In fact, whenever ∇ f (x) 0, we can obtain a step s that satisfies both (12.13) and (12.19) by setting s −α∇ f (x), f ∆ x ∆ ∆ c1 f s x s Figure 12.4 Improvement directions s from two feasible points x for the problem (12.18) at which the constraint is active and inactive, respectively. 311 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION for any positive scalar α sufficiently small. However, this definition does not give a step s with the required properties when ∇ f (x) 0, (12.20) Case II: Consider now the case in which x lies on the boundary of the circle, so that c1 (x) 0. The conditions (12.13) and (12.19) therefore become ∇ f (x)T s < 0, ∇c1 (x)T s ≥ 0. The first of these conditions defines an open half-space, while the second defines a closed half-space, as illustrated in Figure 12.5. It is clear from this figure that the intersection of these two regions is empty only when ∇ f (x) and ∇c1 (x) point in the same direction, that is, when ∇ f (x) λ1 ∇c1 (x), for some λ1 ≥ 0. (12.21) Note that the sign of the multiplier is significant here. If (12.10) were satisfied with a negative value of λ1 , then ∇ f (x) and ∇c1 (x) would point in opposite directions, and we see from Figure 12.5 that the set of directions that satisfy both (12.13) and (12.19) would make up an entire open half-plane. ∆ ∆ 312 f c1 Any d in this cone is a good search direction, to first order Figure 12.5 A direction d that satisfies both (12.13) and (12.19) lies in the intersection of a closed half-plane and an open half-plane. 12.1. EXAMPLES The optimality conditions for both cases I and II can again be summarized neatly with reference to the Lagrangian function L defined in (12.16). When no first-order feasible descent direction exists at some point x ∗ , we have that ∇x L(x ∗ , λ∗1 ) 0, for some λ∗1 ≥ 0, (12.22) where we also require that λ∗1 c1 (x ∗ ) 0. (12.23) Condition (12.23) is known as a complementarity condition; it implies that the Lagrange multiplier λ1 can be strictly positive only when the corresponding constraint c1 is active. Conditions of this type play a central role in constrained optimization, as we see in the sections that follow. In case I, we have that c1 (x ∗ ) > 0, so (12.23) requires that λ∗1 0. Hence, (12.22) reduces to ∇ f (x ∗ ) 0, as required by (12.20). In case II, (12.23) allows λ∗1 to take on a nonnegative value, so (12.22) becomes equivalent to (12.21). TWO INEQUALITY CONSTRAINTS ❏ EXAMPLE 12.3 Suppose we add an extra constraint to the problem (12.18) to obtain min x1 + x2 s.t. 2 − x12 − x22 ≥ 0, x2 ≥ 0, (12.24) for which the feasible√ region is the half-disk illustrated in Figure 12.6. It is easy to see that the solution lies at (− 2, 0)T , a point at which both constraints are active. By repeating the arguments for the previous examples, we would expect a direction d of first-order feasible descent to satisfy ∇ci (x)T d ≥ 0, i ∈ I {1, 2}, ∇ f (x)T d < 0. (12.25) √ However, it is clear from Figure 12.6 that no such direction can exist when x (− 2, 0)T . The conditions ∇ci (x)T d ≥ 0, i 1, 2, are both satisfied only if d lies in the quadrant defined by ∇c1 (x) and ∇c2 (x), but it is clear by inspection that all vectors d in this quadrant satisfy ∇ f (x)T d ≥ 0. Let us see how the √ Lagrangian and its derivatives behave for the problem (12.24) and the solution point (− 2, 0)T . First, we include an additional term λi ci (x) in the Lagrangian for each additional constraint, so the definition of L becomes L(x, λ) f (x) − λ1 c1 (x) − λ2 c2 (x), 313 CHAPTER 12. ∆ THEORY OF CONSTRAINED OPTIMIZATION c2 ∆ f ∆ 314 Figure 12.6 Problem (12.24), illustrating the gradients of the active constraints and objective at the solution. c1 where λ (λ1 , λ2 )T is the vector of Lagrange multipliers. The extension of condition (12.22) to this case is ∇x L(x ∗ , λ∗ ) 0, for some λ∗ ≥ 0, (12.26) where the inequality λ∗ ≥ 0 means that all components of λ∗ are required to be nonnegative. By applying the complementarity condition (12.23) to both inequality constraints, we obtain λ∗1 c1 (x ∗ ) 0, λ∗2 c2 (x ∗ ) 0. (12.27) √ When x ∗ (− 2, 0)T , we have ∇ f (x ∗ ) 1 1 , ∇c1 (x ∗ ) √ 2 2 0 , ∇c2 (x ∗ ) 0 1 , so that it is easy to verify that ∇x L(x ∗ , λ∗ ) 0 when we select λ∗ as follows: ∗ λ √ 1/(2 2) 1 . Note that both components of λ∗ are positive, so that (12.26) is satisfied. We consider now some other feasible points that are not solutions of (12.24), and examine the properties of the √Lagrangian and its gradient at these points. For the point x ( 2, 0)T , we again have that both constraints are active (see Figure 12.7). However, it s easy to identify vectors d that satisfies (12.25): d (−1, 0)T is one such vector (there are many others). For this value of √ x it is easy to verify that the condition ∇x L(x, λ) 0 is satisfied only when λ (−1/(2 2), 1)T . Note that the first component λ1 is negative, so that the conditions (12.26) are not satisfied at this point. Finally, we consider the point x (1, 0)T , at which only the second constraint c2 is active. Since any small step s away from this point will continue to satisfy c1 (x + s) > 0, we need to consider only the behavior of c2 and f in determining whether s is indeed a feasible 12.2. TANGENT CONE AND CONSTRAINT QUALIFICATIONS c2 f ∆ ∆ ∆ c1 Figure 12.7 Problem (12.24), illustrating the gradients of the active constraints and objective at a nonoptimal point. descent step. Using the same reasoning as in the earlier examples, we find that the direction of feasible descent d must satisfy ∇c2 (x)T d ≥ 0, ∇ f (x)T d < 0. (12.28) By noting that ∇ f (x) 1 1 , ∇c2 (x) 0 1 , T it is easy to verify that the vector d − 12 , 14 satisfies (12.28) and is therefore a descent direction. To show that optimality conditions (12.26) and (12.27) fail, we note first from (12.27) that since c1 (x) > 0, we must have λ1 0. Therefore, in trying to satisfy ∇x L(x, λ) 0, we are left to search for a value λ2 such that ∇ f (x) − λ2 ∇c2 (x) 0. No such λ2 exists, and thus this point fails to satisfy the optimality conditions. ❐ 12.2 TANGENT CONE AND CONSTRAINT QUALIFICATIONS In this section we define the tangent cone T (x ∗ ) to the closed convex set at a point x ∗ ∈ , and also the set F(x ∗ ) of first-order feasible directions at x ∗ . We also discuss constraint qualifications. In the previous section, we determined whether or not it was possible to take a feasible descent step away from a given feasible point x by examining the first derivatives of f and the constraint functions ci . We used the first-order Taylor series expansion of these functions about x to form an approximate problem in which both objective and constraints are linear. This approach makes sense, however, only when the linearized approximation captures the essential geometric features of the feasible set near the point x in question. If, near x, the linearization is fundamentally different from the 315 316 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION feasible set (for instance, it is an entire plane, while the feasible set is a single point) then we cannot expect the linear approximation to yield useful information about the original problem. Hence, we need to make assumptions about the nature of the constraints ci that are active at x to ensure that the linearized approximation is similar to the feasible set, near x. Constraint qualifications are assumptions that ensure similarity of the constraint set and its linearized approximation, in a neighborhood of x ∗ . Given a feasible point x, we call {z k } a feasible sequence approaching x if z k ∈ for all k sufficiently large and z k → x. Later, we characterize a local solution of (12.1) as a point x at which all feasible sequences approaching x have the property that f (z k ) ≥ f (x) for all k sufficiently large, and we will derive practical, verifiable conditions under which this property holds. We lay the groundwork in this section by characterizing the directions in which we can step away from x while remaining feasible. A tangent is a limiting direction of a feasible sequence. Definition 12.2. The vector d is said to be a tangent (or tangent vector) to at a point x if there are a feasible sequence {z k } approaching x and a sequence of positive scalars {tk } with tk → 0 such that lim k→∞ zk − x d. tk (12.29) The set of all tangents to at x ∗ is called the tangent cone and is denoted by T (x ∗ ). It is easy to see that the tangent cone is indeed a cone, according to the definition (A.36). If d is a tangent vector with corresponding sequences {z k } and {tk }, then by replacing each tk by α −1 tk , for any α > 0, we find that αd ∈ T (x ∗ ) also. We obtain that 0 ∈ T (x) by setting z k ≡ x in the definition of feasible sequence. We turn now to the linearized feasible direction set, which we define as follows. Definition 12.3. Given a feasible point x and the active constraint set A(x) of Definition 12.1, the set of linearized feasible directions F(x) is d T ∇ci (x) 0, F(x) d T d ∇ci (x) ≥ 0, for all i ∈ E, for all i ∈ A(x) ∩ I . As with the tangent cone, it is easy to verify that F(x) is a cone, according to the definition (A.36). It is important to note that the definition of tangent cone does not rely on the algebraic specification of the set , only on its geometry. The linearized feasible direction set does, however, depend on the definition of the constraint functions ci , i ∈ E ∪ I. 12.2. TANGENT CONE AND CONSTRAINT QUALIFICATIONS c1 feasible sequence zk _ f Figure 12.8 Constraint normal, objective gradient, and feasible sequence for problem (12.9). tangent d We illustrate the tangent cone and the linearized feasible direction set by revisiting Examples 12.1 and 12.2. ❏ EXAMPLE 12.4 (EXAMPLE 12.1, REVISITED) Figure 12.8 shows the problem (12.9), the equality-constrained problem in which the √ √ feasible set is a circle of radius 2, near the nonoptimal point x (− 2, 0)T . The figure also shows a feasible sequence approaching x. This sequence could be defined analytically by the formula zk − 2 − 1/k 2 −1/k . (12.30) By choosing tk z k − x, we find that d (0, −1)T is a tangent. Note that the objective function f (x) x1 + x2 increases as we move along the sequence (12.30); in fact, we have f (z k+1 ) > f (z k ) for all k 2, 3, . . .. It follows that f (z k ) < f (x) for k 2, 3, . . ., so x cannot be a solution of (12.9). √ Another feasible sequence is one that approaches x (− 2, 0)T from the opposite direction. Its elements are defined by zk − 2 − 1/k 2 1/k . It is easy to show that f decreases along this sequence and that the tangents corresponding √ to this sequence are d (0, α)T . In summary, the tangent cone at x (− 2, 0)T is {(0, d2 )T | d2 ∈ IR}. 317 318 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION For the definition (12.9) of this set, and Definition 12.3, we have that d (d1 , d2 )T ∈ F(x) if 0 ∇c1 (x) d T 2x1 T 2x2 d1 d2 √ −2 2d1 . Therefore, we obtain F(x) {(0, d2 )T | d2 ∈ IR}. In this case, we have T (x) F(x). Suppose that the feasible set is defined instead by the formula {x | c1 (x) 0}, where c1 (x) (x12 + x22 − 2)2 0. (12.31) (Note that is the same, but its algebraic specification has changed.) The vector d belongs to the linearized feasible set if 0 ∇c1 (x)T d 4(x12 + x22 − 2)x1 T 4(x12 + x22 − 2)x2 d1 d2 0 0 T d1 d2 , which is true for all (d1 , d2 )T . Hence, we have F(x) IR2 , so for this algebraic specification of , the tangent cone and linearized feasible sets differ. ❐ ❏ EXAMPLE 12.5 (EXAMPLE 12.2, REVISITED) We now reconsider problem (12.18) in Example 12.2. The solution x (−1, −1)T is the same as in the equality-constrained case, but there is a much more extensive collection of feasible sequences that converge to any given feasible point (see Figure 12.9). x2 x1 Figure 12.9 Feasible sequences converging to a particular feasible point for the region defined by x12 + x22 ≤ 2. 12.2. TANGENT CONE AND CONSTRAINT QUALIFICATIONS √ From the point x (− 2, 0)T , the various feasible sequences defined above for the equality-constrained problem are still feasible √ for (12.18). There are also infinitely many feasible sequences that converge to x (− 2, 0)T along a straight line from the interior of the circle. These sequences have the form √ z k (− 2, 0)T + (1/k)w, where w is any vector √ whose first component is positive (w1 > 0). The point z k is feasible provided that z k ≤ 2, that is, √ (− 2 + w1 /k)2 + (w2 /k)2 ≤ 2, √ which is true when k ≥ (w12 + w22 )/(2 2w1 ). In addition to these straight-line √ feasible sequences, we can also define an infinite variety of sequences that approach (− 2, 0)T along √ a curve from the interior of the circle. To summarize, the tangent cone to this set at (− 2, 0)T is {(w1 , w2 )T | w1 ≥ 0}. For the definition (12.18) of this feasible set, we have from Definition 12.3 that d ∈ F(x) if 0 ≤ ∇c1 (x) d T −2x1 T −2x2 d1 d2 √ 2 2d1 . Hence, we obtain F(x) T (x) for this particular algebraic specification of the feasible set. ❐ Constraint qualifications are conditions under which the linearized feasible set F(x) is similar to the tangent cone T (x). In fact, most constraint qualifications ensure that these two sets are identical. As mentioned earlier, these conditions ensure that the F(x), which is constructed by linearizing the algebraic description of the set at x, captures the essential geometric features of the set in the vicinity of x, as represented by T (x). Revisiting Example 12.4, we see that both T (x) and F(x) consist of the vertical axis, which is qualitatively similar to the set − {x} in the neighborhood of x. As a further example, consider the constraints c1 (x) 1 − x12 − (x2 − 1)2 ≥ 0, c2 (x) −x2 ≥ 0, (12.32) for which the feasible set is the single point {(0, 0)T } (see Figure 12.10). For this point x (0, 0)T , it is obvious that that tangent cone is T (x) {(0, 0)T }, since all feasible sequences approaching x must have z k x (0, 0)T for all k sufficiently large. Moreover, it is easy to show that linearized approximation to the feasible set F(x) is F(x ∗ ) {(d1 , 0)T | d1 ∈ IR}, 319 320 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION Figure 12.10 Problem (12.32), for which the feasible set is the single point of intersection between circle and line. that is, the entire horizontal axis. In this case, the linearized feasible direction set does not capture the geometry of the feasible set, so constraint qualifications are not satisfied. The constraint qualification most often used in the design of algorithms is the subject of the next definition. Definition 12.4 (LICQ). Given the point x and the active set A(x) defined in Definition 12.1, we say that the linear independence constraint qualification (LICQ) holds if the set of active constraint gradients {∇ci (x), i ∈ A(x)} is linearly independent. Note that this condition is not satisfied for the examples (12.32) and (12.31). In general, if LICQ holds, none of the active constraint gradients can be zero. We mention other constraint qualifications in Section 12.6. 12.3 FIRST-ORDER OPTIMALITY CONDITIONS In this section, we state first-order necessary conditions for x ∗ to be a local minimizer and show how these conditions are satisfied on a small example. The proof of the result is presented in subsequent sections. As a preliminary to stating the necessary conditions, we define the Lagrangian function for the general problem (12.1). L(x, λ) f (x) − λi ci (x). (12.33) i∈E∪I (We had previously defined special cases of this function for the examples of Section 12.1.) 12.3. FIRST-ORDER OPTIMALITY CONDITIONS The necessary conditions defined in the following theorem are called first-order conditions because they are concerned with properties of the gradients (first-derivative vectors) of the objective and constraint functions. These conditions are the foundation for many of the algorithms described in the remaining chapters of the book. Theorem 12.1 (First-Order Necessary Conditions). Suppose that x ∗ is a local solution of (12.1), that the functions f and ci in (12.1) are continuously differentiable, and that the LICQ holds at x ∗ . Then there is a Lagrange multiplier vector λ∗ , with components λi∗ , i ∈ E ∪ I, such that the following conditions are satisfied at (x ∗ , λ∗ ) ∇x L(x ∗ , λ∗ ) 0, for all i ∈ E, (12.34b) ∗ for all i ∈ I, (12.34c) for all i ∈ I, (12.34d) for all i ∈ E ∪ I. (12.34e) ci (x ) 0, ci (x ) ≥ 0, λi∗ ∗ λi∗ ci (x (12.34a) ∗ ≥ 0, ) 0, The conditions (12.34) are often known as the Karush–Kuhn–Tucker conditions, or KKT conditions for short. The conditions (12.34e) are complementarity conditions; they imply that either constraint i is active or λi∗ 0, or possibly both. In particular, the Lagrange multipliers corresponding to inactive inequality constraints are zero, we can omit the terms for indices i ∈ / A(x ∗ ) from (12.34a) and rewrite this condition as 0 ∇x L(x ∗ , λ∗ ) ∇ f (x ∗ ) − λi∗ ∇ci (x ∗ ). (12.35) i∈A(x ∗ ) A special case of complementarity is important and deserves its own definition. Definition 12.5 (Strict Complementarity). Given a local solution x ∗ of (12.1) and a vector λ∗ satisfying (12.34), we say that the strict complementarity condition holds if exactly one of λi∗ and ci (x ∗ ) is zero for each index i ∈ I. In other words, we have that λi∗ > 0 for each i ∈ I ∩ A(x ∗ ). Satisfaction of the strict complementarity property usually makes it easier for algorithms to determine the active set A(x ∗ ) and converge rapidly to the solution x ∗ . For a given problem (12.1) and solution point x ∗ , there may be many vectors λ∗ for which the conditions (12.34) are satisfied. When the LICQ holds, however, the optimal λ∗ is unique (see Exercise 12.17). The proof of Theorem 12.1 is quite complex, but it is important to our understanding of constrained optimization, so we present it in the next section. First, we illustrate the KKT conditions with another example. 321 322 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION x2 x1 Inequality-constrained problem (12.36) with solution at (1, 0)T . Figure 12.11 ❏ EXAMPLE 12.6 Consider the feasible region illustrated in Figure 12.2 and described by the four constraints (12.6). By restating the constraints in the standard form of (12.1) and including an objective function, the problem becomes ⎡ min x 3 x1 − 2 2 1 + x2 − 2 4 s.t. 1 − x1 − x2 ⎢ ⎢ 1 − x1 + x2 ⎢ ⎢ 1+x −x 1 2 ⎣ 1 + x1 + x2 ⎤ ⎥ ⎥ ⎥ ≥ 0. ⎥ ⎦ (12.36) It is fairly clear from Figure 12.11 that the solution is x ∗ (1, 0)T . The first and second constraints in (12.36) are active at this point. Denoting them by c1 and c2 (and the inactive constraints by c3 and c4 ), we have ⎡ ⎤ −1 ∇ f (x ∗ ) ⎣ 1 ⎦, − 2 ∇c1 (x ∗ ) −1 −1 , ∇c2 (x ∗ ) −1 1 . Therefore, the KKT conditions (12.34a)–(12.34e) are satisfied when we set λ∗ 3 4 T , 14 , 0, 0 . ❐ 12.4. 12.4 FIRST-ORDER OPTIMALITY CONDITIONS: PROOF FIRST-ORDER OPTIMALITY CONDITIONS: PROOF We now develop a proof of Theorem 12.1. A number of key subsidiary results are required, so the development is quite long. However, a complete treatment is worthwhile, since these results are so fundamental to the field of optimization. RELATING THE TANGENT CONE AND THE FIRST-ORDER FEASIBLE DIRECTION SET The following key result uses a constraint qualification (LICQ) to relate the tangent cone of Definition 12.2 to the set F of first-order feasible directions of Definition 12.3. In the proof below and in later results, we use the notation A(x ∗ ) to represent the matrix whose rows are the active constraint gradients at the optimal point, that is, A(x ∗ )T [∇ci (x ∗ )]i∈A(x ∗ ) , (12.37) where the active set A(x ∗ ) is defined as in Definition 12.1. Lemma 12.2. Let x ∗ be a feasible point. The following two statements are true. (i) T (x ∗ ) ⊂ F(x ∗ ). (ii) If the LICQ condition is satisfied at x ∗ , then F(x ∗ ) T (x ∗ ). PROOF. Without loss of generality, let us assume that all the constraints ci (·), i 1, 2, . . . , m, are active at x ∗ . (We can arrive at this convenient ordering by simply dropping all inactive constraints—which are irrelevant in some neighborhood of x ∗ —and renumbering the active constraints that remain.) To prove (i), let {z k } and {tk } be the sequences for which (12.29) is satisfied, that is, lim k→∞ zk − x ∗ d. tk (Note in particular that tk > 0 for all k.) From this definition, we have that z k x ∗ + tk d + o(tk ). By taking i ∈ E and using Taylor’s theorem, we have that 1 ci (z k ) tk 1 ci (x ∗ ) + tk ∇ci (x ∗ )T d + o(tk ) tk o(tk ) ∇ci (x ∗ )T d + . tk 0 (12.38) 323 324 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION By taking the limit as k → ∞, the last term in this expression vanishes, and we have ∇ci (x ∗ )T d 0, as required. For the active inequality constraints i ∈ A(x ∗ ) ∩ I, we have similarly that 1 ci (z k ) tk 1 ci (x ∗ ) + tk ∇ci (x ∗ )T d + o(tk ) tk o(tk ) . ∇ci (x ∗ )T d + tk 0≤ Hence, by a similar limiting argument, we have that ∇ci (x ∗ )T d ≥ 0, as required. For (ii), we use the implicit function theorem (see the Appendix or Lang [187, p. 131] for a statement of this result). First, since the LICQ holds, we have from Definition 12.4 that the m × n matrix A(x ∗ ) of active constraint gradients has full row rank m. Let Z be a matrix whose columns are a basis for the null space of A(x ∗ ); that is, Z ∈ IRn×(n−m) , A(x ∗ )Z 0. Z has full column rank, (12.39) (See the related discussion in Chapter 16.) Choose d ∈ F(x ∗ ) arbitrarily, and suppose that {tk }∞ k0 is any sequence of positive scalars such limk→∞ tk 0. Define the parametrized system of equations R : IRn × IR → IRn by R(z, t) c(z) − t A(x ∗ )d Z T (z − x ∗ − td) 0 0 . (12.40) We claim that the solutions z z k of this system for small t tk > 0 give a feasible sequence that approaches x ∗ and satisfies the definition (12.29). At t 0, z x ∗ , and the Jacobian of R at this point is ∇z R(x ∗ , 0) A(x ∗ ) ZT , (12.41) which is nonsingular by construction of Z . Hence, according to the implicit function theorem, the system (12.40) has a unique solution z k for all values of tk sufficiently small. Moreover, we have from (12.40) and Definition 12.3 that i ∈ E ⇒ ci (z k ) tk ∇ci (x ∗ )T d 0, ∗ ∗ T i ∈ A(x ) ∩ I ⇒ ci (z k ) tk ∇ci (x ) d ≥ 0, so that z k is indeed feasible. (12.42a) (12.42b) 12.4. FIRST-ORDER OPTIMALITY CONDITIONS: PROOF It remains to verify that (12.29) holds for this choice of {z k }. Using the fact that R(z k , tk ) 0 for all k together with Taylor’s theorem, we find that 0 R(z k , tk ) c(z k ) − tk A(x ∗ )d Z T (z k − x ∗ − tk d) A(x ∗ )(z k − x ∗ ) + o(z k − x ∗ ) − tk A(x ∗ )d A(x ∗ ) ZT Z T (z k − x ∗ − tk d) (z k − x ∗ − tk d) + o(z k − x ∗ ). By dividing this expression by tk and using nonsingularity of the coefficient matrix in the first term, we obtain zk − x ∗ z k − x ∗ , d +o tk tk from which it follows that (12.29) is satisfied (for x x ∗ ). Hence, d ∈ T (x ∗ ) for an arbitrary d ∈ F(x ∗ ), so the proof of (ii) is complete. A FUNDAMENTAL NECESSARY CONDITION As mentioned above, a local solution of (12.1) is a point x at which all feasible sequences have the property that f (z k ) ≥ f (x) for all k sufficiently large. The following result shows that if such a sequence exists, then its limiting directions must make a nonnegative inner product with the objective function gradient. Theorem 12.3. If x ∗ is a local solution of (12.1), then we have ∇ f (x ∗ )T d ≥ 0, for all d ∈ T (x ∗ ). (12.43) PROOF. Suppose for contradiction that there is a tangent d for which ∇ f (x ∗ )T d < 0. Let {z k } and {tk } be the sequences satisfying Definition 12.2 for this d. We have that f (z k ) f (x ∗ ) + (z k − x ∗ )T ∇ f (x ∗ ) + o(z k − x ∗ ) f (x ∗ ) + tk d T ∇ f (x ∗ ) + o(tk ), 325 326 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION Figure 12.12 Problem (12.44), showing various limiting directions of feasible sequences at the point (0, 0)T . where the second line follows from (12.38). Since d T ∇ f (x ∗ ) < 0, the remainder term is eventually dominated by the first-order term, that is, f (z k ) < f (x ∗ ) + 12 tk d T ∇ f (x ∗ ), for all k sufficiently large. Hence, given any open neighborhood of x ∗ , we can choose k sufficiently large that z k lies within this neighborhood and has a lower value of the objective f . Therefore, x ∗ is not a local solution. The converse of this result is not necessarily true. That is, we may have ∇ f (x ∗ )T d ≥ 0 for all d ∈ T (x ∗ ), yet x ∗ is not a local minimizer. An example is the following problem in two unknowns, illustrated in Figure 12.12 min x2 subject to x2 ≥ −x12 . (12.44) This problem is actually unbounded, but let us examine its behavior at x ∗ (0, 0)T . It is not difficult to show that all limiting directions d of feasible sequences must have d2 ≥ 0, so that ∇ f (x ∗ )T d d2 ≥ 0. However, x ∗ is clearly not a local minimizer; the point (α, −α 2 )T for α > 0 has a smaller function value than x ∗ , and can be brought arbitrarily close to x ∗ by setting α sufficiently small. FARKAS’ LEMMA The most important step in proving Theorem 12.1 is a classical theorem of the alternative known as Farkas’ Lemma. This lemma considers a cone K defined as follows: K {By + Cw | y ≥ 0}, (12.45) 12.4. FIRST-ORDER OPTIMALITY CONDITIONS: PROOF b1 g b1 g b2 b2 b3 b3 d Figure 12.13 (right). Farkas’ Lemma: Either g ∈ K (left) or there is a separating hyperplane where B and C are matrices of dimension n × m and n × p, respectively, and y and w are vectors of appropriate dimensions. Given a vector g ∈ IRn , Farkas’ Lemma states that one (and only one) of two alternatives is true. Either g ∈ K , or else there is a vector d ∈ IRn such that g T d < 0, B T d ≥ 0, C T d 0. (12.46) The two cases are illustrated in Figure 12.13 for the case of B with three columns, C null, and n 2. Note that in the second case, the vector d defines a separating hyperplane, which is a plane in IRn that separates the vector g from the cone K . Lemma 12.4 (Farkas). Let the cone K be defined as in (12.45). Given any vector g ∈ IRn , we have either that g ∈ K or that there exists d ∈ IRn satisfying (12.46), but not both. PROOF. We show first that the two alternatives cannot hold simultaneously. If g ∈ K , there exist vectors y ≥ 0 and w such that g By + Cw. If there also exists a d with the property (12.46), we have by taking inner products that 0 > d T g d T By + d T Cw (B T d)T y + (C T d)T w ≥ 0, where the final inequality follows from C T d 0, B T d ≥ 0, and y ≥ 0. Hence, we cannot have both alternatives holding at once. We now show that one of the alternatives holds. To be precise, we show how to construct d with the properties (12.46) in the case that g ∈ / K . For this part of the proof, we need to use the property that K is a closed set—a fact that is intuitively obvious but not trivial to prove (see Lemma 12.15 in the Notes and References below). Let ŝ be the vector 327 328 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION in K that is closest to g in the sense of the Euclidean norm. Because K is closed, ŝ is well defined and is given by the solution of the following optimization problem: min s − g22 subject to s ∈ K . (12.47) Since ŝ ∈ K , we have from the fact that K is a cone that α ŝ ∈ K for all scalars α ≥ 0. Since α ŝ − g22 is minimized by α 1, we have by simple calculus that d 2 0 ⇒ −2ŝ T g + 2t ŝ T ŝ α1 0 α ŝ − g2 dα α1 ⇒ ŝ T (ŝ − g) 0. (12.48) Now, let s be any other vector in K . Since K is convex, we have by the minimizing property of ŝ that ŝ + θ (s − ŝ) − g22 ≥ ŝ − g22 for all θ ∈ [0, 1], and hence 2θ (s − ŝ)T (ŝ − g) + θ 2 s − ŝ22 ≥ 0. By dividing this expression by θ and taking the limit as θ ↓ 0, we have (s − ŝ)T (ŝ − g) ≥ 0. Therefore, because of (12.48), s T (ŝ − g) ≥ 0, for all s ∈ K . (12.49) We claim now that the vector d ŝ − g satisfies the conditions (12.46). Note that d 0 because g ∈ / K . We have from (12.48) that d T g d T (ŝ − d) (ŝ − g)T ŝ − d T d −d22 < 0, so that d satisfies the first property in (12.46). From (12.49), we have that d T s ≥ 0 for all s ∈ K , so that d T (By + Cw) ≥ 0 for all y ≥ 0 and all w. By fixing y 0 we have that (C T d)T w ≥ 0 for all w, which is true only if C T d 0. By fixing w 0, we have that (B T d)T y ≥ 0 for all y ≥ 0, which is true only if B T d ≥ 0. Hence, d also satisfies the second and third properties in (12.46) and our proof is complete. 12.4. FIRST-ORDER OPTIMALITY CONDITIONS: PROOF By applying Lemma 12.4 to the cone N defined by N ⎧ ⎨ ⎩ λi ∇ci (x ∗ ), λi ≥ 0 for i ∈ A(x ∗ ) ∩ I i∈A(x ∗ ) ⎫ ⎬ ⎭ , (12.50) and setting g ∇ f (x ∗ ), we have that either ∇ f (x ∗ ) λi ∇ci (x ∗ ) A(x ∗ )T λ∗ , λi ≥ 0 for i ∈ A(x ∗ ) ∩ I, (12.51) i∈A(x ∗ ) or else there is a direction d such that d T ∇ f (x ∗ ) < 0 and d ∈ F(x ∗ ). PROOF OF THEOREM 12.1 Lemmas 12.2 and 12.4 can be combined to give the KKT conditions described in Theorem 12.1. We work through the final steps of the proof here. Suppose that x ∗ ∈ IRn is a feasible point at which the LICQ holds. The theorem claims that if x ∗ is a local solution for (12.1), then there is a vector λ∗ ∈ IRm that satisfies the conditions (12.34). We show first that there are multipliers λi , i ∈ A(x ∗ ), such that (12.51) is satisfied. Theorem 12.3 tells us that d T ∇ f (x ∗ ) ≥ 0 for all tangent vectors d ∈ T (x ∗ ). From Lemma 12.2, since LICQ holds, we have that T (x ∗ ) F(x ∗ ). By putting these two statements together, we find that d T ∇ f (x ∗ ) ≥ 0 for all d ∈ F(x ∗ ). Hence, from Lemma 12.4, there is a vector λ for which (12.51) holds, as claimed. We now define the vector λ∗ by λi∗ λi , i ∈ A(x ∗ ), 0, i ∈ I\A(x ∗ ), (12.52) and show that this choice of λ∗ , together with our local solution x ∗ , satisfies the conditions (12.34). We check these conditions in turn. • The condition (12.34a) follows immediately from (12.51) and the definitions (12.33) of the Lagrangian function and (12.52) of λ∗ . • Since x ∗ is feasible, the conditions (12.34b) and (12.34c) are satisfied. • We have from (12.51) that λi∗ ≥ 0 for i ∈ A(x ∗ ) ∩ I, while from (12.52), λi∗ 0 for i ∈ I\A(x ∗ ). Hence, λi∗ ≥ 0 for i ∈ I, so that (12.34d) holds. • We have for i ∈ A(x ∗ ) ∩ I that ci (x ∗ ) 0, while for i ∈ I\A(x ∗ ), we have λi∗ 0. Hence λi∗ ci (x ∗ ) 0 for i ∈ I, so that (12.34e) is satisfied as well. The proof is complete. 329 330 CHAPTER 12. 12.5 THEORY OF CONSTRAINED OPTIMIZATION SECOND-ORDER CONDITIONS So far, we have described first-order conditions—the KKT conditions—which tell us how the first derivatives of f and the active constraints ci are related to each other at a solution x ∗ . When these conditions are satisfied, a move along any vector w from F(x ∗ ) either increases the first-order approximation to the objective function (that is, w T ∇ f (x ∗ ) > 0), or else keeps this value the same (that is, w T ∇ f (x ∗ ) 0). What role do the second derivatives of f and the constraints ci play in optimality conditions? We see in this section that second derivatives play a “tiebreaking” role. For the directions w ∈ F(x ∗ ) for which w T ∇ f (x ∗ ) 0, we cannot determine from first derivative information alone whether a move along this direction will increase or decrease the objective function f . Second-order conditions examine the second derivative terms in the Taylor series expansions of f and ci , to see whether this extra information resolves the issue of increase or decrease in f . Essentially, the second-order conditions concern the curvature of the Lagrangian function in the “undecided” directions—the directions w ∈ F(x ∗ ) for which w T ∇ f (x ∗ ) 0. Since we are discussing second derivatives, stronger smoothness assumptions are needed here than in the previous sections. For the purpose of this section, f and ci , i ∈ E ∪ I, are all assumed to be twice continuously differentiable. Given F(x ∗ ) from Definition 12.3 and some Lagrange multiplier vector λ∗ satisfying the KKT conditions (12.34), we define the critical cone C(x ∗ , λ∗ ) as follows: C(x ∗ , λ∗ ) {w ∈ F(x ∗ ) | ∇ci (x ∗ )T w 0, all i ∈ A(x ∗ ) ∩ I with λi∗ > 0}. Equivalently, ⎧ ∗ T ⎪ ⎨ ∇ci (x ) w 0, w ∈ C(x ∗ , λ∗ ) ⇔ ∇ci (x ∗ )T w 0, ⎪ ⎩ ∇ci (x ∗ )T w ≥ 0, for all i ∈ E, for all i ∈ A(x ∗ ) ∩ I with λi∗ > 0, ∗ for all i ∈ A(x ) ∩ I with λi∗ (12.53) 0. The critical cone contains those directions w that would tend to “adhere” to the active inequality constraints even when we were to make small changes to the objective (those indices i ∈ I for which the Lagrange multiplier component λi∗ is positive), as well as to the equality constraints. From the definition (12.53) and the fact that λi∗ 0 for all inactive components i ∈ I\A(x ∗ ), it follows immediately that w ∈ C(x ∗ , λ∗ ) ⇒ λi∗ ∇ci (x ∗ )T w 0 for all i ∈ E ∪ I. (12.54) Hence, from the first KKT condition (12.34a) and the definition (12.33) of the Lagrangian function, we have that λi∗ w T ∇ci (x ∗ ) 0. (12.55) w ∈ C(x ∗ , λ∗ ) ⇒ w T ∇ f (x ∗ ) i∈E∪I 12.5. SECOND-ORDER CONDITIONS x2 F C ∆ − f x1 Figure 12.14 Problem (12.56), showing F(x ∗ ) and C(x ∗ , λ∗ ). Hence the critical cone C(x ∗ , λ∗ ) contains directions from F(x ∗ ) for which it is not clear from first derivative information alone whether f will increase or decrease. ❏ EXAMPLE 12.7 Consider the problem min x1 subject to x2 ≥ 0, 1 − (x1 − 1)2 − x22 ≥ 0, (12.56) illustrated in Figure 12.14. It is not difficult to see that the solution is x ∗ (0, 0)T , with active set A(x ∗ ) {1, 2} and a unique optimal Lagrange multiplier λ∗ (0, 0.5)T . Since the gradients of the active constraints at x ∗ are (0, 1)T and (2, 0)T , respectively, the LICQ holds, so the optimal multiplier is unique. The linearized feasible set is then F(x ∗ ) {d | d ≥ 0}, while the critical cone is C(x ∗ , λ∗ ) {(0, w2 )T | w2 ≥ 0}. ❐ 331 332 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION The first theorem defines a necessary condition involving the second derivatives: If x ∗ is a local solution, then the Hessian of the Lagrangian has nonnegative curvature along critical directions (that is, the directions in C(x ∗ , λ∗ )). Theorem 12.5 (Second-Order Necessary Conditions). Suppose that x ∗ is a local solution of (12.1) and that the LICQ condition is satisfied. Let ∗ λ be the Lagrange multiplier vector for which the KKT conditions (12.34) are satisfied. Then w T ∇x2x L(x ∗ , λ∗ )w ≥ 0, for all w ∈ C(x ∗ , λ∗ ). (12.57) PROOF. Since x ∗ is a local solution, all feasible sequences {z k } approaching x ∗ must have f (z k ) ≥ f (x ∗ ) for all k sufficiently large. Our approach in this proof is to construct a feasible sequence whose limiting direction is w and show that the property f (z k ) ≥ f (x ∗ ) implies that (12.57) holds. Since w ∈ C(x ∗ , λ∗ ) ⊂ F(x ∗ ), we can use the technique in the proof of Lemma 12.2 to choose a sequence {tk } of positive scalars and to construct a feasible sequence {z k } approaching x ∗ such that lim k→∞ zk − x ∗ w, tk (12.58) which we can write also as (12.58) that z k − x ∗ tk w + o(tk ). (12.59) Because of the construction technique for {z k }, we have from formula (12.42) that ci (z k ) tk ∇ci (x ∗ )T w, for all i ∈ A(x ∗ ) (12.60) From (12.33), (12.60), and (12.54), we have L(z k , λ∗ ) f (z k ) − λi∗ ci (z k ) i∈E∪I f (z k ) − tk λi∗ ∇ci (x ∗ )T w i∈A(x ∗ ) f (z k ), (12.61) On the other hand, we can perform a Taylor series expansion to obtain an estimate of L(z k , λ∗ ) near x ∗ . By using Taylor’s theorem expression (2.6) and continuity of the Hessians ∇ 2 f and ∇ 2 ci , i ∈ E ∪ I, we obtain L(z k , λ∗ ) L(x ∗ , λ∗ ) + (z k − x ∗ )T ∇x L(x ∗ , λ∗ ) + 1 (z 2 k ∗ T −x ) ∇x2x L(x ∗ , λ∗ )(z k (12.62) ∗ ∗ 2 − x ) + o(z k − x ). 12.5. SECOND-ORDER CONDITIONS By the complementarity conditions (12.34e), we have L(x ∗ , λ∗ ) f (x ∗ ). From (12.34a), the second term on the right-hand side is zero. Hence, using (12.59), we can rewrite (12.62) as L(z k , λ∗ ) f (x ∗ ) + 12 tk2 w T ∇x2x L(x ∗ , λ∗ ) + o(tk2 ). (12.63) By substituting into (12.63), we obtain f (z k ) f (x ∗ ) + 12 tk2 w T ∇x2x L(x ∗ , λ∗ )w + o(tk2 ). (12.64) If w T ∇x2x L(x ∗ , λ∗ )w < 0, then (12.64) would imply that f (z k ) < f (x ∗ ) for all k sufficiently large, contradicting the fact that x ∗ is a local solution. Hence, the condition (12.57) must hold, as claimed. Sufficient conditions are conditions on f and ci , i ∈ E ∪ I, that ensure that x ∗ is a local solution of the problem (12.1). (They take the opposite tack to necessary conditions, which assume that x ∗ is a local solution and deduce properties of f and ci , for the active indices i.) The second-order sufficient condition stated in the next theorem looks very much like the necessary condition just discussed, but it differs in that the constraint qualification is not required, and the inequality in (12.57) is replaced by a strict inequality. Theorem 12.6 (Second-Order Sufficient Conditions). Suppose that for some feasible point x ∗ ∈ IRn there is a Lagrange multiplier vector λ∗ such that the KKT conditions (12.34) are satisfied. Suppose also that w T ∇x2x L(x ∗ , λ∗ )w > 0, for all w ∈ C(x ∗ , λ∗ ), w 0. (12.65) Then x ∗ is a strict local solution for (12.1). PROOF. First, note that the set C̄ {d ∈ C(x ∗ , λ∗ ) | d 1} is a compact subset of C(x ∗ , λ∗ ), so by (12.65), the minimizer of d T ∇x2x L(x ∗ , λ∗ )d over this set is a strictly positive number, say σ . Since C(x ∗ , λ∗ ) is a cone, we have that (w/w) ∈ C̄ if and only if w ∈ C(x ∗ , λ∗ ), w 0. Therefore, condition (12.65) by w T ∇x2x L(x ∗ , λ∗ )w ≥ σ w2 , for all w ∈ C(x ∗ , λ∗ ), (12.66) for σ > 0 defined as above. (Note that this inequality holds trivially for w 0.) We prove the result by showing that every feasible sequence {z k } approaching x ∗ has f (z k ) ≥ f (x ∗ ) + (σ/4)z k − x ∗ 2 , for all k sufficiently large. Suppose for contradiction that this is not the case, and that there is a sequence {z k } approaching x ∗ with f (z k ) < f (x ∗ ) + (σ/4)z k − x ∗ 2 , for all k sufficiently large. (12.67) 333 334 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION By taking a subsequence if necessary, we can identify a limiting direction d such that zk − x ∗ d. k→∞ z k − x ∗ lim (12.68) We have from Lemma 12.2(i) and Definition 12.3 that d ∈ F(x ∗ ). From (12.33) and the facts that λi∗ ≥ 0 and ci (z k ) ≥ 0 for i ∈ I and ci (z k ) 0 for i ∈ E, we have that L(z k , λ∗ ) f (z k ) − λi∗ ci (z k ) ≤ f (z k ), (12.69) i∈A(x ∗ ) while the Taylor series approximation (12.63) from the proof of Theorem 12.5 continues to hold. If d were not in C(x ∗ , λ∗ ), we could identify some index j ∈ A(x ∗ ) ∩ I such that the strict positivity condition λ∗j ∇c j (x ∗ )T d > 0 (12.70) is satisfied, while for the remaining indices i ∈ A(x ∗ ), we have λi∗ ∇ci (x ∗ )T d ≥ 0. From Taylor’s theorem and (12.68), we have for this particular value of j that λ∗j c j (z k ) λ∗j c j (x ∗ ) + λ∗j ∇c j (x ∗ )T (z k − x ∗ ) + o(z k − x ∗ ) z k − x ∗ λ∗j ∇c j (x ∗ )T d + o(z k − x ∗ ). Hence, from (12.69), we have that L(z k , λ∗ ) f (z k ) − λi∗ ci (z k ) i∈A(x ∗ ) ≤ f (z k ) − λ∗j c j (z k ) ≤ f (z k ) − z k − x ∗ λ∗j ∇c j (x ∗ )T d + o(z k − x ∗ ). From the Taylor series estimate (12.63), we have meanwhile that L(z k , λ∗ ) f (x ∗ ) + O(z k − x ∗ 2 ), and by combining with (12.71), we obtain f (z k ) ≥ f (x ∗ ) + z k − x ∗ λ∗j ∇c j (x ∗ )T d + o(z k − x ∗ ). (12.71) 12.5. SECOND-ORDER CONDITIONS Because of (12.70), this inequality is incompatible with (12.67). We conclude that d ∈ C(x ∗ , λ∗ ), and hence d T ∇x2x L(x ∗ , λ∗ )d ≥ σ . By combining the Taylor series estimate (12.63) with (12.69) and using (12.68), we obtain f (z k ) ≥ f (x ∗ ) + 12 (z k − x ∗ )T ∇x2x L(x ∗ , λ∗ )(z k − x ∗ ) + o(z k − x ∗ 2 ) f (x ∗ ) + 12 d T ∇x2x L(x ∗ , λ∗ )dz k − x ∗ 2 + o(z k − x ∗ 2 ) ≥ f (x ∗ ) + (σ/2)z k − x ∗ 2 + o(z k − x ∗ 2 ). This inequality yields the contradiction to (12.67). We conclude that every feasible sequence {z k } approaching x ∗ must satisfy f (z k ) ≥ f (x ∗ ) + (σ/4)z k − x ∗ 2 , for all k sufficiently large, so x ∗ is a strict local solution. ❏ EXAMPLE 12.8 (EXAMPLE 12.2, ONE MORE TIME) We now return to Example 12.2 to check the second-order conditions for problem (12.18). In this problem we have f (x) x1 + x2 , c1 (x) 2 − x12 − x22 , E ∅, and I {1}. The Lagrangian is L(x, λ) (x1 + x2 ) − λ1 (2 − x12 − x22 ), and it is easy to show that the KKT conditions (12.34) are satisfied by x ∗ (−1, −1)T , with λ∗1 12 . The Lagrangian Hessian at this point is ∇x2x L(x ∗ , λ∗ ) 2λ∗1 0 0 2λ∗1 1 0 0 1 . This matrix is positive definite, so it certainly satisfies the conditions of Theorem 12.6. We conclude that x ∗ (−1, −1)T is a strict local solution for (12.18). (In fact, it is the global solution of this problem, since, as we note later, this problem is a convex programming problem.) ❐ ❏ EXAMPLE 12.9 For a more complex example, consider the problem min −0.1(x1 − 4)2 + x22 s.t. x12 + x22 − 1 ≥ 0, (12.72) 335 336 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION in which we seek to minimize a nonconvex function over the exterior of the unit circle. Obviously, the objective function is not bounded below on the feasible region, since we can take the feasible sequence 10 0 , 20 , 0 30 , 0 40 , 0 and note that f (x) approaches −∞ along this sequence. Therefore, no global solution exists, but it may still be possible to identify a strict local solution on the boundary of the constraint. We search for such a solution by using the KKT conditions (12.34) and the second-order conditions of Theorem 12.6. By defining the Lagrangian for (12.72) in the usual way, it is easy to verify that ∇x L(x, λ) ∇x2x L(x, λ) −0.2(x1 − 4) − 2λ1 x1 2x2 − 2λ1 x2 , (12.73a) . (12.73b) −0.2 − 2λ1 0 0 2 − 2λ1 The point x ∗ (1, 0)T satisfies the KKT conditions with λ∗1 0.3 and the active set A(x ∗ ) {1}. To check that the second-order sufficient conditions are satisfied at this point, we note that ∗ ∇c1 (x ) 2 , 0 so that the set C defined in (12.53) is simply C(x ∗ , λ∗ ) {(0, w2 )T | w2 ∈ IR}. Now, by substituting x ∗ and λ∗ into (12.73b), we have for any w ∈ C(x ∗ , λ∗ ) with w 0 that w2 0 and thus w T ∇x2x L(x ∗ , λ∗ )w 0 w2 T −0.4 0 0 1.4 0 w2 1.4w22 > 0. Hence, the second-order sufficient conditions are satisfied, and we conclude from Theorem 12.6 that (1, 0)T is a strict local solution for (12.72). ❐ 12.5. SECOND-ORDER CONDITIONS SECOND-ORDER CONDITIONS AND PROJECTED HESSIANS The second-order conditions are sometimes stated in a form that is slightly weaker but easier to verify than (12.57) and (12.65). This form uses a two-sided projection of the Lagrangian Hessian ∇x2x L(x ∗ , λ∗ ) onto subspaces that are related to C(x ∗ , λ∗ ). The simplest case is obtained when the multiplier λ∗ that satisfies the KKT conditions (12.34) is unique (as happens, for example, when the LICQ condition holds) and strict complementarity holds. In this case, the definition (12.53) of C(x ∗ , λ∗ ) reduces to C(x ∗ , λ∗ ) Null ∇ci (x ∗ )T i∈A(x ∗ ) Null A(x ∗ ), where A(x ∗ ) is defined as in (12.37). In other words, C(x ∗ , λ∗ ) is the null space of the matrix whose rows are the active constraint gradients at x ∗ . As in (12.39), we can define the matrix Z with full column rank whose columns span the space C(x ∗ , λ∗ );that is, ∗ C(x ∗ , λ∗ ) {Z u | u ∈ IR|A(x )| }. Hence, the condition (12.57) in Theorem 12.5 can be restated as u T Z T ∇x2x L(x ∗ , λ∗ )Z u ≥ 0 for all u, or, more succinctly, Z T ∇x2x L(x ∗ , λ∗ )Z is positive semidefinite. Similarly, the condition (12.65) in Theorem 12.6 can be restated as Z T ∇x2x L(x ∗ , λ∗ )Z is positive definite. As we show next, Z can be computed numerically, so that the positive (semi)definiteness conditions can actually be checked by forming these matrices and finding their eigenvalues. One way to compute the matrix Z is to apply a QR factorization to the matrix of active constraint gradients whose null space we seek. In the simplest case above (in which the multiplier λ∗ is unique and strictly complementary holds), we define A(x ∗ ) as in (12.37) and write the QR factorization of its transpose as ∗ T A(x ) Q R 0 Q1 Q2 R 0 Q 1 R, (12.74) where R is a square upper triangular matrix and Q is n × n orthogonal. If R is nonsingular, we can set Z Q 2 . If R is singular (indicating that the active constraint gradients are linearly dependent), a slight enhancement of this procedure that makes use of column pivoting during the QR procedure can be used to identify Z . 337 338 CHAPTER 12. 12.6 THEORY OF CONSTRAINED OPTIMIZATION OTHER CONSTRAINT QUALIFICATIONS We now reconsider constraint qualifications, the conditions discussed in Sections 12.2 and 12.4 that ensure that the linearized approximation to the feasible set captures the essential shape of in a neighborhood of x ∗ . One situation in which the linearized feasible direction set F(x ∗ ) is obviously an adequate representation of the actual feasible set occurs when all the active constraints are already linear; that is, ci (x) aiT x + bi , (12.75) for some ai ∈ IRn and bi ∈ IR. It is not difficult to prove a version of Lemma 12.2 for this situation. Lemma 12.7. Suppose that at some x ∗ ∈ , all active constraints ci (·), i ∈ A(x ∗ ), are linear functions. Then F(x ∗ ) T (x ∗ ). PROOF. We have from Lemma 12.2 (i) that T (x ∗ ) ⊂ F(x ∗ ). To prove that F(x ∗ ) ⊂ T (x ∗ ), we choose an arbitrary w ∈ F(x ∗ ) and show that w ∈ T (x ∗ ). By Definition 12.3 and the form (12.75) of the constraints, we have aiT d 0, F(x ∗ ) d T ai d ≥ 0, for all i ∈ E, for all i ∈ A(x) ∩ I . First, note that there is a positive scalar t¯ such that the inactive constraint remain inactive at x ∗ + tw, for all t ∈ [0, t¯], that is, ci (x ∗ + tw) > 0, for all i ∈ I\A(x ∗ ) and all t ∈ [0, t¯]. Now define the sequence z k by z k x ∗ + (t¯/k)w, k 1, 2, . . . . Since aiT w ≥ 0 for all i ∈ I ∩ A(x ∗ ), we have ci (z k ) ci (z k ) − ci (x ∗ ) aiT (z k − x ∗ ) t¯ T a w ≥ 0, k i for all i ∈ I ∩ A(x ∗ ), so that z k is feasible with respect to the active inequality constraints ci , i ∈ I ∩ A(x ∗ ). By the choice of t¯, we find that z k is also feasible with respect to the inactive inequality constraints 12.6. OTHER CONSTRAINT QUALIFICATIONS i ∈ I\A(x ∗ ), and it is easy to show that ci (z k ) 0 for the equality constraints i ∈ E. Hence, z k is feasible for each k 1, 2, . . .. In addition, we have that zk − x ∗ (t¯/k)w w, (t¯/k) (t¯/k) so that indeed w is the limiting direction of {z k }. Hence, w ∈ T (x ∗ ), and the proof is complete. We conclude from this result that the condition that all active constraints be linear is another possible constraint qualification. It is neither weaker nor stronger than the LICQ condition, that is, there are situations in which one condition is satisfied but not the other (see Exercise 12.12). Another useful generalization of the LICQ is the Mangasarian–Fromovitz constraint qualification (MFCQ). Definition 12.6 (MFCQ). We say that the Mangasarian–Fromovitz constraint qualification (MFCQ) holds if there exists a vector w ∈ IRn such that ∇ci (x ∗ )T w > 0, for all i ∈ A(x ∗ ) ∩ I, ∇ci (x ∗ )T w 0, for all i ∈ E, and the set of equality constraint gradients {∇ci (x ∗ ), i ∈ E} is linearly independent. Note the strict inequality involving the active inequality constraints. The MFCQ is a weaker condition than LICQ. If LICQ is satisfied, then the system of equalities defined by ∇ci (x ∗ )T w 1, for all i ∈ A(x ∗ ) ∩ I, ∇ci (x ∗ )T w 0, for all i ∈ E, has a solution w, by full rank of the active constraint gradients. Hence, we can choose the w of Definition 12.6 to be precisely this vector. On the other hand, it is easy to construct examples in which the MFCQ is satisfied but the LICQ is not; see Exercise 12.13. It is possible to prove a version of the first-order necessary condition result (Theorem 12.1) in which MFCQ replaces LICQ in the assumptions. MFCQ gives rise to the nice property that it is equivalent to boundedness of the set of Lagrange multiplier vectors λ∗ for which the KKT conditions (12.34) are satisfied. (In the case of LICQ, this set consists of a unique vector λ∗ , and so is trivially bounded.) Note that constraint qualifications are sufficient conditions for the linear approximation to be adequate, not necessary conditions. For instance, consider the set defined by x2 ≥ −x12 and x2 ≤ x12 and the feasible point x ∗ (0, 0)T . None of the constraint qualifications 339 340 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION we have discussed are satisfied, but the linear approximation F(x ∗ ) {(w1 , 0)T | w1 ∈ IR} accurately reflects the geometry of the feasible set near x ∗ . 12.7 A GEOMETRIC VIEWPOINT Finally, we mention an alternative first-order optimality condition that depends only on the geometry of the feasible set and not on its particular algebraic description in terms of the constraint functions ci , i ∈ E ∪ I. In geometric terms, our problem (12.1) can be stated as min f (x) subject to x ∈ , (12.76) where is the feasible set. To prove a “geometric” first-order condition, we need to define the normal cone to the set at a feasible point x. Definition 12.7. The normal cone to the set at the point x ∈ is defined as N (x) {v | v T w ≤ 0 for all w ∈ T (x)}, (12.77) where T (x) is the tangent cone of Definition 12.2. Each vector v ∈ N (x) is said to be a normal vector. Geometrically, each normal vector v makes an angle of at least π/2 with every tangent vector. The first-order necessary condition for (12.76) is delightfully simple. Theorem 12.8. Suppose that x ∗ is a local minimizer of f in . Then − ∇ f (x ∗ ) ∈ N (x ∗ ). (12.78) PROOF. Given any d ∈ T (x ∗ ), we have for the sequences {tk } and {z k } in Definition 12.2 that z k ∈ , z k x ∗ + tk d + o(tk ), Since x ∗ is a local solution, we must have f (z k ) ≥ f (x ∗ ) for all k. (12.79) 12.8. LAGRANGE MULTIPLIERS AND SENSITIVITY for all k sufficiently large. Hence, since f is continuously differentiable, we have from Taylor’s theorem (2.4) that f (z k ) − f (x ∗ ) tk ∇ f (x ∗ )T d + o(tk ) ≥ 0. By dividing by tk and taking limits as k → ∞, we have ∇ f (x ∗ )T d ≥ 0. Recall that d was an arbitrary member of T (x ∗ ), so we have −∇ f (x ∗ )T d ≤ 0 for all d ∈ T (x ∗ ). We conclude from Definition 12.7 that −∇ f (x ∗ ) ∈ N (x ∗ ). This result suggests a close relationship between N (x ∗ ) and the conic combination of active constraint gradients given by (12.50). When the linear independence constraint qualification holds, identical (to within a change of sign). Lemma 12.9. Suppose that the LICQ assumption (Definition 12.4) holds at x ∗ . Then t the normal cone N (x ∗ ) is simply −N , where N is the set defined in (12.50). PROOF. The proof follows from Farkas’ Lemma (Lemma 12.4) and Definition 12.7 of N (x ∗ ). From Lemma 12.4, we have that g ∈ N ⇒ g T d ≥ 0 for all d ∈ F(x ∗ ). Since we have F(x ∗ ) T (x ∗ ) from Lemma 12.2, it follows by switching the sign of this expression that g ∈ −N ⇒ g T d ≤ 0 for all d ∈ T (x ∗ ). We conclude from Definition 12.7 that N (x ∗ ) −N , as claimed. 12.8 LAGRANGE MULTIPLIERS AND SENSITIVITY The importance of Lagrange multipliers in optimality theory should be clear, but what of their intuitive significance? We show in this section that each Lagrange multiplier λi∗ tells us something about the sensitivity of the optimal objective value f (x ∗ ) to the presence of the constraint ci . To put it another way, λi∗ indicates how hard f is “pushing” or “pulling” the solution x ∗ against the particular constraint ci . We illustrate this point with some informal analysis. When we choose an inactive constraint i ∈ / A(x ∗ ) such that ci (x ∗ ) > 0, the solution x ∗ and function value f (x ∗ ) are 341 342 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION indifferent to whether this constraint is present or not. If we perturb ci by a tiny amount, it will still be inactive and x ∗ will still be a local solution of the optimization problem. Since λi∗ 0 from (12.34e), the Lagrange multiplier indicates accurately that constraint i is not significant. Suppose instead that constraint i is active, and let us perturb the right-hand-side of this constraint a little, requiring, say, that ci (x) ≥ − ∇ci (x ∗ ) instead of ci (x) ≥ 0. Suppose that is sufficiently small that the perturbed solution x ∗ ( ) still has the same set of active constraints, and that the Lagrange multipliers are not much affected by the perturbation. (These conditions can be made more rigorous with the help of strict complementarity and second-order conditions.) We then find that − ∇ci (x ∗ ) ci (x ∗ ( )) − ci (x ∗ ) ≈ (x ∗ ( ) − x ∗ )T ∇ci (x ∗ ), 0 c j (x ∗ ( )) − c j (x ∗ ) ≈ (x ∗ ( ) − x ∗ )T ∇c j (x ∗ ), for all j ∈ A(x ∗ ) with j i. The value of f (x ∗ ( )), meanwhile, can be estimated with the help of (12.34a). We have f (x ∗ ( )) − f (x ∗ ) ≈ (x ∗ ( ) − x ∗ )T ∇ f (x ∗ ) λ∗j (x ∗ ( ) − x ∗ )T ∇c j (x ∗ ) j∈A(x ∗ ) ≈ − ∇ci (x ∗ )λi∗ . By taking limits, we see that the family of solutions x ∗ ( ) satisfies d f (x ∗ ( )) −λi∗ ∇ci (x ∗ ). d (12.80) A sensitivity analysis of this problem would conclude that if λi∗ ∇ci (x ∗ ) is large, then the optimal value is sensitive to the placement of the ith constraint, while if this quantity is small, the dependence is not too strong. If λi∗ is exactly zero for some active constraint, small perturbations to ci in some directions will hardly affect the optimal objective value at all; the change is zero, to first order. This discussion motivates the definition below, which classifies constraints according to whether or not their corresponding Lagrange multiplier is zero. Definition 12.8. Let x ∗ be a solution of the problem (12.1), and suppose that the KKT conditions (12.34) are satisfied. We say that an inequality constraint ci is strongly active or binding if i ∈ A(x ∗ ) and λi∗ > 0 for some Lagrange multiplier λ∗ satisfying (12.34). We say that ci is weakly active if i ∈ A(x ∗ ) and λi∗ 0 for all λ∗ satisfying (12.34). Note that the analysis above is independent of scaling of the individual constraints. For instance, we might change the formulation of the problem by replacing some active 12.9. DUALITY constraint ci by 10ci . The new problem will actually be equivalent (that is, it has the same feasible set and same solution), but the optimal multiplier λi∗ corresponding to ci will be replaced by λi∗ /10. However, since ∇ci (x ∗ ) is replaced by 10∇ci (x ∗ ), the product λi∗ ∇ci (x ∗ ) does not change. If, on the other hand, we replace the objective function f by 10 f , the multipliers λi∗ in (12.34) all will need to be replaced by 10λi∗ . Hence in (12.80) we see that the sensitivity of f to perturbations has increased by a factor of 10, which is exactly what we would expect. 12.9 DUALITY In this section we present some elements of the duality theory for nonlinear programming. This theory is used to motivate and develop some important algorithms, including the augmented Lagrangian algorithms of Chapter 17. In its full generality, duality theory ranges beyond nonlinear programming to provide important insight into the fields of convex nonsmooth optimization and even discrete optimization. Its specialization to linear programming proved central to the development of that area; see Chapter 13. (We note that the discussion of linear programming duality in Section 13.1 can be read without consulting this section first.) Duality theory shows how we can construct an alternative problem from the functions and data that define the original optimization problem. This alternative “dual” problem is related to the original problem (which is sometimes referred to in this context as the “primal” for purposes of contrast) in fascinating ways. In some cases, the dual problem is easier to solve computationally than the original problem. In other cases, the dual can be used to obtain easily a lower bound on the optimal value of the objective for the primal problem. As remarked above, the dual has also been used to design algorithms for solving the primal problem. Our results in this section are mostly restricted to the special case of (12.1) in which there are no equality constraints and the objective f and the negatives of the inequality constraints −ci are all convex functions. For simplicity we assume that there are m inequality constraints labelled 1, 2, . . . , m and rewrite (12.1) as follows: subject to ci (x) ≥ 0, i 1, 2, . . . , m. minn f (x) x∈IR If we assemble the constraints into a vector function def c(x) (c1 (x), c2 (x), . . . , cm (x))T , we can write the problem as minn f (x) x∈IR subject to c(x) ≥ 0, (12.81) 343 344 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION for which the Lagrangian function (12.16) with Lagrange multiplier vector λ ∈ IRm is L(x, λ) f (x) − λT c(x). We define the dual objective function q : IRn → IR as follows: def q(λ) inf L(x, λ). x (12.82) In many problems, this infimum is −∞ for some values of λ. We define the domain of q as the set of λ values for which q is finite, that is, def D {λ | q(λ) > −∞}. (12.83) Note that calculation of the infimum in (12.82) requires finding the global minimizer of the function L(·, λ) for the given λ which, as we have noted in Chapter 2, may be extremely difficult in practice. However, when f and −ci are convex functions and λ ≥ 0 (the case in which we are most interested), the function L(·, λ) is also convex. In this situation, all local minimizers are global minimizers (as we verify in Exercise 12.4), so computation of q(λ) becomes a more practical proposition. The dual problem to (12.81) is defined as follows: maxn q(λ) λ∈IR subject to λ ≥ 0. (12.84) ❏ EXAMPLE 12.10 Consider the problem min 0.5(x12 + x22 ) (x1 ,x2 ) subject to x1 − 1 ≥ 0. (12.85) The Lagrangian is L(x1 , x2 , λ1 ) 0.5(x12 + x22 ) − λ1 (x1 − 1). If we hold λ1 fixed, this is a convex function of (x1 , x2 )T . Therefore, the infimum with respect to (x1 , x2 )T is achieved when the partial derivatives with respect to x1 and x2 are zero, that is, x1 − λ1 0, x2 0. 12.9. DUALITY By substituting these infimal values into L(x1 , x2 , λ1 ) we obtain the dual objective (12.82): q(λ1 ) 0.5(λ21 + 0) − λ1 (λ1 − 1) −0.5λ21 + λ1 . Hence, the dual problem (12.84) is max −0.5λ21 + λ1 , λ1 ≥0 which clearly has the solution λ1 1. (12.86) ❐ In the remainder of this section, we show how the dual problem is related to (12.81). Our first result concerns concavity of q. Theorem 12.10. The function q defined by (12.82) is concave and its domain D is convex. PROOF. For any λ0 and λ1 in IRm , any x ∈ IRn , and any α ∈ [0, 1], we have L(x, (1 − α)λ0 + αλ1 ) (1 − α)L(x, λ0 ) + αL(x, λ1 ). By taking the infimum of both sides in this expression, using the definition (12.82), and using the results that the infimum of a sum is greater than or equal to the sum of infimums, we obtain q((1 − α)λ0 + αλ1 ) ≥ (1 − α)q(λ0 ) + αq(λ1 ), confirming concavity of q. If both λ0 and λ1 belong to D, this inequality implies that q((1 − α)λ0 + αλ1 ) ≥ −∞ also, and therefore (1 − α)λ0 + αλ1 ∈ D, verifying convexity of D. The optimal value of the dual problem (12.84) gives a lower bound on the optimal objective value for the primal problem (12.81). This observation is a consequence of the following weak duality result. Theorem 12.11 (Weak Duality). For any x̄ feasible for (12.81) and any λ̄ ≥ 0, we have q(λ̄) ≤ f (x̄). PROOF. q(λ̄) inf f (x) − λ̄T c(x) ≤ f (x̄) − λ̄T c(x̄) ≤ f (x̄), x where the final inequality follows from λ̄ ≥ 0 and c(x̄) ≥ 0. 345 346 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION For the remaining results, we note that the KKT conditions (12.34) specialized to (12.81) are as follows: ∇ f (x̄) − ∇c(x̄)λ̄ 0, (12.87a) c(x̄) ≥ 0, (12.87b) λ̄ ≥ 0, (12.87c) λ̄i ci (x̄) 0, i 1, 2, . . . , m, (12.87d) where ∇c(x) is the n × m matrix defined by ∇c(x) [∇c1 (x), ∇c2 (x), . . . , ∇cm (x)]. The next result shows that optimal Lagrange multipliers for (12.81) are solutions of the dual problem (12.84) under certain conditions. It is essentially due to Wolfe [309]. Theorem 12.12. Suppose that x̄ is a solution of (12.81) and that f and −ci , i 1, 2, . . . , m are convex functions on IRn that are differentiable at x̄. Then any λ̄ for which (x̄, λ̄) satisfies the KKT conditions (12.87) is a solution of (12.84). PROOF. Suppose that (x̄, λ̄) satisfies (12.87). We have from λ̄ ≥ 0 that L(·, λ̄) is a convex and differentiable function. Hence, for any x, we have L(x, λ̄) ≥ L(x̄, λ̄) + ∇x L(x̄, λ̄)T (x − x̄) L(x̄, λ̄), where the last equality follows from (12.87a). Therefore, we have q(λ̄) inf L(x, λ̄) L(x̄, λ̄) f (x̄) − λ̄T c(x̄) f (x̄), x where the last equality follows from (12.87d). Since from Theorem 12.11, we have q(λ) ≤ f (x̄) for all λ ≥ 0 it follows immediately from q(λ̄) f (x̄) that λ̄ is a solution of (12.84). Note that if the functions are continuously differentiable and a constraint qualification such as LICQ holds at x̄, then an optimal Lagrange multiplier is guaranteed to exist, by Theorem 12.1. In Example 12.10, we see that λ1 1 is both an optimal Lagrange multiplier for the problem (12.85) and a solution of (12.86). Note too that the optimal objective for both problems is 0.5. We prove a partial converse of Theorem 12.12, which shows that solutions to the dual problem (12.84) can sometimes be used to derive solutions to the original problem (12.81). The essential condition is strict convexity of the function L(·, λ̂) for a certain value λ̂. We note that this condition holds if either f is strictly convex (as is the case in Example 12.10) or if ci is strictly convex for some i 1, 2, . . . , m with λ̂i > 0. 12.9. DUALITY Theorem 12.13. Suppose that f and −ci , i 1, 2, . . . , m are convex and continuously differentiable on IRn . Suppose that x̄ is a solution of (12.81) at which LICQ holds. Suppose that λ̂ solves (12.84) and that the infimum in inf x L(x, λ̂) is attained at x̂. Assume further than L(·, λ̂) is a strictly convex function. Then x̄ x̂ (that is, x̂ is the unique solution of (12.81)), and f (x̄) L(x̂, λ̂). PROOF. Assume for contradiction that x̄ x̂. From Theorem 12.1, because of the LICQ assumption, there exists λ̄ satisfying (12.87). Hence, from Theorem 12.12, we have that λ̄ also solves (12.84), so that L(x̄, λ̄) q(λ̄) q(λ̂) L(x̂, λ̂). Because x̂ arg minx L(x, λ̂), we have from Theorem 2.2 that ∇x L(x̂, λ̂) 0. Moreover, by strict convexity of L(·, λ̂), it follows that L(x̄, λ̂) − L(x̂, λ̂) > ∇x L(x̂, λ̂)T (x̄ − x̂) 0. Hence, we have L(x̄, λ̂) > L(x̂, λ̂) L(x̄, λ̄), so in particular we have −λ̂T c(x̄) > −λ̄T c(x̄) 0, where the final equality follows from (12.87d). Since λ̂ ≥ 0 and c(x̄) ≥ 0, this yields the contradiction, and we conclude that x̂ x̄, as claimed. In Example 12.10, at the dual solution λ1 1, the infimum of L(x1 , x2 , λ1 ) is achieved at (x1 , x2 ) (1, 0)T , which is the solution of the original problem (12.85). An slightly different form of duality that is convenient for computations, known as the Wolfe dual [309], can be stated as follows: max L(x, λ) (12.88a) x,λ subject to ∇x L(x, λ) 0, λ ≥ 0. (12.88b) The following results explains the relationship of the Wolfe dual to (12.81). Theorem 12.14. Suppose that f and −ci , i 1, 2, . . . , m are convex and continuously differentiable on IRn . Suppose that (x̄, λ̄) is a solution pair of (12.81) at which LICQ holds. Then (x̄, λ̄) solves the problem (12.88). 347 348 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION PROOF. From the KKT conditions (12.87) we have that ( x̄, λ̄) satisfies (12.88b), and that L(x̄, λ̄) f (x̄). Therefore for any pair (x, λ) that satisfies (12.88b) we have that L(x̄, λ̄) f (x̄) ≥ f (x̄) − λT c(x̄) L(x̄, λ) ≥ L(x, λ) + ∇x L(x, λ)T (x̄ − x) L(x, λ), where the second inequality follows from the convexity of L(·, λ). We have therefore shown that (x̄, λ̄) maximizes L over the constraints (12.88b), and hence solves (12.88). ❏ EXAMPLE 12.11 (LINEAR PROGRAMMING) An important special case of (12.81) is the linear programming problem min c T x subject to Ax − b ≥ 0, (12.89) for which the dual objective is q(λ) inf c T x − λT (Ax − b) inf (c − A T λ)T x + b T λ . x x If c − A T λ 0, the infimum is clearly −∞ (we can set x to be a large negative multiple of −(c − A T λ) to make q arbitrarily large and negative). When c − A T λ 0, on the other hand, the dual objective is simply b T λ. In maximizing q, we can exclude λ for which c − A T λ 0 from consideration (the maximum obviously cannot be attained at a point λ for which q(λ) −∞). Hence, we can write the dual problem (12.84) as follows: max b T λ λ subject to A T λ c, λ ≥ 0. (12.90) The Wolfe dual of (12.89) can be written as max c T x − λT (Ax − b) λ subject to A T λ c, λ ≥ 0, and by substituting the constraint A T λ − c 0 into the objective we obtain (12.90) again. For some matrices A, the dual problem (12.90) may be computationally easier to solve than the original problem (12.89). We discuss the possibilities further in Chapter 13. ❐ 12.9. ❏ EXAMPLE 12.12 DUALITY (CONVEX QUADRATIC PROGRAMMING) Consider min 1 T x Gx + c T x subject to Ax − b ≥ 0, 2 (12.91) where G is a symmetric positive definite matrix. The dual objective for this problem is q(λ) inf L(x, λ) inf x x 1 T x Gx + c T x − λT (Ax − b). 2 (12.92) Since G is positive definite, since L(·, λ) is a strictly convex quadratic function, the infimum is achieved when ∇x L(x, λ) 0, that is, Gx + c − A T λ 0. (12.93) Hence, we can substitute for x in the infimum expression and write the dual objective explicitly as follows: 1 q(λ) − (A T λ − c)T G −1 (A T λ − c)T + b T λ. 2 Alternatively, we can write the Wolfe dual form (12.88) by retaining x as a variable and including the constraint (12.93) explicitly in the dual problem, to obtain max (λ,x) subject to 1 T x Gx + c T x − λT (Ax − b) 2 Gx + c − A T λ 0, λ ≥ 0. (12.94) To make it clearer that the objective is concave, we can use the constraint to substitute (c − A T λ)T x −x T Gx in the objective, and rewrite the dual formulation as follows: 1 max − x T Gx + λT b, subject to Gx + c − A T λ 0, λ ≥ 0. (λ,x) 2 (12.95) ❐ Note that the Wolfe dual form requires only positive semidefiniteness of G. NOTES AND REFERENCES The theory of constrained optimization is discussed in many books on numerical optimization. The discussion in Fletcher [101, Chapter 9] is similar to ours, though a little 349 350 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION terser, and includes additional material on duality. Bertsekas [19, Chapter 3] emphasizes the role of duality and discusses sensitivity of the solution with respect to the active constraints in some detail. The classic treatment of Mangasarian [198] is particularly notable for its thorough description of constraint qualifications. It also has an extensive discussion of theorems of the alternative [198, Chapter 2], placing Farkas’ Lemma firmly in the context of other related results. The KKT conditions were described in a 1951 paper of Kuhn and Tucker [185], though they were derived earlier (and independently) in an unpublished 1939 master’s thesis of W. Karush. Lagrange multipliers and optimality conditions for general problems (including nonsmooth problems) are described in the deep and wide-ranging article of Rockafellar [270]. Duality theory for nonlinear programming is described in the books of Rockafellar [198] and Bertsekas [19]; the latter treatment is particularly extensive and general. The material in Section 12.9 is adapted from these sources. We return to our claim that the set N defined by N {By + Ct | y ≥ 0}, (where B and C are matrices of dimension n × m and n × p, respectively, and y and t are vectors of appropriate dimensions; see (12.45)) is a closed set. This fact is needed in the proof of Lemma 12.4 to ensure that the solution of the projection subproblem (12.47) is well-defined. The following technical result is well known; the proof given below is due to R. Byrd. Lemma 12.15. The set N is closed. PROOF. By splitting t into positive and negative parts, it is easy to see that N ⎧ ⎪ ⎨ ⎪ ⎩ ⎡ B C −C y ⎢ + ⎣ t t− ⎫ ⎤ ⎡ ⎤ y ⎪ ⎬ ⎥ ⎢ + ⎥ ⎦ ⎣ t ⎦ ≥ 0 . ⎪ ⎭ t− Hence, we can assume without loss of generality that N has the form N {By | y ≥ 0}. Suppose that B has dimensions n × m. First, we show that for any s ∈ N , we can write s B I y I with y I ≥ 0, where I ⊂ {1, 2, . . . , m}, B I is the column submatrix of B indexed by I with full column rank, and I has minimum cardinality. To prove this claim, we assume for contradiction that K ⊂ {1, 2, . . . , m} is an index set with minimal cardinality such that s B K y K , y K ≥ 0, yet 12.9. DUALITY the columns of B K are linearly dependent. Since K is minimal, y K has no zero components. We then have a nonzero vector w such that B K w 0. Since s B K (y K + τ w) for any τ , we can increase or decrease τ from 0 until one or more components of y K + τ w become zero, while the other components remain positive. We define K̄ by removing the indices from K that correspond to zero components of y K + τ w, and define ȳ K̄ to be the vector of strictly positive components of y K + τ w. We then have that s B K̄ ȳ K̄ and ȳ K̄ ≥ 0, contradicting our assumption that K was the set of minimal cardinality with this property. Now let {s k } be a sequence with s k ∈ N for all k and s k → s. We prove the lemma by showing that s ∈ N . By the claim of the previous paragraph, for all k we can write s k B Ik y Ikk with y Ikk ≥ 0, Ik is minimal, and the columns of B Ik are linearly independent. Since there only finitely many possible choices of index set Ik , at least one index set occurs infinitely often in the sequence. By choosing such an index set I , we can take a subsequence if necessary and assume without loss of generality that Ik ≡ I for all k. We then have that s k A I y Ik with y Ik ≥ 0 and A I has full column rank. Because of the latter property, we have that A TI A I is invertible, so that y Ik is defined uniquely as follows: y Ik (A TI A I )−1 A TI s k , k 0, 1, 2, . . . . By taking limits and using s k → s, we have that y Ik → y I (A TI A I )−1 A TI s, def and moreover y I ≥ 0, since y Ik ≥ 0 for all k. Hence we can write s B I y I with y I ≥ 0, and therefore s ∈ N . ✐ EXERCISES ✐ 12.1 The following example from [268] with a single variable x ∈ IR and a single equality constraint shows that strict local solutions are not necessarily isolated. Consider min x x 2 subject to c(x) 0, where c(x) x 6 sin(1/x) 0 if x 0 0 if x 0. (12.96) (a) Show that the constraint function is twice continuously differentiable at all x (including at x 0) and that the feasible points are x 0 and x 1/(kπ ) for all nonzero integers k. (b) Verify that each feasible point except x 0 is an isolated local solution by showing that there is a neighborhood N around each such point within which it is the only feasible point. 351 352 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION (c) Verify that x 0 is a global solution and a strict local solution, but not an isolated local solution ✐ 12.2 Is an isolated local solution necessarily a strict local solution? Explain. ✐ 12.3 Does problem (12.4) have a finite or infinite number of local solutions? Use the first-order optimality conditions (12.34) to justify your answer. ✐ 12.4 If f is convex and the feasible region is convex, show that local solutions of the problem (12.3) are also global solutions. Show that the set of global solutions is convex. (Hint: See Theorem 2.5.) ✐ 12.5 Let v : IRn → IRm be a smooth vector function and consider the unconstrained optimization problems of minimizing f (x) where f (x) v(x)∞ , f (x) max i1,2,...,m vi (x). Reformulate these (generally nonsmooth) problems as smooth constrained optimization problems. ✐ 12.6 Can you perform a smooth reformulation as in the previous question when f is defined by f (x) min i1,2,...,m f i (x)? (N.B. “min” not “max.”) Why or why not? ✐ 12.7 Show that the vector defined by (12.15) satisfies (12.14) when the first-order optimality condition (12.10) is not satisfied. ✐ 12.8 Verify that for the sequence {z k } defined by (12.30), the function f (x) x1 + x2 satisfies f (z k+1 ) > f (z k ) for k 2, 3, . . .. (Hint: Consider the trajectory z(s) def (− 2 − 1/s 2 , −1/s)T and show that the function h(s) f (z(s)) has h (s) > 0 for all s ≥ 2.) ✐ 12.9 Consider the problem (12.9). Specify two feasible sequences that approach the maximizing point (1, 1)T , and show that neither sequence is a decreasing sequence for f . ✐ 12.10 Verify that neither the LICQ nor the MFCQ holds for the constraint set defined by (12.32) at x ∗ (0, 0)T . ✐ 12.11 Consider the feasible set in IR2 defined by x2 ≥ 0, x2 ≤ x12 . (a) For x ∗ (0, 0)T , write down T (x ∗ ) and F(x ∗ ). (b) Is LICQ satisfied at x ∗ ? Is MFCQ satisfied? 12.9. DUALITY (c) If the objective function is f (x) −x2 , verify that that KKT conditions (12.34) are satisfied at x ∗ . (d) Find a feasible sequence {z k } approaching x ∗ with f (z k ) < f (x ∗ ) for all k. ✐ 12.12 It is trivial to construct an example of a feasible set and a feasible point x ∗ at which the LICQ is satisfied but the constraints are nonlinear. Give an example of the reverse situation, that is, where the active constraints are linear but the LICQ is not satisfied. ✐ 12.13 Show that for the feasible region defined by (x1 − 1)2 + (x2 − 1)2 ≤ 2, (x1 − 1)2 + (x2 + 1)2 ≤ 2, x1 ≥ 0, the MFCQ is satisfied at x ∗ (0, 0)T but the LICQ is not satisfied. ✐ 12.14 Consider the half space defined by H {x ∈ IRn | a T x + α ≥ 0} where a ∈ IRn and α ∈ IR are given. Formulate and solve the optimization problem for finding the point x in H that has the smallest Euclidean norm. ✐ 12.15 Consider the following modification of (12.36), where t is a parameter to be fixed prior to solving the problem: ⎡ min x x1 − 3 2 2 + (x2 − t)4 s.t. 1 − x1 − x2 ⎢ ⎢ 1 − x1 + x2 ⎢ ⎢ 1+x −x 1 2 ⎣ 1 + x1 + x2 ⎤ ⎥ ⎥ ⎥ ≥ 0. ⎥ ⎦ (12.97) (a) For what values of t does the point x ∗ (1, 0)T satisfy the KKT conditions? (b) Show that when t 1, only the first constraint is active at the solution, and find the solution. ✐ 12.16 (Fletcher [101]) Solve the problem min x1 + x2 subject to x12 + x22 1 x by eliminating the variable x2 . Show that the choice of sign for a square root operation during the elimination process is critical; the “wrong” choice leads to an incorrect answer. ✐ 12.17 Prove that when the KKT conditions (12.34) and the LICQ are satisfied at a point x ∗ , the Lagrange multiplier λ∗ in (12.34) is unique. 353 354 CHAPTER 12. THEORY OF CONSTRAINED OPTIMIZATION ✐ 12.18 Consider the problem of finding the point on the parabola y 15 (x − 1)2 that is closest to (x, y) (1, 2), in the Euclidean norm sense. We can formulate this problem as min f (x, y) (x − 1)2 + (y − 2)2 subject to (x − 1)2 5y. (a) Find all the KKT points for this problem. Is the LICQ satisfied? (b) Which of these points are solutions? (c) By directly substituting the constraint into the objective function and eliminating the variable x, we obtain an unconstrained optimization problem. Show that the solutions of this problem cannot be solutions of the original problem. ✐ 12.19 Consider the problem min2 f (x) −2x1 + x2 subject to x∈IR (1 − x1 )3 − x2 ≥ 0 x2 + ≥ 0. 0.25x12 −1 The optimal solution is x ∗ (0, 1)T , where both constraints are active. (a) Do the LICQ hold at this point? (b) Are the KKT conditions satisfied? (c) Write down the sets F(x ∗ ) and C(x ∗ , λ∗ ). (d) Are the second-order necessary conditions satisfied? Are the second-order sufficient conditions satisfied? ✐ 12.20 Find the minima of the function f (x) x1 x2 on the unit circle x12 + x22 1. Illustrate this problem geometrically. ✐ 12.21 Find the maxima of f (x) x1 x2 over the unit disk defined by the inequality constraint 1 − x12 − x22 ≥ 0. ✐ 12.22 Show that for (12.1), the feasible set is convex if ci , i ∈ E are linear functions and −ci , i ∈ I are convex functions. This is page 355 Printer: Opaque this 13 CHAPTER Linear Programming: The Simplex Method Dantzig’s development of the simplex method in the late 1940s marks the start of the modern era in optimization. This method made it possible for economists to formulate large models and analyze them in a systematic and efficient way. Dantzig’s discovery coincided with the development of the first electronic computers, and the simplex method became one of the earliest important applications of this new and revolutionary technology. From those days to the present, computer implementations of the simplex method have been continually improved and refined. They have benefited particularly from interactions with numerical analysis, a branch of mathematics that also came into its own with the appearance of electronic computers, and have now reached a high level of sophistication. 356 CHAPTER 13. THE SIMPLEX METHOD Today, linear programming and the simplex method continue to hold sway as the most widely used of all optimization tools. Since 1950, generations of workers in management, economics, finance, and engineering have been trained in the techniques of formulating linear models and solving them with simplex-based software. Often, the situations they model are actually nonlinear, but linear programming is appealing because of the advanced state of the software, guaranteed convergence to a global minimum, and the fact that uncertainty in the model makes a linear model more appropriate than an overly complex nonlinear model. Nonlinear programming may replace linear programming as the method of choice in some applications as the nonlinear software improves, and a new class of methods known as interior-point methods (see Chapter 14) has proved to be faster for some linear programming problems, but the continued importance of the simplex method is assured for the foreseeable future. LINEAR PROGRAMMING Linear programs have a linear objective function and linear constraints, which may include both equalities and inequalities. The feasible set is a polytope, a convex, connected set with flat, polygonal faces. The contours of the objective function are planar. Figure 13.1 depicts a linear program in two-dimensional space, in which the contours of the objective function are indicated by dotted lines. The solution in this case is unique—a single vertex. A simple reorientation of the polytope or the objective gradient c could however make the solution non-unique; the optimal value c T x could take on the same value over an entire edge. In higher dimensions, the set of optimal points can be a single vertex, an edge or face, or even the entire feasible set. The problem has no solution if the feasible set is empty (the infeasible case) or if the objective function is unbounded below on the feasible region (the unbounded case). Linear programs are usually stated and analyzed in the following standard form: min c T x, subject to Ax b, x ≥ 0, (13.1) where c and x are vectors in IRn , b is a vector in IRm , and A is an m × n matrix. Simple devices can be used to transform any linear program to this form. For instance, given the problem min c T x, subject to Ax ≤ b (without any bounds on x), we can convert the inequality constraints to equalities by introducing a vector of slack variables z and writing min c T x, subject to Ax + z b, z ≥ 0. (13.2) This form is still not quite standard, since not all the variables are constrained to be CHAPTER 13. THE SIMPLEX METHOD c feasible polytope optimal point x* Figure 13.1 A linear program in two dimensions with solution at x ∗ . nonnegative. We deal with this by splitting x into its nonnegative and nonpositive parts, x x + − x − , where x + max(x, 0) ≥ 0 and x − max(−x, 0) ≥ 0. The problem (13.2) can now be written as ⎡ c ⎤T ⎡ x+ ⎤ ⎡ ⎥ ⎢ ⎥ ⎢ min ⎣ −c ⎦ ⎣ x − ⎦ , s.t. 0 z A −A I x+ ⎤ ⎡ x+ ⎤ ⎢ − ⎥ ⎢ ⎥ ⎣ x ⎦ b, ⎣ x − ⎦ ≥ 0, z z which clearly has the same form as (13.1). Inequality constraints of the form x ≤ u or Ax ≥ b always can be converted to equality constraints by adding or subtracting slack variables to make up the difference between the left- and right-hand sides. Hence, x ≤ u ⇔ x + w u, w ≥ 0, Ax ≥ b ⇔ Ax − y b, y ≥ 0. (When we subtract the variables from the left hand side, as in the second case, they are sometimes known as surplus variables.) We can also convert a “maximize” objective max c T x into the “minimize” form of (13.1) by simply negating c to obtain: min (−c)T x. We say that the linear program (13.1) is infeasible if the feasible set is empty. We say that the problem (13.1) is unbounded if the objective function is unbounded below on the feasible region, that is, there is a sequence of points x k feasible for (13.1) such that c T x k ↓ −∞. (Of course, unbounded problems have no solution). 357 358 CHAPTER 13. THE SIMPLEX METHOD Many linear programs arise from models of transshipment and distribution networks. These problems have additional structure in their constraints; special-purpose simplex algorithms that exploit this structure are highly efficient. We do not discuss such problems further in this book, except to note that the subject is important and complex, and that a number of fine texts on the topic are available (see, for example, Ahuja, Magnanti, and Orlin [1]). For the standard formulation (13.1), we will assume throughout that m < n. Otherwise, the system Ax b contains redundant rows, or is infeasible, or defines a unique point. When m ≥ n, factorizations such as the Q R or LU factorization (see Appendix A) can be used to transform the system Ax b to one with a coefficient matrix of full row rank. 13.1 OPTIMALITY AND DUALITY OPTIMALITY CONDITIONS Optimality conditions for the problem (13.1) can be derived from the theory of Chapter 12. Only the first-order conditions—the Karush–Kuhn–Tucker (KKT) conditions— are needed. Convexity of the problem ensures that these conditions are sufficient for a global minimum. We do not need to refer to the second-order conditions from Chapter 12, which are not informative in any case because the Hessian of the Lagrangian for (13.1) is zero. The theory we developed in Chapter 12 make derivation of optimality and duality results for linear programming much easier than in other treatments, where this theory is developed more or less from scratch. The KKT conditions follow from Theorem 12.1. As stated in Chapter 12, this theorem requires linear independence of the active constraint gradients (LICQ). However, as we noted in Section 12.6, the result continues to hold for dependent constraints provided they are linear, as is the case here. We partition the Lagrange multipliers for the problem (13.1) into two vectors λ and s, where λ ∈ IRm is the multiplier vector for the equality constraints Ax b, while s ∈ IRn is the multiplier vector for the bound constraints x ≥ 0. Using the definition (12.33), we can write the Lagrangian function for (13.1) as L(x, λ, s) c T x − λT (Ax − b) − s T x. (13.3) Applying Theorem 12.1, we find that the first-order necessary conditions for x ∗ to be a solution of (13.1) are that there exist vectors λ and s such that A T λ + s c, (13.4a) Ax b, (13.4b) x ≥ 0, (13.4c) s ≥ 0, (13.4d) xi si 0, i 1, 2, . . . , n. (13.4e) 13.1. OPTIMALITY AND DUALITY The complementarity condition (13.4e), which essentially says that at least one of the components xi and si must be zero for each i 1, 2, . . . , n, is often written in the alternative form x T s 0. Because of the nonnegativity conditions (13.4c), (13.4d), the two forms are identical. Let (x ∗ , λ∗ , s ∗ ) denote a vector triple that satisfies (13.4). By combining the three equalities (13.4a), (13.4d), and (13.4e), we find that c T x ∗ (A T λ∗ + s ∗ )T x ∗ (Ax ∗ )T λ∗ b T λ∗ . (13.5) As we shall see in a moment, b T λ is the objective function for the dual problem to (13.1), so (13.5) indicates that the primal and dual objectives are equal for vector triples (x, λ, s) that satisfy (13.4). It is easy to show directly that the conditions (13.4) are sufficient for x ∗ to be a global solution of (13.1). Let x̄ be any other feasible point, so that A x̄ b and x̄ ≥ 0. Then c T x̄ (Aλ∗ + s ∗ )T x̄ b T λ∗ + x̄ T s ∗ ≥ b T λ∗ c T x ∗ . (13.6) We have used (13.4) and (13.5) here; the inequality relation follows trivially from x̄ ≥ 0 and s ∗ ≥ 0. The inequality (13.6) tells us that no other feasible point can have a lower objective value than c T x ∗ . We can say more: The feasible point x̄ is optimal if and only if x̄ T s ∗ 0, since otherwise the inequality in (13.6) is strict. In other words, when si∗ > 0, then we must have x̄i 0 for all solutions x̄ of (13.1). THE DUAL PROBLEM Given the data c, b, and A, which defines the problem (13.1), we can define another, closely related, problem as follows: max b T λ, subject to A T λ ≤ c. (13.7) This problem is called the dual problem for (13.1). In contrast, (13.1) is often referred to as the primal. We can restate (13.7) in a slightly different form by introducing a vector of dual slack variables s, and writing max b T λ, subject to A T λ + s c, s ≥ 0. (13.8) The variables (λ, s) in this problem are sometimes jointly referred to collectively as dual variables. 359 360 CHAPTER 13. THE SIMPLEX METHOD The primal and dual problems present two different viewpoints on the same data. Their close relationship becomes evident when we write down the KKT conditions for (13.7). Let us first restate (13.7) in the form min −b T λ subject to c − A T λ ≥ 0, to fit the formulation (12.1) from Chapter 12. By using x ∈ IRn to denote the Lagrange multipliers for the constraints A T λ ≤ c, we see that the Lagrangian function is L̄(λ, x) −b T λ − x T (c − A T λ). Using Theorem 12.1 again, we find the first-order necessary conditions for λ to be optimal for (13.7) to be that there exists x such that Ax b, (13.9a) A λ ≤ c, (13.9b) x ≥ 0, (13.9c) T xi (c − A λ)i 0, i 1, 2, . . . , n. T (13.9d) Defining s c − A T λ (as in (13.8)), we find that the conditions (13.9) and (13.4) are identical! The optimal Lagrange multipliers λ in the primal problem are the optimal variables in the dual problem, while the optimal Lagrange multipliers x in the dual problem are the optimal variables in the primal problem. Analogously to (13.6), we can show that (13.9) are in fact sufficient conditions for a solution of the dual problem (13.7). Given x ∗ and λ∗ satisfying these conditions (so that the triple (x, λ, s) (x ∗ , λ∗ , c − A T λ∗ ) satisfies (13.4)), we have for any other dual feasible point λ̄ (with A T λ̄ ≤ c) that b T λ̄ (x ∗ )T A T λ̄ (x ∗ )T (A T λ̄ − c) + c T x ∗ ≤ cT x ∗ because A T λ̄ − c ≤ 0 and x ∗ ≥ 0 b T λ∗ from (13.5). Hence λ∗ achieves the maximum of the dual objective b T λ over the dual feasible region A T λ ≤ c, so it solves the dual problem (13.7). The primal–dual relationship is symmetric; by taking the dual of the dual problem (13.7), we recover the primal problem (13.1). We leave the proof of this claim as an exercise. Given a feasible vector x for the primal (satisfying Ax b and x ≥ 0) and a feasible point (λ, s) for the dual (satisfying A T λ + s c, s ≥ 0), we have as in (13.6) that c T x − b T λ (c − A T λ)T x s T x ≥ 0. (13.10) 13.1. OPTIMALITY AND DUALITY Therefore we have c T x ≥ b T λ (that is, the dual objective is a lower bound on the primal objective) when both the primal and dual variables are feasible—a result known as weak duality. The following strong duality result is fundamental to the theory of linear programming. Theorem 13.1 (Strong Duality). (i) If either problem (13.1) or (13.7) has a (finite) solution, then so does the other, and the objective values are equal. (ii) If either problem (13.1) or (13.7) is unbounded, then the other problem is infeasible. PROOF. For (i), suppose that (13.1) has a finite optimal solution x ∗ . It follows from Theorem 12.1 that there are vectors λ∗ and s ∗ such that (x ∗ , λ∗ , s ∗ ) satisfies (13.4). We noted above that (13.4) and (13.9) are equivalent, and that (13.9) are sufficient conditions for λ∗ to be a solution of the dual problem (13.7). Moreover, it follows from (13.5) that c T x ∗ b T λ∗ , as claimed. A symmetric argument holds if we start by assuming that the dual problem (13.7) has a solution. To prove (ii), suppose that the primal is unbounded, that is, there is a sequence of points x k , k 1, 2, 3, . . . such that c T x k ↓ −∞, Ax k b, x k ≥ 0. Suppose too that the dual (13.7) is feasible, that is, there exists a vector λ̄ such that A T λ̄ ≤ c. From the latter inequality together with x k ≥ 0, we have that λ̄T Ax k ≤ c T x k , and therefore λ̄T b λ̄T Ax k ≤ c T x k ↓ −∞, yielding a contradiction. Hence, the dual must be infeasible. A similar argument can be used to show that unboundedness of the dual implies infeasibility of the primal. As we showed in the discussion following Theorem 12.1, the multiplier values λ and s for (13.1) indicate the sensitivity of the optimal objective value to perturbations in the constraints. In fact, the process of finding (λ, s) for a given optimal x is often called sensitivity analysis. Considering the case of perturbations to the vector b (the right-hand side in (13.1) and objective gradient in (13.7)), we can make an informal argument to illustrate the sensitivity. Suppose that this small change produces small perturbations in the primal and dual solutions, and that the vectors s and x have zeros in the same locations as s and x, respectively. Since x and s are complementary (see (13.4e)) it follows that 0 x T s x T s (x)T s (x)T s. 361 362 CHAPTER 13. THE SIMPLEX METHOD We have from Theorem 13.1 that the optimal objectives of the primal and dual problems are equal, for both the original and perturbed problems, so c T x b T λ, c T (x + x) (b + b)T (λ + λ). Moreover, by feasibility of the perturbed solutions in the perturbed problems, we have A(x + x) b + b, A T λ −s. Hence, the change in optimal objective due to the perturbation is as follows: c T x (b + b)T (λ + λ) − b T λ (b + b)T λ + (b)T λ (x + x)T A T λ + (b)T λ (x + x)T s + (b)T λ (b)T λ. In particular, if b e j , where e j is the jth unit vector in IRm , we have for all sufficiently small that c T x λ j . (13.11) That is, the change in optimal objective is λ j times the size of the perturbation to b j , if the perturbation is small. 13.2 GEOMETRY OF THE FEASIBLE SET BASES AND BASIC FEASIBLE POINTS We assume for the remainder of the chapter that The matrix A in (13.1) has full row rank. (13.12) In practice, a preprocessing phase is applied to the user-supplied data to remove some redundancies from the given constraints and eliminate some of the variables. Reformulation by adding slack, surplus, and artificial variables can also result in A satisfying the property (13.12) . Each iterate generated by the simplex method is a basic feasible point of (13.1). A vector x is a basic feasible point if it is feasible and if there exists a subset B of the index set {1, 2, . . . , n} such that 13.2. GEOMETRY OF THE FEASIBLE SET • B contains exactly m indices; • i∈ / B ⇒ xi 0 (that is, the bound xi ≥ 0 can be inactive only if i ∈ B); • The m × m matrix B defined by B [Ai ]i∈B (13.13) is nonsingular, where Ai is the ith column of A. A set B satisfying these properties is called a basis for the problem (13.1). The corresponding matrix B is called the basis matrix. The simplex method’s strategy of examining only basic feasible points will converge to a solution of (13.1) only if (a) the problem has basic feasible points; and (b) at least one such point is a basic optimal point, that is, a solution of (13.1) that is also a basic feasible point. Happily, both (a) and (b) are true under reasonable assumptions, as the following result (sometimes known as the fundamental theorem of linear programming) shows. Theorem 13.2. (i) If (13.1) has a nonempty feasible region, then there is at least one basic feasible point; (ii) If (13.1) has solutions, then at least one such solution is a basic optimal point. (iii) If (13.1) is feasible and bounded, then it has an optimal solution. PROOF. Among all feasible vectors x, choose one with the minimal number of nonzero components, and denote this number by p. Without loss of generality, assume that the nonzeros are x1 , x2 , . . . , x p , so we have p Ai xi b. i1 Suppose first that the columns A1 , A2 , . . . , A p are linearly dependent. Then we can express one of them ( A p , say) in terms of the others, and write Ap p−1 i1 Ai z i , (13.14) 363 364 CHAPTER 13. THE SIMPLEX METHOD for some scalars z 1 , z 2 , . . . , z p−1 . It is easy to check that the vector x( ) x + (z 1 , z 2 , . . . , z p−1 , −1, 0, 0, . . . , 0)T x + z (13.15) satisfies Ax( ) b for any scalar . In addition, since xi > 0 for i 1, 2, . . . , p, we also have xi ( ) > 0 for the same indices i 1, 2, . . . , p and all sufficiently small in magnitude. However, there is a value ¯ ∈ (0, x p ] such that xi (¯ ) 0 for some i 1, 2, . . . , p. Hence, x(¯ ) is feasible and has at most p − 1 nonzero components, contradicting our choice of p as the minimal number of nonzeros. Therefore, columns A1 , A2 , . . . , A p must be linearly independent, and so p ≤ m. If p m, we are done, since then x is a basic feasible point and B is simply {1, 2, . . . , m}. Otherwise p < m and, because A has full row rank, we can choose m − p columns from among A p+1 , A p+2 , . . . , An to build up a set of m linearly independent vectors. We construct B by adding the corresponding indices to {1, 2, . . . , p}. The proof of (i) is complete. The proof of (ii) is quite similar. Let x ∗ be a solution with a minimal number of nonzero components p, and assume again that x1∗ , x2∗ , . . . , x ∗p are the nonzeros. If the columns A1 , A2 , . . . , A p are linearly dependent, we define x ∗ ( ) x ∗ + z, where z is chosen exactly as in (13.14), (13.15). It is easy to check that x ∗ ( ) will be feasible for all sufficiently small, both positive and negative. Hence, since x ∗ is optimal, we must have c T (x ∗ + z) ≥ c T x ∗ ⇒ cT z ≥ 0 for all sufficiently small (positive and negative). Therefore, c T z 0 and so c T x ∗ ( ) c T x ∗ for all . The same logic as in the proof of (i) can be applied to find ¯ > 0 such that x ∗ (¯ ) is feasible and optimal, with at most p − 1 nonzero components. This contradicts our choice of p as the minimal number of nonzeros, so the columns A1 , A2 , . . . , A p must be linearly independent. We can now apply the same reasoning as above to conclude that x ∗ is already a basic feasible point and therefore a basic optimal point. The final statement (iii) is a consequence of finite termination of the simplex method. We comment on the latter property in the next section. The terminology we use here is not quite standard, as the following table shows: our terminology basic feasible point basic optimal point terminology used elsewhere basic feasible solution optimal basic feasible solution The standard terms arose because “solution” and “feasible solution” were originally used as synonyms for “feasible point.” However, as the discipline of optimization developed, 13.2. * GEOMETRY OF THE FEASIBLE SET * * * * * * * * * Figure 13.2 Vertices of a three-dimensional polytope (indicated by ∗). the word “solution” took on a more specific and intuitive meaning (as in “solution to the problem”). We maintain consistency with the rest of the book by following this more modern usage. VERTICES OF THE FEASIBLE POLYTOPE The feasible set defined by the linear constraints is a polytope, and the vertices of this polytope are the points that do not lie on a straight line between two other points in the set. Geometrically, they are easily recognizable; see Figure 13.2. Algebraically, the vertices are exactly the basic feasible points defined above. We therefore have an important relationship between the algebraic and geometric viewpoints and a useful aid to understanding how the simplex method works. Theorem 13.3. All basic feasible points for (13.1) are vertices of the feasible polytope {x | Ax b, x ≥ 0}, and vice versa. PROOF. Let x be a basic feasible point and assume without loss of generality that B {1, 2, . . . , m}. The matrix B [Ai ]i1,2,...,m is therefore nonsingular, and xm+1 xm+2 · · · xn 0. (13.16) Suppose that x lies on a straight line between two other feasible points y and z. Then we can find α ∈ (0, 1) such that x αy + (1 − α)z. Because of (13.16) and the fact that α and 1 − α are both positive, we must have yi z i 0 for i m + 1, m + 2, . . . , n. Writing xB (x1 , x2 , . . . , xm )T and defining yB and z B likewise, we have from Ax Ay Az b 365 366 CHAPTER 13. THE SIMPLEX METHOD that BxB ByB Bz B b, and so, by nonsingularity of B, we have xB yB z B . Therefore, x y z, contradicting our assertion that y and z are two feasible points other than x. Therefore, x is a vertex. Conversely, let x be a vertex of the feasible polytope, and suppose that the nonzero components of x are x1 , x2 , . . . , x p . If the corresponding columns A1 , A2 , . . . , A p are linearly dependent, then we can construct the vector x( ) x + z as in (13.15). Since x( ) is feasible for all with sufficiently small magnitude, we can define ˆ > 0 such that x(ˆ ) and x(−ˆ ) are both feasible. Since x x(0) obviously lies on a straight line between these two points, it cannot be a vertex. Hence our assertion that A1 , A2 , . . . , A p are linearly dependent must be incorrect, so these columns must be linearly independent and p ≤ m. If p < m, and since A has full row rank, we can add m − p indices to {1, 2, . . . , p} to form a basis B, for which x is the corresponding basic feasible point. This completes our proof. We conclude this discussion of the geometry of the feasible set with a definition of degeneracy. This term has a variety of meanings in optimization, as we discuss in Chapter 16. For the purposes of this chapter, we use the following definition. Definition 13.1 (Degeneracy). A basis B is said to be degenerate if xi 0 for some i ∈ B, where x is the basic feasible solution corresponding to B. A linear program (13.1) is said to be degenerate if it has at least one degenerate basis. 13.3 THE SIMPLEX METHOD OUTLINE In this section we give a detailed description of the simplex method for (13.1). There are actually a number of variants the simplex method; the one described here is sometimes known as the revised simplex method. (We will describe an alternative known as the dual simplex method in Section 13.6.) As we described above, all iterates of the simplex method are basic feasible points for (13.1) and therefore vertices of the feasible polytope. Most steps consist of a move from one vertex to an adjacent one for which the basis B differs in exactly one component. On most steps (but not all), the value of the primal objective function c T x is decreased. Another type of step occurs when the problem is unbounded: The step is an edge along which the objective function is reduced, and along which we can move infinitely far without ever reaching a vertex. 13.3. THE SIMPLEX METHOD The major issue at each simplex iteration is to decide which index to remove from the basis B. Unless the step is a direction of unboundedness, a single index must be removed from B and replaced by another from outside B. We can gain some insight into how this decision is made by looking again at the KKT conditions (13.4). From B and (13.4), we can derive values for not just the primal variable x but also the dual variables (λ, s), as we now show. First, define the nonbasic index set N as the complement of B, that is, N {1, 2, . . . , n}\B. (13.17) Just as B is the basic matrix, whose columns are Ai for i ∈ B, we use N to denote the nonbasic matrix N [Ai ]i∈N . We also partition the n-element vectors x, s, and c according to the index sets B and N , using the notation xB [xi ]i∈B , xN [xi ]i∈N , sB [si ]i∈B , sN [si ]i∈N , cB [ci ]i∈B , cN [ci ]i∈N . From the KKT condition (13.4b), we have that Ax BxB + N xN b. The primal variable x for this simplex iterate is defined as xB B −1 b, xN 0. (13.18) Since we are dealing only with basic feasible points, we know that B is nonsingular and that xB ≥ 0, so this choice of x satisfies two of the KKT conditions: the equality constraints (13.4b) and the nonnegativity condition (13.4c). We choose s to satisfy the complementarity condition (13.4e) by setting sB 0. The remaining components λ and sN can be found by partitioning this condition into cB and cN components and using sB 0 to obtain B T λ cB , N T λ + sN cN . (13.19) Since B is square and nonsingular, the first equation uniquely defines λ as λ B −T cB . (13.20) The second equation in (13.19) implies a value for sN : sN cN − N T λ cN − (B −1 N )T cB . (13.21) 367 368 CHAPTER 13. THE SIMPLEX METHOD Computation of the vector sN is often referred to as pricing. The components of sN are often called the reduced costs of the nonbasic variables xN . The only KKT condition that we have not enforced explicitly is the nonnegativity condition s ≥ 0. The basic components sB certainly satisfy this condition, by our choice sB 0. If the vector sN defined by (13.21) also satisfies sN ≥ 0, we have found an optimal vector triple (x, λ, s), so the algorithm can terminate and declare success. Usually, however, one or more of the components of sN are negative. The new index to enter the basis B—the entering index—is chosen to be one of the indices q ∈ N for which sq < 0. As we show below, the objective c T x will decrease when we allow xq to become positive if and only if (i) sq < 0 and (ii) it is possible to increase xq away from zero while maintaining feasibility of x. Our procedure for altering B and changing x and s can be described accordingly as follows: • allow xq to increase from zero during the next step; • fix all other components of xN at zero, and figure out the effect of increasing xq on the current basic vector xB , given that we want to stay feasible with respect to the equality constraints Ax b; • keep increasing xq until one of the components of xB (x p , say) is driven to zero, or determining that no such component exists (the unbounded case); • remove index p (known as the leaving index) from B and replace it with the entering index q. This process of selecting entering and leaving indices, and performing the algebraic operations necessary to keep track of the values of the variables x, λ, and s, is sometimes known as pivoting. We now formalize the pivoting procedure in algebraic terms. Since both the new iterate x + and the current iterate x should satisfy Ax b, and since xN 0 and xi+ 0 for i ∈ N \{q}, we have Ax + BxB+ + Aq xq+ BxB Ax. By multiplying this expression by B −1 and rearranging, we obtain xB+ xB − B −1 Aq xq+ . (13.22) Geometrically speaking, (13.22) is usually a move along an edge of the feasible polytope that decreases c T x. We continue to move along this edge until a new vertex is encountered. At this vertex, a new constraint x p ≥ 0 must have become active, that is, one of the components x p , p ∈ B, has decreased to zero. We then remove this index p from the basis B and replace it by q. 13.3. THE SIMPLEX METHOD We now show how the step defined by (13.22) affects the value of c T x. From (13.22), we have c T x + cBT xB+ + cq xq+ cBT xB − cBT B −1 Aq xq+ + cq xq+ . (13.23) From (13.20) we have cBT B −1 λT , while from the second equation in (13.19), since q ∈ N , we have AqT λ cq − sq . Therefore, cBT B −1 Aq xq+ λT Aq xq+ (cq − sq )xq+ , so by substituting in (13.23) we obtain c T x + cBT xB − (cq − sq )xq+ + cq xq+ c T x + sq xq+ . (13.24) Since q was chosen to have sq < 0, it follows that the step (13.22) produces a decrease in the primal objective function c T x whenever xq+ > 0. It is possible that we can increase xq+ to ∞ without ever encountering a new vertex. In other words, the constraint xB+ xB − B −1 Aq xq+ ≥ 0 holds for all positive values of xq+ . When this happens, the linear program is unbounded; the simplex method has identified a ray that lies entirely within the feasible polytope along which the objective c T x decreases to −∞. Figure 13.3 shows a path traversed by the simplex method for a problem in IR2 . In this example, the optimal vertex x ∗ is found in three steps. If the basis B is nondegenerate (see Definition 13.1), then we are guaranteed that xq+ > 0, so we can be assured of a strict decrease in the objective function c T x at this step. If c 0 1 simplex path 2 3 Figure 13.3 Simplex iterates for a two-dimensional problem. 369 370 CHAPTER 13. THE SIMPLEX METHOD the problem (13.1) is nondegenerate, we can ensure a decrease in c T x at every step, and can therefore prove the following result concerning termination of the simplex method. Theorem 13.4. Provided that the linear program (13.1) is nondegenerate and bounded, the simplex method terminates at a basic optimal point. PROOF. The simplex method cannot visit the same basic feasible point x at two different iterations, because it attains a strict decrease at each iteration. Since the number of possible bases B is finite (there are only a finite number of ways to choose a subset of m indices from {1, 2, . . . , n}), and since each basis defines a single basic feasible point, there are only a finite number of basic feasible points. Hence, the number of iterations is finite. Moreover, since the method is always able to take a step away from a nonoptimal basic feasible point, and since the problem is not unbounded, the method must terminate at a basic optimal point. This result gives us a proof of Theorem 13.2 (iii) in the case in which the linear program is nondegenerate. The proof of finite termination is considerably more complex when nondegeneracy of (13.1) is not assumed, as we discuss at the end of Section 13.5. A SINGLE STEP OF THE METHOD We have covered most of the mechanics of taking a single step of the simplex method. To make subsequent discussions easier to follow, we summarize our description. Procedure 13.1 (One Step of Simplex). Given B, N , xB B −1 b ≥ 0, xN 0; Solve B T λ cB for λ, Compute sN cN − N T λ; (∗ pricing ∗ ) if sN ≥ 0 stop; (∗ optimal point found ∗ ) Select q ∈ N with sq < 0 as the entering index; Solve Bd Aq for d; if d ≤ 0 stop; (∗ problem is unbounded ∗ ) Calculate xq+ mini | di >0 (xB )i /di , and use p to denote the minimizing i; Update xB+ xB − d xq+ , xN+ (0, . . . , 0, xq+ , 0, . . . , 0)T ; Change B by adding q and removing the basic variable corresponding to column p of B. We illustrate this procedure with a simple example. 13.3. THE SIMPLEX METHOD ❏ EXAMPLE 13.1 Consider the problem min −4x1 − 2x2 subject to x1 + x2 + x3 5, 2x1 + (1/2)x2 + x4 8, x ≥ 0. Suppose we start with the basis B {3, 4}, for which we have xB x3 x4 5 , 8 λ 0 0 sN , s1 s2 −3 , −2 and an objective value of c T x 0. Since both elements of sN are negative, we could choose either 1 or 2 to be the entering variable. Suppose we choose q 1. We obtain d (1, 2)T , so we cannot (yet) conclude that the problem is unbounded. By performing the ratio calculation, we find that p 2 (corresponding to the index 4) and x1+ 4. We update the basic and nonbasic index sets to B {3, 1} and N {4, 2}, and move to the next iteration. At the second iteration, we have xB x3 x1 1 4 , λ 0 −3/2 sN , s4 s2 3/2 −5/4 , with an objective value of −12. We see that sN has one negative component, corresponding to the index q 2, so we select this index to enter the basis. We obtain d (3/2, −1/2)T , so again we do not detect unboundedness. Continuing, we find that the maximum value of x2+ is 4/3, and that p 1, which indicates that index 3 will leave the basis B. We update the index sets to B {2, 1} and N {4, 3} and continue. At the start of the third iteration, we have xB x2 x1 4/3 11/3 , λ −5/3 −2/3 , sN s4 s3 7/3 5/3 , with an objective value of c T x −41/3. We see that sN ≥ 0, so the optimality test is satisfied, and we terminate. ❐ We need to flesh out Procedure 13.1 with specifics of three important aspects of the implementation: 371 372 CHAPTER 13. THE SIMPLEX METHOD • Linear algebra issues—maintaining an LU factorization of B that can be used to solve for λ and d. • Selection of the entering index q from among the negative components of sN . (In general, there are many such components.) • Handling of degenerate bases and degenerate steps, in which it is not possible to choose a positive value of xq+ without violating feasibility. Proper handling of these issues is crucial to the efficiency of a simplex implementation. We give some details in the next three sections. 13.4 LINEAR ALGEBRA IN THE SIMPLEX METHOD We have to solve two linear systems involving the matrix B at each step; namely, B T λ cB , Bd Aq . (13.25) We never calculate the inverse basis matrix B −1 explicitly just to solve these systems. Instead, we calculate or maintain some factorization of B—usually an LU factorization—and use triangular substitutions with the factors to recover λ and d. It is less expensive to update the factorization than to calculate it afresh at each iteration because the basis matrix B changes by just a single column between iterations. The standard factorization/updating procedures start with an LU factorization of B at the first iteration of the simplex algorithm. Since in practical applications B is large and sparse, its rows and columns are rearranged during the factorization to maintain both numerical stability and sparsity of the L and U factors. One successful pivot strategy that trades off between these two aims was proposed by Markowitz in 1957 [202]; it is still used as the basis of many practical sparse LU algorithms. Other considerations may also enter into our choice of row and column reordering of B. For example, it may help to improve the efficiency of the updating procedure if as many as possible of the leading columns of U contain just a single nonzero, on the diagonal. Many heuristics have been devised for choosing row and column permutations that produce this and other desirable structural features. Let us assume for simplicity that row and column permutations are already incorporated in B, so that we write the initial LU factorization as LU B, (13.26) (L is unit lower triangular, U is upper triangular). The system Bd Aq can then be solved by the following two-step procedure: L d̄ Aq , U d d̄. (13.27) 13.4. LINEAR ALGEBRA IN THE SIMPLEX METHOD column p Figure 13.4 Left: L −1 B + , which is upper triangular except for the column occupied by A p . Right: After cyclic row and column permutation P1 , the non–upper triangular part of P1 L −1 B + P1T appears in the last row. Similarly, the system B T λ cB is solved by performing the following two triangular substitutions: U T λ̄ cB , L T λ λ̄. We now discuss a procedure for updating the factors L and U after one step of the simplex method, when the index p is removed from the basis B and replaced by the index q. The corresponding change to the basis matrix B is that the column B p is removed from B and replaced by Aq . We call the resulting matrix B + and note that if we rewrite (13.26) as U L −1 B, the modified matrix L −1 B + will be upper triangular except in column p. That is, L −1 B + has the form shown on the left in Figure 13.4. We now perform a cyclic permutation that moves column p to the last column position m and moves columns p + 1, p + 2, . . . , m one position to the left to make room for it. If we apply the same permutation to rows p through m, the net effect is to move the non-upper triangular part to the last row of the matrix, as shown in Figure 13.4. If we denote the permutation matrix by P1 , the matrix illustrated at right in Figure 13.4 is P1 L −1 B + P1T . Finally, we perform sparse Gaussian elimination on the matrix P1 L −1 B + P1T to restore upper triangular form. That is, we find L 1 and U1 (lower and upper triangular, respectively) such that P1 L −1 B + P1T L 1 U1 . (13.28) It is easy to show that L 1 and U1 have a simple form. The lower triangular matrix L 1 differs from the identity only in the last row, while U1 is identical to P1 L −1 B + P1T except that the (m, m) element is changed and the off-diagonal elements in the last row are eliminated. 373 374 CHAPTER 13. THE SIMPLEX METHOD We give details of this process for the case of m 5. Using the notation ⎡ ⎢ ⎢ ⎢ ⎢ −1 L B U ⎢ ⎢ ⎢ ⎣ u 11 u 12 u 13 u 14 u 22 u 23 u 24 u 33 u 34 u 15 ⎤ ⎡ ⎥ u 25 ⎥ ⎥ ⎥ u 35 ⎥ , ⎥ u 45 ⎥ ⎦ u 55 u 44 w1 ⎤ ⎥ ⎢ ⎢ w2 ⎥ ⎥ ⎢ ⎥ ⎢ L −1 Aq ⎢ w3 ⎥ , ⎥ ⎢ ⎢ w ⎥ ⎣ 4 ⎦ w5 and supposing that p 2 (so that the second column is replaced by L −1 Aq ), we have ⎡ u 11 ⎢ ⎢ ⎢ ⎢ −1 + L B ⎢ ⎢ ⎢ ⎣ w1 u 13 u 14 w2 u 23 u 24 w3 u 33 u 34 w4 u 44 w5 u 15 ⎤ ⎥ u 25 ⎥ ⎥ ⎥ u 35 ⎥ . ⎥ u 45 ⎥ ⎦ u 55 After the cyclic permutation P1 , we have ⎡ P1 L −1 B + P1 T ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ u 11 u 13 u 14 u 15 u 33 u 34 u 35 u 44 u 45 u 55 u 23 u 24 u 25 w1 ⎤ ⎥ w3 ⎥ ⎥ ⎥ w4 ⎥ . ⎥ w5 ⎥ ⎦ w2 (13.29) The factors L 1 and U1 are now as follows: ⎡ ⎢ ⎢ ⎢ ⎢ L1 ⎢ ⎢ ⎢ ⎣ ⎤ 1 ⎥ ⎥ ⎥ ⎥ ⎥, ⎥ ⎥ ⎦ 1 1 1 0 l52 l53 l54 ⎡ ⎢ ⎢ ⎢ ⎢ U1 ⎢ ⎢ ⎢ ⎣ u 11 u 13 u 14 u 15 u 33 u 34 u 35 u 44 u 45 u 55 1 w1 ⎤ ⎥ w3 ⎥ ⎥ ⎥ w4 ⎥ , ⎥ w5 ⎥ ⎦ ŵ2 (13.30) for certain values of l52 , l53 , l54 , and ŵ2 (see Exercise 13.10). The result of this updating process is the factorization (13.28), which we can rewrite as follows: B + L +U + , where L + L P1T L 1 , U + U1 P1 . (13.31) 13.5. OTHER IMPORTANT DETAILS There is no need to calculate L + and U + explicitly. Rather, the nonzero elements in L 1 and the last column of U1 , and the permutation information in P1 , can be stored in compact form, so that triangular substitutions involving L + and U + can be performed by applying a number of permutations and sparse triangular substitutions involving these factors. The factorization updates from subsequent simplex steps are stored and applied in a similar fashion. The procedure we have just outlined is due to Forrest and Tomlin [110]. It is quite efficient, because it requires the storage of little data at each update and does not require much movement of data in memory. Its major disadvantage is possible numerical instability. Large elements in the factors of a matrix are a sure indicator of instability, and the multipliers in the L 1 factor (l52 in (13.30), for example) may be very large. An earlier scheme of Bartels and Golub [12] allowed swapping of rows to avoid these problems. For instance, if |u 33 | < |u 23 | in (13.29), we could swap rows 2 and 5 to ensure that the subsequent multiplier l52 in the L 1 factor does not exceed 1 in magnitude. This improved stability comes at a price: The lower right corner of the upper triangular factor may become more dense during each update. Although the update information for each iteration (the permutation matrices and the sparse triangular factors) can often be stored in a highly compact form, the total amount of space may build up to unreasonable levels after many such updates have been performed. As the number of updates builds up, so does the time needed to solve for the vectors d and λ in Procedure 13.1. If an unstable updating procedure is used, numerical errors may also come into play, blocking further progress by the simplex algorithm. For all these reasons, most simplex implementations periodically calculate a fresh LU factorization of the current basis matrix B and discard the accumulated updates. The new factorization uses the same permutation strategies that we apply to the very first factorization, which balance the requirements of stability, sparsity, and structure. 13.5 OTHER IMPORTANT DETAILS PRICING AND SELECTION OF THE ENTERING INDEX There are usually many negative components of sN at each step. How do we choose one of these to become the index that enters the basis? Ideally, we would like to choose the sequence of entering indices q that gets us to the solution x ∗ in the fewest possible steps, but we rarely have the global perspective needed to implement this strategy. Instead, we use more shortsighted but practical strategies that obtain a significant decrease in c T x on just the present iteration. There is usually a tradeoff between the effort spent on finding a good entering index and the amount of decrease in c T x resulting from this choice. Different pivot strategies resolve this tradeoff in different ways. Dantzig’s original selection rule is one of the simplest. It chooses q such that sq is the most negative component of sN N T λ. This rule, which is motivated by (13.24), gives the maximum improvement in c T x per unit increase in the entering variable xq . A large 375 376 CHAPTER 13. THE SIMPLEX METHOD reduction in c T x is not guaranteed, however. It could be that we can increase xq+ only a tiny amount from zero (or not at all) before reaching the next vertex. Calculation of the entire vector sN from (13.21) requires a multiplication by N T , which can be expensive when the matrix N is very large. Partial pricing strategies calculate only a subvector of sN and make the choice of entering variable from among the negative entries in this subvector. To give all the indices in N a chance to enter the basis, these strategies cycle through the nonbasic elements, periodically changing the subvector of sN they evaluate so that no nonbasic index is ignored for too long. Neither of these strategies guarantees that we can make a substantial move along the chosen edge before reaching a new vertex. Multiple pricing strategies are more thorough: For a small subset of indices q ∈ N , they evaluate sq and, if sq < 0, the maximum value of xq+ that maintains feasibility of x + and the consequent change sq xq+ in the objective function (see (13.24)). Calculation of xq+ requires evaluation of d B −1 Aq as in Procedure 13.1, which is not cheap. Subsequent iterations deal with this same index subset until we reach an iteration at which all sq are nonnegative for q in the subset. At this point, the full vector sN is computed, a new subset of nonbasic indices is chosen, and the cycle begins again. This approach has the advantage that the columns of the matrix N outside the current subset of priced components need not be accessed at all, so memory access in the implementation is quite localized. Naturally, it is possible to devise heuristics that combine partial and multiple pricing in various imaginative ways. A sophisticated rule known as steepest edge chooses the “most downhill” direction from among all the candidates—the one that produces the largest decrease in c T x per unit distance moved along the edge. (By contrast, Dantzig’s rule maximizes the decrease in c T x per unit change in xq+ , which is not the same thing, as a small change in xq+ can correspond to a large distance moved along the edge.) During the pivoting step, the overall change in x is + x xB+ xN+ xB xN + −B −1 Aq eq xq+ x + ηq xq+ , (13.32) where eq is the unit vector with a 1 in the position corresponding to the index q ∈ N and zeros elsewhere, and the vector ηq is defined as ηq −B −1 Aq eq −d eq ; (13.33) see (13.25). The change in c T x per unit step along ηq is given by c T ηq . ηq The steepest-edge rule chooses q ∈ N to minimize this quantity. (13.34) 13.5. OTHER IMPORTANT DETAILS If we had to compute each ηi by solving Bd Ai for each i ∈ N , the steepest-edge strategy would be prohibitively expensive. Goldfarb and Reid [134] showed that the measure (13.34) of edge steepness for all indices i ∈ N can, in fact, be updated quite economically at each iteration. We outline their steepest-edge procedure by showing how each c T ηi and ηi can be updated at the current iteration. First, note that we already know the numerator c T ηi in (13.34) without calculating ηi , because by taking the inner product of (13.32) with c and using (13.24), we have that c T ηi si . To investigate the change in denominator ηi at this step, we define γi ηi 2 , where this quantity is defined before and after the update as follows: γi ηi 2 B −1 Ai 2 + 1, γi+ ηi+ 2 + −1 (B ) (13.35a) Ai + 1. 2 (13.35b) Assume without loss of generality that the entering column Aq replaces the first column of the basis matrix B (that is, p 1), and that this column corresponds to the index t. We can then express the update to B as follows: B + B + (Aq − At )e1T B + (Aq − Be1 )e1T , (13.36) where e1 (1, 0, 0, . . . , 0)T . By applying the Sherman–Morrison formula (A.27) to the rank-one update formula in (13.36), we obtain (B + )−1 B −1 − (B −1 Aq − e1 )e1T B −1 (d − e1 )e1T B −1 −1 B , − 1 + e1T (B −1 Aq − e1 ) e1T d where again we have used the fact that d B −1 Aq (see (13.25)). Therefore, we have that (B + )−1 Ai B −1 Ai − e1T B −1 Ai (d − e1 ). e1T d By substituting for (B + )−1 Ai in (13.35) and performing some simple manipulation, we obtain γi+ γi − 2 e1T B −1 Ai e1T d AiT B −T d + e1T B −1 Ai e1T d 2 γq . (13.37) Once we solve the following two linear systems to obtain d̂ and r : B T d̂ d, B T r e1 . (13.38) 377 378 CHAPTER 13. THE SIMPLEX METHOD The formula (13.37) then becomes γi+ γi − 2 r T Ai r T Aq d̂ T Ai + r T Ai r T Aq 2 γq . (13.39) Hence, the entire set of γi values, for i ∈ N with i q, can be calculated by solving the two systems (13.38) and then evaluating the inner products r T Ai and d̂ T Ai , for each i. The steepest-edge strategy does not guarantee that we can take a long step before reaching another vertex, but it has proved to be highly effective in practice. STARTING THE SIMPLEX METHOD The simplex method requires a basic feasible starting point x and a corresponding initial basis B ⊂ {1, 2, . . . , n} with |B| m such that the basis matrix B defined by (13.13) is nonsingular and xB B −1 b ≥ 0 and xN 0. The problem of finding this initial point and basis may itself be nontrivial—in fact, its difficulty is equivalent to that of actually solving a linear program. We describe here the two-phase approach that is commonly used to deal with this difficulty in practical implementations. In Phase I of this approach we set up an auxiliary linear program based on the data of (13.1), and solve it with the simplex method. The Phase-I problem is designed so that an initial basis and initial basic feasible point is trivial to find, and so that its solution gives a basic feasible initial point for the second phase. In Phase II, a second linear program similar to the original problem (13.1) is solved, with the Phase-I solution as a starting point. The solution of the original problem (13.1) can be extracted easily from the solution of the Phase-II problem. In Phase I we introduce artificial variables z into (13.1) and redefine the objective function to be the sum of these artificial variables, as follows: min e T z, subject to Ax + E z b, (x, z) ≥ 0, (13.40) where z ∈ IRm , e (1, 1, . . . , 1)T , and E is a diagonal matrix whose diagonal elements are E j j +1 if b j ≥ 0, E j j −1 if b j < 0. It is easy to see that the point (x, z) defined by x 0, z j |b j |, j 1, 2, . . . , m, (13.41) is a basic feasible point for (13.40). Obviously, this point satisfies the constraints in (13.40), while the initial basis matrix B is simply the diagonal matrix E, which is clearly nonsingular. At any feasible point for (13.40), the artificial variables z represent the amounts by which the constraints Ax b are violated by the x component. The objective function is 13.5. OTHER IMPORTANT DETAILS simply the sum of these violations, so by minimizing this sum we are forcing x to become feasible for the original problem (13.1). It is not difficult to see that the Phase-I problem (13.40) has an optimal objective value of zero if and only if the original problem (13.1) is feasible, by using the following argument: If there exists a vector (x̃, z̃) that is feasible for (13.40) such that e T z̃ 0, we must have z̃ 0, and therefore A x̃ b and x̃ ≥ 0, so x̃ is feasible for (13.1). Conversely, if x̃ is feasible for (13.1), then the point (x̃, 0) is feasible for (13.40) with an objective value of 0. Since the objective in (13.40) is obviously nonnegative at all feasible points, then (x̃, 0) must be optimal for (13.40), verifying our claim. In Phase I, we apply the simplex method to (13.40) from the initial point (13.41). This linear program cannot be unbounded, because its objective function is bounded below by 0, so the simplex method will terminate at an optimal point (assuming that it does not cycle; see below). If the objective e T z is positive at this solution, we conclude by the argument above that the original problem (13.1) is infeasible. Otherwise, the simplex method identifies a point (x̃, z̃) with e T z̃ 0, which is also a basic feasible point for the following Phase-II problem: min c T x subject to Ax + z b, x ≥ 0, 0 ≥ z ≥ 0. (13.42) Note that this problem differs from (13.40) in that the objective function is replaced by the original objective c T x, while upper bounds of 0 have been imposed on z. In fact, (13.42) is equivalent to (13.1), because any solution (and indeed any feasible point) must have z 0. We need to retain the artificial variables z in Phase II, however, since some components of z may still be present in the optimal basis from Phase I that we are using as the initial basis for (13.42), though of course the values z̃ j of these components must be zero. In fact, we can modify (13.42) to include only those components of z that are present in the optimal basis for (13.40). The problem (13.42) is not quite in standard form because of the two-sided bounds on z. However, it is easy to modify the simplex method described above to handle upper and lower bounds on the variables (we omit the details). We can customize the simplex algorithm slightly by deleting each component of z from the problem (13.42) as soon as it is swapped out of the basis. This strategy ensures that components of z do not repeatedly enter and leave the basis, thereby avoiding unnecessary simplex iterations. If (x ∗ , z ∗ ) is a basic solution of (13.42), it must have z ∗ 0, and so x ∗ is a solution of (13.1). In fact, x ∗ is a basic feasible point for (13.1), though this claim is not completely obvious because the final basis B for the Phase-II problem may still contain components of z ∗ , making it unsuitable as an optimal basis for (13.1). Since A has full row rank, however, we can construct an optimal basis for (13.1) in a postprocessing phase: Extract from B any components of z that are present, and replace them with nonbasic components of x in a way that maintains nonsingularity of the submatrix B defined by (13.13). A final point to note is that in many problems we do not need to add a complete set of m artificial variables to form the Phase-I problem. This observation is particularly relevant when slack and surplus variables have already been added to the problem formulation, as 379 380 CHAPTER 13. THE SIMPLEX METHOD in (13.2), to obtain a linear program with inequality constraints in standard form (13.1). Some of these slack/surplus variables can play the roles of artificial variables, making it unnecessary to include such variables explicitly. We illustrate this point with the following example. ❏ EXAMPLE 13.2 Consider the inequality-constrained linear program defined by min 3x1 + x2 + x3 subject to 2x1 + x2 + x3 ≤ 2, x1 − x2 − x3 ≤ −1, x ≥ 0. By adding slack variables to both inequality constraints, we obtain the following equivalent problem in standard form: min 3x1 + x2 + x3 subject to 2x1 + x2 + x3 + x4 2, x1 − x2 − x3 + x5 −1, x ≥ 0. By inspection, it is easy to see that the vector x (0, 0, 0, 2, 0) is feasible with respect to the first linear constraint and the lower bound x ≥ 0, though it does not satisfy the second constraint. Hence, in forming the Phase-I problem, we add just a single artificial variable z 2 to the second constraint and obtain min z 2 subject to 2x1 + x2 + x3 + x4 2, x1 − x2 − x3 + x5 − z 2 −1, (x, z 2 ) ≥ 0. (13.43) (13.44) (13.45) (13.46) It is easy to see that the vector (x, z 2 ) ((0, 0, 0, 2, 0), 1) is feasible with respect to (13.43). In fact, it is a basic feasible point, since the corresponding basis matrix B is 1 0 B , 0 −1 which is clearly nonsingular. In this example, the variable x4 plays the role of artificial variable for the first constraint. There was no need to add an explicit artificial variable z 1 . ❐ 13.5. OTHER IMPORTANT DETAILS DEGENERATE STEPS AND CYCLING As noted above, the simplex method may encounter situations in which for the entering index q, we cannot set xq+ any greater than zero in (13.22) without violating the nonnegativity condition x + ≥ 0. By referring to Procedure 13.1, we see that these situations arise when there is i with (xB )i 0 and di < 0, where d is defined by (13.25). Steps of this type are called degenerate steps. On such steps, the components of x do not change and, therefore, the objective function c T x does not decrease. However, the steps may still be useful because they change the basis B (by replacing one index), and the updated B may be closer to the optimal basis. In other words, the degenerate step may be laying the groundwork for reductions in c T x on later steps. Sometimes, however, a phenomenon known as cycling can occur. After a number of successive degenerate steps, we may return to an earlier basis B. If we continue to apply the algorithm from this point using the same rules for selecting entering and leaving indices, we will repeat the same cycle ad infinitum, never converging. Cycling was once thought to be a rare phenomenon, but in recent times it has been observed frequently in the large linear programs that arise as relaxations of integer programming problems. Since integer programs are an important source of linear programs, practical simplex codes usually incorporate a cycling avoidance strategy. In the remainder of this section, we describe a perturbation strategy and its close relative, the lexicographic strategy. Suppose that a degenerate basis is encountered at some simplex iteration, at which the basis is B̂ and the basis matrix is B̂, say. We consider a modified linear program in which we add a small perturbation to the right-hand side of the constraints in (13.1), as follows: ⎤ ⎡ ⎢ ⎢ ⎢ b( ) b + B̂ ⎢ ⎢ ⎣ 2 .. . ⎥ ⎥ ⎥ ⎥, ⎥ ⎦ m where is a very small positive number. This perturbation in b induces a perturbation in the components of the basic solution vector; we have ⎤ ⎡ ⎢ ⎢ ⎢ x B̂ ( ) x B̂ + ⎢ ⎢ ⎣ 2 .. . m ⎥ ⎥ ⎥ ⎥. ⎥ ⎦ (13.47) 381 382 CHAPTER 13. THE SIMPLEX METHOD Retaining the perturbation for subsequent iterations, we see that subsequent basic solutions have the form ⎤ ⎡ xB ( ) xB + B −1 ⎢ ⎢ ⎢ B̂ ⎢ ⎢ ⎣ 2 .. . ⎥ m ⎥ ⎥ (B −1 B̂)·k k , ⎥ xB + ⎥ k1 ⎦ (13.48) m where (B −1 B̂)·k denotes the kth column of B −1 B̂ and xB represents the basic solution for the unperturbed right-hand side b. From (13.47), we have that for all sufficiently small (but positive), (x B̂ ( ))i > 0 for all i. Hence, the basis is nondegenerate for the perturbed problem, and we can perform a step of the simplex method that produces a nonzero (but tiny) decrease in the objective. Indeed, if we retain the perturbation over all subsequent iterations, and provided that the initial choice of was small enough, we claim that all subsequent bases visited by the algorithm are nondegenerate. We prove this claim by contradiction, by assuming that there is some basis matrix B such that (xB ( ))i 0 for some i and all sufficiently small. From (13.48), we see that this can happen only when (xB )i 0 and (B −1 B̄)ik 0 for k 1, 2, . . . , m. The latter relation implies that the ith row of B −1 B̄ is zero, which cannot occur, because both B and B̄ are nonsingular. We conclude that, provided the initial choice of is sufficiently small to ensure nondegeneracy of all subsequent bases, no basis is visited more than once by the simplex method and therefore, by the same logic as in the proof of Theorem 13.4, the method terminates finitely at a solution of the perturbed problem. The perturbation can be removed in a postprocessing phase, by resetting xB B −1 b for the final basis B and the original right-hand side b. The question remains of how to choose small enough at the point at which the original degenerate basis B̂ is encountered. The lexicographic strategy finesses this issue by not making an explicit choice of , but rather keeping track of the dependence of each basic variable on each power of . When it comes to selecting the leaving variable, it chooses the index p that minimizes (xB ( ))i /di over all variables in the basis, for all sufficiently small . (The choice of p is uniquely defined by this procedure, as we can show by an argument similar to the one above concerning nondenegeracy of each basis.) We can extend the pivot procedure slightly to update the dependence of each basic variable on the powers of at each iteration, including the variable xq that has just entered the basis. 13.6 THE DUAL SIMPLEX METHOD Here we describe another variant of the simplex method that is useful in a variety of situations and is often faster on many practical problems than the variant described above. This dual 13.6. THE DUAL SIMPLEX METHOD simplex method uses many of the same concepts and methodology described above, such as the splitting of the matrix A into column submatrices B and N and the generation of iterates (x, λ, s) that satisfy the complementarity condition x T s 0. The method of Section 13.3 starts with a feasible x (with xB ≥ 0 and xN 0) and a corresponding dual iterate (λ, s) for which sB 0 but sN is not necessarily nonnegative. After making systematic column interchanges between B and N , it finally reaches a feasible dual point (λ, s) at which sN ≥ 0, thus yielding a solution of both the primal problem (13.1) and the dual (13.8). By contrast, the dual simplex method starts with a point (λ, s) feasible for (13.8), at which sN ≥ 0 and sB 0, and a corresponding primal feasible point x for which xN 0 but xB is not necessarily nonnegative. By making systematic column interchanges between B and N , it finally reaches a feasible primal point x for which xB ≥ 0, signifying optimality. Note that although the matrix B used in this algorithm is a nonsingular column submatrix of A, it is no longer correct to refer to it as a basis matrix, since it does not satisfy the feasibility condition xB B −1 b ≥ 0. We now describe a single step of this method in a similar fashion to Section 13.3, though the details are a little more complicated here. As mentioned above, we commence each step with submatrices B and N of A, and corresponding sets B and N . The primal and dual variables corresponding to these sets are defined as follows (cf. (13.18), (13.20), and (13.21)): xB B −1 b, λB sB cB − B λ 0, T xN 0, −T (13.49a) cB , (13.49b) sN cN − N λ ≥ 0, T (13.49c) If xB ≥ 0, the current point (x, λ, s) satisfies the optimality conditions (13.4), and we are done. Otherwise, we select a leaving index q ∈ B such that xq < 0. Our aim is to move xq to zero (thereby ensuring that nonnegativity holds for this component), while allowing sq to increase away from zero. We will also identify an entering index r ∈ N , such that sr becomes zero on this step while xr increases away from zero. Hence, the index q will move from B to N , while r will move from N to B. How do we choose r , and how are x, λ, and s changed on this step? The description below provides the answer. We use (x + , λ+ , s + ) to denote the updated values of our variables, after this step is taken. First, let eq the vector of length m that contains all zeros except for a 1 in the position occupied by index q in the set B. Since we increase sq away from zero while fixing the remaining components of sB at zero, the updated value sB+ will have the form sB+ sB + αeq (13.50) for some positive scalar α to be determined. We write the corresponding update to λ as λ+ λ + αv, (13.51) 383 384 CHAPTER 13. THE SIMPLEX METHOD for some vector v. In fact, since sB+ and λ+ must satisfy the first equation in (13.49c), we must have sB+ cB − B T λ+ ⇒ sB + αeq cB − B T (λ + αv) ⇒ eq −B T v, (13.52) which is a system of equations that we can solve to obtain v. To see how the dual objective value b T λ changes as a result of this step, we use (13.52) and the fact that xq xBT eq to obtain b T λ+ b T λ + αb T v b T λ − αb T B −T eq from (13.52) b λ − αxB eq from (13.49a) b λ − αxq by definition of eq . T T T Since xq < 0 and since our aim is to maximize the dual objective, we would like to choose α as large as possible. The upper bound on α is provided by the constraint sN+ ≥ 0. Similarly to (13.49c), we have sN+ cN − N T λ+ sN − α N T v sN − αw, where we have defined w N T v −N T B −T eq . The largest α for which sN+ ≥ 0 is given by the formula α min j∈N , w j >0 sj . wj We define the entering index r to be the index at which the minimum in this expression is achieved. Note that sr+ 0 and wr ArT v > 0, (13.53) where, as usual, Ar denotes the r th column of A. Having now identified how λ and s are updated on this step, we need to figure out how x changes. For the leaving index q, we need to set xq+ 0, while for the entering index r we can allow xr+ to be nonzero. We denote the direction of change for xB to be the vector 13.7. PRESOLVING d, defined by the following linear system: Bd Ai di Ar . (13.54) i∈B Since from (13.49a), we have Ai xi b, i∈B we have that Ai (xi − γ di ) + Ar γ b, (13.55) i∈B for any scalar γ . To ensure that xq+ 0, we set γ xq , dq (13.56) which is well defined only if dq is nonzero. In fact, we have that dq < 0, since dq d T eq ArT B −T eq −ArT v −wr < 0, where we have used the definition of eq along with (13.54), (13.52), and (13.53) to derive these relationships. Since xq < 0, it follows from (13.56) that γ > 0. Following (13.55) we can define the updated vector x + as follows: xi+ 13.7 ⎧ xi − γ di , ⎪ ⎪ ⎪ ⎪ ⎨ 0, ⎪ 0, ⎪ ⎪ ⎪ ⎩ γ, for i ∈ B with i q, for i q, for i ∈ N with i r , for i r . PRESOLVING Presolving (also known as preprocessing) is carried out in practical linear programming codes to reduce the size of the user-defined linear programming problem before passing it to the solver. A variety of techniques—some obvious, some ingenious—are used to eliminate certain variables, constraints, and bounds from the problem. Often the reduction in problem size is quite dramatic, and the linear programming algorithm takes much less time when applied to the presolved problem than when applied to the original problem. Presolving is 385 386 CHAPTER 13. THE SIMPLEX METHOD beneficial regardless of what algorithm is used to solve the linear program; it is used both in simplex and interior-point codes. Infeasibility may also be detected by the presolver, eliminating the need to call the linear programming algorithm at all. We mention just a few of the more straightforward preprocessing techniques here, referring the interested reader to Andersen and Andersen [4] for a more comprehensive list. For the purpose of this discussion, we assume that the linear program is formulated with both lower and upper bounds on x, that is, min c T x, subject to Ax b, l ≤ x ≤ u, (13.57) where some components li of the lower bound vector may be −∞ and some upper bounds u i may be +∞. Consider first a row singleton, which happens when one of the equality constraints involves just one of the variables. Specifically, if constraint k involves only variable j (that is, Ak j 0, but Aki 0 for all i j), we can immediately set x j bk /Ak j and eliminate x j from the problem. Note that if this value of x j violates its bounds (that is, x j < l j or x j > u j ), we can declare the problem to be infeasible, and terminate. Another obvious technique is the free column singleton, in which there is a variable x j that occurs in only one of the equality constraints, and is free (that is, its lower bound is −∞ and its upper bound is +∞). In this case, we have for some k that Ak j 0 while Al j 0 for all l k. Here we can simply use constraint k to eliminate x j from the problem, setting xj bk − p j Ak j Akp x p . Once the values of x p for p j have been obtained by solving a reduced linear program, we can substitute into this formula to recover x j prior to returning the result to the user. This substitution does not require us to modify any other constraints, but it will change the cost vector c in general, whenever c j 0. We will need to make the replacement c p ← c p − c j Akp /Ak j , for all p j. In this case, we can also determine the dual variable associated with constraint k. Since x j is a free variable, there is no dual slack associated with it, so the jth dual constraint becomes m Al j λl c j ⇒ Ak j λk c j , l1 from which we deduce that λk c j /Ak j . Perhaps the simplest preprocessing check is for the presence of zero rows and columns in A. If Aki 0 for all i 1, 2, . . . , n, then provided that the right-hand side is also zero (bk 0), we can simply delete this row from the problem and set the corresponding 13.7. PRESOLVING Lagrange multiplier λk to an arbitrary value. For a zero column—say, Ak j 0 for all k 1, 2, . . . , m—we can determing the optimal value of x j by inspecting its cost coefficient c j and its bounds l j and u j . If c j < 0, we set x j u j to minimize the product c j x j . (We are free to do so because x j is not restricted by any of the equality constraints.) If c j < 0 and u j +∞, then the problem is unbounded. Similarly, if c j > 0, we set x j l j , or else declare unboundedness if l j −∞. A somewhat more subtle presolving technique is to check for forcing or dominated constraints. Rather than give a general specification, we illustrate this case with a simple example. Suppose that one of the equality constraints is as follows: 5x1 − x4 + 2x5 10, where the variables in question have the following bounds: 0 ≤ x1 ≤ 1, −1 ≤ x4 ≤ 5, 0 ≤ x5 ≤ 2. It is not hard to see that the equality constraint can only be satisfied if x1 and x5 are at their upper bounds and x4 is at its lower bound. Any other feasible values of these variables would result in the left-hand side of the equality constraint being strictly less than 10. Hence, we can set x1 1, x4 −1, x5 2 and eliminate these variables, and the equality constraint, from the problem. We use a similar example to illustrate dominated constraints. Suppose that we have the following constraint involving three variables: 2x2 + x6 − 3x7 8, where the variables in question have the following bounds: −10 ≤ x2 ≤ 10, 0 ≤ x6 ≤ 1, 0 ≤ x7 ≤ 2. By rearranging the constraint and using the bounds on x6 and x7 , we find that x2 4 − (1/2)x6 + (3/2)x7 ≤ 4 − 0 + (3/2)2 7. and similarly, using the opposite bounds on x6 and x7 we obtain x2 ≥ 7/2. We conclude that the stated bounds of −10 and 10 on x2 are redundant, since x2 is implicitly confined to an even smaller interval by the combination of the equality constraint and the bounds on x6 and x7 . Hence, we can drop the bounds on x2 from the formulation and treat it as a free variable. Presolving techniques are applied recursively, because the elimination of certain variables or constraints may create situations that allow further eliminations. As a trivial example, 387 388 CHAPTER 13. THE SIMPLEX METHOD suppose that the following two equality constraints are present in the problem: 3x2 6, x2 + 4x5 10. The first of these constraints is a row singleton, which we can use to set x2 2 and eliminate this variable and constraint. After substitution, the second constraint becomes 4x5 10 − x2 8, which is again a row singleton. We can therefore set x5 2 and eliminate this variable and constraint as well. Relatively little information about presolving techniques has appeared in the literature, in part because they have commercial value as an important component of linear programming software. 13.8 WHERE DOES THE SIMPLEX METHOD FIT? In linear programming, as in all optimization problems in which inequality constraints are present, the fundamental task of the algorithm is to determine which of these constraints are active at the solution (see Definition 12.1 and which are inactive. The simplex method belongs to a general class of algorithms for constrained optimization known as active set methods, which explicitly maintain estimates of the active and inactive index sets that are updated at each step of the algorithm. (At each iteration, the basis B is our current estimate of the inactive set, that is, the set of indices i for which we suspect that xi > 0 at the solution of the linear program.) Like most active set methods, the simplex method makes only modest changes to these index sets at each step; a single index is exchanged between B into N . Active set algorithms for quadratic programming, bound-constrained optimization, and nonlinear programming use the same basic strategy as simplex of making an explicit estimate of the active set and taking a step toward the solution of a reduced problem in which the constraints in this estimated active set are satisfied as equalities. When nonlinearity enters the problem, many of the features that make the simplex method so effective no longer apply. For example, it is no longer true in general that at least n − m of the bounds x ≥ 0 are active at the solution, and the specialized linear algebra techniques described in Section 13.5 no longer apply. Nevertheless, the simplex method is rightly viewed as the antecedent of the active set class of methods for constrained optimization. One undesirable feature of the simplex method attracted attention from its earliest days. Though highly efficient on almost all practical problems (the method generally requires at most 2m to 3m iterations, where m is the row dimension of the constraint matrix in (13.1)), there are pathological problems on which the algorithm performs very poorly. Klee and Minty [182] presented an n-dimensional problem whose feasible polytope has 2n vertices, for which the simplex method visits every single vertex before reaching the optimal point! This example verified that the complexity of the simplex method is exponential; 13.8. WHERE DOES THE SIMPLEX METHOD FIT? roughly speaking, its running time may be an exponential function of the dimension of the problem. For many years, theoreticians searched for a linear programming algorithm that has polynomial complexity, that is, an algorithm in which the running time is bounded by a polynomial function of the amount of storage required to define the problem. In the late 1970s, Khachiyan [180] described an ellipsoid method that indeed has polynomial complexity but turned out to be impractical. In the mid-1980s, Karmarkar [175] described a polynomial algorithm that approaches the solution through the interior of the feasible polytope rather than working its way around the boundary as the simplex method does. Karmarkar’s announcement marked the start of intense research in the field of interior-point methods, which are the subject of the next chapter. NOTES AND REFERENCES The standard reference for the simplex method is Dantzig’s book [86]. Later excellent texts include Chvátal [61] and Vanderbei [293]. Further information on steepest-edge pivoting can be found in Goldfarb and Reid [134] and Goldfarb and Forrest [133]. An alternative procedure for performing the Phase-I calculation of an initial basis was described by Wolfe [310]. This technique does not require artificial variables to be introduced in the problem formulation, but rather starts at any point x that satisfies Ax b with at most m nonzero components in x. (Note that we do not require the basic part xB to consist of all positive components.) Phase I then consists in solving the problem min x −xi subject to Ax b, xi <0 and terminating when an objective value of 0 is attained. This problem is not a linear program—its objective is only piecewise linear—but it can be solved by the simplex method nonetheless. The key is to redefine the cost vector f at each iteration x such that f i −1 for xi < 0 and f i 0 otherwise. ✐ EXERCISES ✐ 13.1 Convert the following linear program to standard form: max c T x + d T y subject to A1 x b1 , A2 x + B2 y ≤ b2 , l ≤ y ≤ u, x,y where there are no explicit bounds on x. ✐ 13.2 Verify that the dual of (13.8) is the original primal problem (13.1). 389 390 CHAPTER 13. THE SIMPLEX METHOD ✐ 13.3 Complete the proof of Theorem 13.1 by showing that if the dual (13.7) is unbounded above, the primal (13.1) must be infeasible. ✐ 13.4 Theorem 13.1 does not exclude the possibility that both primal and dual are infeasible. Give a simple linear program for which such is the case. ✐ 13.5 Show that the dual of the linear program min c T x subject to Ax ≥ b, x ≥ 0, is max b T λ subject to A T λ ≤ c, λ ≥ 0. ✐ 13.6 Show that when m ≤ n and the rows of A are linearly dependent in (13.1), then the matrix B in (13.13) is singular, and therefore there are no basic feasible points. ✐ 13.7 Consider the overdetermined linear system Ax b with m rows and n columns (m > n). When we apply Gaussian elimination with complete pivoting to A, we obtain P AQ L U11 U12 0 0 , where P and Q are permutation matrices, L is m × m lower triangular, U11 is m̄ × m̄ upper triangular and nonsingular, U12 is m̄ × (n − m̄), and m̄ ≤ n is the rank of A. (a) Show that the system Ax b is feasible if the last m − m̄ components of L −1 Pb are zero, and infeasible otherwise. (b) When m̄ n, find the unique solution of Ax b. (c) Show that the reduced system formed from the first m̄ rows of P A and the first m̄ components of Pb is equivalent to Ax b (i.e., a solution of one system also solves the other). ✐ 13.8 Verify formula (13.37). ✐ 13.9 Consider the following linear program: min −5x1 − x2 subject to x1 + x2 ≤ 5, 2x1 + (1/2)x2 ≤ 8, x ≥ 0. 13.8. WHERE DOES THE SIMPLEX METHOD FIT? (a) Add slack variables x3 and x4 to convert this problem to standard form. (b) Using Procedure 13.1, solve this problem using the simplex method, showing at each step the basis and the vectors λ, sN , and xB , and the value of the objective function. (The initial choice of B for which xB ≥ 0 should be obvious once you have added the slacks in part (a).) ✐ 13.10 Calculate the values of l52 , l53 , l54 , and ŵ2 in (13.30), by equating the last row of L 1 U1 to the last row of the matrix in (13.29). ✐ 13.11 By extending the procedure (13.27) appropriately, show how the factorization (13.31) can be used to solve linear systems with coefficient matrix B + efficiently. 391 This is pag Printer: O 14 CHAPTER Linear Programming: Interior-Point Methods In the 1980s it was discovered that many large linear programs could be solved efficiently by using formulations and algorithms from nonlinear programming and nonlinear equations. One characteristic of these methods was that they required all iterates to satisfy the inequality constraints in the problem strictly, so they became known as interior-point methods. By the early 1990s, a subclass of interior-point methods known as primal-dual methods had distinguished themselves as the most efficient practical approaches, and proved to be strong competitors to the simplex method on large problems. These methods are the focus of this chapter. 14.1. PRIMAL-DUAL METHODS Interior-point methods arose from the search for algorithms with better theoretical properties than the simplex method. As we mentioned in Chapter 13, the simplex method can be inefficient on certain pathological problems. Roughly speaking, the time required to solve a linear program may be exponential in the size of the problem, as measured by the number of unknowns and the amount of storage needed for the problem data. For almost all practical problems, the simplex method is much more efficient than this bound would suggest, but its poor worst-case complexity motivated the development of new algorithms with better guaranteed performance. The first such method was the ellipsoid method, proposed by Khachiyan [180], which finds a solution in time that is at worst polynomial in the problem size. Unfortunately, this method approaches its worst-case bound on all problems and is not competitive with the simplex method in practice. Karmarkar’s projective algorithm [175], announced in 1984, also has the polynomial complexity property, but it came with the added attraction of good practical behavior. The initial claims of excellent performance on large linear programs were never fully borne out, but the announcement prompted a great deal of research activity which gave rise to many new methods. All are related to Karmarkar’s original algorithm, and to the log-barrier approach described in Chapter 19, but many of the approaches can be motivated and analyzed independently of the earlier methods. Interior-point methods share common features that distinguish them from the simplex method. Each interior-point iteration is expensive to compute and can make significant progress towards the solution, while the simplex method usually requires a larger number of inexpensive iterations. Geometrically speaking, the simplex method works its way around the boundary of the feasible polytope, testing a sequence of vertices in turn until it finds the optimal one. Interior-point methods approach the boundary of the feasible set only in the limit. They may approach the solution either from the interior or the exterior of the feasible region, but they never actually lie on the boundary of this region. In this chapter, we outline some of the basic ideas behind primal-dual interior-point methods, including the relationship to Newton’s method and homotopy methods and the concept of the central path. We sketch the important methods in this class, and give a comprehensive convergence analysis of a particular interior-point method known as a long-step path-following method. We describe in some detail a practical predictor-corrector algorithm proposed by Mehrotra, which is the basis of much of the current generation of software. 14.1 PRIMAL-DUAL METHODS OUTLINE We consider the linear programming problem in standard form; that is, min c T x, subject to Ax b, x ≥ 0, (14.1) where c and x are vectors in IRn , b is a vector in IRm , and A is an m × n matrix with full row 393 394 CHAPTER 14. INTERIOR-POINT METHODS rank. (As in Chapter 13, we can preprocess the problem to remove dependent rows from A if necessary.) The dual problem for (14.1) is max b T λ, subject to A T λ + s c, s ≥ 0, (14.2) where λ is a vector in IRm and s is a vector in IRn . As shown in Chapter 13, solutions of (14.1),(14.2) are characterized by the Karush–Kuhn–Tucker conditions (13.4), which we restate here as follows: A T λ + s c, (14.3a) Ax b, (14.3b) xi si 0, i 1, 2, . . . , n, (14.3c) (x, s) ≥ 0. (14.3d) Primal-dual methods find solutions (x ∗ , λ∗ , s ∗ ) of this system by applying variants of Newton’s method to the three equalities in (14.3) and modifying the search directions and step lengths so that the inequalities (x, s) ≥ 0 are satisfied strictly at every iteration. The equations (14.3a), (14.3b), (14.3c) are linear or only mildly nonlinear and so are not difficult to solve by themselves. However, the problem becomes much more difficult when we add the nonnegativity requirement (14.3d), which gives rise to all the complications in the design and analysis of interior-point methods. To derive primal-dual interior-point methods we restate the optimality conditions (14.3) in a slightly different form by means of a mapping F from IR2n+m to IR2n+m : ⎡ ⎢ F(x, λ, s) ⎣ AT λ + s − c Ax − b ⎤ ⎥ ⎦ 0, (14.4a) (x, s) ≥ 0, (14.4b) X Se where X diag(x1 , x2 , . . . , xn ), S diag(s1 , s2 , . . . , sn ), (14.5) and e (1, 1, . . . , 1)T . Primal-dual methods generate iterates (x k , λk , s k ) that satisfy the bounds (14.4b) strictly, that is, x k > 0 and s k > 0. This property is the origin of the term interior-point. By respecting these bounds, the methods avoid spurious solutions, that is, points that satisfy F(x, λ, s) 0 but not (x, s) ≥ 0. Spurious solutions abound, and do not provide useful information about solutions of (14.1) or (14.2), so it makes sense to exclude them altogether from the region of search. Like most iterative algorithms in optimization, primal-dual interior-point methods have two basic ingredients: a procedure for determining the step and a measure of the 14.1. PRIMAL-DUAL METHODS desirability of each point in the search space. An important component of the measure of desirability is the average value of the pairwise products xi si , i 1, 2, . . . , n, which are all positive when x > 0 and s > 0. This quantity is known as the duality measure and is defined as follows: µ n xT s 1 . xi si n i1 n (14.6) The procedure for determining the search direction has its origins in Newton’s method for the nonlinear equations (14.4a). Newton’s method forms a linear model for F around the current point and obtains the search direction (x, λ, s) by solving the following system of linear equations: ⎡ x ⎤ ⎢ ⎥ J (x, λ, s) ⎣ λ ⎦ −F(x, λ, s), s where J is the Jacobian of F. (See Chapter 11 for a detailed discussion of Newton’s method for nonlinear systems.) If we use the notation rc and rb for the first two block rows in F, that is, rb Ax − b, rc A T λ + s − c, (14.7) we can write the Newton equations as follows: ⎡ 0 ⎢ ⎣ A S AT I ⎤⎡ x ⎤ ⎡ −rc 0 ⎥⎢ ⎥ ⎢ 0 ⎦ ⎣ λ ⎦ ⎣ −rb 0 X s −X Se ⎤ ⎥ ⎦. (14.8) Usually, a full step along this direction would violate the bound (x, s) ≥ 0, so we perform a line search along the Newton direction and define the new iterate as (x, λ, s) + α(x, λ, s), for some line search parameter α ∈ (0, 1]. We often can take only a small step along this direction (α 1) before violating the condition (x, s) > 0. Hence, the pure Newton direction (14.8), sometimes known as the affine scaling direction, often does not allow us to make much progress toward a solution. Most primal-dual methods use a less aggressive Newton direction, one that does not aim directly for a solution of (14.3a), (14.3b), (14.3c) but rather for a point whose pairwise products xi si are reduced to a lower average value—not all the way to zero. Specifically, we 395 396 CHAPTER 14. INTERIOR-POINT METHODS take a Newton step toward the a point for which xi si σ µ, where µ is the current duality measure and σ ∈ [0, 1] is the reduction factor that we wish to achieve in the duality measure on this step. The modified step equation is then ⎡ 0 ⎢ ⎣ A S AT I ⎤⎡ x ⎤ ⎡ −rc 0 ⎥ ⎢ ⎥⎢ 0 ⎦ ⎣ λ ⎦ ⎣ −rb 0 X s −X Se + σ µe ⎤ ⎥ ⎦. (14.9) We call σ the centering parameter, for reasons to be discussed below. When σ > 0, it usually is possible to take a longer step α along the direction defined by (14.16) before violating the bounds (x, s) ≥ 0. At this point, we have specified most of the elements of a path-following primal-dual interior-point method. The general framework for such methods is as follows. Framework 14.1 (Primal-Dual Path-Following). Given (x 0 , λ0 , s 0 ) with (x 0 , s 0 ) > 0; for k 0, 1, 2, . . . Choose σk ∈ [0, 1] and solve ⎡ 0 ⎢ ⎣ A S k AT ⎤⎡ I x k ⎤ ⎡ −rck ⎤ ⎥ ⎦, (14.10) (x k+1 , λk+1 , s k+1 ) (x k , λk , s k ) + αk (x k , λk , s k ), (14.11) 0 0 ⎥⎢ ⎥ ⎢ 0 ⎦ ⎣ λk ⎦ ⎣ −rbk s −X S e + σk µk e X k k k k where µk (x k )T s k /n; Set choosing αk so that (x k+1 , s k+1 ) > 0. end (for). The choices of centering parameter σk and step length αk are crucial to the performance of the method. Techniques for controlling these parameters, directly and indirectly, give rise to a wide variety of methods with diverse properties. Although software for implementing interior-point methods does not usually start from a point (x 0 , λ0 , s 0 ) that is feasible with respect to the linear equations (14.3a) and (14.3b), most of the historical development of theory and algorithms assumed that these conditions are satisfied. In the remainder of this section, we discuss this feasible case, showing that a comprehensive convergence analysis can be presented in just a few pages, using only basic mathematical tools and concepts. Analysis of the infeasible case follows the 14.1. PRIMAL-DUAL METHODS same principles, but is considerably more complicated in the details, so we do not present it here. In Section 14.2, however, we describe a complete practical algorithm that does not require starting from a feasible initial point. To begin our discussion and analysis of feasible interior-point methods, we introduce the concept of the central path, and then describe neighborhoods of this path. THE CENTRAL PATH The primal-dual feasible set F and strictly feasible set F o are defined as follows: F {(x, λ, s) | Ax b, A T λ + s c, (x, s) ≥ 0}, (14.12a) F {(x, λ, s) | Ax b, A λ + s c, (x, s) > 0}. (14.12b) o T The central path C is an arc of strictly feasible points that plays a vital role in primal-dual algorithms. It is parametrized by a scalar τ > 0, and each point (xτ , λτ , sτ ) ∈ C satisfies the following equations: A T λ + s c, (14.13a) Ax b, (14.13b) xi si τ, i 1, 2, . . . , n, (x, s) > 0. (14.13c) (14.13d) These conditions differ from the KKT conditions only in the term τ on the right-hand side of (14.13c). Instead of the complementarity condition (14.3c), we require that the pairwise products xi si have the same (positive) value for all indices i. From (14.13), we can define the central path as C {(xτ , λτ , sτ ) | τ > 0}. It can be shown that (xτ , λτ , sτ ) is defined uniquely for each τ > 0 if and only if F o is nonempty. The conditions (14.13) are also the optimality conditions for a logarithmic-barrier formulation of the problem (14.1). By introducing log-barrier terms for the nonnegativity constraints, with barrier parameter τ > 0, we obtain min c T x − τ n i1 ln xi , subject to Ax b. (14.14) 397 398 CHAPTER 14. INTERIOR-POINT METHODS The KKT conditions (12.34) for this problem, with Lagrange multiplier λ for the equality constraint, are as follows: ci − τ − A·iT λ, i 1, 2, . . . , n, Ax b. xi Since the objective in (14.14) is strictly convex, these conditions are sufficient as well as necessary for optimality. We recover (14.13) by defining si τ/xi , i 1, 2, . . . , n. Another way of defining C is to use the mapping F defined in (14.4) and write ⎡ 0 ⎤ ⎢ ⎥ F(xτ , λτ , sτ ) ⎣ 0 ⎦ , (xτ , sτ ) > 0. (14.15) τe The equations (14.13) approximate (14.3) more and more closely as τ goes to zero. If C converges to anything as τ ↓ 0, it must converge to a primal-dual solution of the linear program. The central path thus guides us to a solution along a route that maintains positivity of the x and s components and decreases the pairwise products xi si , i 1, 2, . . . , n to zero at the same rate. Most primal-dual algorithms take Newton steps toward points on C for which τ > 0, rather than pure Newton steps for F. Since these steps are biased toward the interior of the nonnegative orthant defined by (x, s) ≥ 0, it usually is possible to take longer steps along them than along the pure Newton (affine scaling) steps, before violating the positivity condition. In the feasible case of (x, λ, s) ∈ F, we have rb 0 and rc 0, so the search direction satisfies a special case of (14.8), that is, ⎡ 0 ⎢ ⎣ A S AT I ⎤⎡ x ⎤ ⎡ 0 ⎥⎢ ⎥ ⎢ 0 ⎦ ⎣ λ ⎦ ⎣ 0 X s 0 0 ⎤ ⎥ ⎦, (14.16) −X Se + σ µe where µ is the duality measure defined by (14.6) and σ ∈ [0, 1] is the centering parameter. When σ 1, the equations (14.16) define a centering direction, a Newton step toward the point (xµ , λµ , sµ ) ∈ C, at which all the pairwise products xi si are identical to the current average value of µ. Centering directions are usually biased strongly toward the interior of the nonnegative orthant and make little, if any, progress in reducing the duality measure µ. However, by moving closer to C, they set the scene for a substantial reduction in µ on the next iteration. At the other extreme, the value σ 0 gives the standard Newton (affine scaling) step. Many algorithms use intermediate values of σ from 14.1. PRIMAL-DUAL METHODS the open interval (0, 1) to trade off between the twin goals of reducing µ and improving centrality. CENTRAL PATH NEIGHBORHOODS AND PATH-FOLLOWING METHODS Path-following algorithms explicitly restrict the iterates to a neighborhood of the central path C and follow C to a solution of the linear program. By preventing the iterates from coming too close to the boundary of the nonnegative orthant, they ensure that it is possible to take a nontrivial step along each search direction. Mopreover, by forcing the duality measure µk to zero as k → ∞, we ensure that the iterates (x k , λk , s k ) come closer and closer to satisfying the KKT conditions (14.3). The two most interesting neighborhoods of C are N2 (θ ) {(x, λ, s) ∈ F o | X Se − µe2 ≤ θ µ}, (14.17) for some θ ∈ [0, 1), and N−∞ (γ ) {(x, λ, s) ∈ F o | xi si ≥ γ µ all i 1, 2, . . . , n}, (14.18) for some γ ∈ (0, 1]. (Typical values of the parameters are θ 0.5 and γ 10−3 .) If a point lies in N−∞ (γ ), each pairwise product xi si must be at least some small multiple γ of their average value µ. This requirement is actually quite modest, and we can make N−∞ (γ ) encompass most of the feasible region F by choosing γ close to zero. The N2 (θ ) neighborhood is more restrictive, since certain points in F o do not belong to N2 (θ ) no matter how close θ is chosen to its upper bound of 1. By keeping all iterates inside one or other of these neighborhoods, path-following methods reduce all the pairwise products xi si to zero at more or less the same rate. Figure 14.1 shows the projection of the central path C onto the primal variables for a typical problem, along with a typical neighborhood N . Path-following methods are akin to homotopy methods for general nonlinear equations, which also define a path to be followed to the solution. Traditional homotopy methods stay in a tight tubular neighborhood of their path, making incremental changes to the parameter and chasing the homotopy path all the way to a solution. For primal-dual methods, this neighborhood is horn-shaped rather than tubular, and it tends to be broad and loose for larger values of the duality measure µ. It narrows as µ → 0, however, because of the positivity requirement (x, s) > 0. The algorithm we specify below, a special case of Framework 14.1, is known as a long-step path-following algorithm. This algorithm can make rapid progress because of its use of the wide neighborhood N−∞ (γ ), for γ close to zero. It depends on two parameters σmin and σmax , which are lower and upper bounds on the centering parameter σk . The search direction is, as usual, obtained by solving (14.10), and we choose the step length αk to be as large as possible, subject to the requirement that we stay inside N−∞ (γ ). 399 400 CHAPTER 14. INTERIOR-POINT METHODS central path neighborhood C Figure 14.1 Central path, projected into space of primal variables x, showing a typical neighborhood N . Here and in later analysis, we use the notation def (x k (α), λk (α), s k (α)) (x k , λk , s k ) + α(x k , λk , s k ), def µk (α) x (α) s (α)/n. k T k (14.19a) (14.19b) Algorithm 14.2 (Long-Step Path-Following). Given γ , σmin , σmax with γ ∈ (0, 1), 0 < σmin ≤ σmax < 1, and (x 0 , λ0 , s 0 ) ∈ N−∞ (γ ); for k 0, 1, 2, . . . Choose σk ∈ [σmin , σmax ]; Solve (14.10) to obtain (x k , λk , s k ); Choose αk as the largest value of α in [0, 1] such that (x k (α), λk (α), s k (α)) ∈ N−∞ (γ ); (14.20) Set (x k+1 , λk+1 , s k+1 ) (x k (αk ), λk (αk ), s k (αk )); end (for). Typical behavior of the algorithm is illustrated in Figure 14.2 for the case of n 2. The horizontal and vertical axes in this figure represent the pairwise products x1 s1 and x2 s2 , so the central path C is the line emanating from the origin at an angle of 45◦ . (A point at the origin of this illustration is a primal-dual solution if it also satisfies the feasibility conditions 14.1. x2 s2 1 iterates PRIMAL-DUAL METHODS 0 central path C 2 3 boundary of neighborhood N x1 s1 Figure 14.2 Iterates of Algorithm 14.2, plotted in (xs) space. (14.3a), (14.3b), and (14.3d).) In the unusual geometry of Figure 14.2, the search directions (x k , λk , s k ) transform to curves rather than straight lines. As Figure 14.2 shows (and the analysis confirms), the lower bound σmin on the centering parameter ensures that each search direction starts out by moving away from the boundary of N−∞ (γ ) and into the relative interior of this neighborhood. That is, small steps along the search direction improve the centrality. Larger values of α take us outside the neighborhood again, since the error in approximating the nonlinear system (14.15) by the linear step equations (14.16) becomes more pronounced as α increases. Still, we are guaranteed that a certain minimum step can be taken before we reach the boundary of N−∞ (γ ), as we show in the analysis below. The analysis of Algorithm 14.2 appears in the next few pages. With judicious choices of σk , this algorithm is fairly efficient in practice. With a few more modifications, it becomes the basis of a truly competitive method, as we discuss in Section 14.2. Our aim in the analysis below is to show that given some small tolerance > 0, the algorithm requires O(n| log |) iterations to reduce the duality measure by a factor of , that is, to identify a point (x k , λk , s k ) for which µk ≤ µ0 . For small , the point (x k , λk , s k ) satisfies the primal-dual optimality conditions except for perturbations of about in the right-hand side of (14.3c), so it is usually very close to a primal-dual solution of the original linear program. The O(n| log |) estimate is a worst-case bound on the number of iterations required; on practical problems, the number of iterations required appears 401 402 CHAPTER 14. INTERIOR-POINT METHODS to increase only slightly (if at all) as n increases. The simplex method may require 2n iterations to solve a problem with n variables, though in practice it usually requires a modest multiple of m iterations, where m is the row dimension of the constraint matrix A in (14.1). As is typical for interior-point methods, the analysis builds from a purely technical lemma to a powerful theorem in just a few pages. We start with the technical result (Lemma 14.1) and use it to derive a bound on the vector of pairwise products xi si , i 1, 2, . . . , n (Lemma 14.2). Theorem 14.3 finds a lower bound on the step length αk and a corresponding estimate of the reduction in µ on iteration k. Finally, Theorem 14.4 proves that O(n| log |) iterations are required to identify a point for which µk < , for a given tolerance ∈ (0, 1). Lemma 14.1. Let u and v be any two vectors in IRn with u T v ≥ 0. Then U V e2 ≤ 2−3/2 u + v22 , where U diag(u 1 , u 2 , . . . , u n ), V diag(v1 , v2 , . . . , vn ). PROOF. (When the subscript is omitted from · , we mean · 2 , as is our convention throughout the book.) First, note that for any two scalars α and β with αβ ≥ 0, we have from the algebraic-geometric mean inequality that 1 |αβ| ≤ |α + β|. 2 (14.21) Since u T v ≥ 0, we have 0 ≤ uT v u i vi ≥0 u i vi + u i vi u i vi <0 i∈P |u i vi | − i∈M where we partitioned the index set {1, 2, . . . , n} as P {i | u i vi ≥ 0}, M {i | u i vi < 0}. |u i vi |, (14.22) 14.1. PRIMAL-DUAL METHODS Now, 1/2 U V e [u i vi ]i∈P 2 + [u i vi ]i∈M 2 1/2 ≤ [u i vi ]i∈P 21 + [u i vi ]i∈M 21 1/2 ≤ 2 [u i vi ]i∈P 21 √ 1 2 ≤ 2 (u i + vi ) 4 i∈P 1 2−3/2 (u i + vi )2 since · 2 ≤ · 1 from (14.22) from (14.21) i∈P n ≤ 2−3/2 (u i + vi )2 i1 ≤ 2−3/2 u + v2 , completing the proof. For the next result, we omit the iteration counter k from (14.10), and define the diagonal matrices X and S similarly to (14.5), as follows: X diag(x1 , x2 , . . . , xn ), S diag(s1 , s2 , . . . , sn ).. Lemma 14.2. If (x, λ, s) ∈ N−∞ (γ ), then X Se ≤ 2−3/2 (1 + 1/γ )nµ. PROOF. It is easy to show using (14.10) that x T s 0. (14.23) By multiplying the last block row in (14.10) by (X S)−1/2 and using the definition D X 1/2 S −1/2 , we obtain D −1 x + Ds (X S)−1/2 (−X Se + σ µe). (14.24) Because (D −1 x)T (Ds) x T s 0, we can apply Lemma 14.1 with u D −1 x and v Ds to obtain X Se (D −1 X )(DS)e ≤ 2−3/2 D −1 x + Ds2 −3/2 2 (X S) −1/2 from Lemma 14.1 (−X Se + σ µe) 2 from (14.24). Expanding the squared Euclidean norm and using such relationships as x T s nµ and 403 404 CHAPTER 14. INTERIOR-POINT METHODS e T e n, we obtain n 1 X Se ≤ 2 x s − 2σ µe e + σ µ xs i1 i i n ≤ 2−3/2 x T s − 2σ µe T e + σ 2 µ2 γµ 2 σ nµ ≤ 2−3/2 1 − 2σ + γ −3/2 T T 2 2 since xi si ≥ γ µ ≤ 2−3/2 (1 + 1/γ )nµ, as claimed. Theorem 14.3. Given the parameters γ , σmin , and σmax in Algorithm 14.2, there is a constant δ independent of n such that δ µk , µk+1 ≤ 1 − n (14.25) for all k ≥ 0. PROOF. We start by proving that 1 − γ σk x k (α), λk (α), s k (α) ∈ N−∞ (γ ) for all α ∈ 0, 23/2 γ , 1+γ n (14.26) where x k (α), λk (α), s k (α) is defined as in (14.19). It follows that the step length αk is at least as long as the upper bound of this interval, that is, αk ≥ 23/2 σk 1 − γ γ . n 1+γ (14.27) For any i 1, 2, . . . , n, we have from Lemma 14.2 that |xik sik | ≤ X k S k e2 ≤ 2−3/2 (1 + 1/γ )nµk . Using (14.10), we have from xik sik ≥ γ µk and (14.28) that xik (α)sik (α) xik + αxik sik + αsik xik sik + α xik sik + sik xik + α 2 xik sik ≥ xik sik (1 − α) + ασk µk − α 2 |xik sik | ≥ γ (1 − α)µk + ασk µk − α 2 2−3/2 (1 + 1/γ )nµk . (14.28) 14.1. PRIMAL-DUAL METHODS By summing the n components of the equation S k x k + X k s k −X k S k e + σk µk e (the third block row from (14.10)), and using (14.23) and the definition of µk and µk (α) (see (14.19)), we obtain µk (α) (1 − α(1 − σk ))µk . From these last two formulas, we can see that the proximity condition xik (α)sik (α) ≥ γ µk (α) is satisfied, provided that γ (1 − α)µk + ασk µk − α 2 2−3/2 (1 + 1/γ )nµk ≥ γ (1 − α + ασk )µk . Rearranging this expression, we obtain ασk µk (1 − γ ) ≥ α 2 2−3/2 nµk (1 + 1/γ ), which is true if α≤ 23/2 1−γ σk γ . n 1+γ We have proved that x k (α), λk (α), s k (α) satisfies the proximity condition for N−∞ (γ ) when α lies in the range stated in (14.26). It is not difficult to show that k x (α), λk (α), s k (α) ∈ F o for all α in the given range. Hence, we have proved (14.26) and therefore (14.27). We complete the proof of the theorem by estimating the reduction in µ on the kth step. Because of (14.23), (14.27), and the last block row of (14.16), we have µk+1 x k (αk )T s k (αk )/n (x k )T s k + αk (x k )T s k + (s k )T x k + αk2 (x k )T s k /n µk + αk −(x k )T s k /n + σk µk (1 − αk (1 − σk ))µk 23/2 1 − γ γ σk (1 − σk ) µk . ≤ 1− n 1+γ (14.29) Now, the function σ (1 − σ ) is a concave quadratic function of σ , so on any given interval it attains its minimum value at one of the endpoints. Hence, we have σk (1 − σk ) ≥ min {σmin (1 − σmin ), σmax (1 − σmax )} , for all σk ∈ [σmin , σmax ]. 405 406 CHAPTER 14. INTERIOR-POINT METHODS The proof is completed by substituting this estimate into (14.29) and setting δ 23/2 γ 1−γ min {σmin (1 − σmin ), σmax (1 − σmax )} . 1+γ We conclude with a result that a reduction of a factor of can be obtained in O(n log 1/ ) iterations. in the duality measure µ Theorem 14.4. Given ∈ (0, 1) and γ ∈ (0, 1), suppose the starting point in Algorithm 14.2 satisfies (x 0 , λ0 , s 0 ) ∈ N−∞ (γ ). Then there is an index K with K O(n log 1/ ) such that µk ≤ µ0 , for all k ≥ K . PROOF. By taking logarithms of both sides in (14.25), we obtain log µk+1 δ + log µk . ≤ log 1 − n By applying this formula repeatedly, we have δ + log µ0 . log µk ≤ k log 1 − n The following well-known estimate for the log function, log(1 + β) ≤ β, for all β > −1, implies that δ . log(µk /µ0 ) ≤ k − n Therefore, the condition µk /µ0 ≤ is satisfied if we have δ ≤ log . k − n This inequality holds for all k that satisfy def k≥K so the proof is complete. 1 n n log | log |, δ δ 14.2. 14.2 PRACTICAL PRIMAL-DUAL ALGORITHMS PRACTICAL PRIMAL-DUAL ALGORITHMS Practical implementations of interior-point algorithms follow the spirit of the previous section, in that strict positivity of x k and s k is maintained throughout and each step is a Newton-like step involving a centering component. However, most implementations work with an infeasible starting point and infeasible iterations. Several aspects of “theoretical” algorithms are typically ignored, while several enhancements are added that have a significant effect on practical performance. In this section, we describe the algorithmic enhancements that are found in a typical implementation of an infeasible-interior-point method, and present the resulting method as Algorithm 14.3. Many of the techniques of this section are described in the paper of Mehrotra [207], which can be consulted for further details. CORRECTOR AND CENTERING STEPS A key feature of practical algorithms is their use of corrector steps that compensate for the linearization error made by the Newton (affine-scaling) step in modeling the equation xi si 0, i 1, 2, . . . , n (see (14.3c)). Consider the affine-scaling direction (x, λ, s) defined by ⎡ 0 ⎢ ⎣ A AT 0 0 S I ⎤⎡ x aff ⎤ ⎡ ⎥ ⎢ ⎥⎢ 0 ⎦ ⎣ λaff ⎦ ⎣ s X −rc −rb ⎤ ⎥ ⎦, (14.30) −X Se aff (where rb and rc are defined in (14.7)). If we take a full step in this direction, we obtain (xi + xiaff )(si + siaff ) xi si + xi siaff + si xiaff + xiaff siaff xiaff siaff . That is, the updated value of xi si is xiaff siaff rather than the ideal value 0. We can solve the following system to obtain a step (x cor , λcor , s cor ) that attempts to correct for this deviation from the ideal: ⎡ 0 ⎢ ⎣ A S AT 0 0 I ⎤⎡ x cor ⎤ ⎡ ⎥ ⎢ ⎥⎢ 0 ⎦ ⎣ λcor ⎦ ⎣ X s cor ⎤ 0 ⎥ ⎦. 0 (14.31) −X S e aff aff In many cases, the combined step (x aff , λaff , s aff ) + (x cor , λcor , s cor ) does a better job of reducing the duality measure than does the affine-scaling step alone. Like theoretical algorithms such as the one analysed in Section 14.1, practical algorithms make use of centering steps, with an adaptive choice of the centering parameter σk . The affine-scaling step can be used as the basis of a successful heuristic for choosing σk . 407 408 CHAPTER 14. INTERIOR-POINT METHODS Roughly speaking, if the affine-scaling step (multiplied by a steplength to maintain nonnegativity of x and s) reduces the duality measure significantly, there is not much need for centering, so a smaller value of σk is appropriate. Conversely, if not much progress can be made along this direction before reaching the boundary of the nonnegative orthant, a larger value of σk will ensure that the next iterate is more centered, so a longer step will be possible from this next point. Specifically, this scheme calculates the maximum allowable steplengths along the affine-scaling direction (14.30) as follows: xi min 1, min − aff , xi i:xiaff <0 si def min 1, min − aff , si i:siaff <0 pri def αaff dual αaff (14.32a) (14.32b) and then defines µaff to be the value of µ that would be obtained by using these steplengths, that is, pri dual s aff )/n. µaff (x + αaff x aff )T (s + αaff (14.33) The centering parameter σ is chosen according to the following heuristic (which does not have a solid analytical justification, but appears to work well in practice): σ µaff µ 3 . (14.34) To summarize, computation of the search direction requires the solution of two linear systems. First, the system (14.30) is solved to obtain the affine-scaling direction, also known as the predictor step. This step is used to define the right-hand side for the corrector step (see (14.31)) and to calculate the centering parameter from (14.33), (14.34). Second, the search direction is calculated by solving ⎡ 0 ⎢ ⎣ A S AT I ⎤⎡ x ⎤ ⎡ ⎤ −rc 0 ⎥⎢ ⎥ ⎢ 0 ⎦ ⎣ λ ⎦ ⎣ −rb 0 s −X Se − X S e + σ µe X aff ⎥ ⎦. (14.35) aff Note that the predictor, corrector, and centering contributions have been aggregated on the right-hand side of this system. The coefficient matrix in both linear systems (14.30) and (14.35) is the same. Thus, the factorization of the matrix needs to be computed only once, and the marginal cost of solving the second system is relatively small. 14.2. PRACTICAL PRIMAL-DUAL ALGORITHMS STEP LENGTHS Practical implementations typically do not enforce membership of the central path neighborhoods N2 and N−∞ defined in the previous section. Rather, they calculate the maximum steplengths that can be taken in the x and s variables (separately) without violating nonnegativity, then take a steplength of slightly less than this maximum (but no greater than 1). Given an iterate (x k , λk , s k ) with (x k , s k ) > 0, and a step (x k , λk , s k ), pri dual defined as follows: it is easy to show that the quantities αk,max and αk,max pri def αk,max min − i:xik <0 xik , xik def dual αk,max min − i:sik <0 sik , sik (14.36) are the largest values of α for which x k + αx k ≥ 0 and s k + αs k ≥ 0, respectively. (Note that these formulae are similar to the ratio test used in the simplex method to determine the index that enters the basis.) Practical algorithms then choose the steplengths to lie in the open intervals defined by these maxima, that is, pri pri αk ∈ (0, αk,max ), dual αkdual ∈ (0, αk,max ), and then obtain a new iterate by setting pri x k+1 x k + αk x k , (λk+1 , s k+1 ) (λk , s k ) + αkdual (λk , s k ). If the step (x k , λk , s k ) rectifies the infeasibility in the KKT conditions (14.3a) and (14.3b), that is, Ax k −rbk −(Ax k − b), A T λk + s k −rck −(A T λk + s k − c), it is easy to show that the infeasibilities at the new iterate satisfy pri rbk+1 1 − αk rbk , rck+1 1 − αkdual rck . (14.37) The following formula is used to calculate steplengths in many practical implementations pri pri αk min(1, ηk αk,max ), dual αkdual min(1, ηk αk,max ), (14.38) where ηk ∈ [0.9, 1.0) is chosen so that ηk → 1 as the iterates approach the primal-dual solution, to accelerate the asymptotic convergence. 409 410 CHAPTER 14. INTERIOR-POINT METHODS STARTING POINT Choice of starting point is an important practical issue with a significant effect on the robustness of the algorithm. A poor choice (x 0 , λ0 , s 0 ) satisfying only the minimal conditions x 0 > 0 and s 0 > 0 often leads to failure of convergence. We describe here a heuristic that finds a starting point that satisfies the equality constraints in the primal and dual problems reasonably well, while maintaining positivity of the x and s components and avoiding excessively large values of these components. First, we find a vector x̃ of minimum norm satisfying the primal constraint Ax b, and a vector (λ̃, s̃) satisfy the dual constraint A T λ + s c such that s̃ has minimum norm. That is, we solve the problems min 12 x T x subject to Ax b, (14.39a) min 12 s T s subject to A T λ + s c. (14.39b) x (λ,s) It is not difficult to show that x̃ and (λ̃, s̃) can be written explicitly as follows: x̃ A T (A A T )−1 b, λ̃ (A A T )−1 Ac, s̃ c − A T λ̃. (14.40) In general, x̃ and s̃ will have nonpositive components, so are not suitable for use as a starting point. We define δx max(−(3/2) min x̃i , 0), i δs max(−(3/2) min s̃i , 0), i and adjust the x and s vectors as follows: x̂ x̃ + δx e, ŝ s̃ + δs e, where, as usual, e (1, 1, . . . , 1)T . Clearly, we have x̂ ≥ 0 and ŝ ≥ 0. To ensure that the components of x 0 and s 0 are not too close to zero and not too dissimilar, we add two more scalars defined as follows: δ̂x 1 x̂ T ŝ , 2 e T ŝ δ̂s 1 x̂ T ŝ 2 e T x̂ (Note that δ̂x is the average size of the components of x̂, weighted by the corresponding components of ŝ; similarly for δ̂s .) Finally, we define the starting point as follows: x 0 x̂ + δ̂x e, λ0 λ̃, s 0 ŝ + δ̂s e. The computational cost of finding (x 0 , λ0 , s 0 ) by this scheme is about the same as one step of the primal-dual method. 14.2. PRACTICAL PRIMAL-DUAL ALGORITHMS In some cases, we have prior knowledge about the solution, possibly in the form of a solution to a similar linear program. The use of such “warm-start” information in constructing a starting point is discussed in Section 14.4. A PRACTICAL ALGORITHM We now give a formal specification of a practical algorithm. Algorithm 14.3 (Predictor-Corrector Algorithm (Mehrotra [207])). Calculate (x 0 , λ0 , s 0 ) as described above; for k 0, 1, 2, . . . Set (x, λ, s) (x k , λk , s k ) and solve (14.30) for (x aff , λaff , s aff ); pri dual , and µaff as in (14.32) and (14.33); Calculate αaff , αaff Set centering parameter to σ (µaff /µ)3 ; Solve (14.35) for (x, λ, s); pri Calculate αk and αkdual from (14.38); Set pri x k+1 x k + αk x, (λk+1 , s k+1 ) (λk , s k ) + αkdual (λ, s); end (for). No convergence theory is available for Mehrotra’s algorithm, at least in the form in which it is described above. In fact, there are examples for which the algorithm diverges. Simple safeguards could be incorporated into the method to force it into the convergence framework of existing methods or to improve its robustness, but many practical codes do not implement these safeguards, because failures are rare. When presented with a linear program that is infeasible or unbounded, the algorithm above typically diverges, with the infeasibilities rbk and rck and/or the duality measure µk going to ∞. Since the symptoms of infeasibility and unboundedness are fairly easy to recognize, interior-point codes contain heuristics to detect and report these conditions. More rigorous approaches for detecting infeasibility and unboundedness make use of the homogeneous self-dual formulation; see Wright [316, Chapter 9] and the references therein for a discussion. A more recent approach that applies directly to infeasible-interior-point methods is described by Todd [286]. SOLVING THE LINEAR SYSTEMS Most of the computational effort in primal-dual methods is taken up in solving linear systems such as (14.9), (14.30), and (14.35). The coefficient matrix in these systems is usually large and sparse, since the constraint matrix A is itself large and sparse in most applications. 411 412 CHAPTER 14. INTERIOR-POINT METHODS The special structure in the step equations allows us to reformulate them as systems with more compact symmetric coefficient matrices, which are easier and cheaper to factor than the original sparse form. We apply the reformulation procedures to the following general form of the linear system: ⎡ 0 ⎢ ⎣ A S AT I ⎤⎡ x ⎤ ⎡ −rc ⎤ 0 ⎥⎢ ⎥ ⎢ ⎥ 0 ⎦ ⎣ λ ⎦ ⎣ −rb ⎦ . 0 X s (14.41) −r xs Since x and s are strictly positive, the diagonal matrices X and S are nonsingular. We can eliminate s and add −X −1 times the third equation in this system to the first equation to obtain −D −2 A T x −rc + X −1r xs , (14.42a) A 0 λ −rb s −X −1 r xs − X −1 Sx, (14.42b) where we have introduced the notation D S −1/2 X 1/2 . (14.43) This form of the step equations usually is known as the augmented system. We can go further and eliminate x and add AD 2 times the first equation to the second equation in (14.42a) to obtain AD 2 A T λ −rb − AX S −1 rc + AS −1r xs (14.44a) s −rc − A T λ, (14.44b) x −S −1 r xs − X S −1 s, (14.44c) where the expressions for s and s are obtained from the original system (14.41). The form (14.44a) often is called the normal-equations form, because the system (14.44a) can be viewed as the normal equations (10.14) for a certain linear least-squares problem with coefficient matrix D A T . Most implementations of primal-dual methods are based on formulations like (14.44). They use direct sparse Cholesky algorithms to factor the matrix AD 2 A T , and then perform triangular solves with the resulting sparse factors to obtain the step λ from (14.44a). The steps s and x are recovered from (14.44b) and (14.44c). General-purpose sparse Cholesky software can be applied to AD 2 A T , but modifications are needed because AD 2 A T may be ill-conditioned or singular. (Ill conditioning of this system is often observed during 14.3. OTHER PRIMAL-DUAL ALGORITHMS AND EXTENSIONS the final stages of a primal-dual algorithm, when the elements of the diagonal weighting matrix D 2 take on both huge and tiny values.) The Cholesky technique may encounter diagonal elements that are very small, zero or (because of roundoff error) slightly negative. One approach for handling this eventuality is to skip a step of the factorization, setting the component of λ that corresponds to the faulty diagonal element to zero. We refer to Wright [317] for details of this and other approaches. A disadvantage of the normal-equations formulation is that if A contains any dense columns, the entire matrix AD 2 A T is also dense. Hence, practical software identifies dense and nearly-dense columns, excludes them from the matrix product AD 2 A T , and performs the Cholesky factorization of the resulting sparse matrix. Then, a device such as a Sherman-Morrison-Woodbury update is applied to account for the excluded columns. We refer the reader to Wright [316, Chapter 11] for further details. The formulation (14.42) has received less attention than (14.44), mainly because algorithms and software for factoring sparse symmetric indefinite matrices are more complicated, slower, and less prevalent than sparse Cholesky algorithms. Nevertheless, the formulation (14.42) is cleaner and more flexible than (14.44) in a number of respects. It normally avoids the fill-in caused by dense columns in A in the matrix product AD 2 A T . Moreover, it allows free variables (components of x with no explicit lower or upper bounds) to be handled directly in the formulation. (The normal equations form must resort to various artificial devices to express such variables, otherwise it is not possible to perform the block elimination that leads to the system (14.44a).) 14.3 OTHER PRIMAL-DUAL ALGORITHMS AND EXTENSIONS OTHER PATH-FOLLOWING METHODS Framework 14.1 is the basis of a number of other algorithms of the path-following variety. They are less important from a practical viewpoint, but we mention them here because of their elegance and their strong theoretical properties. Some path-following methods choose conservative values for the centering parameter σ (that is, σ only slightly less than 1) so that unit steps (that is, a steplength of α 1) can be taken along the resulting direction from (14.16) without leaving the chosen neighborhood. These methods, which are known as short-step path-following methods, make only slow progress toward the solution because they require the iterates to stay inside a restrictive N2 neighborhood (14.17). From a theoretical point of view, however, they have the advantage of better complexity. (A result similar to Theorem 14.4 holds with n replaced by n 1/2 in the complexity estimate.) Better results are obtained with the predictor-corrector method, due to Mizuno, Todd, and Ye [208], which uses two N2 neighborhoods, nested one inside the other. (Despite the similar terminology, this algorithm is quite distinct from Algorithm 14.3 of Section 14.2.) Every second step of this method is a predictor step, which starts in the inner neighborhood 413 414 CHAPTER 14. INTERIOR-POINT METHODS and moves along the affine-scaling direction (computed by setting σ 0 in (14.16)) to the boundary of the outer neighborhood. The gap between neighborhood boundaries is wide enough to allow this step to make significant progress in reducing µ. Alternating with the predictor steps are corrector steps (computed with σ 1 and α 1), which take the next iterate back inside the inner neighborhood in preparation for the next predictor step. The predictor-corrector algorithm produces a sequence of duality measures µk that converge superlinearly to zero, in contrast to the linear convergence that characterizes most methods. POTENTIAL-REDUCTION METHODS Potential-reduction methods take steps of the same form as path-following methods, but they do not explicitly follow the central path C and can be motivated independently of it. They use a logarithmic potential function to measure the worth of each point in F o and aim to achieve a certain fixed reduction in this function at each iteration. The primal-dual potential function, which we denote generically by , usually has two important properties: → ∞ if xi si → 0 for some i, while µ x T s/n → 0, (14.45a) → −∞ if and only if (x, λ, s) → . (14.45b) The first property (14.45a) prevents any one of the pairwise products xi si from approaching zero independently of the others, and therefore keeps the iterates away from the boundary of the nonnegative orthant. The second property (14.45b) relates to the solution set . If our algorithm forces to −∞, then (14.45b) ensures that the sequence approaches the solution set. An interesting primal-dual potential function is defined by ρ (x, s) ρ log x T s − n log xi si , (14.46) i1 for some parameter ρ > n (see Tanabe [283] and Todd and Ye [287]). Like all algorithms based on Framework 14.1, potential-reduction algorithms obtain their search directions by solving (14.10), for some σk ∈ (0, 1), and they take steps of length αk along these directions. For instance, the step length αk may be chosen to approximately minimize ρ along the √ computed direction. By fixing σk n/(n + n) for all k, one can guarantee constant reduction in ρ at every iteration. Hence, ρ will approach −∞, forcing convergence. Adaptive and heuristic choices of σk and αk are also covered by the theory, provided that they at least match the reduction in ρ obtained from the conservative theoretical values of these parameters. 14.3. OTHER PRIMAL-DUAL ALGORITHMS AND EXTENSIONS EXTENSIONS Primal-dual methods for linear programming can be extended to wider classes of problems. There are simple extensions of the algorithm to the monotone linear complementarity problem (LCP) and convex quadratic programming problems for which the convergence and polynomial complexity properties of the linear programming algorithms are retained. The monotone LCP is the problem of finding vectors x and s in IRn that satisfy the following conditions: s M x + q, (x, s) ≥ 0, x T s 0, (14.47) where M is a positive semidefinite n × n matrix and q ∈ IRn . The similarity between (14.47) and the KKT conditions (14.3) is obvious: The last two conditions in (14.47) correspond to (14.3d) and (14.3c), respectively, while the condition s M x + q is similar to the equations (14.3a) and (14.3b). For practical instances of the problem (14.47), see Cottle, Pang, and Stone [80]. Interior-point methods for monotone LCP have a close correspondence to algorithms for linear programming. The duality measure (14.6) is redefined to be the complementarity measure (with the same definition µ x T s/n), and the conditions that must be satisfied by the solution can be stated similarly to (14.4) as follows: Mx + q − s 0, X Se (x, s) ≥ 0. The general formula for a path-following step is defined analogously to (14.9) as follows: M −I S X x s −(M x + q − s) −X Se + σ µe , where σ ∈ [0, 1]. Using these and similar adaptations, an extension of the practical method of Section 14.2 can also be derived. Extensions to convex quadratic programs are discussed in Section 16.6. Their adaptation to nonlinear programming problems is the subject of Chapter 19. Interior-point methods are highly effective in solving semidefinite programming problems, a class of problems involving symmetric matrix variables that are constrained to be positive semidefinite. Semidefinite programming, which has been the topic of concentrated research since the early 1990s, has applications in many areas, including control theory and combinatorial optimization. Further information on this increasingly important topic can be found in the survey papers of Todd [285] and Vandenberghe and Boyd [292] and the books of Nesterov and Nemirovskii [226], Boyd et al. [37], and Boyd and Vandenberghe [38]. 415 416 CHAPTER 14. 14.4 INTERIOR-POINT METHODS PERSPECTIVES AND SOFTWARE The appearance of interior-point methods in the 1980s presented the first serious challenge to the dominance of the simplex method as a practical means of solving linear programming problems. By about 1990, interior-point codes had emerged that incorporated the techniques described in Section 14.2 and that were superior on many large problems to the simplex codes available at that time. The years that followed saw significant improvements in simplex software, evidenced by the appearance of packages such as CPLEX and XPRESS-MP. These improvements were due to algorthmic advances such as steepest-edge pivoting (see Goldfarb and Forrest [133]) and improved pricing heuristics, and also to close attention to the nuts and bolts of efficient implementation. The efficiency of interior-point codes also continued to improve, through improvements in the linear algebra for solving the step equations and through the use of higher-order correctors in the step calculation (see Gondzio [138]). During this period, a number of good interior-point codes became freely available (such as PCx [84], HOPDM [137], BPMPD, and LIPSOL [321]) and found their way into many applications. In general, simplex codes are faster on problems of small-medium dimensions, while interior-point codes are competitive and often faster on large problems. However, this rule is certainly not hard-and-fast; it depends strongly on the structure of the particular application. Interior-point methods are generally not able to take full advantage of prior knowledge about the solution, such as an estimate of the solution itself or an estimate of the optimal basis. Hence, interior-point methods are less useful than simplex approaches in situations in which “warm-start” information is readily available. One situation of this type involves branch-and-bound algorithms for solving integer programs, where each node in the branch-and-bound tree requires the solution of a linear program that differs only slightly from one already solved in the parent node. In other situations, we may wish to solve a sequence of linear programs in which the data is perturbed slightly to investigate sensitivity of the solutions to various perturbations, or in which we approximate a nonlinear optimization problem by a sequence of linear programs. Yıldırım and Wright [319] describe how a given point (such as an approximate solution) can be modified to obtain a starting point that is theoretically valid, in that it allows complexity results to be proved that depend on the quality of the given point. In practice, however, these techniques can be expected to provide only a modest improvement in algorithmic performance (perhaps a factor of between 2 and 5) over a “cold” starting point such as the one described in Section 14.2. Interior-point software has the advantage that it is easy to program, relative to the simplex method. The most complex operation is the solution of the large linear systems at each iteration to compute the step; software to perform this linear algebra operation is readily available. The interior-point code LIPSOL [321] is written entirely in the Matlab language, apart from a small amount of FORTRAN code that interfaces to the linear algebra software. The code PCx [84] is written in C, but also is easy for the interested user to comprehend and modify. It is even possible for a non-expert in optimization to write an 14.4. PERSPECTIVES AND SOFTWARE efficient interior-point implementation from scratch that is customized to their particular application. NOTES AND REFERENCES For more details on the material of this chapter, see the book by Wright [316]. As noted in the text, Karmarkar’s method arose from a search for linear programming algorithms with better worst-case behavior than the simplex method. The first algorithm with polynomial complexity, Khachiyan’s ellipsoid algorithm [180], was a computational disappointment. In contrast, the execution times required by Karmarkar’s method were not too much greater than simplex codes at the time of its introduction, particularly for large linear programs. Karmarkar’s is a primal algorithm; that is, it is described, motivated, and implemented purely in terms of the primal problem (14.1) without reference to the dual. At each iteration, Karmarkar’s algorithm performs a projective transformation on the primal feasible set that maps the current iterate x k to the center of the set and takes a step in the feasible steepest descent direction for the transformed space. Progress toward optimality is measured by a logarithmic potential function. Descriptions of the algorithm can be found in Karmarkar’s original paper [175] and in Fletcher [101, Section 8.7]. Karmarkar’s method falls outside the scope of this chapter, and in any case, its practical performance does not appear to match the most efficient primal-dual methods. The algorithms we discussed in this chapter have polynomial complexity, like Karmarkar’s method. Many of the algorithmic ideas that have been examined since 1984 actually had their genesis in three works that preceded Karmarkar’s paper. The first of these is the book of Fiacco and McCormick [98] on logarithmic barrier functions (originally proposed by Frisch [115]), which proves existence of the central path, among many other results. Further analysis of the central path was carried out by McLinden [205], in the context of nonlinear complementarity problems. Finally, there is Dikin’s paper [94], in which an interior-point method known as primal affine-scaling was originally proposed. The outburst of research on primal-dual methods, which culminated in the efficient software packages available today, dates to the seminal paper of Megiddo [206]. Todd gives an excellent survey of potential reduction methods in [284]. He relates the primal-dual potential reduction method mentioned above to pure primal potential reduction methods, including Karmarkar’s original algorithm, and discusses extensions to special classes of nonlinear problems. For an introduction to complexity theory and its relationship to optimization, see the book by Vavasis [297]. Andersen et al. [6] cover many of the practical issues relating to implementation of interior-point methods. In particular, they describe an alternative scheme for choosing the initial point, for the case in which upper bounds are also present on the variables. 417 418 CHAPTER 14. ✐ INTERIOR-POINT METHODS EXERCISES ✐ 14.1 This exercise illustrates the fact that the bounds (x, s) ≥ 0 are essential in relating solutions of the system (14.4a) to solutions of the linear program (14.1) and its dual. Consider the following linear program in IR2 : min x1 , subject to x1 + x2 1, (x1 , x2 ) ≥ 0. Show that the primal-dual solution is x∗ 0 , 1 λ∗ 0, s∗ 1 . 0 Also verify that the system F(x, λ, s) 0 has the spurious solution x 1 0 , λ 1, s 0 −1 , which has no relation to the solution of the linear program. ✐ 14.2 (i) Show that N2 (θ1 ) ⊂ N2 (θ2 ) when 0 ≤ θ1 < θ2 < 1 and that N−∞ (γ1 ) ⊂ N−∞ (γ2 ) for 0 < γ2 ≤ γ1 ≤ 1. (ii) Show that N2 (θ ) ⊂ N−∞ (γ ) if γ ≤ 1 − θ . ✐ 14.3 Given an arbitrary point (x, λ, s) ∈ F o , find the range of γ values for which (x, λ, s) ∈ N−∞ (γ ). (The range depends on x and s.) ✐ 14.4 For n 2, find a point (x, s) > 0 for which the condition X Se − µe2 ≤ θ µ is not satisfied for any θ ∈ [0, 1). ✐ 14.5 Prove that the neighborhoods N−∞ (1) (see (14.18)) and N2 (0) (see (14.17)) coincide with the central path C. ✐ 14.6 In the long-step path-following method (Algorithm 14.2), give a procedure for calculating the maximum value of α such that (14.20) is satisfied. ✐ ✐ 14.7 Show that ρ defined by (14.46) has the property (14.45a). 14.8 Prove that the coefficient matrix in (14.16) is nonsingular if and only if A has full row rank. 14.4. ✐ PERSPECTIVES AND SOFTWARE 14.9 Given (x, λ, s) satisfying (14.10), prove (14.23). ✐ pri 14.10 Given an iterate (x k , λk , s k ) with (x k , s k ) > 0, show that the quantities αmax dual and αmax defined by (14.36) are the largest values of α such that x k + αx k ≥ 0 and s k + αs k ≥ 0, respectively. ✐ 14.11 Verify (14.37). ✐ 14.12 Given that X and S are diagonal with positive diagonal elements, show that the coefficient matrix in (14.44a) is symmetric and positive definite if and only if A has full row rank. Does this result continue to hold if we replace D by a diagonal matrix in which exactly m of the diagonal elements are positive and the remainder are zero? (Here m is the number of rows of A.) ✐ 14.13 Given a point (x, λ, s) with (x, s) > 0, consider the trajectory H defined by ⎡ ⎢ F x̂(τ ), λ̂(τ ), ŝ(τ ) ⎣ (1 − τ )(A T λ + s − c) (1 − τ )(Ax − b) ⎤ ⎥ ⎦, (x̂(τ ), ŝ(τ )) ≥ 0, (1 − τ )X Se for τ ∈ [0, 1], and note that x̂(0), λ̂(0), ŝ(0) (x, λ, s), while the limit of x̂(τ ), λ̂(τ ), ŝ(τ ) as τ ↑ 1 will lie in the primal-dual solution set of the linear program. Find equations for the first, second, and third derivatives of H with respect to τ at τ 0. Hence, write down a Taylor series approximation to H near the point (x, λ, s). ✐ 14.14 Consider the following linear program, which contains “free variables” denoted by y: min c T x + d T y, subject to A1 x + A2 y b, x ≥ 0. By introducing Lagrange multipliers λ for the equality constraints and s for the bounds x ≥ 0, write down optimality conditions for this problem in an analogous fashion to (14.3). Following (14.4) and (14.16), use these conditions to derive the general step equations for a primal-dual interior-point method. Express these equations in augmented system form analogously to (14.42) and explain why it is not possible to reduce further to a formulation like (14.44) in which the coefficient matrix is symmetric positive definite. ✐ 14.15 Program Algorithm 14.3 in Matlab. Choose η 0.99 uniformly in (14.38). Test your code on a linear programming problem (14.1) generated by choosing A randomly, 419 420 CHAPTER 14. INTERIOR-POINT METHODS and then setting x, s, b, and c as follows: xi si random positive number i 1, 2, . . . , m, 0 i m + 1, m + 2, . . . , n, random positive number i m + 1, m + 2, . . . , n 0 i 1, 2, . . . , m, λ random vector, c A T λ + s, b Ax. Choose the starting point (x 0 , λ0 , s 0 ) with the components of x 0 and s 0 set to large positive values. ✐ 14.17 Show that the solutions of the problems (14.39) are given explicitly by (14.40). This is page 421 Printer: Opaque this 15 CHAPTER Fundamentals of Algorithms for Nonlinear Constrained Optimization In this chapter, we begin our discussion of algorithms for solving the general constrained optimization problem minn f (x) x∈IR subject to ci (x) 0, i ∈ E, ci (x) ≥ 0, i ∈ I, (15.1) where the objective function f and the constraint functions ci are all smooth, real-valued functions on a subset of IRn , and I and E are finite index sets of inequality and equality constraints, respectively. In Chapter 12, we used this general statement of the problem 422 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS to derive optimality conditions that characterize its solutions. This theory is useful for motivating the various algorithms discussed in the remainder of the book, which differ from each other in fundamental ways but are all iterative in nature. They generate a sequence of estimates of the solution x ∗ that, we hope, tend toward a solution. In some cases, they also generate a sequence of guesses for the Lagrange multipliers associated with the constraints. As in the chapters on unconstrained optimization, we study only algorithms for finding local solutions of (15.1); the problem of finding a global solution is outside the scope of this book. We note that this chapter is not concerned with individual algorithms themselves, but rather with fundamental concepts and building blocks that are common to more than one algorithm. After reading Sections 15.1 and 15.2, the reader may wish to glance at the material in Sections 15.3, 15.4, 15.5, and 15.6, and return to these sections as needed during study of subsequent chapters. 15.1 CATEGORIZING OPTIMIZATION ALGORITHMS We now catalog the algorithmic approaches presented in the rest of the book. No standard taxonomy exists for nonlinear optimization algorithms; in the remaining chapters we have grouped the various approaches as follows. I. In Chapter 16 we study algorithms for solving quadratic programming problems. We consider this category separately because of its intrinsic importance, because its particular characteristics can be exploited by efficient algorithms, and because quadratic programming subproblems need to be solved by sequential quadratic programming methods and certain interior-point methods for nonlinear programming. We discuss active set, interior-point, and gradient projection methods. II. In Chapter 17 we discuss penalty and augmented Lagrangian methods. By combining the objective function and constraints into a penalty function, we can attack problem (15.1) by solving a sequence of unconstrained problems. For example, if only equality constraints are present in (15.1), we can define the quadratic penalty function as f (x) + µ 2 c (x), 2 i∈E i (15.2) where µ > 0 is referred to as a penalty parameter. We minimize this unconstrained function, for a series of increasing values of µ, until the solution of the constrained optimization problem is identified to sufficient accuracy. If we use an exact penalty function, it may be possible to find a local solution of (15.1) by solving a single unconstrained optimization problem. For the equality-constrained problem, 15.1. CATEGORIZING OPTIMIZATION ALGORITHMS the function defined by f (x) + µ |ci (x)|, i∈E is usually an exact penalty function, for a sufficiently large value of µ > 0. Although they often are nondifferentiable, exact penalty functions can be minimized by solving a sequence of smooth subproblems. In augmented Lagrangian methods, we define a function that combines the properties of the Lagrangian function (12.33) and the quadratic penalty function (15.2). This so-called augmented Lagrangian function has the following form for equality-constrained problems: L A (x, λ; µ) f (x) − i∈E λi ci (x) + µ 2 c (x). 2 i∈E i Methods based on this function fix λ to some estimate of the optimal Lagrange multiplier vector and fix µ to some positive value, then find a value of x that approximately minimizes L A (·, λ; µ). At this new x-iterate, λ and µ may be updated; then the process is repeated. This approach avoids certain drawbacks associated with the minimization of the quadratic penalty function (15.2). III. In Chapter 18 we describe sequential quadratic programming (SQP) methods, which model (15.1) by a quadratic programming subproblem at each iterate and define the search direction to be the solution of this subproblem. In the basic SQP method, we define the search direction pk at the iterate (xk , λk ) to be the solution of min p subject to 1 2 p T ∇x2x L(xk , λk ) p + ∇ f (xk )T p (15.3a) ∇ci (xk )T p + ci (xk ) 0, i ∈ E, (15.3b) ∇ci (xk ) p + ci (xk ) ≥ 0, i ∈ I, (15.3c) T where L is the Lagrangian function defined in (12.33). The objective in this subproblem is an approximation to the change in the Lagrangian function in moving from xk to xk + p, while the constraints are linearizations of the constraints in (15.1). A trust-region constraint may be added to (15.3) to control the length and quality of the step, and quasi-Newton approximate Hessians can be used in place of ∇x2x L(xk , λk ). In a variant called sequential linear-quadratic programming, the step pk is computed in two stages. First, we solve a linear program that is defined by omitting the first (quadratic) term from the objective (15.3a) and adding a trust-region constraint to (15.3). Next, we obtain the step pk by solving an equality-constrained subproblem in which the constraints active at the solution of the linear program are imposed as equalities, while all other constraints are ignored. IV. In Chapter 19 we study interior-point methods for nonlinear programming. These methods can be viewed as extensions of the primal-dual interior-point methods for linear 423 424 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS programming discussed in Chapter 14. We can also view them as barrier methods that generate steps by solving the problem min x,s subject to f (x) − µ m log si (15.4a) i ∈ E, (15.4b) i1 ci (x) 0, ci (x) − si 0, i ∈ I, (15.4c) for some positive value of the barrier parameter µ, where the variables si > 0 are slacks. Interior-point methods constitute the newest class of methods for nonlinear programming and have already proved to be formidable competitors of sequential quadratic programming methods. The algorithms in categories I, III, and IV make use of elimination techniques, in which the constraints are used to eliminate some of the degrees of freedom in the problem. As a background to those algorithms, we discuss elimination in Section 15.3. In later sections we discuss merit functions and filters, which are important mechanisms for promoting convergence of nonlinear programming algorithms from remote starting points. 15.2 THE COMBINATORIAL DIFFICULTY OF INEQUALITY-CONSTRAINED PROBLEMS One of the main challenges in solving nonlinear programming problems lies in dealing with inequality constraints—in particular, in deciding which of these constraints are active at the solution and which are not. One approach, which is the essence of active-set methods, starts by making a guess of the optimal active set A∗ , that is, the set of constraints that are satisfied as equalities at a solution. We call our guess the working set and denote it by W. We then solve a problem in which the constraints in the working set are imposed as equalities and the constraints not in W are ignored. We then check to see if there is a choice of Lagrange multipliers such that the solution x ∗ obtained for this W satisfies the KKT conditions (12.34). If so, we accept x ∗ as a local solution of (15.1). Otherwise, we make a different choice of W and repeat the process. This approach is based on the observation that, in general, it is much simpler to solve equality-constrained problems than to solve nonlinear programs. The number of choices for working set W may be very large—up to 2|I| , where |I| is the number of inequality constraints. We arrive at this estimate by observing that we can make one of two choices for each i ∈ I: to include it in W or leave it out. Since the number of possible working sets grows exponentially with the number of inequalities—a phenomenon which we refer to as the combinatorial difficulty of nonlinear programming—we cannot hope to design a practical algorithm by considering all possible choices for W. 15.2. THE COMBINATORIAL DIFFICULTY OF INEQUALITY-CONSTRAINED PROBLEMS The following example suggests that even for a small number of inequality constraints, determination of the optimal active set is not a simple task. ❏ EXAMPLE 15.1 Consider the problem def min f (x, y) 12 (x − 2)2 + 12 (y − 12 )2 x,y (x + 1)−1 − y − 1 4 (15.5) ≥ 0, x ≥ 0, subject to y ≥ 0. We label the constraints, in order, with the indices 1 through 3. Figure 15.1 illustrates the contours of the objective function (dashed circles). The feasible region is the region enclosed by the curve and the two axes. We see that only the first constraint is active at the solution, which is (x ∗ , y ∗ )T (1.953, 0.089)T . Let us now apply the working-set approach described above to (15.5), considering all 3 2 8 possible choices of W. We consider first the possibility that no constraints are active at the solution, that is, W ∅. Since ∇ f (x − 2, y − 1/2)T , we see that the unconstrained minimum of f lies outside the feasible region. Hence, the optimal active set cannot be empty. There are seven further possibilities. First, all three constraints could be active (that is, W {1, 2, 3}). A glance at Figure 15.1 shows that this does not happen for our problem; the three constraints do not share a common point of intersection. Three further possibilities are obtained by making a single constraint active (that is, W {1}, W {2}, and W {3}), y (2,0.5) (x*,y*) x Figure 15.1 Graphical illustration of problem (15.5). 425 426 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS while the final three possibilities are obtained by making exactly two constraints active (that is, W {1, 2}, W {1, 3}, and W {2, 3}). We consider three of these cases in detail. - W {2}; that is, only the constraint x 0 is active. If we minimize f enforcing only this constraint, we obtain the point (0, 1/2)T . A check of the KKT conditions (12.34) shows that no matter how we choose the Lagrange multipliers, we cannot satisfy all these conditions at (0, 1/2)T . (We must have λ1 λ3 0 to satisfy (12.34e), which implies that we must set λ2 −2 to satisfy (12.34a); but this value of λ2 violates the condition (12.34d).) - W {1, 3}, which yields the single feasible point (3, 0)T . Since constraint 2 is inactive at this point, we have λ2 0, so by solving (12.34a) for the other Lagrange multipliers, we obtain λ1 −16 and λ3 −16.5. These values are negative, so they violate (12.34d), and x (3, 0)T cannot be a solution of (15.1). - W {1}. Solving the equality-constrained problem in which the first constraint is active, we obtain (x, y)T (1.953, 0.089)T with Lagrange multiplier λ1 0.411. It is easy to see that by setting λ2 λ3 0, the remaining KKT conditions (12.34) are satisfied, so we conclude that this is a KKT point. Furthermore, it is easy to show that the second-order sufficient conditions are satisfied, as the Hessian of the Lagrangian is positive definite. ❐ Even for this small example, we see that it is exhausting to consider all possible choices for W. Figure 15.1 suggests, however, that some choices of W can be eliminated from consideration if we make use of knowledge of the functions that define the problem, and their derivatives. In fact, the active set methods described in Chapter 16 use this kind of information to make a series of educated guesses for the working set, avoiding choices of W that obviously will not lead to a solution of (15.1). A different approach is followed by interior-point (or barrier) methods discussed in Chapter 19. These methods generate iterates that stay away from the boundary of the feasible region defined by the inequality constraints. As the solution of the nonlinear program is approached, the barrier effects are weakened to permit an increasingly accurate estimate of the solution. In this manner, interior-point methods avoid the combinatorial difficulty of nonlinear programming. 15.3 ELIMINATION OF VARIABLES When dealing with constrained optimization problems, it is natural to try to use the constraints to eliminate some of the variables from the problem, to obtain a simpler problem with fewer degrees of freedom. Elimination techniques must be used with care, however, as they may alter the problem or introduce ill conditioning. 15.3. ELIMINATION OF VARIABLES y 2 = (x-1) 3 y x 2+y 2= 4 x 2+y 2=1 x (1,0) Figure 15.2 The danger of nonlinear elimination. We begin with an example in which it is safe and convenient to eliminate variables. In the problem min f (x) f (x1 , x2 , x3 , x4 ) subject to x1 + x32 − x4 x3 0, −x2 + x4 + x32 0, there is no risk in setting x1 x4 x3 − x32 , x2 x4 + x32 , to obtain a function of two variables h(x3 , x4 ) f (x4 x3 − x32 , x4 + x32 , x3 , x4 ), which we can minimize using the unconstrained optimization techniques described in earlier chapters. The dangers of nonlinear elimination are illustrated in the following example. ❏ EXAMPLE 15.2 (FLETCHER [101]) Consider the problem min x 2 + y 2 subject to (x − 1)3 y 2 . The contours of the objective function and the constraints are illustrated in Figure 15.2, which shows that the solution is (x, y) (1, 0). 427 428 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS We attempt to solve this problem by eliminating y. By doing so, we obtain h(x) x 2 + (x − 1)3 . Clearly, h(x) → −∞ as x → −∞. By blindly applying this transformation we may conclude that the problem is unbounded, but this view ignores the fact that the constraint (x − 1)3 y 2 implicitly imposes the bound x ≥ 1 that is active at the solution. Hence, if we wish to eliminate y, we should explicitly introduce the bound x ≥ 1 into the problem. ❐ This example shows that the use of nonlinear equations to eliminate variables may result in errors that can be difficult to trace. For this reason, nonlinear elimination is not used by most optimization algorithms. Instead, many algorithms linearize the constraints and apply elimination techniques to the simplified problem. We now describe systematic procedures for performing variable elimination using linear constraints. SIMPLE ELIMINATION USING LINEAR CONSTRAINTS We consider the minimization of a nonlinear function subject to a set of linear equality constraints, subject to Ax b, min f (x) (15.6) where A is an m × n matrix with m ≤ n. Suppose for simplicity that A has full row rank. (If such is not the case, we find either that the problem is inconsistent or that some of the constraints are redundant and can be deleted without affecting the solution of the problem.) Under this assumption, we can find a subset of m columns of A that is linearly independent. If we gather these columns into an m × m matrix B and define an n × n permutation matrix P that swaps these columns to the first m column positions in A, we can write A P [B | N ], (15.7) where N denotes the n − m remaining columns of A. (The notation here is consistent with that of Chapter 13, where we discussed similar concepts in the context of linear programming.) We define the subvectors xB ∈ IRm and xN ∈ IRn−m as follows: xB xN P T x, (15.8) 15.3. ELIMINATION OF VARIABLES and call xB the basic variables and B the basis matrix. Noting that P P T I , we can rewrite the constraint Ax b as b Ax A P(P T x) BxB + N xN . By rearranging this formula, we deduce that the basic variables can be expressed as follows: xB B −1 b − B −1 N xN . (15.9) We can therefore compute a feasible point for the constraints Ax b by choosing any value of xN and then setting xB according to the formula (15.9). The problem (15.6) is therefore equivalent to the unconstrained problem def min h(xN ) f xN P B −1 b − B −1 N xN . xN (15.10) We refer to the substitution in (15.9) as simple elimination of variables. This discussion shows that a nonlinear optimization problem with linear equality constraints is, from a mathematical point of view, the same as an unconstrained problem. ❏ EXAMPLE 15.3 Consider the problem 1 min sin(x1 + x2 ) + x32 + (x4 + x54 + x6 /2) 3 8x1 − 6x2 + x3 + 9x4 + 4x5 6 subject to 3x1 + 2x2 − x4 + 6x5 + 4x6 −4. (15.11a) (15.11b) By defining the permutation matrix P so as to reorder the components of x as x T (x3 , x6 , x1 , x2 , x4 , x5 )T , we find that the coefficient matrix A P is AP 1 0 8 −6 9 4 0 4 3 2 −1 6 . The basis matrix B is diagonal and therefore easy to invert. We obtain from (15.9) that x3 x6 ⎡ 8 −⎣ 3 4 −6 1 2 9 1 − 4 ⎤ ⎡ x1 ⎢ 4 ⎢ x2 3 ⎦⎢ ⎢ x ⎣ 4 2 x5 ⎤ ⎥ ⎥ 6 ⎥+ . ⎥ −1 ⎦ (15.12) 429 430 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS By substituting for x3 and x6 in (15.11a), the problem becomes min sin(x1 + x2 ) + (8x1 − 6x2 + 9x4 + 4x5 − 6)2 (15.13) x1 ,x2 ,x4 ,x5 1 + (x4 + x54 − [(1/2) + (3/8)x1 + (1/4)x2 − (1/8)x4 + (3/4)x5 ]). 3 We could have chosen two other columns of the coefficient matrix A (that is, two variables other than x3 and x6 ) as the basis for elimination in the system (15.11b), but the matrix B −1 N would not have been so simple. ❐ A set of m independent columns can be selected, in general, by means of Gaussian elimination. In the parlance of linear algebra, we can compute the row echelon form of the matrix and choose the pivot columns as the columns of the basis B. Ideally, we would like B to be easy to factor and well conditioned. A technique that suits these purposes is a sparse Gaussian elimination approach that attempts to preserve sparsity while keeping rounding errors under control. A well-known implementation of this algorithm is MA48 from the HSL library [96]. As we discuss below, however, there is no guarantee that the Gaussian elimination process will identify the best choice of basis matrix. There is an interesting interpretation of the simple elimination-of-variables approach that we have just described. To simplify the notation, we will assume from now on that the coefficient matrix is already given to us so that the basic columns appear in the first m positions, that is, P I . From (15.8) and (15.9) we see that any feasible point x for the linear constraints in (15.6) can be written as xB x Y b + Z xN , xN (15.14) where Y B −1 0 , Z −B −1 N I . (15.15) Note that Z has n − m linearly independent columns (because of the presence of the identity matrix in the lower block) and that it satisfies AZ 0. Therefore, Z is a basis for the null space of A. In addition, the columns of Y and the columns of Z form a linearly independent set. We note also from (15.15), (15.7) that Y b is a particular solution of the linear constraints Ax b. In other words, the simple elimination technique expresses feasible points as the sum of a particular solution of Ax b (the first term in (15.14)) plus a displacement along the 15.3. ELIMINATION OF VARIABLES x2 Ax = b x1 coordinate relaxation step Figure 15.3 Simple elimination, showing the coordinate relaxation step obtained by choosing the basis to be the first column of A. null space of the constraints (the second term in (15.14)). The relations (15.14), (15.15) indicate that the particular Y b solution is obtained by holding n −m components of x at zero while relaxing the other m components (the ones in xB ) until they reach the constraints. The particular solution Y b is sometimes known as the coordinate relaxation step. In Figure 15.3, we see the coordinate relaxation step Y b obtained by choosing the basis matrix B to be the first column of A. If we were to choose B to be the second column of A, the coordinate relaxation step would lie along the x2 axis. Simple elimination is inexpensive but can give rise to numerical instabilities. If the feasible set in Figure 15.3 consisted of a line that was almost parallel to the x1 axis, the coordinate relaxation along this axis would be very large in magnitude. We would then be computing x as the difference of very large vectors, giving rise to numerical cancellation. In that situation it would be preferable to choose a particular solution along the x2 axis, that is, to select a different basis. Selection of the best basis is, therefore, not a straightforward task in general. To overcome the dangers of an excessively large coordinate relaxation step, we could define the particular solution Y b as the minimum-norm step to the constraints. This approach is a special case of more general elimination strategies, which we now describe. GENERAL REDUCTION STRATEGIES FOR LINEAR CONSTRAINTS To generalize (15.14) and (15.15), we choose matrices Y ∈ IRn×m and Z ∈ IRn×(n−m) with the following properties: [Y | Z ] ∈ IRn×n is nonsingular, AZ 0. (15.16) 431 432 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS These properties indicate that, as in (15.15), the columns of Z are a basis for the null space of A. Since A has full row rank, so does A[Y | Z ] [AY | 0], so it follows that the m × m matrix AY is nonsingular. We now express any solution of the linear constraints Ax b as x Y xY + Z xZ , (15.17) for some vectors xY ∈ IRm and xZ ∈ IRn−m . By substituting (15.17) into the constraints Ax b, we obtain Ax (AY )xY b; hence by nonsingularity of AY , xY can be written explicitly as xY (AY )−1 b. (15.18) By substituting this expression into (15.17), we conclude that any vector x of the form x Y (AY )−1 b + Z xZ (15.19) satisfies the constraints Ax b for any choice of xZ ∈ IRn−m . Therefore, the problem (15.6) can be restated equivalently as the following unconstrained problem min f (Y (AY )−1 b + Z xZ ). xZ (15.20) Ideally, we would like to choose Y in such a way that the matrix AY is as well conditioned as possible, since it needs to be factorized to give the particular solution Y (AY )−1 b. We can do this by computing Y and Z by means of a QR factorization of A T , which has the form R , (15.21) AT Q 1 Q 2 0 where Q 1 Q 2 is orthogonal. The submatrices Q 1 and Q 2 have orthonormal columns and are of dimension n × m and n × (n − m), while R is m × m upper triangular and nonsingular and is an m × m permutation matrix. (See the discussion following (A.24) in the Appendix for further details.) We now define Y Q1, Z Q2, (15.22) so that the columns of Y and Z form an orthonormal basis of IRn . If we expand (15.21) and do a little rearrangement, we obtain AY R T , AZ 0. 15.3. ELIMINATION OF VARIABLES Therefore, Y and Z have the desired properties, and the condition number of AY is the same as that of R, which in turn is the same as that of A itself. From (15.19) we see that any solution of Ax b can be expressed as x Q 1 R −T T b + Q 2 xZ , for some vector xZ . The computation R −T T b can be carried out inexpensively, at the cost of a single triangular substitution. A simple computation shows that the particular solution Q 1 R −T T b can also be written as A T (A A T )−1 b. This vector is the solution of the following problem: min x2 subject to Ax b; that is, it is the minimum-norm solution of Ax b. See Figure 15.5 for an illustration of this step. Elimination via the orthogonal basis (15.22) is ideal from the point of view of numerical stability. The main cost associated with this reduction strategy is in computing the QR factorization (15.21). Unfortunately, for problems in which A is large and sparse, a sparse QR factorization can be much more costly to compute than the sparse Gaussian elimination strategy used in simple elimination. Therefore, other elimination strategies have been developed that seek a compromise between these two techniques; see Exercise 15.7. x2 YxY x1 ZxZ Ax= b x3 Figure 15.4 General elimination: Case in which A ∈ IR1×3 , showing the particular solution and a step in the null space of A. 433 434 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS x2 T T -1 A [AA ] b Ax=b x1 Figure 15.5 The minimum-norm step. EFFECT OF INEQUALITY CONSTRAINTS Elimination of variables is not always beneficial if inequality constraints are present alongside the equalities. For instance, if problem (15.11) had the additional constraint x ≥ 0, then after eliminating the variables x3 and x6 , we would be left with the problem of minimizing the function in (15.13) subject to the constraints (x1 , x2 , x4 , x5 ) ≥ 0, 8x1 − 6x2 + 9x4 + 4x5 ≤ 6, (3/4)x1 + (1/2)x2 − (1/4)x4 + (3/2)x5 ≤ −1. Hence, the cost of eliminating the equality constraints (15.11b) is to make the inequalities more complicated than the simple bounds x ≥ 0. For many algorithms, this transformation will not yield any benefit. If, however, problem (15.11) included the general inequality constraint 3x1 +2x3 ≥ 1, the elimination (15.12) would transform the problem into one of minimizing the function in (15.13) subject to the inequality constraint − 13x1 + 12x2 − 18x4 − 8x5 ≥ −11. (15.23) In this case, the inequality constraint would not become much more complicated after elimination of the equality constraints, so it is probably worthwhile to perform the elimination. 15.4. 15.4 MERIT FUNCTIONS AND FILTERS MERIT FUNCTIONS AND FILTERS Suppose that an algorithm for solving the nonlinear programming problem (15.1) generates a step that reduces the objective function but increases the violation of the constraints. Should we accept this step? This question is not easy to answer. We must look for a way to balance the twin (often competing) goals of reducing the objective function and satisfying the constraints. Merit functions and filters are two approaches for achieving this balance. In a typical constrained optimization algorithm, a step p will be accepted only if it leads to a sufficient reduction in the merit function φ or if it is acceptable to the filter. These concepts are explained in the rest of the section. MERIT FUNCTIONS In unconstrained optimization, the objective function f is the natural choice for the merit function. All the unconstrained optimization methods described in this book require that f be decreased at each step (or at least within a certain number of iterations). In feasible methods for constrained optimization in which the starting point and all subsequent iterates satisfy all the constraints in the problem, the objective function is still an appropriate merit function. On the other hand, algorithms that allow iterates to violate the constraints require some means to assess the quality of the steps and iterates. The merit function in this case combines the objective with measures of constraint violation. A popular choice of merit function for the nonlinear programming problem (15.1) is the 1 penalty function defined by φ1 (x; µ) f (x) + µ i∈E |ci (x)| + µ [ci (x)]− , (15.24) i∈I where we use the notation [z]− max{0, −z}. The positive scalar µ is the penalty parameter, which determines the weight that we assign to constraint satisfaction relative to minimization of the objective. The 1 merit function φ1 is not differentiable because of the presence of the absolute value and [·]− functions, but it has the important property of being exact. Definition 15.1 (Exact Merit Function). A merit function φ(x; µ) is exact if there is a positive scalar µ∗ such that for any µ > µ∗ , any local solution of the nonlinear programming problem (15.1) is a local minimizer of φ(x; µ). We show in Theorem 17.3 that, under certain assumptions, the 1 merit function φ1 (x; µ) is exact and that the threshold value µ∗ is given by µ∗ max{|λi∗ |, i ∈ E ∪ I}, 435 436 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS where the λi∗ denote the Lagrange multipliers associated with an optimal solution x ∗ . Since the optimal Lagrange multipliers are, however, not known in advance, algorithms based on the 1 merit function contain rules for adjusting the penalty parameter whenever there is reason to believe that it is not large enough (or is excessively large). These rules depend on the choice of optimization algorithm and are discussed in the next chapters. Another useful merit function is the exact 2 function, which for equality-constrained problems takes the form φ2 (x; µ) f (x) + µc(x)2 . (15.25) This function is nondifferentiable because the 2-norm term is not squared; its derivative is not defined at x for which c(x) 0. Some merit functions are both smooth and exact. To ensure that both properties hold, we must include additional terms in the merit function. For equality-constrained problems, Fletcher’s augmented Lagrangian is given by φF (x; µ) f (x) − λ(x)T c(x) + 12 µ ci (x)2 , (15.26) i∈E where µ > 0 is the penalty parameter and λ(x) [A(x)A(x)T ]−1 A(x)∇ f (x). (15.27) (Here A(x) denotes the Jacobian of c(x).) Although this merit function has some interesting theoretical properties, it has practical limitations, including the expense of solving for λ(x) in (15.27). A quite different merit function is the (standard) augmented Lagrangian in x and λ, which for equality-constrained problems has the form L A (x, λ; µ) f (x) − λT c(x) + 12 µc(x)22 . (15.28) We assess the acceptability of a trial point (x + , λ+ ) by comparing the value of L A (x + , λ+ ; µ) with the value at the current iterate, (x, λ). Strictly speaking, L A is not a merit function in the sense that a solution (x ∗ , λ∗ ) of the nonlinear programming problem is not in general a minimizer of L A (x, λ; µ) but only a stationary point. Although some sequential quadratic programming methods use L A successfully as a merit function by adaptively modifying µ and λ, we will not consider its use as a merit function further. Instead, we will focus primarily on the nonsmooth exact penalty functions φ1 and φ2 . A trial step x + x + αp generated by a line search algorithm will be accepted if it produces a sufficient decrease in the merit function φ(x; µ). One way to define this concept is analogous to the condition (3.4) used in unconstrained optimization, where the amount 15.4. MERIT FUNCTIONS AND FILTERS of decrease is not too small relative to the predicted change in the function over the step. The 1 and 2 merit functions are not differentiable, but they have a directional derivative. (See (A.51) for background on directional derivatives.) We write the directional derivative of φ(x; µ) in the direction p as D(φ(x; µ); p). In a line search method, the sufficient decrease condition requires the steplength parameter α > 0 to be small enough that the inequality φ(x + αp; µ) ≤ φ(x; µ) + ηα D(φ(x; µ); p), (15.29) is satisfied for some η ∈ (0, 1). Trust-region methods typically use a quadratic model q( p) to estimate the value of the merit function φ after a step p; see Section 18.5. The sufficient decrease condition can be stated in terms of a decrease in this model, as follows φ(x + p; µ) ≤ φ(x; µ) − η(q(0) − q( p)), (15.30) for some η ∈ (0, 1). (The final term in (15.30) is positive, because the step p is computed to decrease the model q.) FILTERS Filter techniques are step acceptance mechanisms based on ideas from multiobjective optimization. Our derivation starts with the observation that nonlinear programming has two goals: minimization of the objective function and the satisfaction of the constraints. If we define a measure of infeasibility as h(x) |ci (x)| + i∈E [ci (x)]− , (15.31) i∈I we can write these two goals as min f (x) x and min h(x). x (15.32) Unlike merit functions, which combine both problems into a single minimization problem, filter methods keep the two goals in (15.32) separate. Filter methods accept a trial step x + as a new iterate if the pair ( f (x + ), h(x + )) is not dominated by a previous pair ( fl , h l ) ( f (xl ), h(xl )) generated by the algorithm. These concepts are defined as follows. 437 438 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS h(x) (fk ,hk ) (f i ,h i ) f(x) Figure 15.6 Graphical illustration of a filter with four pairs. Definition 15.2. (a) A pair ( f k , h k ) is said to dominate another pair ( fl , h l ) if both f k ≤ fl and h k ≤ h l . (b) A filter is a list of pairs ( fl , h l ) such that no pair dominates any other. (c) An iterate xk is said to be acceptable to the filter if ( f k , h k ) is not dominated by any pair in the filter. When an iterate xk is acceptable to the filter, we (normally) add ( f k , h k ) to the filter and remove any pairs that are dominated by ( f k , h k ). Figure 15.6 shows a filter where each pair ( fl , h l ) in the filter is represented as a black dot. Every point in the filter creates an (infinite) rectangular region, and their union defines the set of pairs not acceptable to the filter. More specifically, a trial point x + is acceptable to the filter if ( f + , h + ) lies below or to the left of the solid line in Figure 15.6. To compare the filter and merit function approaches, we plot in Figure 15.7 the contour line of the set of pairs ( f, h) such that f + µh f k + µh k , where xk is the current iterate. The region to the left of this line corresponds to the set of pairs that reduce the merit function φ(x; µ) f (x) + µh(x); clearly this set is quite different from the set of points acceptable to the filter. If a trial step x + xk + αk pk generated by a line search method gives a pair ( f + , h + ) that is acceptable to the filter, we set xk+1 x + ; otherwise, a backtracking line search is performed. In a trust-region method, if the step is not acceptable to the filter, the trust region is reduced, and a new step is computed. Several enhancements to this filter technique are needed to obtain global convergence and good practical performance. We need to ensure, first of all, that we do not accept a point whose ( f, h) pair is very close to the current pair ( f k , h k ) or to another pair in the filter. We 15.4. MERIT FUNCTIONS AND FILTERS h(x) (fk ,hk ) isovalue of merit function (f i ,h i ) f(x) Figure 15.7 Comparing the filter and merit function techniques. do so by modifying the acceptability criterion and imposing a sufficient decrease condition. A trial iterate x + is acceptable to the filter if, for all pairs ( f j , h j ) in the filter, we have that f (x + ) ≤ f j − βh j or h(x + ) ≤ h j − βh j , (15.33) for β ∈ (0, 1). Although this condition is effective in practice using, say β 10−5 , for purposes of analysis it may be advantageous to replace the first inequality by f (x + ) ≤ f j − βh + . A second enhancement addresses some problematic aspects of the filter mechanism. Under certain circumstances, the search directions generated by line search methods may require arbitrarily small steplengths αk to be acceptable to the filter. This phenomenon can cause the algorithm to stall and fail. To guard against this situation, if the backtracking line search generates a steplength that is smaller than a given threshold αmin , the algorithm switches to a feasibility restoration phase, which we describe below. Similarly, in a trust-region method, if a sequence of trial steps is rejected by the filter, the trust-region radius may be decreased so much that the trust-region subproblem becomes infeasible (see Section 18.5). In this case, too, the feasibility restoration phase is invoked. (Other mechanisms could be employed to handle this situation, but as we discuss below, the feasibility restoration phase can help the algorithm achieve other useful goals.) The feasibility restoration phase aims exclusively to reduce the constraint violation, that is, to find an approximate solution to the problem min h(x). x 439 440 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS Although h(x) defined by (15.31) is not smooth, we show in Chapter 17 how to minimize it using a smooth constrained optimization subproblem. This phase terminates at an iterate that has a sufficiently small value of h and is compatible with the filter. We now present a framework for filter methods that assumes that iterates are generated by a trust-region method; see Section 18.5 for a discussion of trust-region methods for constrained optimization. Algorithm 15.1 (General Filter Method). Choose a starting point x0 and an initial trust-region radius 0 ; Set k ← 0; repeat until a convergence test is satisfied if the step-generation subproblem is infeasible Compute xk+1 using the feasibility restoration phase; else Compute a trial iterate x + xk + pk ; if ( f + , h + ) is acceptable to the filter Set xk+1 x + and add ( f k+1 , h k+1 ) to the filter; Choose k+1 such that k+1 ≥ k ; Remove all pairs from the filter that are dominated by ( f k+1 , h k+1 ); else Reject the step, set xk+1 xk ; Choose k+1 < k ; end if end if k ← k + 1; end repeat Other enhancements of this simple filter framework are used in practice; they depend on the choice of algorithm and will be discussed in subsequent chapters. 15.5 THE MARATOS EFFECT Some algorithms based on merit functions or filters may fail to converge rapidly because they reject steps that make good progress toward a solution. This undesirable phenomenon is often called the Maratos effect, because it was first observed by Maratos [199]. It is illustrated by the following example, in which steps pk , which would yield quadratic convergence if accepted, cause an increase both in the objective function value and the constraint violation. 15.5. THE MARATOS EFFECT contours of f xk θ x* xk + pk Figure 15.8 Maratos Effect: Example 15.4. Note that the constraint is no longer satisfied after the step from xk to xk + pk , and the objective value has increased. constraint x12 + x 22 = 1 ❏ EXAMPLE 15.4 (POWELL [255]) Consider the problem min f (x1 , x2 ) 2(x12 + x22 − 1) − x1 , subject to x12 + x22 − 1 0. (15.34) One can verify (see Figure 15.8) that the optimal solution is x ∗ (1, 0)T , that the corresponding Lagrange multiplier is λ∗ 32 , and that ∇x2x L(x ∗ , λ∗ ) I . Let us consider an iterate xk of the form xk (cos θ, sin θ )T , which is feasible for any value of θ . Suppose that our algorithm computes the following step: pk sin2 θ − sin θ cos θ , (15.35) which yields a trial point x k + pk cos θ + sin2 θ sin θ (1 − cos θ ) . By using elementary trigonometric identities, we have that xk + pk − x ∗ 2 2 sin2 (θ/2), xk − x ∗ 2 2| sin(θ/2)|, 441 442 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS and therefore xk + pk − x ∗ 2 1 . 2 ∗ 2 xk − x 2 Hence, this step approaches the solution at a rate consistent with Q-quadratic convergence. However, we have that f (xk + pk ) sin2 θ − cos θ > − cos θ f (xk ), c(xk + pk ) sin2 θ > c(xk ) 0, so that, as can be seen in Figure 15.8, both the objective function value and the constraint violation increase over this step. This behavior occurs for any nonzero value of θ , even if the initial point is arbitrarily close to the solution. ❐ On the example above, any algorithm that requires reduction of a merit function of the form φ(x; µ) f (x) + µh(c(x)), where h(·) is a nonnegative function satisfying h(0) 0, will reject the good step (15.35). (Examples of such merit functions include the φ1 and φ2 penalty functions.) The step (15.35) will also be rejected by the filter mechanism described above because the pair ( f (xk + pk ), h(xk + pk )) is dominated by ( f k , h k ). Therefore, all these approaches will suffer from the Maratos effect. If no remedial measures are taken, the Maratos effect can slow optimization methods by interfering with good steps away from the solution and by preventing superlinear convergence. Strategies for avoiding the Maratos effect include the following. 1. We can use a merit function that does not suffer from the Maratos effect. An example is Fletcher’s augmented Lagrangian function (15.26). 2. We can use a second-order correction in which we add to pk a step p̂k , which is computed at c(xk + pk ) and which decreases the constraint violation. 3. We can allow the merit function φ to increase on certain iterations; that is, we can use a nonmonotone strategy. We discuss the last two approaches in the next section. 15.6. 15.6 SECOND-ORDER CORRECTION AND NONMONOTONE TECHNIQUES SECOND-ORDER CORRECTION AND NONMONOTONE TECHNIQUES By adding a correction term that decreases the constraint violation, various algorithms are able to overcome the difficulties associated with the Maratos effect. We describe this technique with respect to the equality-constrained problem, in which the constraint is c(x) 0, where c : IRn → IR|E| . Given a step pk , the second-order correction step p̂k is defined to be p̂k −AkT (Ak AkT )−1 c(xk + pk ), (15.36) where Ak A(xk ) is the Jacobian of c at xk . Note that p̂k has the property that it satisfies a linearization of the constraint c at the point xk + pk , that is, Ak p̂k + c(xk + pk ) 0. In fact, p̂k is the minimum-norm solution of this equation. (A different interpretation of the second-order correction is given in Section 18.3.) The effect of the correction step p̂k is to decrease the quantity c(x) to the order of xk − x ∗ 3 , provided the primary step pk satisfies Ak pk + c(xk ) 0. This estimate indicates that the step from from xk to xk + pk + p̂k will decrease the merit function, at least near the solution. The cost of this enhancement includes the additional evaluation of the constraint function c at xk + pk and the linear algebra required to calculate the step p̂k from (15.36). We now describe an algorithm that uses a merit function together with a line-search strategy and a second-order correction step. We assume that the search direction pk and the penalty parameter µk are computed so that pk is a descent direction for the merit function, that is, D(φ(xk ; µ); pk ) < 0. In Chapters 18 and 19, we discuss how to accomplish these goals. The key feature of the algorithm is that, if the full step αk 1 does not produce satisfactory descent in the merit function, we try the second-order correction step before backtracking along the original direction pk . Algorithm 15.2 (Generic Algorithm with Second-Order Correction). Choose parameters η ∈ (0, 0.5) and τ1 , τ2 with 0 < τ1 < τ2 < 1; Choose initial point x0 ; set k ← 0; repeat until a convergence test is satisfied: Compute a search direction pk ; Set αk ← 1, newpoint ← false ; while newpoint = false if φ(xk + αk pk ; µ) ≤ φ(xk ; µ) + ηαk D(φ(xk ; µ); pk ) Set xk+1 ← xk + αk pk ; Set newpoint ← true; 443 444 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS else if αk 1 Compute p̂k from (15.36); if φ(xk + pk + p̂k ; µ) ≤ φ(xk ; µ) + ηD(φ(xk ; µ); pk ) Set xk+1 ← xk + pk + p̂k ; Set newpoint ← true; else Choose new αk in [τ1 αk , τ2 αk ]; end else Choose new αk in [τ1 αk , τ2 αk ]; end end while end repeat In this algorithm, the full second-order correction step p̂k is discarded if does not produce a reduction in the merit function. We do not backtrack along the direction pk + p̂k because it is not guaranteed to be a descent direction for the merit function. A variation of this algorithm applies the second-order correction step only if the sufficient decrease condition (15.29) is violated as a result of an increase in the norm of the constraints. The second-order correction strategy is effective in practice. The cost of performing the extra constraint function evaluation and an additional backsolve in (15.36) is outweighed by added robustness and efficiency. NONMONOTONE (WATCHDOG) STRATEGY The inefficiencies caused by the Maratos effect can also be avoided by occasionally accepting steps that increase the merit function; such steps are called relaxed steps. There is a limit to our tolerance, however. If a sufficient reduction of the merit function has not been obtained within a certain number of iterates of the relaxed step (tˆ iterates, say), then we return to the iterate before the relaxed step and perform a normal iteration, using a line search or some other technique to force a reduction in the merit function. In contrast with the second-order correction, which aims only to improve satisfaction of the constraints, this nonmonotone strategy always takes regular steps pk of the algorithm that aim both for improved feasibility and optimality. The hope is that any increase in the merit function over a single step will be temporary, and that subsequent steps will more than compensate for it. We now describe a particular instance of the nonmonotone approach called the watchdog strategy. We set tˆ 1, so that we allow the merit function to increase on just a single step before insisting on a sufficient decrease in the merit function. As above, we focus our discussion on a line search algorithm that uses a nonsmooth merit function φ. We assume that the penalty parameter µ is not changed until a successful cycle has been 15.6. SECOND-ORDER CORRECTION AND NONMONOTONE TECHNIQUES completed. To simplify the notation, we omit the dependence of φ on µ and write the merit function as φ(x) and the directional derivative as D(φ(x); pk ). Algorithm 15.3 (Watchdog). Choose a constant η ∈ (0, 0.5) and an initial point x0 ; Set k ← 0, S ← {0}; repeat until a termination test is satisfied Compute a step pk ; Set xk+1 ← xk + pk ; if φ(xk+1 ) ≤ φ(xk ) + ηD(φ(xk ); pk ) k ← k + 1, S ← S ∪ {k}; else Compute a search direction pk+1 from xk+1 ; Find αk+1 such that φ(xk+2 ) ≤ φ(xk+1 ) + ηαk+1 D(φ(xk+1 ); pk+1 ); Set xk+2 ← xk+1 + αk+1 pk+1 ; if φ(xk+1 ) ≤ φ(xk ) or φ(xk+2 ) ≤ φ(xk ) + ηD(φ(xk ); pk ) k ← k + 2, S ← S ∪ {k}; else if φ(xk+2 ) > φ(xk ) (* return to xk and search along pk *) Find αk such that φ(xk+3 ) ≤ φ(xk ) + ηαk D(φ(xk ); pk ); Compute xk+3 xk + αk pk ; k ← k + 3, S ← S ∪ {k}; else Compute a direction pk+2 from xk+2 ; Find αk+2 such that φ(xk+3 ) ≤ φ(xk+2 ) + ηαk+2 D(φ(xk+2 ); pk+2 ); Set xk+3 ← xk+2 + αk+2 pk+2 ; k ← k + 3, S ← S ∪ {k}; end end end (repeat) The set S is not required by the algorithm and is introduced only to identify the iterates for which a sufficient merit function reduction was obtained. Note that at least a third of the iterates have their indices in S. By using this fact, one can show that various constrained optimization methods that use the watchdog technique are globally convergent. One can also show that for all sufficiently large k, the step length is αk 1 and the convergence rate is superlinear. In practice, it may be advantageous to allow increases in the merit function for more than one iteration. Values of tˆ such as 5 or 8 are typical. As this discussion indicates, careful implementations of the watchdog technique have a certain degree of complexity, but 445 446 CHAPTER 15. FUNDAMENTALS OF CONSTRAINED ALGORITHMS the added complexity is worthwhile because the approach has good practical performance. A potential advantage of the watchdog technique over the second-order correction strategy is that it may require fewer evaluations of the constraint functions. In the best case, most of the steps will be full steps, and there will rarely be a need to return to an earlier point. NOTES AND REFERENCES Techniques for eliminating linear constraints are described, for example, in Fletcher [101] and Gill, Murray, and Wright [131]. For a thorough discussion of merit functions see Boggs and Tolle [33] and Conn, Gould, and Toint [74]. Some of the earliest references on nonmonotone methods include Grippo, Lampariello and Lucidi [158], and Chamberlain et al [57]; see [74] for a review of nonmonotone techniques and an extensive list of references. The concept of a filter was introduced by Fletcher and Leyffer [105]; our discussion of filters is based on that paper. Second-order correction steps are motivated and discussed in Fletcher [101]. ✐ EXERCISES ✐ 15.1 In Example 15.1, consider these three choices of the working set: W {3}, W {1, 2}, W {2, 3}. Show that none of these working sets are the optimal active set for (15.5). ✐ 15.2 For the problem in Example 15.3, perform simple elimination of the variables x2 and x5 to obtain an unconstrained problem in the remaining variables x1 , x3 , x4 , and x6 . Similarly to (15.12), express the eliminated variables explicitly in terms of the retained variables. ✐ 15.3 Do the following problems have solutions? Explain. min x1 + x2 subject to x12 + x22 2, 0 ≤ x1 ≤ 1, 0 ≤ x2 ≤ 1; min x1 + x2 subject to x12 + x22 ≤ 1, x1 + x2 3; min x1 x2 subject to x1 + x2 2. ✐ 15.4 Show that if in Example 15.2 we eliminate x in terms of y, then the correct solution of the problem is obtained by performing unconstrained minimization. ✐ ✐ 15.5 Show that the basis matrices (15.15) are linearly independent. 15.6 Show that the particular solution Q 1 R −T T b of Ax b is identical to A (A A T )−1 b. T 15.6. SECOND-ORDER CORRECTION AND NONMONOTONE TECHNIQUES ✐ 15.7 In this exercise we compute basis matrices that attempt to compromise between the orthonormal basis (15.22) and simple elimination (15.15). We assume that the basis matrix is given by the first m columns of A, so that P I in (15.7), and define Y I (B −1 N )T , Z −B −1 N I . (15.37) (a) Show that the columns of Y and Z are no longer of norm 1 and that the relations AZ 0 and Y T Z 0 hold. Therefore, the columns of Y and Z form a linearly independent set, showing that (15.37) is a valid choice of the basis matrices. (b) Show that the particular solution Y (AY )−1 b defined by this choice of Y is, as in the orthogonal factorization approach, the minimum-norm solution of Ax b. More specifically, show that Y (AY )−1 A T (A A T )−1 . It follows that the matrix Y (AY )−1 is independent of the choice of basis matrix B in (15.7), and its conditioning is determined by that of A alone. (Note, however, that the matrix Z still depends explicitly on B, so a careful choice of B is needed to ensure well conditioning in this part of the computation.) ✐ 15.8 Verify that by adding the inequality constraint 3x1 + 2x3 ≥ 1 to the problem (15.11), the elimination (15.12) transforms the problem into one of minimizing the function (15.13) subject to the inequality constraint (15.23). 447 This is pag Printer: O 16 CHAPTER Quadratic Programming An optimization problem with a quadratic objective function and linear constraints is called a quadratic program. Problems of this type are important in their own right, and they also arise as subproblems in methods for general constrained optimization, such as sequential quadratic programming (Chapter 18), augmented Lagrangian methods (Chapter 17), and interior-point methods (Chapter 19). CHAPTER 16. QUADRATIC PROGRAMMING The general quadratic program (QP) can be stated as min x subject to q(x) 12 x T Gx + x T c (16.1a) aiT x bi , i ∈ E, (16.1b) ≥ bi , i ∈ I, (16.1c) aiT x where G is a symmetric n × n matrix, E and I are finite sets of indices, and c, x, and {ai }, i ∈ E ∪ I, are vectors in IRn . Quadratic programs can always be solved (or shown to be infeasible) in a finite amount of computation, but the effort required to find a solution depends strongly on the characteristics of the objective function and the number of inequality constraints. If the Hessian matrix G is positive semidefinite, we say that (16.1) is a convex QP, and in this case the problem is often similar in difficulty to a linear program. (Strictly convex QPs are those in which G is positive definite.) Nonconvex QPs, in which G is an indefinite matrix, can be more challenging because they can have several stationary points and local minima. In this chapter we focus primarily on convex quadratic programs. We start by considering an interesting application of quadratic programming. ❏ EXAMPLE 16.1 (PORTFOLIO OPTIMIZATION) Every investor knows that there is a tradeoff between risk and return: To increase the expected return on investment, an investor must be willing to tolerate greater risks. Portfolio theory studies how to model this tradeoff given a collection of n possible investments with returns ri , i 1, 2, . . . , n. The returns ri are usually not known in advance and are often assumed to be random variables that follow a normal distribution. We can characterize these variables by their expected value µi E[ri ] and their variance σi2 E[(ri − µi )2 ]. The variance measures the fluctuations of the variable ri about its mean, so that larger values of σi indicate riskier investments. The returns are not in general independent, and we can define correlations between pairs of returns as follows: ρi j E[(ri − µi )(r j − µ j )] , σi σ j for i, j 1, 2, . . . , n. The correlation measures the tendency of the return on investments i and j to move in the same direction. Two investments whose returns tend to rise and fall together have a positive correlation; the nearer ρi j is to 1, the more closely the two investments track each other. Investments whose returns tend to move in opposite directions have a negative correlation. An investor constructs a portfolio by putting a fraction xi of the available funds into investment i, for i 1, 2, . . . , n. Assuming that all available funds are invested and that n xi 1 and x ≥ 0. The return on the short-selling is not allowed, the constraints are i1 449 450 CHAPTER 16. QUADRATIC PROGRAMMING portfolio is given by R n x i ri . (16.2) i1 To measure the desirability of the portfolio, we need to obtain measures of its expected return and variance. The expected return is simply E[R] E n x i ri i1 n xi E[ri ] x T µ, i1 while the variance is given by Var[R] E[(R − E[R]) ] 2 n n xi x j σi σ j ρi j x T Gx, i1 j1 where the n × n symmetric positive semidefinite matrix G defined by G i j ρi j σi σ j is called the covariance matrix. Ideally, we would like to find a portfolio for which the expected return x T µ is large while the variance x T Gx is small. In the model proposed by Markowitz [201], we combine these two aims into a single objective function with the aid of a “risk tolerance parameter” denoted by κ, and we solve the following problem to find the optimal portfolio: max x T µ − κ x T Gx, subject to n xi 1, x ≥ 0. i1 The value chosen for the nonnegative parameter κ depends on the preferences of the individual investor. Conservative investors, who place more emphasis on minimizing risk in their portfolio, would choose a large value of κ to increase the weight of the variance measure in the objective function. More daring investors, who are prepared to take on more risk in the hope of a higher expected return, would choose a smaller value of κ. The difficulty in applying this portfolio optimization technique to real-life investing lies in defining the expected returns, variances, and correlations for the investments in question. Financial professionals often combine historical data with their own insights and expectations to produce values of these quantities. ❐ 16.1. 16.1 EQUALITY-CONSTRAINED QUADRATIC PROGRAMS EQUALITY-CONSTRAINED QUADRATIC PROGRAMS We begin our discussion of algorithms for quadratic programming by considering the case in which only equality constraints are present. Techniques for this special case are applicable also to problems with inequality constraints since, as we see later in this chapter, some algorithms for general QP require the solution of an equality-constrained QP at each iteration. PROPERTIES OF EQUALITY-CONSTRAINED QPs For simplicity, we write the equality constraints in matrix form and state the equalityconstrained QP as follows: min x subject to def q(x) 12 x T Gx + x T c (16.3a) Ax b, (16.3b) where A is the m × n Jacobian of constraints (with m ≤ n) whose rows are aiT , i ∈ E and b is the vector in IRm whose components are bi , i ∈ E. For the present, we assume that A has full row rank (rank m) so that the constraints (16.3b) are consistent. (In Section 16.8 we discuss the case in which A is rank deficient.) The first-order necessary conditions for x ∗ to be a solution of (16.3) state that there is a vector λ∗ such that the following system of equations is satisfied: G −A T A 0 x∗ λ∗ −c . b (16.4) These conditions are a consequence of the general result for first-order optimality conditions, Theorem 12.1. As in Chapter 12, we call λ∗ the vector of Lagrange multipliers. The system (16.4) can be rewritten in a form that is useful for computation by expressing x ∗ as x ∗ x + p, where x is some estimate of the solution and p is the desired step. By introducing this notation and rearranging the equations, we obtain G AT A 0 −p λ∗ g h , (16.5) where h Ax − b, g c + Gx, p x ∗ − x. (16.6) The matrix in (16.5) is called the Karush–Kuhn–Tucker (KKT) matrix, and the following result gives conditions under which it is nonsingular. As in Chapter 15, we use Z to 451 452 CHAPTER 16. QUADRATIC PROGRAMMING denote the n × (n − m) matrix whose columns are a basis for the null space of A. That is, Z has full rank and satisfies AZ 0. Lemma 16.1. Let A have full row rank, and assume that the reduced-Hessian matrix Z T G Z is positive definite. Then the KKT matrix K G AT A 0 (16.7) is nonsingular, and hence there is a unique vector pair (x ∗ , λ∗ ) satisfying (16.4). PROOF. Suppose there are vectors w and v such that G AT A 0 w 0. v (16.8) Since Aw 0, we have from (16.8) that 0 w T v G AT A 0 w v w T Gw. Since w lies in the null space of A, it can be written as w Z u for some vector u ∈ IRn−m . Therefore, we have 0 w T Gw u T Z T G Z u, which by positive definiteness of Z T G Z implies that u 0. Therefore, w 0, and by (16.8), A T v 0. Full row rank of A then implies that v 0. We conclude that equation (16.8) is satisfied only if w 0 and v 0, so the matrix is nonsingular, as claimed. ❏ EXAMPLE 16.2 Consider the quadratic programming problem min q(x) 3x12 + 2x1 x2 + x1 x3 + 2.5x22 + 2x2 x3 + 2x32 − 8x1 − 3x2 − 3x3 , subject to x1 + x3 3, x2 + x3 0. (16.9) 16.1. EQUALITY-CONSTRAINED QUADRATIC PROGRAMS We can write this problem in the form (16.3) by defining ⎡ 6 ⎢ G⎣ 2 1 2 1 ⎡ ⎤ 5 ⎥ 2 ⎦, 2 4 −8 ⎤ ⎥ ⎢ c ⎣ −3 ⎦ , A −3 1 0 1 0 1 1 , b 3 0 . The solution x ∗ and optimal Lagrange multiplier vector λ∗ are given by x ∗ (2, −1, 1)T , λ∗ (3, −2)T . In this example, the matrix G is positive definite, and the null-space basis matrix can be defined as in (15.15), giving Z (−1, −1, 1)T . (16.10) ❐ We have seen that when the conditions of Lemma 16.1 are satisfied, there is a unique vector pair (x ∗ , λ∗ ) that satisfies the first-order necessary conditions for (16.3). In fact, the second-order sufficient conditions (see Theorem 12.6) are also satisfied at (x ∗ , λ∗ ), so x ∗ is a strict local minimizer of (16.3). In fact, we can use a direct argument to show that x ∗ is a global solution of (16.3). Theorem 16.2. Let A have full row rank and assume that the reduced-Hessian matrix Z T G Z is positive definite. Then the vector x ∗ satisfying (16.4) is the unique global solution of (16.3). PROOF. Let x be any other feasible point (satisfying Ax b), and as before, let p denote the difference x ∗ − x. Since Ax ∗ Ax b, we have that Ap 0. By substituting into the objective function (16.3a), we obtain q(x) 12 (x ∗ − p)T G(x ∗ − p) + c T (x ∗ − p) 12 p T Gp − p T Gx ∗ − c T p + q(x ∗ ). From (16.4) we have that Gx ∗ −c + A T λ∗ , so from Ap 0 we have that p T Gx ∗ p T (−c + A T λ∗ ) − p T c. By substituting this relation into (16.11), we obtain q(x) 12 p T Gp + q(x ∗ ). (16.11) 453 454 CHAPTER 16. QUADRATIC PROGRAMMING Since p lies in the null space of A, we can write p Z u for some vector u ∈ IRn−m , so that q(x) 12 u T Z T G Z u + q(x ∗ ). By positive definiteness of Z T G Z , we conclude that q(x) > q(x ∗ ) except when u 0, that is, when x x ∗ . Therefore, x ∗ is the unique global solution of (16.3). When the reduced Hessian matrix Z T G Z is positive semidefinite with zero eigenvalues, the vector x ∗ satisfying (16.4) is a local minimizer but not a strict local minimizer. If the reduced Hessian has negative eigenvalues, then x ∗ is only a stationary point, not a local minimizer. 16.2 DIRECT SOLUTION OF THE KKT SYSTEM In this section we discuss efficient methods for solving the KKT system (16.5). The first important observation is that if m ≥ 1, the KKT matrix is always indefinite. We define the inertia of a symmetric matrix K to be the scalar triple that indicates the numbers n + , n − , and n 0 of positive, negative, and zero eigenvalues, respectively, that is, inertia(K ) (n + , n − , n 0 ). The following result characterizes the inertia of the KKT matrix. Theorem 16.3. Let K be defined by (16.7), and suppose that A has rank m. Then inertia(K ) inertia(Z T G Z ) + (m, m, 0). Therefore, if Z T G Z is positive definite, inertia(K ) (n, m, 0). The proof of this result is given in [111], for example. Note that the assumptions of this theorem are satisfied by Example 16.2. Hence, if we construct the 5 × 5 matrix K using the data of this example, we obtain inertia(K ) (3, 2, 0). Knowing that the KKT system is indefinite, we now describe the main direct techniques used to solve (16.5). FACTORING THE FULL KKT SYSTEM One option for solving (16.5) is to perform a triangular factorization on the full KKT matrix and then perform backward and forward substitution with the triangular factors. Because of indefiniteness, we cannot use the Cholesky factorization. We could use Gaussian 16.2. DIRECT SOLUTION OF THE KKT SYSTEM elimination with partial pivoting (or a sparse variant thereof) to obtain the L and U factors, but this approach has the disadvantage that it ignores the symmetry. The most effective strategy in this case is to use a symmetric indefinite factorization, which we have discussed in Chapter 3 and the Appendix. For a general symmetric matrix K , this factorization has the form PT K P L BLT , (16.12) where P is a permutation matrix, L is unit lower triangular, and B is block-diagonal with either 1 × 1 or 2 × 2 blocks. The symmetric permutations defined by the matrix P are introduced for numerical stability of the computation and, in the case of large sparse K , for maintaining sparsity. The computational cost of the symmetric indefinite factorization (16.12) is typically about half the cost of sparse Gaussian elimination. To solve (16.5), we first compute the factorization (16.12) of the coefficient matrix. We then perform the following sequence of operations to arrive at the solution: solve Lz P T solve B ẑ z solve L z̄ ẑ −p set P z̄. λ∗ T g h to obtain z; to obtain ŷ; to obtain z̄; Since multiplications with the permutation matrices P and P T can be performed by simply rearranging vector components, they are inexpensive. Solution of the system B ẑ z entails solving a number of small 1 × 1 and 2 × 2 systems, so the number of operations is a small multiple of the system dimension (m + n), again inexpensive. Triangular substitutions with L and L T are more costly. Their precise cost depends on the amount of sparsity, but is usually significantly less than the cost of performing the factorization (16.12). This approach of factoring the full (n + m) × (n + m) KKT matrix (16.7) is quite effective on many problems. It may be expensive, however, when the heuristics for choosing the permutation matrix P are not able to maintain sparsity in the L factor, so that L becomes much more dense than the original coefficient matrix. SCHUR-COMPLEMENT METHOD Assuming that G is positive definite, we can multiply the first equation in (16.5) by AG −1 and then subtract the second equation to obtain a linear system in the vector λ∗ alone: (AG −1 A T )λ∗ (AG −1 g − h). (16.13) 455 456 CHAPTER 16. QUADRATIC PROGRAMMING We solve this symmetric positive definite system for λ∗ and then recover p from the first equation in (16.5) by solving Gp A T λ∗ − g. (16.14) This approach requires us to perform operations with G −1 , as well as to compute the factorization of the m × m matrix AG −1 A T . Therefore, it is most useful when: • G is well conditioned and easy to invert (for instance, when G is diagonal or blockdiagonal); or • G −1 is known explicitly through a quasi-Newton updating formula; or • the number of equality constraints m is small, so that the number of backsolves needed to form the matrix AG −1 A T is not too large. The name “Schur-Complement method” derives from the fact that, by applying block Gaussian elimination to (16.7) using G as the pivot, we obtain the block upper triangular system G AT 0 −AG −1 A T . (16.15) In linear algebra terminology, the matrix AG −1 A T is the Schur complement of G in the matrix K of (16.7). By applying this block elimination technique to the system (16.5), and performing a block backsolve, we obtain (16.13), (16.14). We can use an approach like the Schur-complement method to derive an explicit inverse formula for the KKT matrix in (16.5). This formula is G AT A 0 −1 C E ET F , (16.16) with C G −1 − G −1 A T (AG −1 A T )−1 AG −1 , E G −1 A T (AG −1 A T )−1 , F −(AG −1 A T )−1 . The solution of (16.5) can be obtained by multiplying its right-hand side by this inverse matrix. If we take advantage of common expressions, and group the terms appropriately, we recover the approach (16.13), (16.14). 16.2. DIRECT SOLUTION OF THE KKT SYSTEM NULL-SPACE METHOD The null-space method does not require nonsingularity of G and therefore has wider applicability than the Schur-complement method. It assumes only that the conditions of Lemma 16.1 hold, namely, that A has full row rank and that Z T G Z is positive definite. However, it requires knowledge of the null-space basis matrix Z . Like the Schur-complement method, it exploits the block structure in the KKT system to decouple (16.5) into two smaller systems. Suppose that we partition the vector p in (16.5) into two components, as follows: p Y pY + Z pZ , (16.17) where Z is the n × (n − m) null-space matrix, Y is any n × m matrix such that [Y | Z ] is nonsingular, pY is an m-vector, and pZ is an (n − m)-vector. The matrices Y and Z were discussed in Section 15.3, where Figure 15.4 shows that Y xY is a particular solution of Ax b, while Z xZ is a displacement along these constraints. By substituting p into the second equation of (16.5) and recalling that AZ 0, we obtain (AY ) pY −h. (16.18) Since A has rank m and [Y | Z ] is n × n nonsingular, the product A[Y | Z ] [AY | 0] has rank m. Therefore, AY is a nonsingular m × m matrix, and pY is well determined by the equations (16.18). Meanwhile, we can substitute (16.17) into the first equation of (16.5) to obtain −GY pY − G Z pZ + A T λ∗ g and multiply by Z T to obtain (Z T G Z ) pZ −Z T GY pY − Z T g. (16.19) This system can be solved by performing a Cholesky factorization of the reduced-Hessian matrix Z T G Z to determine pZ . We therefore can compute the total step p Y pY + Z pZ . To obtain the Lagrange multiplier, we multiply the first block row in (16.5) by Y T to obtain the linear system (AY )T λ∗ Y T (g + Gp), which can be solved for λ∗ . (16.20) 457 458 CHAPTER 16. QUADRATIC PROGRAMMING ❏ EXAMPLE 16.3 Consider the problem (16.9) given in Example 16.2. We can choose ⎡ 2/3 −1/3 1/3 1/3 ⎢ Y ⎣ −1/3 ⎤ ⎥ 2/3 ⎦ and set Z as in (16.10). Note that AY I . Suppose we have x (0, 0, 0)T in (16.6). Then ⎡ −8 ⎤ ⎢ ⎥ g c + Gx c ⎣ −3 ⎦ . h Ax − b −b, −3 Simple calculation shows that 3 pY , 0 pZ , 0 so that ⎡ 2 ⎤ ⎢ ⎥ p x ∗ − x Y pY + Z pZ ⎣ −1 ⎦ . 1 After recovering λ∗ from (16.20), we conclude that ⎡ 2 ⎤ ⎢ ⎥ x ∗ ⎣ −1 ⎦ , 1 λ∗ 3 −2 . ❐ The null-space approach can be very effective when the number of degrees of freedom n − m is small. Its main limitation lies in the need for the null-space matrix Z which, as we have seen in Chapter 15, can be expensive to compute in some large problems. The matrix Z is not uniquely defined and, if it is poorly chosen, the reduced system (16.19) may become ill conditioned. If we choose Z to have orthonormal columns, as is normally done in software for small and medium-sized problems, then the conditioning of Z T G Z is at least as good as that of G itself. When A is large and sparse, however, an orthonormal Z is expensive to 16.3. ITERATIVE SOLUTION OF THE KKT SYSTEM compute, so for practical reasons we are often forced to use one of the less reliable choices of Z described in Chapter 15. It is difficult to give hard and fast rules about the relative effectiveness of null-space and Schur-complement methods, because factors such as fill-in during computation of Z vary significantly even among problems of the same dimension. In general, we can recommend the Schur-complement method if G is positive definite and AG −1 A T can be computed relatively cheaply (because G is easy to invert or because m is small relative to n). Otherwise, the null-space method is often preferable, in particular when it is much more expensive to compute factors of G than to compute the null-space matrix Z and the factors of Z T G Z . 16.3 ITERATIVE SOLUTION OF THE KKT SYSTEM An alternative to the direct factorization techniques discussed in the previous section is to use an iterative method to solve the KKT system (16.5). Iterative methods are suitable for solving very large systems and often lend themselves well to parallelization. The conjugate gradient (CG) method is not recommended for solving the full system (16.5) as written, because it can be unstable on systems that are not positive definite. Better options are Krylov methods for general linear or symmetric indefinite systems. Candidates include the GMRES, QMR, and LSQR methods; see the Notes and References at the end of the chapter. Other iterative methods can be derived from the null-space approach by applying the conjugate gradient method to the reduced system (16.19). Methods of this type are key to the algorithms of Chapters 18 and 19, and are discussed in the remainder of this section. We assume throughout that Z T G Z is positive definite. CG APPLIED TO THE REDUCED SYSTEM We begin our discussion of iterative null-space methods by deriving the underlying equations in the notation of the equality-constrained QP (16.3). Expressing the solution of the quadratic program (16.3) as x ∗ Y xY + Z xZ , (16.21) for some vectors xZ ∈ IRn−m , xY ∈ IRm , the constraints Ax b yield AY xY b, (16.22) which determines the vector xY . In Chapter 15, various practical choices of Y are described, some of which allow (16.22) to be solved economically. Substituting (16.21) into (16.3), we see that xZ solves the unconstrained reduced problem min 12 xZ T Z T G Z xZ + xZ T cZ , xZ 459 460 CHAPTER 16. QUADRATIC PROGRAMMING where cZ Z T GY xY + Z T c. (16.23) The solution xZ satisfies the linear system Z T G Z xZ −cZ . (16.24) Since Z T G Z is positive definite, we can apply the CG method to this linear system and substitute xZ into (16.21) to obtain a solution of (16.3). As discussed in Chapter 5, preconditioning can improve the rate of convergence of the CG iteration, so we assume that a preconditioner WZZ is given. The preconditioned CG method (Algorithm 5.3) applied to the (n − m)-dimensional reduced system (16.24) is as follows. (We denote the steps produced by the CG iteration by dZ .) Algorithm 16.1 (Preconditioned CG for Reduced Systems). Choose an initial point xZ ; Compute rZ Z T G Z xZ + cZ , gZ WZZ −1rZ , and dZ −gZ ; repeat α ← rZ T gZ /dZ T Z T G Z dZ ; (16.25a) xZ ← xZ + αdZ ; (16.25b) T rZ ← rZ + α Z G Z dZ ; (16.25c) gZ ← WZZ rZ ; (16.25d) + −1 + + β ← (rZ + )T gZ + /rZ T gZ ; (16.25e) dZ ← −gZ + βdZ ; (16.25f) + gZ ← gZ ; + rZ ← rZ ; + (16.25g) until a termination test is satisfied. This iteration may be terminated when, for example, rZ T WZZ −1rZ is sufficiently small. In this approach, it is not necessary to form the reduced Hessian Z T G Z explicitly because the CG method requires only that we compute matrix-vector products involving this matrix. In fact, it is not even necessary to form Z explicitly as long as we are able to compute products of Z and Z T with arbitrary vectors. For some choices of Z , these products are much cheaper to compute than Z itself, as we have seen in Chapter 15. The preconditioner WZZ is a symmetric, positive definite matrix of dimension n − m, which might be chosen to cluster the eigenvalues of WZZ −1/2 (Z T G Z )WZZ −1/2 and to reduce the span between the smallest and largest eigenvalues. An ideal choice of preconditioner is one for which WZZ −1/2 (Z T G Z )WZZ −1/2 I , that is, WZZ Z T G Z . Motivated by this ideal, we consider preconditioners of the form WZZ Z T H Z , (16.26) 16.3. ITERATIVE SOLUTION OF THE KKT SYSTEM where H is a symmetric matrix such that Z T H Z is positive definite. Some choices of H are discussed below. Preconditioners of the form (16.26) allow us to apply the CG method in n-dimensional space, as we discuss next. THE PROJECTED CG METHOD It is possible to design a modification of the Algorithm 16.1 that avoids operating with the null-space basis Z , provided we use a preconditioner of the form (16.26) and a particular solution of the equation Ax b. This approach works implicitly with an orthogonal matrix Z and is not affected by ill conditioning in A or by a poor choice of Z . After the solution xZ of (16.24) has been computed by using Algorithm 16.1, it must be multiplied by Z and substituted in (16.21) to give the solution of the quadratic program (16.3). Alternatively, we may rewrite Algorithm 16.1 to work directly with the vector x Z xZ + Y xY , where the Y xY term is fixed at the start and the xZ term is updated (implicitly) within each iteration. To specify this form of the CG algorithm, we introduce the n-vectors x, r , g, and d, which satisfy x Z xZ + Y xY , Z T r rZ , g Z gZ , and d Z dZ , respectively. We also define the scaled n × n projection matrix P as follows: P Z (Z T H Z )−1 Z T , (16.27) where H is the preconditioning matrix from (16.26). The CG iteration in n-dimensional space can be specified as follows. Algorithm 16.2 (Projected CG Method). Choose an initial point x satisfying Ax b; Compute r Gx + c, g Pr , and d −g; repeat α ← r T g/d T Gd; (16.28a) x ← x + αd; (16.28b) + r ← r + αGd; + (16.28c) + g ← Pr ; + T (16.28d) + β ← (r ) g /r g; T (16.28e) + d ← −g + βd; + g←g ; until a convergence test is satisfied. (16.28f) + r ←r ; (16.28g) 461 462 CHAPTER 16. QUADRATIC PROGRAMMING A practical stop test is to terminate when r T g r T Pr is smaller than a prescribed tolerance. Note that the vector g + , which we call the preconditioned residual, has been defined to be in the null space of A. As a result, in exact arithmetic, all the search directions d generated by Algorithm 16.2 also lie in the null space of A, and thus the iterates x all satisfy Ax b. It is not difficult to verify (see Exercise 16.14) that the iteration is well defined if Z T G Z and Z T H Z are positive definite. The reader can also verify that the iterates x generated by Algorithm 16.2 are related to the iterates xZ of Algorithm 16.1 via (16.21). Two simple choices of the preconditioning matrix H are H diag(|G ii |) and H I . In some applications, it is effective to define H as a block diagonal submatrix of G. Algorithm 16.2 makes use of the null-space basis Z only through the operator (16.27). It is possible, however, to compute Pr without knowing a representation of the null-space basis Z . For simplicity, we first consider the case in which H I , so that P is the orthogonal projection operator onto the null space of A. We use PI to denote this special case of P, that is, PI Z (Z T Z )−1 Z T . (16.29) The computation of the preconditioned residual g + PIr + in (16.28d) can be performed in two ways. The first is to express PI by the equivalent formula PI I − A T (A A T )−1 A (16.30) and thus compute g + PIr + . We can then write g + r + − A T v + , where v + is the solution of the system A A T v + Ar + . (16.31) This approach for computing the projection g + PIr + is called the normal equations approach; the system (16.31) can be solved by using a Cholesky factorization of A A T . The second approach is to express the projection (16.28d) as the solution of the augmented system I AT A 0 g+ v+ r+ 0 , (16.32) which can be solved by means of a symmetric indefinite factorization, as discussed earlier. We call this approach the augmented system approach. 16.4. INEQUALITY-CONSTRAINED PROBLEMS We suppose now that the preconditioning has the general form of (16.27) and (16.28d). When H is nonsingular, we can compute g + as follows: g + Pr + , P H −1 I − A T (AH −1 A T )−1 AH −1 . where (16.33) Otherwise, when z T H z 0 for all nonzero z with Az 0, we can find g + as the solution of the system H AT A 0 g+ v+ r+ . 0 (16.34) While (16.33) is unappealing when H −1 does not have a simple form, (16.34) is a useful generalization of (16.32). A “perfect” preconditioner is obtained by taking H G, but other choices for H are also possible, provided that Z T H Z is positive definite. The matrix in (16.34) is often called a constraint preconditioner. None of these procedures for computing the projection makes use of a null-space basis Z ; only the factorization of matrices involving A is required. Significantly, all these forms allow us to compute an initial point satisfying Ax b. The operator g + PIr + relies on a factorization of A A T from which we can compute x A T (A A T )−1 b, while factorizations of the system matrices in (16.32) and (16.34) allow us to find a suitable x by solving I AT A 0 x y 0 b or H AT A 0 x y 0 b . Therefore we can compute an initial point for Algorithm 16.2 at the cost of one backsolve, using the factorization of the system needed to perform the projection operators. We point out that these approaches for computing g + can give rise to significant round-off errors, so the use of iterative refinement is recommended to improve accuracy. 16.4 INEQUALITY-CONSTRAINED PROBLEMS In the remainder of the chapter we discuss several classes of algorithms for solving convex quadratic programs that contain both inequality and equality constraints. Active-set methods have been widely used since the 1970s and are effective for small- and medium-sized problems. They allow for efficient detection of unboundedness and infeasibility and typically return an accurate estimate of the optimal active set. Interior-point methods are more recent, having become popular in the 1990s. They are well suited for large problems but may not be the most effective when a series of related QPs must be solved. We also study a special 463 464 CHAPTER 16. QUADRATIC PROGRAMMING type of active-set methods called a gradient projection method, which is most effective when the only constraints in the problem are bounds on the variables. OPTIMALITY CONDITIONS FOR INEQUALITY-CONSTRAINED PROBLEMS We begin our discussion with a brief review of the optimality conditions for inequalityconstrained quadratic programming, then discuss some of the less obvious properties of the solutions. Theorem 12.1 can be applied to (16.1) by noting that the Lagrangian for this problem is L(x, λ) 12 x T Gx + x T c − λi (aiT x − bi ). (16.35) i∈I∪E As in Definition 12.1, the active set A(x ∗ ) consists of the indices of the constraints for which equality holds at x ∗ : 3 2 A(x ∗ ) i ∈ E ∪ I | aiT x ∗ bi . (16.36) By specializing the KKT conditions (12.34) to this problem, we find that any solution x ∗ of (16.1) satisfies the following first-order conditions, for some Lagrange multipliers λi∗ , i ∈ A(x ∗ ): Gx ∗ + c − λi∗ ai 0, (16.37a) i∈A(x ∗ ) aiT x ∗ bi , aiT x ∗ λi∗ ≥ bi , ≥ 0, for all i ∈ A(x ∗ ), (16.37b) ∗ for all i ∈ I\A(x ), (16.37c) ∗ (16.37d) for all i ∈ I ∩ A(x ). A technical point: In Theorem 12.1 we assumed that the linear independence constraint qualification (LICQ) was satisfied. As mentioned in Section 12.6, this theorem still holds if we replace LICQ by other constraint qualifications, such as linearity of the constraints, which is certainly satisfied for quadratic programming. Hence, in the optimality conditions for quadratic programming given above, we need not assume that the active constraints are linearly independent at the solution. For convex QP, when G is positive semidefinite, the conditions (16.37) are in fact sufficient for x ∗ to be a global solution, as we now prove. Theorem 16.4. If x ∗ satisfies the conditions (16.37) for some λi∗ , i ∈ A(x ∗ ), and G is positive semidefinite, then x ∗ is a global solution of (16.1). 16.4. INEQUALITY-CONSTRAINED PROBLEMS PROOF. If x is any other feasible point for (16.1), we have that aiT x bi for all i ∈ E and aiT x ≥ bi for all i ∈ A(x ∗ ) ∩ I. Hence, aiT (x − x ∗ ) 0 for all i ∈ E and aiT (x − x ∗ ) ≥ 0 for all i ∈ A(x ∗ ) ∩ I. Using these relationships, together with (16.37a) and (16.37d), we have that (x − x ∗ )T (Gx ∗ + c) λi∗ aiT (x − x ∗ ) + i∈E λi∗ aiT (x − x ∗ ) ≥ 0. (16.38) i∈A(x ∗ )∩I By elementary manipulation, we find that q(x) q(x ∗ ) + (x − x ∗ )T (Gx ∗ + c) + 12 (x − x ∗ )T G(x − x ∗ ) ≥ q(x ∗ ) + 12 (x − x ∗ )T G(x − x ∗ ) ≥ q(x ∗ ), where the first inequality follows from (16.38) and the second inequality follows from positive semidefiniteness of G. We have shown that q(x) ≥ q(x ∗ ) for any feasible x, so x ∗ is a global solution. By a trivial modification of this proof, we see that x ∗ is actually the unique global solution when G is positive definite. We can also apply the theory from Section 12.5 to derive second-order optimality conditions for (16.1). Second-order sufficient conditions for x ∗ to be a local minimizer are satisfied if Z T G Z is positive definite, where Z is defined to be a null-space basis matrix for the active constraint Jacobian matrix, which is the matrix whose rows are aiT for all i ∈ A(x ∗ ). In this case, x ∗ is a strict local solution, according to Theorem 12.6. When G is not positive definite, the general problem (16.1) may have more than one strict local solution. As mentioned above, such problems are called “nonconvex QPs” or “indefinite QPs,” and they cause some complications for algorithms. Examples of indefinite QPs are illustrated in Figure 16.1. On the left we have plotted the feasible region and the contours of a quadratic objective q(x) in which G has one positive and one negative eigenvalue. We have indicated by + or − that the function tends toward plus or minus infinity in that direction. Note that x ∗∗ is a local maximizer, x ∗ a local minimizer, and the center of the box is a stationary point. The picture on the right in Figure 16.1, in which both eigenvalues of G are negative, shows a global maximizer at x̃ and local minimizers at x∗ and x∗∗ . DEGENERACY A second property that causes difficulties for some algorithms is degeneracy. Confusingly, this term has been given a variety of meanings. It refers to situations in which 465 466 CHAPTER 16. QUADRATIC PROGRAMMING feasible region x * + x** x x* - - ~ x + Figure 16.1 x ** Nonconvex quadratic programs. x* x* Figure 16.2 Degenerate solutions of quadratic programs. (a) the active constraint gradients ai , i ∈ A(x ∗ ), are linearly dependent at the solution x ∗ , and/or (b) the strict complementarity condition of Definition 12.5 fails to hold, that is, there is some index i ∈ A(x ∗ ) such that all Lagrange multipliers satisfying (16.37) have λi∗ 0. (Such constraints are weakly active according to Definition 12.8.) Two examples of degeneracy are shown in Figure 16.2. In the left-hand picture, there is a single active constraint at the solution x∗ , which is also an unconstrained minimizer of the objective function. In the notation of (16.37a), we have that Gx∗ + c 0, so that 16.5. ACTIVE-SET METHODS FOR CONVEX QPS the lone Lagrange multiplier must be zero. In the right-hand picture, three constraints are active at the solution x∗ . Since each of the three constraint gradients is a vector in IR2 , they must be linearly dependent. Lack of strict complementarity is also illustrated by the problem min x12 + (x2 + 1)2 subject to x ≥ 0, which has a solution at x ∗ 0 at which both constraints are active. Strict complementarity does not hold at x ∗ because the Lagrange multiplier associated with the active constraint x1 ≥ 0 is zero. Degeneracy can cause problems for algorithms for two main reasons. First, linear dependence of the active constraint gradients can cause numerical difficulties in the step computation because certain matrices that we need to factor become rank deficient. Second, when the problem contains weakly active constraints, it is difficult for the algorithm to determine whether these constraints are active at the solution. In the case of active-set methods and gradient projection methods (described below), this indecisiveness can cause the algorithm to zigzag as the iterates move on and off the weakly active constraints on successive iterations. Safeguards must be used to prevent such behavior. 16.5 ACTIVE-SET METHODS FOR CONVEX QPs We now describe active-set methods for solving quadratic programs of the form (16.1) containing equality and inequality constraints. We consider only the convex case, in which the matrix G in (16.1a) is positive semidefinite. The case in which G is an indefinite matrix raises complications in the algorithms and is outside the scope of this book. We refer to Gould [147] for a discussion of nonconvex QPs. If the contents of the optimal active set (16.36) were known in advance, we could find the solution x ∗ by applying one of the techniques for equality-constrained QP of Sections 16.2 and 16.3 to the problem min q(x) 12 x T Gx + x T c x subject to aiT x bi , i ∈ A(x ∗ ). Of course, we usually do not have prior knowledge of A(x ∗ ) and, as we now see, determination of this set is the main challenge facing algorithms for inequality-constrained QP. We have already encountered an active-set approach for linear programming in Chapter 13, namely, the simplex method. In essence, the simplex method starts by making a guess of the optimal active set, then repeatedly uses gradient and Lagrange multiplier information to drop one index from the current estimate of A(x ∗ ) and add a new index, until optimality 467 468 CHAPTER 16. QUADRATIC PROGRAMMING is detected. Active-set methods for QP differ from the simplex method in that the iterates (and the solution x ∗ ) are not necessarily vertices of the feasible region. Active-set methods for QP come in three varieties: primal, dual, and primal-dual. We restrict our discussion to primal methods, which generate iterates that remain feasible with respect to the primal problem (16.1) while steadily decreasing the objective function q(x). Primal active-set methods find a step from one iterate to the next by solving a quadratic subproblem in which some of the inequality constraints (16.1c), and all the equality constraints (16.1b), are imposed as equalities. This subset is referred to as the working set and is denoted at the kth iterate xk by Wk . An important requirement we impose on Wk is that the gradients ai of the constraints in the working set be linearly independent, even when the full set of active constraints at that point has linearly dependent gradients. Given an iterate xk and the working set Wk , we first check whether xk minimizes the quadratic q in the subspace defined by the working set. If not, we compute a step p by solving an equality-constrained QP subproblem in which the constraints corresponding to the working set Wk are regarded as equalities and all other constraints are temporarily disregarded. To express this subproblem in terms of the step p, we define p x − xk , gk Gxk + c. By substituting for x into the objective function (16.1a), we find that q(x) q(xk + p) 12 p T Gp + gkT p + ρk , where ρk 12 xkT Gxk + c T xk is independent of p. Since we can drop ρk from the objective without changing the solution of the problem, we can write the QP subproblem to be solved at the kth iteration as follows: min p subject to 1 2 p T Gp + gkT p aiT p 0, i ∈ Wk . (16.39a) (16.39b) We denote the solution of this subproblem by pk . Note that for each i ∈ Wk , the value of aiT x does not change as we move along pk , since we have aiT (xk + αpk ) aiT xk bi for all α. Since the constraints in Wk were satisfied at xk , they are also satisfied at xk + αpk , for any value of α. Since G is positive definite, the solution of (16.39) can be computed by any of the techniques described in Section 16.2. Supposing for the moment that the optimal pk from (16.39) is nonzero, we need to decide how far to move along this direction. If xk + pk is feasible with respect to all the constraints, we set xk+1 xk + pk . Otherwise, we set xk+1 xk + αk pk , (16.40) 16.5. ACTIVE-SET METHODS FOR CONVEX QPS where the step-length parameter αk is chosen to be the largest value in the range [0, 1] for which all constraints are satisfied. We can derive an explicit definition of αk by considering what happens to the constraints i ∈ / Wk , since the constraints i ∈ Wk will certainly be / Wk , then for all αk ≥ 0 we satisfied regardless of the choice of αk . If aiT pk ≥ 0 for some i ∈ have aiT (xk + αk pk ) ≥ aiT xk ≥ bi . Hence, constraint i will be satisfied for all nonnegative / Wk , however, we choices of the step-length parameter. Whenever aiT pk < 0 for some i ∈ have that aiT (xk + αk pk ) ≥ bi only if αk ≤ bi − aiT xk . aiT pk To maximize the decrease in q, we want αk to be as large as possible in [0, 1] subject to retaining feasibility, so we obtain the following definition: def αk min bi − aiT xk 1, min aiT pk i ∈W / k , aiT pk <0 . (16.41) We call the constraints i for which the minimum in (16.41) is achieved the blocking constraints. (If αk 1 and no new constraints are active at xk + αk pk , then there are no blocking constraints on this iteration.) Note that it is quite possible for αk to be zero, because we could have aiT pk < 0 for some constraint i that is active at xk but not a member of the current working set Wk . If αk < 1, that is, the step along pk was blocked by some constraint not in Wk , a new working set Wk+1 is constructed by adding one of the blocking constraints to Wk . We continue to iterate in this manner, adding constraints to the working set until we reach a point x̂ that minimizes the quadratic objective function over its current working set Ŵ. It is easy to recognize such a point because the subproblem (16.39) has solution p 0. Since p 0 satisfies the optimality conditions (16.5) for (16.39), we have that ai λ̂i g G x̂ + c, (16.42) i∈Ŵ for some Lagrange multipliers λ̂i , i ∈ Ŵ. It follows that x̂ and λ̂ satisfy the first KKT condition (16.37a), if we define the multipliers corresponding to the inequality constraints that are not in the working set to be zero. Because of the control imposed on the step length, x̂ is also feasible with respect to all the constraints, so the second and third KKT conditions (16.37b) and (16.37c) are satisfied at this point. We now examine the signs of the multipliers corresponding to the inequality constraints in the working set, that is, the indices i ∈ Ŵ ∩ I. If these multipliers are all nonnegative, the fourth KKT condition (16.37d) is also satisfied, so we conclude that x̂ is a KKT point for the original problem (16.1). In fact, since G is positive semidefinite, we have 469 470 CHAPTER 16. QUADRATIC PROGRAMMING from Theorem 16.4 that x̂ is a global solution of (16.1). (As noted after Theorem 16.4, x̂ is a strict local minimizer and the unique global solution if G is positive definite.) If, on the other hand, one or more of the multipliers λ̂ j , j ∈ Ŵ ∩ I, is negative, the condition (16.37d) is not satisfied and the objective function q(·) may be decreased by dropping one of these constraints, as shown in Section 12.3. Thus, we remove an index j corresponding to one of the negative multipliers from the working set and solve a new subproblem (16.39) for the new step. We show in the following theorem that this strategy produces a direction p at the next iteration that is feasible with respect to the dropped constraint. We continue to assume that the constraint gradients ai for i in the working set are linearly independent. After the algorithm has been fully stated, we discuss how this property can be maintained. Theorem 16.5. Suppose that the point x̂ satisfies first-order conditions for the equality-constrained subproblem with working set Ŵ; that is, equation (16.42) is satisfied along with aiT x̂ bi for all i ∈ Ŵ. Suppose, too, that the constraint gradients ai , i ∈ Ŵ, are linearly independent and that there is an index j ∈ Ŵ such that λ̂ j < 0. Let p be the solution obtained by dropping the constraint j and solving the following subproblem: min p 1 2 p T Gp + (G x̂ + c)T p, subject to aiT p 0, for all i ∈ Ŵ with i j. (16.43a) (16.43b) Then p is a feasible direction for constraint j, that is, a Tj p ≥ 0. Moreover, if p satisfies secondorder sufficient conditions for (16.43), then we have that a Tj p > 0, and that p is a descent direction for q(·). PROOF. Since p solves (16.43), we have from the results of Section 16.1 that there are multipliers λ̃i , for all i ∈ Ŵ with i j, such that λ̃i ai Gp + (G x̂ + c). (16.44) i∈Ŵ, i j In addition, we have by second-order necessary conditions that if Z is a null-space basis vector for the matrix aiT i∈Ŵ, i j , then Z T G Z is positive semidefinite. Clearly, p has the form p Z pZ for some vector pZ , so it follows that p T Gp ≥ 0. 16.5. ACTIVE-SET METHODS FOR CONVEX QPS We have made the assumption that x̂ and Ŵ satisfy the relation (16.42). By subtracting (16.42) from (16.44), we obtain (λ̃i − λ̂i )ai − λ̂ j a j Gp. (16.45) i∈Ŵ, i j By taking inner products of both sides with p and using the fact that aiT p 0 for all i ∈ Ŵ with i j, we have that − λ̂ j a Tj p p T Gp. (16.46) Since p T Gp ≥ 0 and λ̂ j < 0 by assumption, it follows that a Tj p ≥ 0. If the second-order sufficient conditions of Section 12.5 are satisfied, we have that Z T G Z defined above is positive definite. From (16.46), we can have a Tj p 0 only if p T Gp pZT Z T G Z pZ 0, which happens only if pZ 0 and p 0. But if p 0, then by substituting into (16.45) and using linear independence of ai for i ∈ Ŵ, we must have that λ̂ j 0, which contradicts our choice of j. We conclude that p T Gp > 0 in (16.46), and therefore a Tj p > 0 whenever p satisfies the second-order sufficient conditions for (16.43). The claim that p is a descent direction for q(·) is proved in Theorem 16.6 below. While any index j for which λ̂ j < 0 usually will yield a direction p along which the algorithm can make progress, the most negative multiplier is often chosen in practice (and in the algorithm specified below). This choice is motivated by the sensitivity analysis given in Chapter 12, which shows that the rate of decrease in the objective function when one constraint is removed is proportional to the magnitude of the Lagrange multiplier for that constraint. As in linear programming, however, the step along the resulting direction may be short (as when it is blocked by a new constraint), so the amount of decrease in q is not guaranteed to be greater than for other possible choices of j. We conclude with a result that shows that whenever pk obtained from (16.39) is nonzero and satisfies second-order sufficient optimality conditions for the current working set, it is a direction of strict descent for q(·). Theorem 16.6. Suppose that the solution pk of (16.39) is nonzero and satisfies the second-order sufficient conditions for optimality for that problem. Then the function q(·) is strictly decreasing along the direction pk . PROOF. Since pk satisfies the second-order conditions, that is, Z T G Z is positive definite for the matrix Z whose columns are a basis of the null space of the constraints (16.39b), we have by applying Theorem 16.2 to (16.39) that pk is the unique global solution of (16.39). Since p 0 is also a feasible point for (16.39), its objective value in (16.39a) must be larger 471 472 CHAPTER 16. QUADRATIC PROGRAMMING than that of pk , so we have 1 2 pkT Gpk + gkT pk < 0. Since pkT Gpk ≥ 0 by convexity, this inequality implies that gkT pk < 0. Therefore, we have q(xk + αk pk ) q(xk ) + αgkT pk + 12 α 2 pkT Gpk < q(xk ), for all α > 0 sufficiently small. When G is positive definite—the strictly convex case—the second-order sufficient conditions are satisfied for all feasible subproblems of the form (16.39). Hence, it follows from the result above that we obtain a strict decrease in q(·) whenever pk 0. This fact is significant when we discuss finite termination of the algorithm. SPECIFICATION OF THE ACTIVE-SET METHOD FOR CONVEX QP Having described the active-set algorithm for convex QP, we now present the following formal specification. We assume that the objective function q is bounded in the feasible set (16.1b), (16.1c). Algorithm 16.3 (Active-Set Method for Convex QP). Compute a feasible starting point x0 ; Set W0 to be a subset of the active constraints at x0 ; for k 0, 1, 2, . . . Solve (16.39) to find pk ; if pk 0 Compute Lagrange multipliers λ̂i that satisfy (16.42), with Ŵ Wk ; if λ̂i ≥ 0 for all i ∈ Wk ∩ I stop with solution x ∗ xk ; else j ← arg min j∈Wk ∩I λ̂ j ; xk+1 ← xk ; Wk+1 ← Wk \{ j}; else (* pk 0 *) Compute αk from (16.41); xk+1 ← xk + αk pk ; if there are blocking constraints Obtain Wk+1 by adding one of the blocking constraints to Wk ; else Wk+1 ← Wk ; end (for) 16.5. ACTIVE-SET METHODS FOR CONVEX QPS Various techniques can be used to determine an initial feasible point. One such is to use the “Phase I” approach for linear programming described in Chapter 13. Though no significant modifications are needed to generalize this method from linear programming to quadratic programming, we describe a variant here that allows the user to supply an initial estimate x̃ of the vector x. This estimate need not be feasible, but a good choice based on knowledge of the QP may reduce the work needed in the Phase I step. Given x̃, we define the following feasibility linear program: min e T z (x,z) subject to aiT x + γi z i bi , i ∈ E, + γi z i ≥ bi , i ∈ I, aiT x z ≥ 0, where e (1, 1, . . . , 1)T , γi −sign(aiT x̃ − bi ) for i ∈ E, and γi 1 for i ∈ I. A feasible initial point for this problem is then x x̃, z i |aiT x̃ − bi | (i ∈ E), z i max(bi − aiT x̃, 0) (i ∈ I). It is easy to verify that if x̃ is feasible for the original problem (16.1), then ( x̃, 0) is optimal for the feasibility subproblem. In general, if the original problem has feasible points, then the optimal objective value in the subproblem is zero, and any solution of the subproblem yields a feasible point for the original problem. The initial working set W0 for Algorithm 16.3 can be found by taking a linearly independent subset of the active constraints at the solution of the feasibility problem. An alternative approach is a penalty (or “big M”) method, which does away with the “Phase I” and instead includes a measure of infeasibility in the objective that is guaranteed to be zero at the solution. That is, we introduce a scalar artificial variable η into (16.1) to measure the constraint violation, and we solve the problem min 12 x T Gx + x T c + Mη, (x,η) subject to (aiT x − bi ) ≤ η, i ∈ E, − bi ) ≤ η, i ∈ E, −(aiT x bi − aiT x ≤ η, (16.47) i ∈ I, 0 ≤ η, for some large positive value of M. It can be shown by applying the theory of exact penalty functions (see Chapter 17) that whenever there exist feasible points for the original problem (16.1), then for all M sufficiently large, the solution of (16.47) will have η 0, with an x component that is a solution for (16.1). 473 474 CHAPTER 16. QUADRATIC PROGRAMMING Our strategy is to use some heuristic to choose a value of M and solve (16.47) by the usual means. If the solution we obtain has a positive value of η, we increase M and try again. Note that a feasible point is easy to obtain for the subproblem (16.47): We set x x̃ (where, as before, x̃ is the user-supplied initial guess) and choose η large enough that all the constraints in (16.47) are satisfied. This approach is, in fact, an exact penalty method using the ∞ norm; see Chapter 17. A variant of (16.47) that penalizes the 1 norm of the constraint violation rather than the ∞ norm is as follows: min 1 x T Gx (x,s,t,v) 2 + x T c + MeET (s + t) + MeIT v subject to aiT x − bi + si − ti 0, i ∈ E, aiT x − bi + vi ≥ 0, i ∈ I, (16.48) s ≥ 0, t ≥ 0, v ≥ 0. Here, eE is the vector (1, 1, . . . , 1)T of length |E|; similarly for eI . The slack variables si , ti , and vi soak up any infeasibility in the constraints. In the following example we use subscripts on the vectors x and p to denote their components, and we use superscripts to indicate the iteration index. For example, x1 denotes the first component, while x 4 denotes the fourth iterate of the vector x. x2 (2,2) x4 x5 (4,1) (0,1) x 2, x 3 Figure 16.3 (2,0) x 0, x 1 Iterates of the active-set method. x1 16.5. ACTIVE-SET METHODS FOR CONVEX QPS ❏ EXAMPLE 16.4 We apply Algorithm 16.3 to the following simple 2-dimensional problem illustrated in Figure 16.3. min q(x) (x1 − 1)2 + (x2 − 2.5)2 (16.49a) x subject to x1 − 2x2 + 2 ≥ 0, (16.49b) −x1 − 2x2 + 6 ≥ 0, (16.49c) −x1 + 2x2 + 2 ≥ 0, (16.49d) x1 ≥ 0, (16.49e) x2 ≥ 0. (16.49f) We refer the constraints, in order, by indices 1 through 5. For this problem it is easy to determine a feasible initial point; say x 0 (2, 0)T . Constraints 3 and 5 are active at this point, and we set W0 {3, 5}. (Note that we could just as validly have chosen W0 {5} or W0 {3} or even W ∅; each choice would lead the algorithm to perform somewhat differently.) Since x 0 lies on a vertex of the feasible region, it is obviously a minimizer of the objective function q with respect to the working set W0 ; that is, the solution of (16.39) with k 0 is p 0. We can then use (16.42) to find the multipliers λ̂3 and λ̂5 associated with the active constraints. Substitution of the data from our problem into (16.42) yields −1 2 λ̂3 + 0 1 λ̂5 2 −5 , which has the solution (λ̂3 , λ̂5 ) (−2, −1). We now remove constraint 3 from the working set, because it has the most negative multiplier, and set W1 {5}. We begin iteration 1 by finding the solution of (16.39) for k 1, which is p 1 (−1, 0)T . The step-length formula (16.41) yields α1 1, and the new iterate is x 2 (1, 0)T . There are no blocking constraints, so that W2 W1 {5}, and we find at the start of iteration 2 that the solution of (16.39) is p 2 0. From (16.42) we deduce that the Lagrange multiplier for the lone working constraint is λ̂5 −5, so we drop 5 from the working set to obtain W3 ∅. Iteration 3 starts by solving the unconstrained problem, to obtain the solution p 3 (0, 2.5)T . The formula (16.41) yields a step length of α3 0.6 and a new iterate x 4 (1, 1.5)T . There is a single blocking constraint (constraint 1), so we obtain W4 {1}. The solution of (16.39) for k 4 is then p 4 (0.4, 0.2)T , and the new step length is 1. There are no blocking constraints on this step, so the next working set is unchanged: W5 {1}. The new iterate is x 5 (1.4, 1.7)T . 475 476 CHAPTER 16. QUADRATIC PROGRAMMING Finally, we solve (16.39) for k 5 to obtain a solution p 5 0. The formula (16.42) yields a multiplier λ̂1 0.8, so we have found the solution. We set x ∗ (1.4, 1.7)T and terminate. ❐ FURTHER REMARKS ON THE ACTIVE-SET METHOD We noted above that there is flexibility in the choice of the initial working set and that each initial choice leads to a different iteration sequence. When the initial active constraints have independent gradients, as above, we can include them all in W0 . Alternatively, we can select a subset. For instance, if in the example above we have chosen W0 {3}, the first iterate would have yielded p 0 (0.2, 0.1)T and a new iterate of x 1 (2.2, 0.1)T . If we had chosen W0 {5}, we would have moved immediately to the new iterate x 1 (1, 0)T , without first performing the operation of dropping the index 3, as is done in the example. If we had selected W0 ∅, we would have obtained p 1 (−1, 2.5)T , α1 23 , a new iterate of x 1 ( 34 , 53 )T , and a new working set of W1 {1}. The solution x ∗ would have been found on the next iteration. Even if the initial working set W0 coincides with the initial active set, the sets Wk and A(x k ) may differ at later iterations. For instance, when a particular step encounters more than one blocking constraint, just one of them is added to the working set, so the identification between Wk and A(x k ) is broken. Moreover, subsequent iterates differ in general according to what choice is made. We require the constraint gradients in W0 to be linearly independent, and our strategy for modifying the working set ensures that this same property holds for all subsequent working sets Wk . When we encounter a blocking constraint on a particular step, its constraint normal cannot be a linear combination of the normals ai in the current working set (see Exercise 16.18). Hence, linear independence is maintained after the blocking constraint is added to the working set. On the other hand, deletion of an index from the working set cannot introduce linear dependence. The strategy of removing the constraint corresponding to the most negative Lagrange multiplier often works well in practice but has the disadvantage that it is susceptible to the scaling of the constraints. (By multiplying constraint i by some factor β > 0 we do not change the geometry of the optimization problem, but we introduce a scaling of 1/β to the corresponding multiplier λi .) Choice of the most negative multiplier is analogous to Dantzig’s original pivot rule for the simplex method in linear programming (see Chapter 13) and, as we noted there, strategies that are less sensitive to scaling often give better results. We do not discuss this advanced topic further. We note that the strategy of adding or deleting at most one constraint at each iteration of the Algorithm 16.3 places a natural lower bound on the number of iterations needed to reach optimality. Suppose, for instance, that we have a problem in which m inequality constraints are active at the solution x ∗ but that we start from a point x 0 that is strictly 16.5. ACTIVE-SET METHODS FOR CONVEX QPS feasible with respect to all the inequality constraints. In this case, the algorithm will need at least m iterations to move from x 0 to x ∗ . Even more iterations will be required if the algorithm adds some constraint j to the working set at some iteration, only to remove it at a later step. FINITE TERMINATION OF ACTIVE-SET ALGORITHM ON STRICTLY CONVEX QPs It is not difficult to show that, under certain assumptions, Algorithm 16.3 converges for strictly convex QPs, that is, it identifies the solution x ∗ in a finite number of iterations. This claim is certainly true if we assume that the method always takes a nonzero step length αk whenever the direction pk computed from (16.39) is nonzero. Our argument proceeds as follows: • If the solution of (16.39) is pk 0, the current point xk is the unique global minimizer of q(·) for the working set Wk ; see Theorem 16.6. If it is not the solution of the original problem (16.1) (that is, at least one of the Lagrange multipliers is negative), Theorems 16.5 and 16.6 together show that the step pk+1 computed after a constraint is dropped will be a strict decrease direction for q(·). Therefore, because of our assumption αk > 0, we have that the value of q is lower than q(xk ) at all subsequent iterations. It follows that the algorithm can never return to the working set Wk , because subsequent iterates have values of q that are lower than the global minimizer for this working set. • The algorithm encounters an iterate k for which pk 0 solves (16.39) at least on every nth iteration. To demonstrate this claim, we note that for any k at which pk 0, either we have αk 1 (in which case we reach the minimizer of q on the current working set Wk , so that the next iteration will yield pk+1 0), or else a constraint is added to the working set Wk . If the latter situation occurs repeatedly, then after at most n iterations the working set will contain n indices, which correspond to n linearly independent vectors. The solution of (16.39) will then be pk 0, since only the zero vector will satisfy the constraints (16.39b). • Taken together, the two statements above indicate that the algorithm finds the global minimum of q on its current working set periodically (at least once every n iterations) and that, having done so, it never visits this particular working set again. It follows that, since there are only a finite number of possible working sets, the algorithm cannot iterate forever. Eventually, it encounters a minimizer for a current working set that satisfies optimality conditions for (16.1), and it terminates with a solution. The assumption that we can always take a nonzero step along a nonzero descent direction pk calculated from (16.39) guarantees that the algorithm does not undergo cycling. This term refers to the situation in which a sequence of consecutive iterations results in no movement in iterate x, while the working set Wk undergoes deletions and additions of indices 477 478 CHAPTER 16. QUADRATIC PROGRAMMING and eventually repeats itself. That is, for some integers k and l ≥ 1, we have that x k x k+l and Wk Wk+l . At each iterate in the cycle, a constraint is dropped (as in Theorem 16.5), but a new constraint i ∈ / Wk is encountered immediately without any movement along the computed direction p. Procedures for handling degeneracy and cycling in quadratic programming are similar to those for linear programming discussed in Chapter 13; we do not discuss them here. Most QP implementations simply ignore the possibility of cycling. UPDATING FACTORIZATIONS We have seen that the step computation in the active-set method given in Algorithm 16.3 requires the solution of the equality-constrained subproblem (16.39). As mentioned at the beginning of this chapter, this computation amounts to solving the KKT system (16.5). Since the working set can change by just one index at every iteration, the KKT matrix differs in at most one row and one column from the previous iteration’s KKT matrix. Indeed, G remains fixed, whereas the matrix A of constraint gradients corresponding to the current working set may change through addition and/or deletion of a single row. It follows from this observation that we can compute the matrix factors needed to solve (16.39) at the current iteration by updating the factors computed at the previous iteration, rather than recomputing them from scratch. These updating techniques are crucial to the efficiency of active-set methods. We limit our discussion to the case in which the step is computed with the null-space method (16.17)–(16.20). Suppose that A has m linearly independent rows and assume that the bases Y and Z are defined by means of a QR factorization of A (see Section 15.3 for details). Thus A Q T R 0 Q1 Q2 R (16.50) 0 (see (15.21)), where is a permutation matrix; R is square, upper triangular and nonsingular; Q Q 1 Q 2 is n × n orthogonal; and Q 1 and R both have m columns while Q 2 has n − m columns. As noted in Chapter 15, we can choose Z to be simply the orthonormal matrix Q 2 . Suppose that one constraint is added to the working set at the next iteration, so that the new constraint matrix is Ā T A T a , where a is a column vector of length n such that Ā T retains full column rank. As we now show, there is an economical way to update the Q and R factors in (16.50) to obtain new factors (and hence a new null-space basis matrix Z̄ , with n − m − 1 columns) for the expanded matrix Ā. Note first that, since Q 1 Q 1T + Q 2 Q 2T I , we have Ā T 0 0 1 A T a Q R Q 1T a 0 Q 2T a . (16.51) 16.5. ACTIVE-SET METHODS CONVEX QPS FOR We can now define an orthogonal matrix Q̂ that transforms the vector Q 2T a to a vector in which all elements except the first are zero. That is, we have Q̂(Q 2T a) γ , 0 where γ is a scalar. (Since Q̂ is orthogonal, we have Q 2T a |γ |.) From (16.51) we now have Ā T 0 0 1 ⎡ ⎢ Q⎣ ⎤ Q 1T a ⎥ I γ ⎦Q T Q̂ 0 0 R 0 0 Q̂ T ⎡ R ⎢ ⎣ 0 Q 1T a γ 0 ⎤ ⎥ ⎦. 0 This factorization has the form ¯ Q̄ Ā T where ¯ 0 0 1 , Q̄ Q I 0 0 Q̂ T R̄ , 0 ) Q 2 Q̂ Q1 T * , R̄ R Q 1T a 0 γ . We can therefore choose Z̄ to be the last n −m −1 columns of Q 2 Q̂ T . If we know Z explicitly and need an explicit representation of Z̄ , we need to account for the cost of obtaining Q̂ and the cost of forming the product Q 2 Q̂ T Z Q̂ T . Because of the special structure of Q̂, this cost is of order n(n − m), compared to the cost of computing (16.50) from scratch, which is of order n 2 m. The updating strategy is less expensive, especially when the null space is small (that is, when n − m n). An updating technique can also be designed for the case in which a row is removed from A. This operation has the effect of deleting a column from R in (16.50), thus disturbing the upper triangular property of this matrix by introducing a number of nonzeros on the diagonal immediately below the main diagonal of the matrix. Upper triangularity can be restored by applying a sequence of plane rotations. These rotations introduce a number of inexpensive transformations into the first m columns of Q, and the updated null-space matrix is obtained by selecting the last n − m + 1 columns from this matrix after the transformations are complete. The new null-space basis in this case has the form Z̄ z̄ Z , (16.52) that is, the current matrix Z is augmented by a single column. The total cost of this operation varies with the location of the removed column in A but is in general cheaper 479 480 CHAPTER 16. QUADRATIC PROGRAMMING than recomputing a QR factorization from scratch. For details of these procedures, see Gill et al. [124, Section 5]. We now consider the reduced Hessian. Because of the special form of (16.39), we have h 0 in (16.5), and the step pY given in (16.18) is zero. Thus from (16.19), the null-space component pZ is the solution of (Z T G Z ) pZ −Z T g. (16.53) We can sometimes find ways of updating the factorization of the reduced Hessian Z T G Z after Z has changed. Suppose that we have the Cholesky factorization of the current reduced Hessian, written as ZT G Z L LT , and that at the next step Z changes as in (16.52), gaining a column after deletion of a constraint. A series of inexpensive, elementary operations can be used to transform the Cholesky factor L into the new factor L̄ for the new reduced Hessian Z̄ T G Z̄ . A variety of other simplifications are possible. For example, as discussed in Section 16.7, we can update the reduced gradient Z T g at the same time as we update Z to Z̄ . 16.6 INTERIOR-POINT METHODS The interior-point approach can be applied to convex quadratic programs through a simple extension of the linear-programming algorithms described in Chapter 14. The resulting primal-dual algorithms are easy to describe and are quite efficient on many types of problems. Extensions of interior-point methods to nonconvex problems are discussed in Chapter 19. For simplicity, we restrict our attention to convex quadratic programs with inequality constraints, which we write as follows: min x subject to q(x) 12 x T Gx + x T c (16.54a) Ax ≥ b, (16.54b) where G is symmetric and positive semidefinite and where the m×n matrix A and right-hand side b are defined by A [ai ]i∈I , b [bi ]i∈I , I {1, 2, . . . , m}. (If equality constraints are also present, they can be accommodated with simple extensions to the approaches described below.) Rewriting the KKT conditions (16.37) in this notation, 16.6. INTERIOR-POINT METHODS we obtain Gx − A T λ + c 0, Ax − b ≥ 0, (Ax − b)i λi 0, i 1, 2, . . . , m, λ ≥ 0. By introducing the slack vector y ≥ 0, we can rewrite these conditions as Gx − A T λ + c 0, (16.55a) Ax − y − b 0, (16.55b) yi λi 0, i 1, 2, . . . , m, (16.55c) (y, λ) ≥ 0. (16.55d) Since we assume that G is positive semidefinite, these KKT conditions are not only necessary but also sufficient (see Theorem 16.4), so we can solve the convex quadratic program (16.54) by finding solutions of the system (16.55). Given a current iterate (x, y, λ) that satisfies (y, λ) > 0, we can define a complementarity measure µ by µ yT λ . m (16.56) As in Chapter 14, we derive path-following, primal-dual methods by considering the perturbed KKT conditions given by ⎡ ⎢ F(x, y, λ; σ µ) ⎣ Gx − A T λ + c Ax − y − b ⎤ ⎥ ⎦ 0, (16.57) Ye − σ µe where Y diag(y1 , y2 , . . . , ym ), diag(λ1 , λ2 , . . . , λm ), e (1, 1, . . . , 1)T , and σ ∈ [0, 1]. The solutions of (16.57) for all positive values of σ and µ define the central path, which is a trajectory that leads to the solution of the quadratic program as σ µ tends to zero. By fixing µ and applying Newton’s method to (16.57), we obtain the linear system ⎡ ⎢ ⎣ A 0 −A T −I 0 0 Y G ⎤⎡ x ⎤ ⎡ ⎥⎢ ⎥ ⎢ ⎦ ⎣ y ⎦ ⎣ λ −rd −r p −Ye + σ µe ⎤ ⎥ ⎦, (16.58) 481 482 CHAPTER 16. QUADRATIC PROGRAMMING where rd Gx − A T λ + c, r p Ax − y − b. (16.59) (x + , y + , λ+ ) (x, y, λ) + α(x, y, λ), (16.60) We obtain the next iterate by setting where α is chosen to retain the inequality (y + , λ+ ) > 0 and possibly to satisfy various other conditions. In the rest of the chapter we discuss several enhancements of this primal-dual iteration that make it effective in practice. SOLVING THE PRIMAL-DUAL SYSTEM The major computational operation in the interior-point method is the solution of the system (16.58). The coefficient matrix in this system can be much more costly to factor than the matrix (14.9) arising in linear programming because of the presence of the Hessian matrix G. It is therefore important to exploit the structure of (16.58) by choosing a suitable direct factorization algorithm, or by choosing an appropriate preconditioner for an iterative solver. As in Chapter 14, the system (16.58) may be restated in more compact forms. The “augmented system” form is G −A T A −1 Y x λ −rd −r p + (−y + σ µ−1 e) . (16.61) After a simple transformation to symmetric form, a symmetric indefinite factorization scheme can be applied to the coefficient matrix in this system. The “normal equations” form (14.44a) is (G + A T Y −1 A)x −rd + A T Y −1 [−r p − y + σ µ−1 e], (16.62) which can be solved by means of a modified Cholesky algorithm. This approach is effective if the term A T (Y −1 )A is not too dense compared with G, and it has the advantage of being much smaller than (16.61) if there are many inequality constraints. The projected CG method of Algorithm 16.2 can also be effective for solving the primal-dual system. We can rewrite (16.58) in the form ⎡ G ⎢ ⎣ 0 A 0 −A T Y −1 I −I 0 ⎤⎡ x ⎤ ⎡ −rd ⎤ ⎥⎢ ⎥ ⎢ ⎥ ⎦ ⎣ y ⎦ ⎣ −e + σ µY −1 e ⎦ , λ −r p (16.63) 16.6. INTERIOR-POINT METHODS and observe that these are the optimality conditions for an equality-constrained convex quadratic program of the form (16.3), in which the variable is (x, y). Hence, we can make appropriate substitutions and solve this system using Algorithm 16.2. This approach may be useful for problems in which the direct factorization cannot be performed due to excessive memory demands. The projected CG method does not require that the matrix G be formed or factored; it requires only matrix-vector products. STEP LENGTH SELECTION We mentioned in Chapter 14 that interior-point methods for linear programming are more efficient if different step lengths α pri , α dual are used for the primal and dual variables. Equation (14.37) indicates that the greatest reduction in the residuals rb and rc is obtained by choosing the largest admissible primal and dual step lengths. The situation is different in quadratic programming. Suppose that we define the new iterate as (x + , y + ) (x, y) + α pri (x, y), λ+ λ + α dual λ, (16.64) where α pri and α dual are step lengths that ensure the positivity of (y + , λ+ ). By using (16.58) and (16.59), we see that the new residuals satisfy the following relations: pri r+ p (1 − α )r p , rd+ (1 − α dual )rd + (α (16.65a) pri −α dual )Gx. (16.65b) If α pri α dual α then both residuals decrease linearly for all α ∈ (0, 1). For different step lengths, however, the dual residual rd+ may increase for certain choices of α pri , α dual , possibly causing divergence of the interior-point iteration. pri One option is to use equal step lengths, as in (16.60), and to set α min(ατ , ατdual ), where ατpri max{α ∈ (0, 1] : y + αy ≥ (1 − τ )y}, (16.66a) max{α ∈ (0, 1] : λ + αλ ≥ (1 − τ )λ}; (16.66b) ατdual the parameter τ ∈ (0, 1) controls how far we back off from the maximum step for which the conditions y + αy ≥ 0 and λ + αλ ≥ 0 are satisfied. Numerical experience has shown, however, that using different step lengths in the primal and dual variables often leads to faster convergence. One way to choose unequal step lengths is to select (α pri , α dual ) so as to (approximately) minimize the optimality measure Gx + − A T λ+ + c22 + Ax + − y + − b22 + (y + )T z + , subject to 0 ≤ α pri ≤ ατ and 0 ≤ α dual ≤ ατdual , where x + , y + , λ+ are defined as a function of the step lengths through (16.64). pri 483 484 CHAPTER 16. QUADRATIC PROGRAMMING A PRACTICAL PRIMAL-DUAL METHOD The most popular interior-point method for convex QP is based on Mehrotra’s predictor-corrector, originally developed for linear programming (see Section 14.2). The extension to quadratic programming is straightforward, as we now show. First, we compute an affine scaling step (x aff , y aff , λaff ) by setting σ 0 in (16.58). We improve upon this step by computing a corrector step, which is defined following the same reasoning that leads to (14.31). Next, we compute the centering parameter σ using (14.34). The total step is obtained by solving the following system (cf. (14.35)): ⎡ ⎢ ⎣ A 0 −A T −I 0 0 Y G ⎤⎡ x ⎤ ⎡ ⎥ ⎢ ⎥⎢ ⎦ ⎣ y ⎦ ⎣ λ ⎤ −rd ⎥ ⎦. −r p −Ye − Y aff aff (16.67) e + σ µe We now specify the algorithm. For simplicity, we will assume in our description that equal step lengths are used in the primal and dual variables though, as noted above, unequal step lengths can give slightly faster convergence. Algorithm 16.4 (Predictor-Corrector Algorithm for QP). Compute (x0 , y0 , λ0 ) with (y0 , λ0 ) > 0; for k 0, 1, 2, . . . Set (x, y, λ) (xk , yk , λk ) and solve (16.58) with σ 0 for (x aff , y aff , λaff ); Calculate µ y T λ/m; Calculate α̂aff max{α ∈ (0, 1] | (y, λ) + α(y aff , λaff ) ≥ 0}; Calculate µaff (y + α̂ aff y aff )T (λ + α̂ aff λaff )/m; Set centering parameter to σ (µaff /µ)3 ; Solve (16.67) for (x, y, λ); pri ) (see (16.66)); Choose τk ∈ (0, 1) and set α̂ min(ατk , ατdual k Set (xk+1 , yk+1 , λk+1 ) (xk , yk , λk ) + α̂(x, y, λ); end (for) We can choose τk to approach 1 as the iterates approach the solution, to accelerate the convergence. As for linear programming, efficiency and robustness of this approach is greatly enhanced if we choose a good starting point. This selection can be done in several ways. The following simple heuristic accepts an initial point (x̄, ȳ, λ̄) from the user and moves it far enough away from the boundary of the region (y, λ) ≥ 0 to permit the algorithm to take long steps on early iterations. First, we compute the affine scaling step (x aff , y aff , λaff ) 16.7. THE GRADIENT PROJECTION METHOD from the user-supplied initial point ( x̄, ȳ, λ̄), then set y0 max(1, | ȳ + y aff |), λ0 max(1, |λ̄ + λaff |), x0 x̄, where the max and absolute values are applied component-wise. We conclude this section by contrasting some of the properties of active-set and interior-point methods for convex quadratic programming. Active-set methods generally require a large number of steps in which each search direction is relatively inexpensive to compute, while interior-point methods take a smaller number of more expensive steps. Active-set methods are more complicated to implement, particularly if the procedures for updating matrix factorizations try to take advantage of sparsity or structure in G and A. By contrast, the nonzero structure of the matrix to be factored at each interior-point iteration remains the same at all iterations (though the numerical values change), so standard sparse factorization software can be used to obtain the steps. For particular sparsity structures (for example, bandedness in the matrices A and G), efficient customized solvers for the linear system arising at each interior-point iteration can be devised. For very large problems, interior-point methods are often more efficient. However, when an estimate of the solution is available (a “warm start”), the active-set approach may converge rapidly in just a few iterations, particularly if the initial value of x is feasible. Interior-point methods are less able to exploit a warm start, though research efforts to improve their performance in this regard are ongoing. 16.7 THE GRADIENT PROJECTION METHOD In the active-set method described in Section 16.5, the active set and working set change slowly, usually by a single index at each iteration. This method may thus require many iterations to converge on large-scale problems. For instance, if the starting point x 0 has no active constraints, while 200 constraints are active at the (nondegenerate) solution, then at least 200 iterations of the active-set method will be required to reach the solution. The gradient projection method allows the active set to change rapidly from iteration to iteration. It is most efficient when the constraints are simple in form—in particular, when there are only bounds on the variables. Accordingly, we restrict our attention to the following bound-constrained problem: min x subject to q(x) 12 x T Gx + x T c (16.68a) l ≤ x ≤ u, (16.68b) where G is symmetric and l and u are vectors of lower and upper bounds on the components of x. We do not make any positive definiteness assumptions on G in this section, because the gradient projection approach can be applied to both convex and nonconvex problems. The 485 486 CHAPTER 16. QUADRATIC PROGRAMMING feasible region defined by (16.68b) is sometimes called a “box” because of its rectangular shape. Some components of x may lack an upper or a lower bound; we handle these cases formally by setting the appropriate components of l and u to −∞ and +∞, respectively. Each iteration of the gradient projection algorithm consists of two stages. In the first stage, we search along the steepest descent direction from the current point x, that is, the direction −g, where g Gx + c; see (16.6). Whenever a bound is encountered, the search direction is “bent” so that it stays feasible. We search along the resulting piecewise-linear path and locate the first local minimizer of q, which we denote by x c and refer to as the Cauchy point, by analogy with our terminology of Chapter 4. The working set is now defined to be the set of bound constraints that are active at the Cauchy point, denoted by A(x c ). In the second stage of each gradient projection iteration, we explore the face of the feasible box on which the Cauchy point lies by solving a subproblem in which the active components xi for i ∈ A(x c ) are fixed at the values xic . We describe the gradient projection method in detail in the rest of this section. Our convention in this section is to denote the iteration number by a superscript (that is, x k ) and use subscripts to denote the elements of a vector. CAUCHY POINT COMPUTATION We now derive an explicit expression for the piecewise-linear path obtained by projecting the steepest descent direction onto the feasible box, and outline the search procedure for identifying the first local minimum of q along this path. The projection of an arbitrary point x onto the feasible region (16.68b) is defined as follows. The ith component is given by ⎧ ⎪ l ⎪ ⎨ i xi P(x, l, u)i ⎪ ⎪ ⎩ ui if x i < li , if xi ∈ [li , u i ], if xi > u i . (16.69) (We assume, without loss of generality, that li < u i for all i.) The piecewise-linear path x(t) starting at the reference point x and obtained by projecting the steepest descent direction at x onto the feasible region (16.68b) is thus given by x(t) P(x − tg, l, u), (16.70) where g Gx + c; see Figure 16.4. The Cauchy point x c , is defined as the first local minimizer of the univariate, piecewisequadratic function q(x(t)), for t ≥ 0. This minimizer is obtained by examining each of the line segments that make up x(t). To perform this search, we need to determine the values of t at which the kinks in x(t), or breakpoints, occur. We first identify the values of t for which each component reaches its bound along the chosen direction −g. These values t¯i are given 16.7. THE GRADIENT PROJECTION METHOD x−tg x(t3 ) x(t2 ) x(t1 ) x Figure 16.4 The piecewise-linear path x(t), for an example in IR3 . by the following explicit formulae: ⎧ ⎪ ⎨ (xi − u i )/gi t¯i (xi − li )/gi ⎪ ⎩ ∞ if gi < 0 and u i < +∞, if gi > 0 and li > −∞, (16.71) otherwise. The components of x(t) for any t are therefore xi (t) xi − tgi if t ≤ t¯i , xi − t¯i gi otherwise. To search for the first local minimizer along P(x −tg, l, u), we eliminate the duplicate values and zero values of t¯i from the set {t¯1 , t¯2 , . . . , t¯n }, to obtain a sorted, reduced set of breakpoints {t1 , t2 , . . . , tl } with 0 < t1 < t2 < · · ·. We now examine the intervals [0, t1 ], [t1 , t2 ], [t2 , t3 ], . . . in turn. Suppose we have examined up to t j−1 and have not yet found a local minimizer. For the interval [t j−1 , t j ], we have that x(t) x(t j−1 ) + (t) p j−1 , where t t − t j−1 ∈ [0, t j − t j−1 ], 487 488 CHAPTER 16. QUADRATIC PROGRAMMING and j−1 pi −gi if t j−1 < t¯i , 0 otherwise. (16.72) We can then write the quadratic (16.68a) on the line segment [x(t j−1 ), x(t j )] as follows: q(x(t)) c T (x(t j−1 ) + (t) p j−1 ) + 12 (x(t j−1 ) + (t) p j−1 )T G(x(t j−1 ) + (t) p j−1 ). Expanding and grouping the coefficients of 1, t, and (t)2 , we find that q(x(t)) f j−1 + f j−1 t + 1 2 f j−1 (t)2 , t ∈ [0, t j − t j−1 ], (16.73) where the coefficients f j−1 , f j−1 , and f j−1 are defined by def f j−1 c T x(t j−1 ) + 12 x(t j−1 )T Gx(t j−1 ), f j−1 c T p j−1 + x(t j−1 )T Gp j−1 , def f j−1 ( p j−1 )T Gp j−1 . def Differentiating (16.73) with respect to t and equating to zero, we obtain t ∗ / f j−1 . The following cases can occur. (i) If f j−1 > 0 there is a local minimizer − f j−1 ∗ of q(x(t)) at t t j−1 ; else (ii) t ∈ [0, t j − t j−1 ) there is a minimizer at t t j−1 + t ∗ ; (iii) in all other cases we move on to the next interval [t j , t j+1 ] and continue the search. For the next search interval, we need to calculate the new direction p j from (16.72), and we use this new value to calculate f j , f j , and f j . Since p j differs from p j−1 typically in just one component, computational savings can be made by updating these coefficients rather than computing them from scratch. SUBSPACE MINIMIZATION After the Cauchy point x c has been computed, the components of x c that are at their lower or upper bounds define the active set A(x c ) {i | xic li or xic u i }. In the second stage of the gradient projection iteration, we approximately solve the QP obtained by fixing the components xi for i ∈ A(x c ) at the values xic . The remaining 16.7. THE GRADIENT PROJECTION METHOD components are determined from the subproblem min q(x) 12 x T Gx + x T c (16.74a) x xi xic , i ∈ A(x c ), (16.74b) / A(x ). li ≤ x i ≤ u i , i ∈ (16.74c) subject to c It is not necessary to solve this problem exactly. Nor is it desirable in the large-dimensional case, because the subproblem may be almost as difficult as the original problem (16.68). In fact, to obtain global convergence of the gradient projection procedure, we require only that the approximate solution x + of (16.74) is feasible with respect to (16.68b) and has an objective function value no worse than that of x c , that is, q(x + ) ≤ q(x c ). A strategy that is intermediate between choosing x + x c as the approximate solution (on the one hand) and solving (16.74) exactly (on the other hand) is to compute an approximate solution of (16.74) by using the conjugate gradient iteration described in Algorithm 16.1 or Algorithm 16.2. Note that for the equality constraints (16.74b), the Jacobian A and the null-space basis matrix Z have particularly simple forms. We could therefore apply conjugate gradient to the problem (16.74a), (16.74b) and terminate as soon as a bound l ≤ x ≤ u is encountered. Alternatively, we could continue to iterate, temporarily ignoring the bounds and projecting the solution back onto the box constraints. The negative-curvature case can be handled as in Algorithm 7.2, the method for approximately solving possibly indefinite trust-region subproblems in unconstrained optimization. We summarize the gradient projection algorithm for quadratic programming as follows. Algorithm 16.5 (Gradient Projection Method for QP). Compute a feasible starting point x 0 ; for k 0, 1, 2, . . . if x k satisfies the KKT conditions for (16.68) stop with solution x ∗ x k ; Set x x k and find the Cauchy point x c ; Find an approximate solution x + of (16.74) such that q(x + ) ≤ q(x c ) and x + is feasible; k+1 ← x +; x end (for) If the algorithm approaches a solution x ∗ at which the Lagrange multipliers associated with all the active bounds are nonzero (that is, strict complementarity holds), the active sets A(x c ) generated by the gradient projection algorithm are equal to the optimal active set for all k sufficiently large. That is, constraint indices do not repeatedly enter and leave the active set on successive iterations. When the problem is degenerate, the active set may not settle down at its optimal value. Various devices have been proposed to prevent this undesirable behavior from taking place. 489 490 CHAPTER 16. QUADRATIC PROGRAMMING While gradient projection methods can be applied in principle to problems with general linear constraints, significant computation may be required to perform the projection onto the feasible set in such cases. For example, if the constraint set is defined as aiT x ≥ bi , i ∈ I, we must solve the following convex quadratic program to compute the projection of a given point x̄ onto this set: max x − x̄2 x subject to aiT x ≥ bi for all i ∈ I. The expense of solving this “projection subproblem” may approach the cost of solving the original quadratic program, so it is usually not economical to apply gradient projection to this case. When we use duality to replace a strictly convex quadratic program with its dual (see Example 12.12), the gradient projection method may be useful in solving the boundconstrained dual problem, which is formulated in terms of the Lagrange multipliers λ as follows: 1 max q̃(λ) − (A T λ − c)T G −1 (A T λ − c)T + b T λ, subject to λ ≥ 0. λ 2 (Note that the dual is conventionally written as a maximization problem; we can equivalently minimize −q̃(λ) and note that this transformed problem is convex.) This approach is most useful when G has a simple form, for example, a diagonal or block-diagonal matrix. 16.8 PERSPECTIVES AND SOFTWARE Active-set methods for convex quadratic programming are implemented in QPOPT [126], VE09 [142], BQPD [103], and QPA [148]. Several commercial interior-point solvers for QP are available, including CPLEX [172], XPRESS-MP [159] and MOSEK [5]. The code QPB [146] uses a two-phase interior-point method that can handle convex and nonconvex problems. OOPS [139] and OOQP [121] are object-oriented interior-point codes that allow the user to customize the linear algebra techniques to the particular structure of the data for an application. Some nonlinear programming interior-point packages, such as LOQO [294] and KNITRO [46], are also effective for convex and nonconvex quadratic programming. The numerical comparison of active-set and interior-point methods for convex quadratic programming reported in [149] indicates that interior-point methods are generally much faster on large problems. If a warm start is required, however, active-set methods may be generally preferable. Although considerable research has been focused on improving the warm-start capabilities of interior-point methods, the full potential of such techniques is now yet known. We have assumed in this chapter that all equality-constrained quadratic programs have linearly independent constraints, that is, the m × n constraint Jacobian matrix A has rank m. 16.8. PERSPECTIVES AND SOFTWARE If redundant constraints are present, they can be detected by forming a SVD or rank-revealing QR factorization of A T , and then removed from the formulation. When A is larger, sparse Gaussian elimination techniques can be applied to A T instead, but they are less reliable. The KNITRO and OOPS software packages provide the option of solving the primal-dual equations (16.63) by means of the projected CG iteration of Algorithm 16.2. We have not considered active-set methods for the case in which the Hessian matrix G is indefinite because these methods can be quite complicated to describe and it is not well understood how to adapt them to the large dimensional case. We make some comments here on the principal techniques. Algorithm 16.3, the active-set method for convex QP, can be adapted to this indefinite case by modifying the computation of the search direction and step length in certain situations. To explain the need for the modification, we consider the computation of a step by a null-space method, that is, p Z pZ , where pZ is given by (16.53). If the reduced Hessian Z T G Z is positive definite, then this step p points to the minimizer of the subproblem (16.39), and the logic of the iteration need not be changed. If Z T G Z has negative eigenvalues, however, p points only to a saddle point of (16.39) and is therefore not always a suitable step. Instead, we seek an alternative direction sZ that is a direction of negative curvature for Z T G Z . We then have that q(x + α Z sZ ) → −∞ as α → ∞. (16.75) Additionally, we change the sign of sZ if necessary to ensure that Z sZ is a non-ascent direction for q at the current point x, that is, ∇q(x)T Z sZ ≤ 0. By moving along the direction Z sZ , we will encounter a constraint that can be added to the working set for the next iteration. (If we don’t find such a constraint, the problem is unbounded.) If the reduced Hessian for the new working set is not positive definite, we repeat this process until enough constraints have been added to make the reduced Hessian positive definite. A difficulty with this general approach, however, is that if we allow the reduced Hessian to have several negative eigenvalues, it is difficult to make these methods efficient when the reduced Hessian changes from one working set to the next. Inertia controlling methods are a practical class of algorithms for indefinite QP that never allow the reduced Hessian to have more than one negative eigenvalue. As in the convex case, there is a preliminary phase in which a feasible starting point x0 is found. We place the additional demand on x0 that it be either a vertex (in which case the reduced Hessian is the null matrix) or a constrained stationary point at which the reduced Hessian is positive definite. At each iteration, the algorithm will either add or remove a constraint from the working set. If a constraint is added, the reduced Hessian is of smaller dimension and must remain positive definite or be the null matrix. Therefore, an indefinite reduced Hessian can arise only when one of the constraints is removed from the working set, which happens only when the current point is a minimizer with respect to the current working set. In this case, we will choose the new search direction to be a direction of negative curvature for the reduced Hessian. 491 492 CHAPTER 16. QUADRATIC PROGRAMMING Various algorithms for indefinite QP differ in the way that indefiniteness is detected, in the computation of the negative curvature direction, and in the handling of the working set; see Fletcher [99] and Gill and Murray [126]. NOTES AND REFERENCES The problem of determining whether a feasible point for a nonconvex QP (16.1) is a global minimizer is NP-hard (Murty and Kabadi [219]); so is the problem of determining whether a given point is a local minimizer (Vavasis [296, Theorem 5.1]). Various algorithms for convex QP with polynomial convexity are discussed in Nesterov and Nemirovskii [226]. The portfolio optimization problem was formulated by Markowitz [201]. For a discussion on the QMR, LSQR, and GMRES methods see, for example, [136, 272, 290]. The idea of using the projection (16.30) in the CG method dates back to at least Polyak [238]. The alternative (16.34), and its special case (16.32), are proposed in Coleman [64]. Although it can give rise to substantial rounding errors, they can be corrected by iterative refinement; see Gould et al. [143]. More recent studies on preconditioning of the projected CG method include Keller et al. [176] and Lukšan and Vlček [196]. For further discussion on the gradient projection method see, for example, Conn, Gould, and Toint [70] and Burke and Moré [44]. In some areas of application, the KKT matrix (16.7) not only is sparse but also contains special structure. For instance, the quadratic programs that arise in many control problems have banded matrices G and A (see Wright [315]), which can be exploited by interior-point methods via a suitable symmetric reordering of K . When active-set methods are applied to this problem, however, the advantages of bandedness and sparsity are lost after just a few updates of the factorization. Further details of interior-point methods for convex quadratic programming can be found in Wright [316] and Vanderbei [293]. The first inertia-controlling method for indefinite quadratic programming was proposed by Fletcher [99]. See also Gill et al. [129] and Gould [142] for a discussion of methods for general quadratic programming. ✐ EXERCISES ✐ 16.1 (a) Solve the following quadratic program and illustrate it geometrically. min f (x) 2x1 + 3x2 + 4x12 + 2x1 x2 + x22 , subject to x1 − x2 ≥ 0, x1 + x2 ≤ 4, x1 ≤ 3. (b) If the objective function is redefined as q(x) − f (x), does the problem have a finite minimum? Are there local minimizers? 16.8. PERSPECTIVES AND SOFTWARE ✐ 16.2 The problem of finding the shortest distance from a point x0 to the hyperplane {x | Ax b}, where A has full row rank, can be formulated as the quadratic program min 12 (x − x0 )T (x − x0 ) subject to Ax b. Show that the optimal multiplier is λ∗ (A A T )−1 (b − Ax0 ) and that the solution is x ∗ x0 + A T (A A T )−1 (b − Ax0 ). Show that in the special case in which A is a row vector, the shortest distance from x0 to the solution set of Ax b is |b − Ax0 |/A2 . ✐ 16.3 Use Theorem 12.1 to verify that the first-order necessary conditions for (16.3) are given by (16.4). ✐ 16.4 Suppose that G is positive semidefinite in (16.1) and that x ∗ satisfies the KKT conditions (16.37) for some λi∗ , i ∈ A(x ∗ ). Suppose in addition that second-order sufficient conditions are satisfied, that is, Z T G Z is positive definite where the columns of Z span the null space of the active constraint Jacobian matrix. Show that x ∗ is in fact the unique global solution for (16.1), that is, q(x) > q(x ∗ ) for all feasible x with x x ∗ . ✐ 16.5 Verify that the inverse of the KKT matrix is given by (16.16). ✐ 16.6 Use Theorem 12.6 to show that if the conditions of Lemma 16.1 hold, then the second-order sufficient conditions for (16.3) are satisfied by the vector pair (x ∗ , λ∗ ) that satisfies (16.4). ✐ 16.7 Consider (16.3) and suppose that the projected Hessian matrix Z T G Z has a negative eigenvalue; that is, u T Z T G Z u < 0 for some vector u. Show that if there exists any vector pair (x ∗ , λ∗ ) that satisfies (16.4), then the point x ∗ is only a stationary point of (16.3) and not a local minimizer. (Hint: Consider the function q(x ∗ + α Z u) for α 0, and use an expansion like that in the proof of Theorem 16.2.) ✐ 16.8 By using the QR factorization and a permutation matrix, show that for a fullrank m ×n matrix A (with m < n) one)can find an * orthogonal matrix Q and an m ×m upper triangular matrix Û such that AQ 0 Û . (Hint: Start by applying the standard QR factorization to A T .) ✐ 16.9 Verify that the first-order conditions for optimality of (16.1) are equivalent to (16.37) when we make use of the active-set definition (16.36). 493 494 CHAPTER 16. QUADRATIC PROGRAMMING ✐ 16.10 For each of the alternative choices of initial working set W0 in the example (16.49) (that is, W0 {3}, W0 {5}, and W0 ∅) work through the first two iterations of Algorithm 16.3. ✐ 16.11 Program Algorithm 16.3, and use it to solve the problem min subject to x12 + 2x22 − 2x1 − 6x2 − 2x1 x2 1 x 2 1 + 12 x2 ≤ 1, −x1 + 2x2 ≤ 2, x1 , x2 ≥ 0. Choose three initial starting points: one in the interior of the feasible region, one at a vertex, and one at a non-vertex point on the boundary of the feasible region. ✐ 16.12 Show that the operator P defined by (16.27) is independent of the choice of null-space basis Z . (Hint: First show that any null-space basis Z can be written as Z Q B where Q is an orthogonal basis and B is a nonsingular matrix.) ✐ 16.13 (a) Show that the the computation of the preconditioned residual g + in (16.28d) can be performed with (16.29) or (16.30). (b) Show that we can also perform this computation by solving the system (16.32). (c) Verify (16.33). ✐ 16.14 (a) Show that if Z T G Z is positive definite, then the denominator in (16.28a) is nonzero. (b) Show that if Z T r rZ 0 and Z T H Z is positive definite, then the denominator in (16.28e) is nonzero. ✐ 16.15 Consider problem (16.3), and assume that A has full row rank and that Z is a basis for the null space of A. Prove that there are no finite solutions if Z T G Z has negative eigenvalues. ✐ 16.16 (a) Assume that A 0. Show that the KKT matrix (16.7) is indefinite. (b) Prove that if the KKT matrix (16.7) is nonsingular, then A must have full rank. ✐ 16.17 Consider the quadratic program max subject to 6x1 + 4x2 − 13 − x12 − x22 , x1 + x2 ≤ 3, x1 ≥ 0, x2 ≥ 0. (16.76) 16.8. PERSPECTIVES AND SOFTWARE First solve it graphically, and then use your program implementing the active-set method given in Algorithm 16.3. ✐ 16.18 Using (16.39) and (16.41), explain briefly why the gradient of each blocking constraint cannot be a linear combination of the constraint gradients in the current working set Wk . ✐ 16.19 Let W be an n × n symmetric matrix, and suppose that Z is of dimension n × t. Suppose that Z T W Z is positive definite and that Z̄ is obtained by removing a column from Z . Show that Z̄ T W Z̄ is positive definite. ✐ 16.20 Find a null-space basis matrix Z for the equality-constrained problem defined by (16.74a), (16.74b). ✐ 16.21 Write down KKT conditions for the following convex quadratic program with mixed equality and inequality constraints: min q(x) 12 x T Gx + x T c subject to Ax ≥ b, Āx b̄, where G is symmetric and positive semidefinite. Use these conditions to derive an analogue of the generic primal-dual step (16.58) for this problem. ✐ 16.22 Explain why for a bound-constrained problems the number of possible active sets is at most 3n . ✐ 16.23 (a) Show that the primal-dual system (16.58) can be solved using the augmented system (16.61) or the normal equations (16.62). Describe in detail how all the components (x, y, λ) are computed. (b) Verify (16.65). ✐ 16.24 Program Algorithm 16.4 and use it to solve problem (16.76). Set all initial variables to be the vector e (1, 1, . . . , 1)T . ✐ 16.25 Let x̄ ∈ R n be given, and let x ∗ be the solution of the projection problem min x − x̄2 subject to l ≤ x ≤ u. (16.77) For simplicity, assume that −∞ < li < u i < ∞ for all i 1, 2, . . . , n. Show that the solution of this problem coincides with the projection formula given by (16.69) that is, show that x ∗ P(x̄, l, u). (Hint: Note that the problem is separable.) 495 496 CHAPTER 16. ✐ QUADRATIC PROGRAMMING 16.26 Consider the bound-constrained quadratic problem (16.68) with G 4 1 1 2 , c −1 1 , l 0 0 , and u 5 3 . (16.78) Suppose x 0 (0, 2)T . Find t¯1 , t¯2 , t1 , t2 , p 1 , p 2 and x(t1 ), x(t2 ). Find the minimizer of q(x(t)). ✐ 16.27 Consider the search for the one dimensional minimizer of the function q(x(t)) defined by (16.73). There are 9 possible cases since f, f , f can each be positive, negative, or zero. For each case, determine the location of the minimizer. Verify that the rules described in Section 16.7 hold. This is page 497 Printer: Opaque this 17 CHAPTER Penalty and Augmented Lagrangian Methods Some important methods for constrained optimization replace the original problem by a sequence of subproblems in which the constraints are represented by terms added to the objective. In this chapter we describe three approaches of this type. The quadratic penalty method adds a multiple of the square of the violation of each constraint to the objective. Because of its simplicity and intuitive appeal, this approach is used often in practice, although it has some important disadvantages. In nonsmooth exact penalty methods, a single unconstrained problem (rather than a sequence) takes the place of the original constrained problem. Using these penalty functions, we can often find a solution by performing a single 498 CHAPTER 17. PENALTY AND AUGMENTED LAGRANGIAN METHODS unconstrained minimization, but the nonsmoothness may create complications. A popular function of this type is the 1 penalty function. A different kind of exact penalty approach is the method of multipliers or augmented Lagrangian method, in which explicit Lagrange multiplier estimates are used to avoid the ill-conditioning that is inherent in the quadratic penalty function. A somewhat related approach is used in the log-barrier method, in which logarithmic terms prevent feasible iterates from moving too close to the boundary of the feasible region. This approach forms part of the foundation for interior-point methods for nonlinear programming and we discuss it further in Chapter 19. 17.1 THE QUADRATIC PENALTY METHOD MOTIVATION Let us consider replacing a constrained optimization problem by a single function consisting of - the original objective of the constrained optimization problem, plus - one additional term for each constraint, which is positive when the current point x violates that constraint and zero otherwise. Most approaches define a sequence of such penalty functions, in which the penalty terms for the constraint violations are multiplied by a positive coefficient. By making this coefficient larger, we penalize constraint violations more severely, thereby forcing the minimizer of the penalty function closer to the feasible region for the constrained problem. The simplest penalty function of this type is the quadratic penalty function, in which the penalty terms are the squares of the constraint violations. We describe this approach first in the context of the equality-constrained problem min f (x) x subject to ci (x) 0, i ∈ E, (17.1) which is a special case of (12.1). The quadratic penalty function Q(x; µ) for this formulation is def Q(x; µ) f (x) + µ 2 c (x), 2 i∈E i (17.2) where µ > 0 is the penalty parameter. By driving µ to ∞, we penalize the constraint violations with increasing severity. It makes good intuitive sense to consider a sequence of values {µk } with µk ↑ ∞ as k → ∞, and to seek the approximate minimizer xk of Q(x; µk ) for each k. Because the penalty terms in (17.2) are smooth, we can use techniques from 17.1. THE QUADRATIC PENALTY METHOD unconstrained optimization to search for xk . In searching for xk , we can use the minimizers xk−1 , xk−2 , etc., of Q(·; µ) for smaller values of µ to construct an initial guess. For suitable choices of the sequence {µk } and the initial guesses, just a few steps of unconstrained minimization may be needed for each µk . ❏ EXAMPLE 17.1 Consider the problem (12.9) from Chapter 12, that is, min x1 + x2 subject to x12 + x22 − 2 0, (17.3) for which the solution is (−1, −1)T and the quadratic penalty function is Q(x; µ) x1 + x2 + 2 µ 2 x1 + x22 − 2 . 2 (17.4) We plot the contours of this function in Figures 17.1 and 17.2. In Figure 17.1 we have µ 1, and we observe a minimizer of Q near the point (−1.1, −1.1)T . (There is also a local maximizer near x (0.3, 0.3)T .) In Figure 17.2 we have µ 10, so points that do not lie on the feasible circle defined by x12 + x22 2 suffer a much greater penalty than in the first figure—the “trough” of low values of Q is clearly evident. The minimizer in this figure is much closer to the solution (−1, −1)T of the problem (17.3). A local maximum lies near (0, 0)T , and Q goes rapidly to ∞ outside the circle x12 + x22 2. ❐ 1.5 1 0.5 0 −0.5 −1 −1.5 −1.5 −1 −0.5 0 0.5 1 1.5 Figure 17.1 Contours of Q(x; µ) from (17.4) for µ 1, contour spacing 0.5. 499 500 CHAPTER 17. PENALTY AND AUGMENTED LAGRANGIAN METHODS 1.5 1 0.5 0 −0.5 −1 −1.5 −1.5 −1 Figure 17.2 −0.5 0 0.5 1 1.5 Contours of Q(x; µ) from (17.4) for µ 10, contour spacing 2. The situation is not always so benign as in Example 17.1. For a given value of the penalty parameter µ, the penalty function may be unbounded below even if the original constrained problem has a unique solution. Consider for example min −5x12 + x22 subject to x1 1, (17.5) whose solution is (1, 0)T . The penalty function is unbounded for any µ < 10. For such values of µ, the iterates generated by an unconstrained minimization method would usually diverge. This deficiency is, unfortunately, common to all the penalty functions discussed in this chapter. For the general constrained optimization problem min f (x) x subject to ci (x) 0, i ∈ E, ci (x) ≥ 0, i ∈ I, (17.6) which contains inequality constraints as well as equality constraints, we can define the quadratic penalty function as def Q(x; µ) f (x) + 2 µ 2 µ [ci (x)]− , ci (x) + 2 i∈E 2 i∈I (17.7) where [y]− denotes max(−y, 0). In this case, Q may be less smooth than the objective and constraint functions. For instance, if one of the inequality constraints is x1 ≥ 0, then the function min(0, x1 )2 has a discontinuous second derivative, so that Q is no longer twice continuously differentiable. 17.1. THE QUADRATIC PENALTY METHOD ALGORITHMIC FRAMEWORK A general framework for algorithms based on the quadratic penalty function (17.2) can be specified as follows. Framework 17.1 (Quadratic Penalty Method). Given µ0 > 0, a nonnegative sequence {τk } with τk → 0, and a starting point x0s ; for k 0, 1, 2, . . . Find an approximate minimizer xk of Q(·; µk ), starting at xks , and terminating when ∇x Q(x; µk ) ≤ τk ; if final convergence test satisfied stop with approximate solution xk ; end (if) Choose new penalty parameter µk+1 > µk ; s ; Choose new starting point xk+1 end (for) The parameter sequence {µk } can be chosen adaptively, based on the difficulty of minimizing the penalty function at each iteration. When minimization of Q(x; µk ) proves to be expensive for some k, we choose µk+1 to be only modestly larger than µk ; for instance µk+1 1.5µk . If we find the approximate minimizer of Q(x; µk ) cheaply, we could try a more ambitious increase, for instance µk+1 10µk . The convergence theory for Framework 17.1 allows wide latitude in the choice of nonnegative tolerances τk ; it requires only that τk → 0, to ensure that the minimization is carried out more accurately as the iterations progress. There is no guarantee that the stop test ∇x Q(x; µk ) ≤ τk will be satisfied because, as discussed above, the iterates may move away from the feasible region when the penalty parameter is not large enough. A practical implementation must include safeguards that increase the penalty parameter (and possibly restore the initial point) when the constraint violation is not decreasing rapidly enough, or when the iterates appear to be diverging. When only equality constraints are present, Q(x; µk ) is smooth, so the algorithms for unconstrained minimization described in the first chapters of the book can be used to identify the approximate solution xk . However, the minimization of Q(x; µk ) becomes more difficult to perform as µk becomes large, unless we use special techniques to calculate the search directions. For one thing, the Hessian ∇x2x Q(x; µk ) becomes arbitrarily ill conditioned near the minimizer. This property alone is enough to make many unconstrained minimization algorithms such as quasi-Newton and conjugate gradient perform poorly. Newton’s method, on the other hand, is not sensitive to ill conditioning of the Hessian, but it, too, may encounter difficulties for large µk for two other reasons. First, ill conditioning of ∇x2x Q(x; µk ) might be expected to cause numerical problems when we solve the linear equations to calculate the Newton step. We discuss this issue below, and show that these effects are not severe and 501 502 CHAPTER 17. PENALTY AND AUGMENTED LAGRANGIAN METHODS that a reformulation of the Newton equations is possible. Second, even when x is close to the minimizer of Q(·; µk ), the quadratic Taylor series approximation to Q(x; µk ) about x is a reasonable approximation of the true function only in a small neighborhood of x. This property can be seen in Figure 17.2, where the contours of Q near the minimizer have a “banana” shape, rather than the elliptical shape that characterizes quadratic functions. Since Newton’s method is based on the quadratic model, the steps that it generates may not make rapid progress toward the minimizer of Q(x; µk ). This difficulty can be lessened by a s s , or by setting xk+1 xk and choosing µk+1 to be judicious choice of the starting point xk+1 only modestly larger than µk . CONVERGENCE OF THE QUADRATIC PENALTY METHOD We describe some convergence properties of the quadratic penalty method in the following two theorems. We restrict our attention to the equality-constrained problem (17.1), for which the quadratic penalty function is defined by (17.2). For the first result we assume that the penalty function Q(x; µk ) has a (finite) minimizer for each value of µk . Theorem 17.1. Suppose that each xk is the exact global minimizer of Q(x; µk ) defined by (17.2) in Framework 17.1 above, and that µk ↑ ∞. Then every limit point x ∗ of the sequence {xk } is a global solution of the problem (17.1). PROOF. Let x̄ be a global solution of (17.1), that is, f (x̄) ≤ f (x) for all x with ci (x) 0, i ∈ E. Since xk minimizes Q(·; µk ) for each k, we have that Q(xk ; µk ) ≤ Q(x̄; µk ), which leads to the inequality f (xk ) + µk 2 µk 2 ci (xk ) ≤ f (x̄) + c (x̄) f (x̄). 2 i∈E 2 i∈E i (17.8) By rearranging this expression, we obtain ci2 (xk ) ≤ i∈E 2 [ f (x̄) − f (xk )]. µk (17.9) Suppose that x ∗ is a limit point of {xk }, so that there is an infinite subsequence K such that lim xk x ∗ . k∈K 17.1. THE QUADRATIC PENALTY METHOD By taking the limit as k → ∞, k ∈ K, on both sides of (17.9), we obtain i∈E ci2 (x ∗ ) lim k∈K 2 [ f (x̄) − f (xk )] 0, k∈K µk ci2 (xk ) ≤ lim i∈E where the last equality follows from µk ↑ ∞. Therefore, we have that ci (x ∗ ) 0 for all i ∈ E, so that x ∗ is feasible. Moreover, by taking the limit as k → ∞ for k ∈ K in (17.8), we have by nonnegativity of µk and of each ci (xk )2 that µk 2 ci (xk ) ≤ f (x̄). k∈K 2 i∈E f (x ∗ ) ≤ f (x ∗ ) + lim Since x ∗ is a feasible point whose objective value is no larger than that of the global solution x̄, we conclude that x ∗ , too, is a global solution, as claimed. Since this result requires us to find the global minimizer for each subproblem, this desirable property of convergence to the global solution of (17.1) cannot be attained in general. The next result concerns convergence properties of the sequence {xk } when we allow inexact (but increasingly accurate) minimizations of Q(·; µk ). In contrast to Theorem 17.1, it shows that the sequence may be attracted to infeasible points, or to any KKT point (that is, a point satisfying first-order necessary conditions; see (12.34)), rather than to a minimizer. It also shows that the quantities µk ci (xk ) may be used as estimates of the Lagrange multipliers λi∗ in certain circumstances. This observation is important for the analysis of augmented Lagrangian methods in Section 17.3. To establish the result we will make the (optimistic) assumption that the stop test ∇x Q(x; µk ) ≤ τk is satisfied for all k. Theorem 17.2. Suppose that the tolerances and penalty parameters in Framework 17.1 satisfy τk → 0 and µk ↑ ∞. Then if a limit point x ∗ of the sequence {xk } is infeasible, it is a stationary point of the function c(x)2 . On the other hand, if a limit point x ∗ is feasible and the constraint gradients ∇ci (x ∗ ) are linearly independent, then x ∗ is a KKT point for the problem (17.1). For such points, we have for any infinite subsequence K such that limk∈K xk x ∗ that lim −µk ci (xk ) λi∗ , for all i ∈ E, k∈K (17.10) where λ∗ is the multiplier vector that satisfies the KKT conditions (12.34) for the equalityconstrained problem (17.1). PROOF. By differentiating Q(x; µk ) in (17.2), we obtain ∇x Q(xk ; µk ) ∇ f (xk ) + i∈E µk ci (xk )∇ci (xk ), (17.11) 503 504 CHAPTER 17. PENALTY AND AUGMENTED LAGRANGIAN METHODS so from the termination criterion for Framework 17.1, we have that µk ci (xk )∇ci (xk ) ≤ τk . ∇ f (xk ) + (17.12) i∈E By rearranging this expression (and in particular using the inequality a−b ≤ a +b), we obtain 1 ci (xk )∇ci (xk ) ≤ (17.13) [τk + ∇ f (xk )] . µk i∈E Let x ∗ be a limit point of the sequence of iterates. Then there is a subsequence K such that limk∈K xk x ∗ . When we take limits as k → ∞ for k ∈ K, the bracketed term on the right-hand-side approaches ∇ f (x ∗ ), so because µk ↑ ∞, the right-hand-side approaches zero. From the corresponding limit on the left-hand-side, we obtain ci (x ∗ )∇ci (x ∗ ) 0. (17.14) i∈E We can have ci (x ∗ ) 0 (if the constraint gradients ∇ci (x ∗ ) are dependent), but in this case (17.14) implies that x ∗ is a stationary point of the function c(x)2 . If, on the other hand, the constraint gradients ∇ci (x ∗ ) are linearly independent at a limit point x ∗ , we have from (17.14) that ci (x ∗ ) 0 for all i ∈ E, so x ∗ is feasible. Hence, the second KKT condition (12.34b) is satisfied. We need to check the first KKT condition (12.34a) as well, and to show that the limit (17.10) holds. By using A(x) to denote the matrix of constraint gradients (also known as the Jacobian), that is, A(x)T [∇ci (x)]i∈E , (17.15) and λk to denote the vector −µk c(xk ), we have as in (17.12) that A(xk )T λk ∇ f (xk ) − ∇x Q(xk ; µk ), ∇x Q(xk ; µk ) ≤ τk . (17.16) For all k ∈ K sufficiently large, the matrix A(xk ) has full row rank, so that A(xk )A(xk )T is nonsingular. By multiplying (17.16) by A(xk ) and rearranging, we have that λk A(xk )A(xk )T −1 A(xk ) [∇ f (xk ) − ∇x Q(xk ; µk )] . Hence by taking the limit as k ∈ K goes to ∞, we find that lim λk λ∗ A(x ∗ )A(x ∗ )T k∈K −1 A(x ∗ )∇ f (x ∗ ). 17.1. THE QUADRATIC PENALTY METHOD By taking limits in (17.12), we conclude that ∇ f (x ∗ ) − A(x ∗ )T λ∗ 0, (17.17) so that λ∗ satisfies the first KKT condition (12.34a) for (17.1). Hence, x ∗ is a KKT point for (17.1), with unique Lagrange multiplier vector λ∗ . It is reassuring that, if a limit point x ∗ is not feasible, it is at least a stationary point for the function c(x)2 . Newton-type algorithms can always be attracted to infeasible points of this type. (We see the same effect in Chapter 11, in our discussion of methods for nonlinear equations that use the sum-of-squares merit function r (x)2 .) Such methods cannot be guaranteed to find a root, and can be attracted to a stationary point or minimizer of the merit function. In the case in which the nonlinear program (17.1) is infeasible, we often observe convergence of the quadratic-penalty method to stationary points or minimizers of c(x)2 . ILL CONDITIONING AND REFORMULATIONS We now examine the nature of the ill conditioning in the Hessian ∇x2x Q(x; µk ). An understanding of the properties of this matrix, and the similar Hessians that arise in other penalty and barrier methods, is essential in choosing effective algorithms for the minimization problem and for the linear algebra calculations at each iteration. The Hessian is given by the formula ∇x2x Q(x; µk ) ∇ 2 f (x) + µk ci (x)∇ 2 ci (x) + µk A(x)T A(x), (17.18) i∈E where we have used the definition (17.15) of A(x). When x is close to the minimizer of Q(·; µk ) and the conditions of Theorem 17.2 are satisfied, we have from (17.10) that the sum of the first two terms on the right-hand-side of (17.18) is approximately equal to the Hessian of the Lagrangian function defined in (12.33). To be specific, we have ∇x2x Q(x; µk ) ≈ ∇x2x L(x, λ∗ ) + µk A(x)T A(x), (17.19) when x is close to the minimizer of Q(·; µk ). We see from this expression that ∇x2x Q(x; µk ) is approximately equal to the sum of - a matrix whose elements are independent of µk (the Lagrangian term), and - a matrix of rank |E| whose nonzero eigenvalues are of order µk (the second term on the right-hand side of (17.19)). The number of constraints |E| is usually smaller than n. In this case, the last term in (17.19) is singular. The overall matrix has some of its eigenvalues approaching a constant, while others 505 506 CHAPTER 17. PENALTY AND AUGMENTED LAGRANGIAN METHODS are of order µk . Since µk is approaching ∞, the increasing ill conditioning of ∇x2x Q(x; µk ) is apparent. One consequence of the ill conditioning is possible inaccuracy in the calculation of the Newton step for Q(x; µk ), which is obtained by solving the following system: ∇x2x Q(x; µk ) p −∇x Q(x; µk ). (17.20) In general, the poor conditioning of this system will lead to significant errors in the computed value of p, regardless of the computational technique used to solve (17.20). For the same reason, iterative methods can be expected to perform poorly unless accompanied by a preconditioning strategy that removes the systematic ill conditioning. There is an alternative formulation of the equations (17.20) that avoids the ill conditioning due to the final term in (17.18). By introducing a new variable vector ζ defined by ζ µA(x) p, we see that the vector p that solves (17.20) also satisfies the following system: ⎡ ⎣ ∇ 2 f (x) + µk ci (x)∇ 2 ci (x) A(x)T i∈E A(x) −(1/µk )I ⎤ ⎦ p ζ −∇x Q(x; µk ) 0 . (17.21) When x is not too far from the solution x ∗ , the coefficient matrix in this system does not have large singular values (of order µk ), so the system (17.21) can be viewed as a well conditioned reformulation of (17.20). We note, however, that neither system may yield a good search direction p because the coefficients µk ci (x) in the summation term of the upper left block of (17.21) may be poor approximations to the Lagrange multipliers −λi∗ , even when x is quite close to the minimizer xk of Q(x; µk ). This fact may cause the quadratic model on which p is based to be an inadequate model of Q(·; µk ), so the Newton step may be intrinsically an unsuitable search direction. We discussed possible remedies for this difficulty above, in our comments following Framework 17.1. To compute the step via (17.21) involves the solution of a linear system of dimension n + |E| rather than the system of dimension n given by (17.19). A similar system must be solved to calculate the sequential quadratic programming (SQP) step (18.6), which is derived in Chapter 18. In fact, when µk is large, (17.21) can be viewed as a regularization of the SQP step (18.6