37
1 Thomas Stidsen DTU-Management / Operations Research Lagrangean Methods – bounding through penalty adjustment Thomas Stidsen [email protected] DTU-Management Technical University of Denmark

Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

1Thomas Stidsen

DTU-Management / Operations Research

Lagrangean Methods– bounding through penalty adjustment

Thomas Stidsen

[email protected]

DTU-Management

Technical University of Denmark

Page 2: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

2Thomas Stidsen

DTU-Management / Operations Research

OutlineBrief introduction

How to perform Lagrangean relaxation

Subgradient techniques

Example: Setcover

Decomposition techniques and Branch andBound

Dual Ascent

Page 3: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

3Thomas Stidsen

DTU-Management / Operations Research

IntroductionLagrangean Relaxation is a technique which hasbeen known for many years:

Lagrange relaxation is invented by (surprise!)Lagrange in 1797 !

This technique has been very usefull inconjunction with Branch and Bound methods.

Since 1970 this has been the boundingdecomposition technique of choice ...

... until the beginning of the 90’ies(branch-and-price)

Page 4: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

4Thomas Stidsen

DTU-Management / Operations Research

The Beasley NoteThis lecture is based on the (excellent !) Beasleynote. The note has a practical approach to theproblem:

Emphasis on examples.

Only little theory.

Good practical advices.

All in all: This note is a good place to start if you later

need to apply Lagrangean relaxation.

Page 5: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

5Thomas Stidsen

DTU-Management / Operations Research

Given a Linear programMin:

cx

s.t.:

Ax ≥ b

Bx ≥ d

x ∈ {0, 1}How can we calculate lower bounds ? We can useheuristics to generate upper bounds, but getting(good) lower bounds is often much harder ! Theclassical approach is to create a relaxation.

Page 6: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

6Thomas Stidsen

DTU-Management / Operations Research

Requirements for relaxationThe program:min{f(x)|x ∈ Γ ⊆ Rn}

is a relaxation of:min{g(x)|x ∈ Γ′ ⊆ Rn}if:

Γ′ ⊆ Γ

For x ∈ Γ′ : f(x) ≤ g(x)

Page 7: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

7Thomas Stidsen

DTU-Management / Operations Research

Relaxation Graphically

Def f(x)

Def g(x)

f(x)

g(x)

Solutions

Objective

Page 8: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

8Thomas Stidsen

DTU-Management / Operations Research

Example of relaxation: LPWhen we perform the LP relaxation:

f(x) = g(x)

Γ′(= Z) ⊆ Γ(= R)

The classical branch-and-bound algorithm use theLP relaxation. It has the nice feature of beinggeneral, i.e. applicable to all MIP models.

Page 9: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

9Thomas Stidsen

DTU-Management / Operations Research

A very simple example Ig(x):Min:

5x

s.t.:

x ≥ 3

−x ≥ −10

x ∈ R+

Page 10: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

10Thomas Stidsen

DTU-Management / Operations Research

