337. KKT Conditions

Conditions that a solution must satisfy in order to be optimal for a nonlinear optimization problem

Conditions are necessary for optimality, and sufficient if:

337.0.1. Setup

min𝑥𝑛𝑓(𝑥)𝑠.𝑡.𝑔𝑖(𝑥)0𝑖=1,,𝑚𝑗(𝑥)=0𝑗=1,,𝑝

337.0.2. KKT Multipliers

We introduce:

The Lagrangian is:

ℒ︀(𝑥,𝜆,𝜇)=𝑓(𝑥)+𝑖=1𝑚𝜆𝑖𝑔𝑖(𝑥)+𝑗=1𝑝𝜇𝑗𝑗(𝑥)

For 𝑛 variables and 𝑚 constrains:

337.0.3. KKT Conditions

At local optimum 𝑥 there exists multipliers (𝜆,𝜇) such that:

  1. Stationarity

Minimization:

𝑓(𝑥)+𝑖=1𝑚𝜆𝑖𝑔𝑖(𝑥)+𝑗=1𝑝𝜇𝑗𝑗(𝑥)=0

Stationarity is like a generalized version of “set the derivative to zero”, but accounting for the constraints

  1. Primal feasibility
𝑔𝑖(𝑥)0𝑗(𝑥)=0

The solution must satisfy all the original constraints — it must lie inside the feasible region

  1. Dual Feasibility
𝜆𝑖0𝑖
  1. Complementary Slackness
𝜆𝑖𝑔𝑖(𝑥)=0𝑖

Complementary slackness only applies to inequalities

Inactive (non-binding) constraint

𝑔𝑖(𝑥)<0𝜆𝑖=0

Active (binding) constraint

𝑔𝑖(𝑥)=0𝜆𝑖0
Example
min𝑥12+𝑥22𝑠.𝑡.𝑥122𝑥22

Step 1. Standardize constraints

Constraints already in the form 𝑔(𝑥)0 for minimization

Sign convention 𝜆0

Step 2. Formulate Lagrangian

ℒ︀(𝑥1,𝑥2,𝜆)=𝑥12+𝑥22+𝜆(𝑥122𝑥22)

Step 3. Stationarity

𝑥ℒ︀=[𝜕ℒ︀𝜕𝑥1𝜕ℒ︀𝜕𝑥2]=[2𝑥1+𝜆𝑥12𝑥2𝜆]=0

Solve for 𝑥1:

2𝑥1+𝜆𝑥1=0𝑥1(2+𝜆)=0𝑥1(2+𝜆)=02+𝜆𝑥1=0

Solve for 𝑥2

2𝑥2𝜆=0𝑥2=𝜆2

Candidate point:

(𝑥1,𝑥2)=(0,𝜆2)

Step 4. Primal Feasibility

Constraint:

𝑔(𝑥1,𝑥2)=𝑥122𝑥220

Substitute 𝑥1=0 and 𝑥2=𝜆2

022𝜆220𝜆220𝜆22𝜆4

Step 5. Dual Feasibility

𝜆0

Step 6. Complementary Slackness

Constraint:

𝑔(𝑥1,𝑥2)=𝑥122𝑥220

Condition:

𝜆𝑔(𝑥)=0

Candidate point:

(𝑥1,𝑥2)=(0,𝜆2)

Evaluate 𝑔(𝑥):

𝜆𝑔(𝑥)=𝜆(𝑥122𝑥22)=0

Substitute 𝑥1=0 and 𝑥2=𝜆2

𝜆(022𝜆22)=0𝜆(𝜆22)=0

Solve:

𝜆(𝜆22)=0𝜆=0or𝜆=4

But because of Dual Feasibility 𝜆0, so 𝜆=0

Constraint is non-binding at optimum:

  • 𝜆=0

  • 𝑔(𝑥)<0

𝑔(𝑥)=𝑥122𝑥220022𝜆220022022020

Step 7. Solve for Optimum

(𝑥1,𝑥2)=(0,𝜆2)=(0,02)=(0,0)

Step 8. Check Convexity

Example
min𝑥12+𝑥22𝑠.𝑡.𝑥122𝑥21

Step 1. Standardize constraints

Constraints already in the form 𝑔(𝑥)0 for minimization

Sign convention 𝜆0

Step 2. Formulate Lagrangian

