Chapter 6: Constraned Optzaton CHAPER 6 CONSRAINED OPIMIZAION : K- CONDIIONS Introducton We now begn our dscusson of gradent-based constraned optzaton. Recall that n Chapter 3 we looked at gradent-based unconstraned optzaton and learned about the necessary and suffcent condtons for an unconstraned optu, varous search drectons, conductng a lne search, and quas-newton ethods. We wll buld on that foundaton as we extend the theory to probles wth constrants. Necessary Condtons for Constraned Optu At an unconstraned local optu, there s no drecton n whch we can ove to prove the objectve functon. We can state the necessary condtons atheatcally as f 0. At a constraned local optu, there s no feasble drecton n whch we can ove to prove the objectve. hat s, there ay be drectons fro the current pont that wll prove the objectve, but these drectons pont nto nfeasble space. he necessary condtons for a constraned local optu are called the Kuhn-ucker Condtons, and these condtons play a very portant role n constraned optzaton theory and algorth developent.. Proble For It wll be convenent to cast our optzaton proble nto one of two partcular fors. hs s no restrcton snce any proble can be cast nto ether of these fors. or Max s.t.: Mn s.t.: f x x 0,, x 0,, g b k g b k f x x 0,, x 0,, g b k g b k. Graphcal Exaples For the graphcal exaples below, we wll assue we are axzng wth constrants. We have prevously consdered how we can tell atheatcally f soe arbtrary vector, s, ponts downhll. hat condton s, s f 0. We developed ths condton by notng that
Chapter 6: Constraned Optzaton any vector s could be resolved nto vector coponents whch le n the tangent plane and along the gradent (or negatve gradent) drecton. Now suppose we have the stuaton shown n Fg. 6. below. We are axzng. We have contours ncreasng n the drecton of the arrow. he gradent vector s shown. What s the set of drectons whch proves the objectve? It s the set for whch s f 0. We show that set as a se-crcle n Fg. 6. Fg. 6. Gradent and set of drectons whch proves objectve functon. Now suppose we add n a less-than nequalty constrant, g( x ) 0. Contours for ths constrant are gven n Fg. 6.. he trangular arkers ndcate the contour for the allowable value and pont towards the drecton of the feasble space. What s the set of drectons whch s feasble? It s the set for whch s f 0. hat set s shown as a se-crcle n the fgure. Fg. 6. Gradent and set of feasble drectons for a constrant. Now suppose we overlay these two sets of contours on top of each other, as n Fg. 6.3. Where does the optu le? By defnton, a constraned optu s a pont for whch there s no feasble drecton whch proves the objectve. We can see that that condton occurs when the gradent for the objectve and gradent for the constrant le on top of each other. When ths happens, the set of drectons whch proves the objectve (dashed se-crcle) does not overlap wth the set of feasble drectons (sold se-crcle.)
Chapter 6: Constraned Optzaton Fg. 6.3 An optu for one bndng constrant occurs when the gradent vectors overlap. When ths condton occurs, no feasble pont exsts whch proves the objectve. Matheatcally we can wrte the above condton as f x g x (6.) where s a postve constant. Now consder a case where there are two bndng constrants at the soluton, as shown n Fg. 6.4 Fg. 6.4 wo bndng constrants at an optu. As long as the objectve gradent s wthn the cone of the constrant gradents, no feasble pont exsts whch proves the objectve. We see that the objectve gradent vector s contaned nsde the constrant gradent vectors. If the objectve gradent vector s wthn the constrant gradent vectors, then no 3
Chapter 6: Constraned Optzaton drecton exsts whch sultaneously proves the objectve and ponts n the feasble regon. We can state ths condton atheatcally as: f x g x g x (6.) where, as wth the sngle constrant case, and are postve constants. Havng graphcally otvated the developent of the an atheatcal condtons for a constraned optu, we are now ready to state these condtons..3 he Kuhn-ucker Condtons he Kuhn-ucker condtons are the necessary condtons for a pont to be a constraned local optu, for ether of the general probles gven below. (he K- equatons also work for an unconstraned optu, as we wll explan later.) If x s a local ax for: Max s.t.: f x (6.3) 0,, 0,, g x b k (6.4) g x b k (6.5) Or f x s a local n for: Mn s.t.: f x (6.6) 0,, 0,, g x b k (6.7) g x b k (6.8) and f the constrant gradents at the optu, g x, are ndependent, then there exst λ, called Lagrange ultplers, such that x and λ satsfy the followng syste of equatons, g x b (6.9) s feasble,, g g b 0,, k f x x 0 (6.0) x (6.) 0,, k (6.) unrestrcted for k,, (6.3) or 4
Chapter 6: Constraned Optzaton Note n the above equatons,,, k ndcates nequalty constrants, k,, ndcates equalty constrants, and,, ndcates all constrants. Just as wth the necessary condtons for an unconstraned optu, the K- condtons are necessary but not suffcent condtons for a constraned optu. We wll now explan each of these condtons. Equaton (6.9) requres that a constraned optu be feasble wth respect to all constrants. Equaton (6.0) requres the objectve functon gradent to be a lnear cobnaton of the constrant gradents. hs nsures there s no drecton that wll sultaneously prove the objectve and satsfy the constrants. Equaton (6.) enforces a condton known as copleentary slackness. Notce that ths condton s for the nequalty constrants only. hs condton states that ether an nequalty constrant s bndng, or the assocated Lagrange ultpler s zero. Essentally ths eans that nonbndng nequalty constrants drop out of the proble. Equaton (6.) states that the Lagrange ultplers for the nequalty constrants ust be postve. Equaton (6.3) states that the Lagrange ultplers for the equalty constrants can be ether postve or negatve. Note that (6.0) above, whch s gven n vector for, represents a syste of n equatons. We can rewrte (6.0) as: f g g g 0 x x x x f g g g 0 x x x x n n n n (6.4) We note there s a Lagrange ultpler,, for every constrant. Recall, however, that f the constrant s not bndng then ts Lagrange ultpler s zero, fro (6.). aken together, the K- condtons represent +n equatons n +n unknowns. he equatons are the n equatons gven by (6.4) (or (6.0)) and the constrants ( (6.9)). he unknowns are the n eleents of the vector x and the eleents of the vector 5
Chapter 6: Constraned Optzaton.4 Exaples of the K- Condtons.4. Exaple : An Equalty Constraned Proble Usng the K- equatons, fnd the optu to the proble, Mn f x x 4x s.t. g: 3xx A pcture of ths proble s gven below: Fg. 6.5 Contours of functons for Exaple. Snce the constrant s an equalty constrant, we know t s bndng, so the Lagrange ultpler wll be non-zero. Wth two varables and one constrant, the K- equatons represent three equatons n three unknowns. he K- condtons can be wrtten: f g x x f g x x g x 0 b 0 evaluatng these expressons: 0 6
Chapter 6: Constraned Optzaton 4x 3 0 8x 0 3x x 0 whch we can wrte n atrx for as: 4 0 3x 0 0 8 x 0 3 0 he soluton to ths syste of equatons s x 3.77, x.0909, 4.3636. he value of the objectve at ths pont s f 6.8. hs optu occurs where the gradent vectors of the constrant and objectve overlap, just as ndcated by the graphcal dscusson. We should verfy to ake sure ths s a constraned n and not a constraned ax, snce the K- equatons apply at both. Because the objectve functon for ths proble s quadratc and the constrant s lnear, the K- equatons are lnear and thus easy to solve. We call a proble wth a quadratc objectve and lnear constrants a quadratc prograng proble for ths reason. Usually the K- equatons are not lnear. However, the SQP algorth attepts to solve these equatons by solvng a sequence of quadratc progra approxatons to the real progra thus the nae of Sequental Quadratc Prograng..4. Exaple : An Inequalty Constraned Proble In general t s ore dffcult to use the K- condtons to solve for the optu of an nequalty constraned proble (than for a proble wth equalty constrants only) because we don t know beforehand whch constrants are bndng at the optu. hus we often use the K- condtons to verfy that a pont we have reached s a canddate optal soluton. Gven a pont, t s easy to check whch constrants are bndng. Verfy that the pont 0.7059.835 x s an optu to the proble: Mn f x x x s.t. g: x 4x Step : Put proble n proper for: Mn f x x x s.t. g x4x 0 Step : See whch constrants are bndng: 7
Chapter 6: Constraned Optzaton 0.7059 4.835-0.000 0 Snce ths constrant s bndng, the assocated Lagrange ultpler s solved for. (If t were not bndng, the Lagrange ultpler would be zero, fro copleentary slackness.) Step 3: Wrte out the Lagrange ultpler equatons represented by (6.0): g f x x x f g x x x Step 4: Substtute n the gven pont: () 0 (4) 0 0.7059 (6.5).835 4 (6.6) Fro (6.5),.48 Fro (6.6),.48 Snce these 's are consstent and postve, the above pont satsfes the K- equatons and s a canddate optal soluton..4.3 Exaple 3: Another Inequalty Constraned Proble Gven the proble: See f x 0 3 Mn f x x x s.t. g x x x g x x x 90 0 satsfes the K condtons. Graphcally the proble looks lke, 8
Chapter 6: Constraned Optzaton Fg. 6.6. Contour plot and proposed pont for Exaple 3. At the proposed pont constrant g s bndng; g s not. Step : Change proble to be n the for of (6.3-6.5): Max f x x x s.t. gx x x g x x x : 90 : 0 Step : See whch constrants are bndng: In ths case we can check constrants graphcally. Because fro (6.). However, s solved for snce g x s bndng. g x s not bndng, 0 Step 3: Wrte out the Lagrange ultpler equatons represented by (6.0): f g g x ( x) 0 x x x f g g x 0 x x x (6.7) (6.8) 9
Chapter 6: Constraned Optzaton Step 4: Substtute n the gven pont: At 0 3 x, (6.7) vanshes; fro (6.8): 3 6 so a vald set of s,.e., 0 6 has been found and the K condtons are satsfed. hs s therefore a canddate optal soluton..4.4 Exaple 4: Another Pont for the Sae Proble Check to see f 0 x satsfes the K condtons for the proble gven n Exaple 3 above. hs pont s shown n Fg. 6.7 Fg. 6.7 Contour plot and proposed pont for Exaple 4. Step : Change proble to be n the for of (6.3-6.5): Max x f x x s.t. gx x x g x x x : 90 : 0 0
Chapter 6: Constraned Optzaton Step : See whch constrants are bndng: Fro Fg. 6.7 we can see that 0 g x s not bndng and therefore 0 ; g Step 3: Wrte out the Lagrange ultpler equatons represented by (6.0): x s bndng so f g g x () 0 x x x f g g 0 x x x (6.9) (6.0) Step 4: Substtute n the gven pont: Substtutng x 0 fro (6.9) fro (6.0) Snce we cannot fnd a consstent set of s, and the s are negatve as well (ether condton beng enough to dsqualfy the pont), ths pont does not satsfy the Kuhn-ucker condtons and cannot be a constraned optu. Queston: In Exaples 3 and 4 we have looked at two ponts a constraned n, and pont whch s not an optu. Are there any other ponts whch would satsfy the K- condtons for ths proble? Where would a constraned ax be found? Would the K- condtons apply there?.5 Unconstraned Probles We entoned the K- condtons also apply to unconstraned probles. hs s fortunate snce a constraned optzaton proble does not have to have a constraned soluton. he optu ght be an unconstraned optu n the nteror of the constrants. If we have an unconstraned optu to a constraned proble, what happens to the K- condtons? In ths case none of the constrants are bndng so all of the Lagrange ultplers are zero, fro (6.), so (6.0) becoes, = 0 f x gx f x 0 hus we see that the K- equatons splfy to the necessary condtons for an unconstraned optu when no constrants are bndng.
Chapter 6: Constraned Optzaton 3 he Lagrangan Functon 3. Defnton It wll be convenent for us to defne the Lagrangan Functon: L x, λ f x g x b (6.) Note that the Lagrangan functon s a functon of both x and. hus the gradent of the Lagrangan functon s ade up of partals wth respect to x and : L L L L L x, λ (6.) x xn We wll evaluate soe of these partals to becoe falar wth the, he partal L x s: L f g x x x L Slarly, s gven by, x L f g x x x he partal L L s: g b It s convenent, gven these results, to splt the gradent vector of the Lagrangan functon nto two parts: the vector contanng the partal dervatves wth respect to x, wrtten L, x and the vector contanng the partals wth respect to, wrtten L. he gradent of the Lagrangan functon wth respect to x can be wrtten n vector for as: x L f x g x (6.3) so that we could replace (6.0) by L x 0 f we wshed. he gradent of the Lagrangan functon wth respect to s:
Chapter 6: Constraned Optzaton L g g x x g b b b x (6.4) 3. he Lagrangan Functon and Optalty For a proble wth equalty constrants only, we can copactly state the K- condtons as, xl L L 0 (6.5) For a proble wth nequalty constrants as well, the an condton of the K- equatons, (6.0), can be stated as, L x 0 (6.6) hus we can consder that at an optu, there exst and x such that x s a statonary pont of the Lagrangan functon. he Lagrangan functon provdes nforaton about how the objectve and bndng constrants together affect an optu. Suppose we are at a constraned optu. If we were to change the objectve functon, ths would clearly have an effect on the soluton. Lkewse, f we were to change the bndng constrants (perhaps by changng the rght hand sdes), these changes would also affect the value of the soluton. he Lagrangan functon tells how these changes trade-off aganst each other, x λ x x L, f g b he Lagrange ultplers serve as weghtng factors between the ndvdual constrants and the objectve. Approprately, the ultplers have unts of (objectve functon/constrant functon). hus f our objectve had unts of pounds, and constrant had unts of nches, Lagrange ultpler would have unts of pounds per nch. 3.3 Interpretng Values of Lagrange Multplers hus far we have solved for Lagrange ultplers, but we have not attached any sgnfcance to ther values. We wll use the Lagrangan functon to help us nterpret what ther values ean. We wll start wth the Lagrangan functon at an optu: 3
Chapter 6: Constraned Optzaton L x, λ f x g b x (6.7) Suppose now we consder the rght-hand sde of constrant, b, to be a varable. How does df the optal soluton change as we change b? o answer ths queston, we need to fnd db. hat s, we need to fnd how the optal value of the objectve changes as we change the rght hand sde, b. he Lagrangan functon, whch relates how constrants and the objectve nteract at the optu, can gve us ths nforaton. We wll be concerned only wth sall perturbatons at the optu. hs allows us to gnore nonbndng nequalty constrants, whch wll be treated as f they were not there. hus nstead of constrants, we wll have constrants, whch s the set of equalty and bndng nequalty constrants. At an optu, the value of L becoes the sae as the value of f. hs s because all of the ters n braces go to zero, = 0 L x, λ f x g b x f x df dl snce all constrants n our set are bndng. At the optu therefore,. db db As we change b, we would expect x and to change, so we need to consder x and x b, λ b. hen by the chan rule: theselves to be functons of b,.e., df db db b b b dl x L xl λ L (6.8) At the optu xl 0 and L 0, leavng only Fro the Lagrangan functon, hus we have the result, L, b L. b df (6.9) db he Lagrange ultplers provde us wth senstvty nforaton about the optal soluton. hey tell use how the optal objectve value would change f we changed the rght-hand sde of the constrants. hs can be very useful nforaton, tellng us, for exaple, how we 4
Chapter 6: Constraned Optzaton could expect the optal weght of a truss to change f we relaxed the rght-hand sde of a bndng stress constrant (.e. ncreased the allowable value of the stress constrant). Cauton: he senstvty nforaton provded by the Lagrange ultplers s vald only for sall changes about the optu (snce for nonlnear functons, dervatves change as we ove fro pont to pont) and assues that the sae constrants are bndng at the perturbed optu. 3.3. Exaple 5: Interpretng the Value of the Lagrange Multplers In Exaple, Secton.4., we solved the followng proble Mn f x x 4x s.t. g: 3x x We found the optal soluton to be: x 3.77, x.0909, 4.3636, at whch pont f 6.8. What would be the expected change n the objectve be f we ncreased the rght-hand sde of the constrant fro to 3? Fro (6.9), f b For b, the change n the objectve should be approxately 4.36. If we change the rght hand sde and re-optze the proble, the new optu s, x 3.5454, x.88, 4.77, at whch pont f 30.7. he actual change n the objectve s 4.54. (Indeed, t s the average of the two 's.) hus, wthout optzng, the Lagrange ultpler provdes an estate of how uch the objectve would change per unt change n the constrant rght hand sde. hs helps us evaluate how senstve the optu s to changes. Soetes the objectve represents proft, and the rght hand sde of a constrant s vewed as a resource whch can be purchased. he value of the Lagrange ultpler s a breakpont between realzng a net ncrease n proft or a net loss. If, for a bndng constrant, we can purchase ore rght hand sde for less than the Lagrange ultpler, net proft wll be postve. If not, the cost of the resource wll outwegh the ncrease n proft. 3.4 Necessary and Suffcent Condtons he K- Condtons we have presented n prevous sectons are necessary condtons for a constraned optu. hat s, for a pont to be a canddate optal soluton, t ust be possble to fnd values of that satsfy (6.9)-(6.3). If we cannot fnd such, then the canddate pont cannot be a constraned optal soluton. 5
Chapter 6: Constraned Optzaton Note, however, that as part of the K condtons we requre the constrant gradents, g x, to be ndependent at the optal soluton; otherwse t s possble, although unlkely, that we could have a pont be a constraned optu and not satsfy the K condtons. If a pont satsfes the K condtons, then t s a canddate optal soluton. As we have seen, the necessary condtons can hold at a constraned ax, constraned n, or a pont that s nether. An exaple showng how ths ght occur s gven below: A, C - Locally Constraned Opta B - Saddle Pont Decreasng Objectve X A B K Condtons can be satsfed at ponts A, B, and C. Infeasble Space C X Fg. 6.8. Ponts where the K- equatons would be satsfed. For an unconstraned optu we saw that suffcent condtons for a nu were that f 0 and, the Hessan, f ( x ), s postve defnte. Lkewse, for a constraned optu, suffcent condtons for a pont to be a constraned nu are the K- equatons are satsfed (6-9-6.3) and the Hessan of the Lagrangan L, x x λ, s postve defnte, where, functon wth respect to x, f g L x, λ x x (6.30) x Soe further dscusson s needed, however. If we wrte the condton of postve defnteness as, x he vectors y ust satsfy, y L x, λ y 0 (6.3) Jx () y 0 (6.3) 6
Chapter 6: Constraned Optzaton Where Jx ( ) s the Jacoban atrx of the constrants (atrx whose rows are the gradents of the constrants) actve at x. hese vectors coprse a tangent plane and are orthogonal to the gradents of the actve constrants. For ore nforaton about the suffcent condtons, see Luenberger, (984), Fletcher (987) or Edgar et al. (00). 4 References Fletcher, R., Practcal Methods of Optzaton nd Ed., Wley, 987. Luenberger, D. G., Lnear and Nonlnear Prograng, nd Ed, Addson Wesley, 984 Edgar,. F., Helblau, D. M., Lasdon, L. S., Optzaton of Checal Processes, nd Ed., McGraw-Hll, 00. 7