A very simple example IIf(x): (relaxation of g(x)Min:

5x + λ(3 − x)

s.t.:

−x ≥ −10

x ∈ R+

Page 11: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

11Thomas Stidsen

DTU-Management / Operations Research

Relaxation by removal of constraintsGiven:Min:

cx

s.t.:

Ax ≥ b

Bx ≥ d

x ∈ {0, 1}What if we instead of relaxing the domainconstraints, relax another set of constraints ? (thisalso goes for integer variables i.e. x ∈ Z

Page 12: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

12Thomas Stidsen

DTU-Management / Operations Research

Lagrangean RelaxationMin:

cx + λ(b − Ax)

s.t.:

Bx ≥ d

x ∈ {0, 1} λ ∈ R+

This is called the Lagrangean Lower BoundProgram (LLBP) or the Lagrangean dual program.

Page 13: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

13Thomas Stidsen

DTU-Management / Operations Research

Lagrangean RelaxationFirst: IS IT A RELAXATION ?

Well the feasible domain has been increased:Γ′(Ax ≥ b, Bx ≥ d) ⊆ Γ(Bx ≥ d)

Regarding the objective:Inside the original domain:f(x) = g(x) + λ(b − Ax) and since we knowλ(b − Ax) ≤ 0 ⇒ f(x) =≤ g(x)

Outside, no guarantee, but that is not aproblem !

Page 14: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

14Thomas Stidsen

DTU-Management / Operations Research

Lagrangean RelaxationWhat can this be used for ?

Primary usage: Bounding ! Because it is arelaxation, the optimal value will bound theoptimal value of the real problem !

Lagrangean heuristics, i.e. generate a “good”solution based on a solution to the relaxedproblem.

Problem reduction, i.e. reduce the originalproblem based on the solution to the relaxedproblem.

Page 15: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

15Thomas Stidsen

DTU-Management / Operations Research

Two ProblemsFacing a problem we need to decide:

Which constraints to relax (strategic choice)

How to find the lagrangean multipliers, (tacticalchoice)

Page 16: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

16Thomas Stidsen

DTU-Management / Operations Research

Which constraints to relaxWhich constraints to relax depends on two things:

Computational effort:Number of Lagrangian multipliersHardness of problem to solve

Integrality of relaxed problem: If it is integral, wecan only do as good as the straightforward LPrelaxation !

The integrality point will be dealt with theoretically

next time ! And we will see an example here.

Page 17: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

17Thomas Stidsen

DTU-Management / Operations Research

Multiplier adjustmentIn Beasley two different types are given:

Subgradient optimisation

Multiplier adjustment

Of these, subgradient optimisation is the method ofchoice. This is general method which nearly alwaysworks ! Hence, here we will only consider thismethod. Since the Beasley note more efficient (butmuch more complicated) adjustment methods hasbeen suggested.

Page 18: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

18Thomas Stidsen

DTU-Management / Operations Research

Lagrangean RelaxationWe had:

Min:cx + λ(b − Ax)

s.t.:

Bx ≥ d

x ∈ {0, 1} λ ∈ R+

Page 19: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

19Thomas Stidsen

DTU-Management / Operations Research

Problem reformulationMin: ∑

j

(cj · xj +∑

i

λi(bi − aij · xij))

s.t.:

Bx ≥ d

xj ∈ {0, 1} λi ∈ R+

Remember we want to obtain the best possible

bounding, hence we want to maximize the λ bound.

Page 20: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

20Thomas Stidsen

DTU-Management / Operations Research

The subgradientWe define the subgradient:Gi = bi −

∑j aijXj

If subgradient Gi is positive, decrease λi if Gi isnegative, increase λi

Page 21: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

21Thomas Stidsen

DTU-Management / Operations Research

Subgradient OptimisationThe sub-gradient optimisation algorithm is now:

Initialise π ∈]0, 2]Initialise λ valuesrepeat

Solve LLBP given λ values get ZLB, Xj

Calc. the subgradients Gi = bi −∑

j aijXj

Calc. step size T = π(ZUB−ZLB)∑i G2

i

Update λi = max(0, λi + TGi)until we get bored ...

Page 22: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

22Thomas Stidsen

DTU-Management / Operations Research

Example: SetcoverMin:

2x1 + 3x2 + 4x3 + 5x4

s.t.:

x1 + x3 ≥ 1

x1 + x4 ≥ 1

x2 + x3 + x4 ≥ 1

x1, x2, x3, x4 ∈ {0, 1}

Page 23: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

23Thomas Stidsen

DTU-Management / Operations Research

Relaxed SetcoverMin:

2x1 + 3x2 + 4x3 + 5x4

+ λ1(1 − x1 − x3)

+ λ2(1 − x1 − x4)

+ λ3(1 − x2 − x3 − x4)

s.t.:

x1, x2, x3, x4 ∈ {0, 1}λ ≥ 0

How can we solve this problem to optimality ???

Page 24: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

24Thomas Stidsen

DTU-Management / Operations Research

Optimization AlgorithmThe answer is so simple that we are reluctantcalling it an optimization algorithm: Choose all x’eswith negative coefficients !

What does this tell us about the strength of therelaxation ?

Page 25: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

25Thomas Stidsen

DTU-Management / Operations Research

Rewritten: Relaxed SetcoverMin:

C1x1 + C2x2 + C3x3 + C4x4 + λ1 + λ2 + λ3

s.t.:

x1, x2, x3, x4 ∈ {0, 1}λ ≥ 0

C1 = (2 − λ1 − λ2)

C2 = (3 − λ3)

C3 = (4 − λ1 − λ3)

C4 = (5 − λ2 − λ3)