ℒ︀(𝑥1,𝑥2,𝜆)=𝑥12+𝑥22+𝜆(𝑥122𝑥2+1)

Step 3. Stationarity

𝑥ℒ︀=[𝜕ℒ︀𝜕𝑥1𝜕ℒ︀𝜕𝑥2]=[2𝑥1+𝜆𝑥12𝑥2𝜆]

Solve for 𝑥1:

2𝑥1+𝜆𝑥1=0𝑥1(2+𝜆)=0𝑥1=02+𝜆𝑥1=0

Solve for 𝑥2:

2𝑥2𝜆=02𝑥2=𝜆𝑥2=𝜆2

Candidate point:

(𝑥1,𝑥2)=(0,𝜆2)

Step 4. Primal Feasibility

Constraint:

𝑔(𝑥1,𝑥2)=𝑥122𝑥2+10

Substitute 𝑥1=0 and 𝑥2=𝜆2:

𝑥122𝑥2+10022𝜆2+10𝜆2+10𝜆21𝜆2

Step 5. Dual Feasibility

𝜆0

Step 6. Complementary Slackness

Constraint:

𝑔(𝑥1,𝑥2)=𝑥122𝑥2+10

Condition:

𝜆𝑔(𝑥)=0

Candidate point:

(𝑥1,𝑥2)=(0,𝜆2)

Evaluate 𝑔(𝑥):

𝜆𝑔(𝑥)=𝜆(𝑥122𝑥2+1)=0

Substitute 𝑥1=0 and 𝑥2=𝜆2

𝜆(022𝜆2+1)=0𝜆(𝜆2+1)=0

Solve:

𝜆(𝜆2+1)=0𝜆=0or𝜆=2

But because of Primal Feasibility, if 𝜆=0, (𝑥1,𝑥2)=(0,0) and 𝑔(0,0)=10, thus 𝜆=2

Constraint is binding at optimum:

  • 𝜆=2

  • 𝑔(𝑥)=0

𝑔(𝑥)=𝑥122𝑥2+1=0022𝜆2+1=002222+1=00=0

Step 7. Solve for Optimum

(𝑥1,𝑥2)=(0,𝜆2)=(0,22)=(0,1)

Step 8. Check Convexity

337.0.4. Calculating Lagrangian Multipliers

To find the multipliers (𝜆,𝜇) and the optimal point 𝑥, solve the KKT system of equations:

{𝑥ℒ︀(𝑥,𝜆,𝜇)=0𝑔𝑖(𝑥)0𝑖=1,,𝑚𝑗(𝑥)=0𝑖=1,,𝑝𝜆𝑖0𝑖=1,,𝑚𝜆𝑖𝑔𝑖(𝑥)=0𝑖=1,,𝑚
Example

Retailer Maximizing Profit under a Capacity Constraint

A retailer sells product 1 and 2 with quantities 𝑞1 and 𝑞2. For product 𝑖 the market-clearing prices are:

𝑝𝑖=𝑎𝑖𝑏𝑖𝑞𝑖𝑖=1,2

Where 𝑎𝑖,𝑏𝑖>0.

The retailer maximizes total profit subject to a capacity constraint:

𝑞1+𝑞2𝐾𝑞1,𝑞20
  1. Formulation
max𝑞1,𝑞20𝑞1(𝑎1𝑏1𝑞1)𝑝1+𝑞2(𝑎2𝑏2𝑞2)𝑝2𝑠.𝑡.𝑞1+𝑞2𝐾

The objective is concave because

2𝑓(𝑞1,𝑞2)=[2𝑏1002𝑏2]

is positive semi-definite.

The unconstrained FOC solution is:

𝑞1=𝑎12𝑏1,𝑞2=𝑎22𝑏2

If 𝑞1+𝑞2𝐾, this solution is feasible.

  1. Lagrangian

Introduce KKT multiplier 𝜆0 for the inequality constraint:

ℒ︀(𝑞1,𝑞2,𝜆)=𝑞1(𝑎1𝑏1𝑞1)+𝑞2(𝑎2𝑏2𝑞2)𝑓+𝜆(𝐾𝑞1𝑞2)𝑏𝑔
  1. KKT Conditions

1. Stationarity

𝜕𝜕𝑞1ℒ︀=𝑎12𝑏1𝑞1𝜆=0𝜕𝜕𝑞2ℒ︀=𝑎22𝑏2𝑞2𝜆=0

2. Primal Feasibility

𝑞1+𝑞2𝐾𝑞1,𝑞20

3. Dual Feasibility

𝜆0

4. Complementary Slackness

𝜆(𝐾𝑞1𝑞2)=0
  1. Solving KKT system

Case 1: Unconstrained (𝜆=0)

max𝑞1,𝑞20𝑓(𝑞1,𝑞2)=𝑞1(𝑎1𝑏1𝑞1)+𝑞2(𝑎2𝑏2𝑞2)𝑓(𝑞1,𝑞2)=𝑎1𝑞1𝑏1𝑞12+𝑎2𝑞2𝑏2𝑞22

First-Order Condition

𝜕𝑓𝜕𝑞1=𝑎12𝑏1𝑞1𝜕𝑓𝜕𝑞2=𝑎22𝑏2𝑞2

Set derivatives to 0 (stationarity)

𝑎12𝑏1𝑞1=0𝑞1=𝑎12𝑏1𝑎22𝑏2𝑞2=0𝑞2=𝑎22𝑏2

Unconstrained Solution:

𝑞1=𝑎12𝑏1𝑞2=𝑎22𝑏2

The second derivative check confirms it’s a maximum because:

𝜕2𝑓𝜕𝑞12=2𝑏1<0𝜕2𝑓𝜕𝑞22=2𝑏2<0

Feasible if

𝑎12𝑏1+𝑎22𝑏2𝐾

Case 2: Binding Constraint (𝜆>0)

We now include the capacity constraint:

𝑞1+𝑞2=𝐾

If it binds (active) then

𝑞1+𝑞2=𝐾

Lagrangian

ℒ︀(𝑞1,𝑞2,𝜆)=𝑞1(𝑎1𝑏1𝑞1)+𝑞2(𝑎2𝑏2𝑞2)𝑓(𝑞1,𝑞2)+𝜆(𝐾𝑞1𝑞2)𝑏𝑔(𝑞1,𝑞2)

First-Order Condition

𝜕ℒ︀𝜕𝑞1=𝑎12𝑏1𝑞1𝜆𝜕ℒ︀𝜕𝑞2=𝑎22𝑏2𝑞2𝜆𝜕ℒ︀𝜕𝜆=𝐾𝑞1𝑞2

Set derivatives to 0 (stationarity)

𝑎12𝑏1𝑞1𝜆=0𝑎22𝑏2𝑞2𝜆=0𝐾𝑞1𝑞2=0

When we take the derivative of the Lagrangian with respect to the multiplier 𝜆 we recover the constraint itself.

Solve system of equations

{𝑎12𝑏1𝑞1𝜆=0𝑎22𝑏2𝑞2𝜆=0𝑞1+𝑞2=𝐾

Solution:

𝑞1=2𝑏2𝐾+𝑎1𝑎22(𝑏1+𝑏2)𝑞2=2𝑏1𝐾+𝑎2𝑎12(𝑏1+𝑏2)

Feasible if

𝑎12𝑏1+𝑎22𝑏2>𝐾
  1. Optimal Solution
(𝑞1,𝑞2)={(𝑎12𝑏1,𝑎22𝑏2)if𝑎12𝑏1+𝑎22𝑏2𝐾(2𝑏2𝐾+𝑎1𝑎22(𝑏1+𝑏2),2𝑏1𝐾+𝑎2𝑎12(𝑏1+𝑏2))otherwise

Intuition:

  • If capacity 𝐾 is large enough, the retailer produces unconstrained quantities.
  • If 𝐾 is tight, the total production hits the limit, and the optimal quantities are shared according to the relative parameters 𝑎𝑖,𝑏𝑖
Example
max𝑓(𝑥)=𝑥1𝑥2𝑠.𝑡.𝑔1(𝑥)=𝑥12+𝑥224𝑔2(𝑥)=𝑥12(𝑥2+2)24

This NLP is nonconvex

1️⃣ Lagrangian

Introduce multipliers 𝜆1,𝜆20 for the inequalities. The Lagrangian is

ℒ︀(𝑥1,𝑥2,𝜆)=𝑥1𝑥2𝑓+𝜆1(4𝑥12𝑥22)𝑔1+𝜆2(4+𝑥12+(𝑥2+2)2)𝑔2

The solution 𝑥̄ is a local maximum only if there exists 𝜆 such that

2️⃣ KKT Conditions

  1. Primal feasibility
𝑥12+𝑥224(PF-1)𝑥12(𝑥2+2)24(PF-2)
  1. Dual Feasibility
𝜆10(DFS-1)𝜆20(DFS-2)
  1. Stationarity
𝜕ℒ︀𝜕𝑥1=12(𝜆1𝜆2)𝑥1=0(DFF-1)𝜕ℒ︀𝜕𝑥2=12(𝜆1𝜆2)𝑥2+4𝜆2=0(DFF-2)
  1. Complimentary Slackness
𝜆1(4𝑥12𝑥22)=0(CS-1)𝜆2(4+𝑥12+(𝑥2+2)2)=0(CS-2)

3️⃣ Examine all 4 cases for (𝜆1,𝜆2)

Case 1. (𝜆1>0,𝜆2>0)

Step 1: Complementary Slackness

Since both multipliers are positive, the corresponding constraints must be active:

𝑥12+𝑥22=4(CS-1)𝑥12+(𝑥2+2)2=4(CS-2)

Solve this system two candidate points:

(𝑥1,𝑥2)=(3,1)and(3,1)

Step 2: Primal Feasibility

  1. For (3,1)
𝑥12+𝑥22=32+(1)24(PF-1)𝑥12(𝑥2+2)2=(3)2(1+2)24(PF-2)
  1. For (3,1)
𝑥12+𝑥22=(3)2+(1)24(PF-1)𝑥12(𝑥2+2)2=(3)2(1+2)24(PF-2)

✅ Both satisfy primal feasibility.

Step 3: Stationarity / First-order conditions (DFF)

Plug each candidate point into the gradient equations and solve the system:

12(𝜆1𝜆2)𝑥1=0(DFF-1)12(𝜆1𝜆2)𝑥2+4𝜆2=0(DFF-2)

For (3,1):

12(𝜆1𝜆2)(3)=012(𝜆1𝜆2)(1)+4𝜆2=0

Solving the system we get:

𝜆1=14+143𝜆2=14143

✅ Both 𝜆1,𝜆20 dual feasibility satisfied.

For (3,1):

12(𝜆1𝜆2)(3)=0𝜆1𝜆2=12312(𝜆1𝜆2)(1)+4𝜆2=0𝜆2=14+143

Solving the system we get:

𝜆1=14143𝜆2=14+143

✅ Both 𝜆1,𝜆20 dual feasibility satisfied.

✅ Both (3,1) and (3,1) satisfy dual feasibility both are KKT points.

Case 2. (𝜆1>0,𝜆2=0)

Step 1. Assumptions (Activity / Inactivity)

  • Constraint 1: Active (𝑥12+𝑥22=4)

  • Constraint 2: Inactive (𝑥12+(𝑥2+2)2=4)

Step 2. Stationarity Condition

The Lagragian:

ℒ︀(𝑥1,𝑥2,𝜆1,𝜆2)=(𝑥1𝑥2)+𝜆1(4𝑥12𝑥22)+𝜆2(4+𝑥12+(𝑥2+2)2)

Compute the gradients with respect to 𝑥1 and 𝑥2:

{𝜕ℒ︀𝜕𝑥1=12𝜆1𝑥1+2𝜆2𝑥1=0𝜕ℒ︀𝜕𝑥2=12𝜆1𝑥2+2𝜆2(𝑥2+2)=0

Since 𝜆2=0, the equations simplify to:

{12𝜆1𝑥1=012𝜆1𝑥2=0

Simplify:

{𝑥1=12𝜆1𝑥2=12𝜆1𝑥1=𝑥2

Step 3. Substitute into Active Constraint

Using 𝑥12+𝑥22=4 and 𝑥2=𝑥1:

𝑥12+(𝑥1)2=2𝑥12=4𝑥12=2𝑥1=±2,𝑥2=2

Two candidate solutions 𝑥1 and 𝑥2:

(2,2)and(2,2)

Step 4. Solve for 𝜆1 and enforce 𝜆1>0

1+2𝜆1𝑥1=0𝜆1=12𝑥1

Substitute (𝑥1,𝑥2) into the stationarity condition:

1+2𝜆1𝑥1
  • For (𝑥1,𝑥2)=(2,2):
𝜆1=122>0Valid(𝜆10)
  • For (𝑥1,𝑥2)=(2,2):
𝜆1=12(2)>0Reject(violates𝜆10)

So, the surviving candidate is:

(𝑥1,𝑥2)=(2,2),𝜆1=122,𝜆2=0

Step 5. Check the (inactive) constraint 2 for primal feasibility

Constraint 2:

𝑔2(𝑥)=𝑥12(𝑥2+2)2+40

Plug 𝑥1=2 and 𝑥2=2:

𝑔2(𝑥)=(2)2(2+2)2+4>0

❌ This violates the inequality 𝑔2(𝑥)0

(𝑥1,𝑥2)=(2,2) is rejected because it violates the inequality 𝑔2(𝑥)0

(𝑥1,𝑥2)=(2,2) is rejected because it gives 𝜆<0

Case 3. (𝜆1=0,𝜆2>0)

Step 1. Assumptions (Activity / Inactivity)

  • Constraint 1: Inactive (𝑥12+𝑥22=4)

  • Constraint 2: Active (𝑥12+(𝑥2+2)2=4)

Step 2. Stationarity Condition

The Lagragian:

ℒ︀(𝑥1,𝑥2,𝜆1,𝜆2)=(𝑥1𝑥2)+𝜆1(4𝑥12𝑥22)+𝜆2(4+𝑥12+(𝑥2+2)2)

Compute the gradients with respect to 𝑥1 and 𝑥2:

{𝜕ℒ︀𝜕𝑥1=12𝜆1𝑥1+2𝜆2𝑥1=0𝜕ℒ︀𝜕𝑥2=12𝜆1𝑥2+2𝜆2(𝑥2+2)=0

Since 𝜆1=0, the equations simplify to:

{1+2𝜆2𝑥1=01+2𝜆2(𝑥2+2)=0

Simplify:

{𝑥1=12𝜆2𝑥2=12𝜆22𝑥1=𝑥2

Step 3. Substitute into Active Constraint

𝑥12+(𝑥2+2)2=4

Substituting 𝑥1 and 𝑥2:

(12𝜆2)2+(12𝜆22+2)2=4𝜆2=±122

Two candidate solutions 𝑥1 and 𝑥2:

(2,22)and(2,22)

Substitute (𝑥1,𝑥2) into the stationarity condition:

1+2𝜆2(𝑥2+2)
  • For (𝑥1,𝑥2)=(2,22):
𝜆2=122<0Reject(violates𝜆10)
  • For (𝑥1,𝑥2)=(2,22):
𝜆2=122>0Valid(𝜆10)

So, the surviving candidate is:

(𝑥1,𝑥2)=(2,22),𝜆1=0,𝜆2=122

Step 5. Check the (inactive) constraint 1 for primal feasibility

Constraint 1:

𝑔1(𝑥)=𝑥12+𝑥224

Plug 𝑥1=2 and 𝑥2=22:

𝑔1(𝑥)=(2)2(22)2+40

✅ Satisfies primal feasibility. Constraint 1 is inactive (strict inequality), as required.

(𝑥1,𝑥2)=(2,22) is a valid KKT point under this assumption.

(𝑥1,𝑥2)=(2,22) is rejected because it gives 𝜆<0

Case 4. (𝜆1=0,𝜆2=0)

Step 1. Assumptions (Activity / Inactivity)

  • Both multipliers are zero: 𝜆1=0,𝜆2=0
  • No constraints are forced to be active by complementary slackness

Step 2. Stationarity Condition

With 𝜆1=0 and 𝜆2=0, the stationarity equations simplify to:

{12(𝜆1𝜆2)𝑥1=1=012(𝜆1𝜆2)𝑥2+4𝜆2=1=0

Step 3. Stationary Check

Both equations 1=0 and 1=0 are impossible

No solution exists under this assumption

❌ No KKT points exist

4️⃣ Summary

  • 𝜆1>0 and 𝜆2>0:

    • (3,1)
    • (3,1)
  • 𝜆1=0 and 𝜆2>0:

    • (2,22)

These are the only candidates for local maxima (and thus global maxima)

Necessary, but not sufficient for non-convex NLPs

337.0.5. Sensitivity Analysis and Shadow Prices

Lagrange multipliers measure how senitive the objective function is to changes in the constraints

337.0.5.1. Shadow Prices

The shadow price of a constraint is the value of the corresponding Lagrange multiplier at the optimal solution:

ShadowPrice𝑖=𝜆𝑖

It measures how much the objective function would improve if the constraint were relaxed by one unit. For example:

𝑥1+𝑥212𝑥1+𝑥213

The corresponding shadow price tells us the change in the optimal objective due to this relaxation. The magnitude of the Lagrange multiplier reflects the influence of its associated constraint on the optimal solution.

Constraint StatusShadow Price (𝜆)Impact on Objective
Binding / Active𝑔𝑖(𝑥)=0𝜆>0Relaxing improves objective
Inactive / Slack𝑔𝑖(𝑥)<0𝜆=0Relaxing has no effect
Example

Primal NLP

𝑧=max𝑥𝑛{𝑓(𝑥)|𝑔𝑖(𝑥)𝑏𝑖𝑖=1,,𝑚}

Lagrange Dual Program

𝑤=min𝜆0𝑧𝐿(𝜆)=min𝜆0{max𝑥𝑛𝑓(𝑥)+𝑖=1𝑚𝜆𝑖[𝑏𝑖𝑔𝑖(𝑥)]}

Convexity

The Lagrange Dual Program function 𝑧𝐿(𝜆) is always convex over 𝜆[0,)𝑛

Weak Duality

𝑤𝑧𝜆0

Strong Duality

𝑤=𝑧 is the primal NLP is a “regular” convex program

Example
𝑧=max𝑥1+𝑥2𝑠.𝑡.𝑥12+𝑥228𝑥26

Optimal solution

𝑥=(2,2)𝑧=4

Lagragian relaxation

𝑤=min𝜆10,𝜆20𝑧𝐿(𝜆)=min𝜆10,𝜆20max𝑥2ℒ︀(𝑥|𝜆)

Where

ℒ︀(𝑥|𝜆)=𝑥1+𝑥2+𝜆1(8𝑥12+𝑥22)+𝜆2(6𝑥2)

To solve the Lagrange dual program:

max𝑥2ℒ︀(𝑥|𝜆)max𝑥2{𝑥1+𝑥2+𝜆1(8𝑥12𝑥22)+𝜆2(6𝑥2)}

First-order condition:

𝑥1=12𝜆1and𝑥2=1𝜆22𝜆1

Plugging into ℒ︀(𝑥|𝜆):

𝑧𝐿(𝜆)=max𝑥2ℒ︀(𝑥|𝜆)=1+(1𝜆2)24𝜆1+8𝜆1+6𝜆2

The Lagrangian dual program is to look for 𝜆10 and 𝜆20 to minimize 𝑧𝐿(𝜆)

The Lagrange dual program:

min𝜆10,𝜆201+(1𝜆2)24𝜆1+8𝜆1+6𝜆2

𝑧𝐿(𝜆) is convex over (0,)2:

𝑧𝐿(𝜆)=[1+(1𝜆2)24𝜆12+81𝜆22𝜆1+6],2𝑧𝐿(𝜆)=[1+(1𝜆2)22𝜆121𝜆22𝜆121𝜆22𝜆1212𝜆1]

Since:

1+(1𝜆2)22𝜆12>0 and det(2𝑧𝐿(𝜆))=12𝜆1>0, 𝑧𝐿(𝜆) is convex

To solve

min𝜆10,𝜆201+(1𝜆2)24𝜆1+8𝜆1+6𝜆2

Apply KKT conditions

𝜆1 cannot be binding (𝜆1=0), because division by 0, so ignore it

Let 𝜇0 be the Lagrange multiplier for 𝜆20, the Lagrange is

1+(1𝜆2)24𝜆1+8𝜆1+6𝜆2𝜇𝜆2

The KKT condition requires an optional solution to satisfy (FOC)

1+(1𝜆2)24𝜆12+8=0,1𝜆22𝜆1+6𝜇=0,𝜇𝜆=0
  • Suppose 𝜇>0

    • Implies 𝜆2=0

    • 1+(1𝜆2)24𝜆12+8=0 requires 𝜆1=14

    • 1𝜆22𝜆1+6𝜇=0 requires 𝜇=4, which is feasible

  • Suppose 𝜇=0

    • 1+(1𝜆2)24𝜆12+8=0 requires 𝜆2=112𝜆1

    • Plugging into 1+(1𝜆2)24𝜆12+8=0 results on 1+112𝜆12 which is impossible

  • The only KKT point is (𝜆1,𝜆2)=(14,0)

  • Plugging into 𝑧𝐿(𝜆) gives us 𝑤=4 which exactly equals 𝑧

So strong duality holds, 𝑤=𝑧

337.0.6. Lagrange Duality and LP Duality

LP duality is a special case of Lagrange Duality

For a general LP

max𝑐𝑇𝑥𝑠.𝑡.𝐴𝑥=𝑏𝑥0

Where 𝐴𝑚×𝑛 (𝑚 constraints and 𝑛 variables)

Let 𝜆𝑚 be the Lagrange multipliers, the Lagrange relaxation is

𝑧(𝜆)=max𝑥0𝑐𝑇𝑥+𝜆𝑇(𝑏𝐴𝑥)=𝐴𝑇𝑏+max𝑥0(𝑐𝑇𝜆𝑇𝐴)𝑥

Because of equality constraint, 𝜆 is unrestricted in sign

Lagrange dual program

min𝜆𝑧𝐿(𝜆)=min𝜆{𝜆𝑇𝑏+max𝑥0(𝑐𝑇𝜆𝑇𝐴)𝑥}

Search for 𝜆 that minimizes 𝑧𝐿(𝜆)

Dual program is only meaningful if 𝑐𝑇𝜆𝑇𝐴, because if (𝑐𝑇)𝑖>(𝜆𝑇𝐴)𝑖 for any 𝑖, max𝑥0(𝑐𝑇𝜆𝑇𝐴)𝑥 will be unbounded because we can increase 𝑥𝑖 to

Thus, no choice of 𝜆 that violates 𝑐𝑇𝜆𝑇𝐴 may be optimal to the Lagrange dual program

The Lagrange dual program

min𝜆𝑧(𝜆)=min𝜆𝑖𝑐𝑇𝜆𝑇𝐴{𝜆𝑇𝑏+max𝑥0(𝑐𝑇𝜆𝑇𝐴)𝑥}

If 𝜆 satisfies 𝑐𝑇𝜆𝑇𝐴 thenwe know max𝑥0(𝑐𝑇𝜆𝑇𝐴)𝑥=0

The Lagrange dual program becomes

min𝜆urs𝜆𝑇𝑏𝑠.𝑡.𝜆𝑇𝐴𝑐𝑇

Which is exactly the dual LP of

max𝑥0𝑐𝑇𝑥𝑠.𝑡.𝐴𝑥=𝑏
Example
min(𝑥14)2+(𝑥22)2𝑠.𝑡.2𝑥1+𝑥26
  1. What are the leading principle minors of the Hessian matrix of the objective function?
𝑓(𝑥1,𝑥2)=[2(𝑥14)2(𝑥22)]2𝑓(𝑥1,𝑥2)=[2002]

2 and 4

ℒ︀(𝑥1,𝑥2|𝜆)=(𝑥14)2+(𝑥22)2+𝜆(62𝑥22)

𝜆0

  1. According to the FOC of the Lagragian, what is a necessary condition for an optimal solution

Case 1. 𝜆>0

Constraint active: 2𝑥226

FOC (gradient w.r.t. 𝑥1 and 𝑥2):

ℒ︀(𝑥1,𝑥2|𝜆)=[2(𝑥14)2(𝑥22)2𝜆]2(𝑥14)=0𝑥1=42(𝑥22)2𝜆=02𝑥242𝜆=0𝑥2=2𝜆+42𝑥2=𝜆+2𝑥1=4𝑥2=𝜆+2

Substitute into active constraint

62𝑥22=042𝑥2=042(𝜆+2)=042𝜆+4=02𝜆=0𝜆=02𝜆=0

Find 𝜆:

𝜆=0

Which violates 𝜆>0

Case 2. 𝜆=0

𝑥1=4𝑥2=𝜆+2𝑥2=0+2(𝑥1,𝑥2)=(4,2)

𝑥12𝑥2=0

Case 2. 𝜆=0

  1. What is a local optimal solution to the nonlinear program?

(𝑥1,𝑥2)=(125,65)

For a linear program, linear programming duality and Lagrange duality is equivalent (i.e., the dual programs obtained through the two ways are identical).

For an unconstrained nonlinear program, the KKT condition is equivalent to the first-order condition.

For an unconstrained nonlinear program, the KKT condition is necessary and sufficient.