Page 26: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

26Thomas Stidsen

DTU-Management / Operations Research

GAMS for Lagrange Rel. for SetcoverWHILE( counter < max_it,

CC(j)= C(j)-SUM(i, A(i,j) * lambda(i));x.L(j)=0 + 1\$(CC(j)<0);Z_LB = SUM(j, CC(j) * x.L(j)) + SUM(i, lamb dG(i)=1 - SUM(j,A(i,j) * x.L(j));T = pi * (Z_UB-Z_LB)/SUM(i,G(i) * G(i));lambda(i)=max(0,lambda(i)+T * G(i));counter=counter+1;lambda_sum = SUM(i,ABS(lambda(i)));put counter, Z_LB, G(’1’), lambda(’1’), l a

);

Page 27: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

27Thomas Stidsen

DTU-Management / Operations Research

Lower bound

-4

-2

0

2

4

0 50 100 150 200 250 300 350 400 450 500

"lag.txt" us 2

Page 28: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

28Thomas Stidsen

DTU-Management / Operations Research

CommentsComments to the algorithm:

This is actually quite interesting: The algorithmis very simple, but a good lower bound is foundquickly !

This relied a lot on the very simple LLBPoptimization algorithm.

Usually the LLBP requires much more work ....

... but according to Beasley, the subgradientalgorithm very often works ...

Page 29: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

29Thomas Stidsen

DTU-Management / Operations Research

So whats the use ?This is all wery nice, but how can we solve ourproblem ?

We may be lucky that the lowerbound is also afeasible and optimal solution (like integersolutions to LP formulations).

We may reduce the problem, performingLagrangean problem reduction, next week.

We may generate heuristic solutions based onthe LLBP, next week.

We may use LLBP in lower bound calculationsfor a Branch and Bound algorithm.

Page 30: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

30Thomas Stidsen

DTU-Management / Operations Research

In a Branch and Bound MethodWhy has Lagrangean relaxation become soimportant ? Because it is usefull in Branch andBound methods.

10S

S S

SSS SSSSS

S00

x3=0

x2=0

x1=1x1=0

111110101100011010001000

111001S

S

S

Page 31: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

31Thomas Stidsen

DTU-Management / Operations Research

Branching Influence on Lagrangian BoundingEach branch corresponds to a simple choice:Branch up or branch down. This correspond tochoose the value for one of our variables xi. Hence:If we want to include Lagrangian bounding in abranch and bound algorithm, we need to be able tosolve subproblems with these fixings ...

Page 32: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

32Thomas Stidsen

DTU-Management / Operations Research

Branching Influence on Lagrangian Bounding IIGiven this lower bound on some sub-tree in the

branch-and-bound tree, we can (perhaps) perform

bounding. Important: Any solution to the Lagrangian

problem is a bound, so we can stop at any time (not

the case in Branch-and-Price).

Page 33: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

33Thomas Stidsen

DTU-Management / Operations Research

Dual AscentAnother technique considered in the Beasley noteis Dual Ascent. The idea is very simple: Given a(hard) MIP:

Optimal (min) solution to MIP≥

Optimal solution to LP=

Optimal solution to DUAL LP≥

Any solution to DUAL LP

Page 34: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

34Thomas Stidsen

DTU-Management / Operations Research

Example in Beasley: SetcoverLP Relaxation:

objective: minimise∑

j

cj · xj

s.t.∑

j

aij · xj ≥ 1 ∀i

xj ≥ 0

Page 35: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

35Thomas Stidsen

DTU-Management / Operations Research

Graphical

Optimal solution to MIP

feasible solutionsUpper bounds

Optimal solution to LP

GAP

solutionslower bounds

Dual feasible

Page 36: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

36Thomas Stidsen

DTU-Management / Operations Research

Dual Setcoverobjective: maximize ∑

i

ui

s.t.∑

i

ui · aij ≤ cj ∀j

ui ≥ 0

Page 37: Lagrangean Methods - Technical University of Denmark · Lagrange relaxation is invented by (surprise!) Lagrange in 1797 ! This technique has been very usefull in conjunction with

37Thomas Stidsen

DTU-Management / Operations Research

Comments to Dual AscentDual ascent is a simple neat idea ...

Beasley is not too impressed ...

Dual ascent critically depends on the efficiencyof the heuristic and the size of the GAP