• Ingen resultater fundet

Benders (once more ...)

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "Benders (once more ...)"

Copied!
53
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Thomas Stidsen 1

Benders (once more ...)

Thomas Stidsen

thst@man.dtu.dk

DTU-Management

Technical University of Denmark

(2)

Outline

The algorithm

The assignment from last week GAMS Implementation

(3)

Thomas Stidsen 3

Definitions

RBMP: Relaxed Benders Master Problem BPSP: Benders Primal Sub-Problem: The direct formulation for finding the u values.

BDSP: Benders Dual Sub-Problem: The original problem with fixed y values

RGP: Ray Generation Problem

(4)

But ...

When we solve the BPSP ( the u problem) what if:

Problem solved: No problem (we add optimality cut)

Problem infeasible: We have a solution which is infeasible because of the y values. Hence we need a feasibility cut based on an extreme ray.

Problem un-bounded: Original problem un-bounded !

(5)

Thomas Stidsen 5

Benders Alorithm

Initialize RBMP, RGP, BDSP/BPSP ZLO = −∞, ZU P = ∞, y, ǫ

while ZU P − ZLO > ǫ

Solve BDSP(y) or BPSP(y)getting u if feasible

update ZU P

Add Optimality constraint else

Solve RGP(y) getting u Add Feasibility constraint Solve RBMP getting y

update ZLO endwhile

(6)

Example

Min:

z0 = 5x − 3y s.t.:

x + 2y ≥ 4 2x − y ≥ 0

x − 3y ≥ −13 x ≥ 0

y ∈ {0, . . . , 10}

Optimal value: (x=2.5, y=5), z=-2.5

(7)

Thomas Stidsen 7

Example 10.6: The B matrix

A =

2 6 6 4

1 2 1

3 7 7 5

B =

2 6 6 4

2 -1 -3

3 7 7 5

bT = [4, 0, −13]

cT = [5]

fT = [−3]

(8)

The Optimality cuts

The optimality cuts we are looking for are:

z0 ≥ fT y + (ui)T (b − By) i = 1, . . . , q

Which becomes:

z0 ≥ −3y + (ui)T ([4, 0, −13]T − [2, −1, −3]T y)

Hence, every time we find new optimality cut values, i.e. u values, we only have to plug them in, in the above equation.

(9)

Thomas Stidsen 9

Example

Min:

z0 = 5x − 3y s.t.:

x ≥ 4 − 2y 2x ≥ 0 + y

x ≥ −13 + 3y x ≥ 0

y ∈ {0, . . . , 10}

Optimal value: (x=2.5, y=5), z=-2.5

(10)

1. Iteration: Subproblem

Max:

z1 = (4 − 2y)u1 + y · u2 + (−13 + 3y)u3 s.t.:

u1 + 2u2 + u3 ≤ 5 ui ≥ 0

(11)

Thomas Stidsen 11

Inititialisation

Initial solution

¯

y0 = 0. Upper bound:

U P0 = ∞. Lower bound:

LO0 = −∞.

(12)

Graphical BMP, initialisation

10

1 Y

Z

Z

120 100 80 20

60 40

(13)

Thomas Stidsen 13

1. Iteration: Subproblem

Max:

z1 = 4u1 − 13u3 s.t.:

u1 + 2u2 + u3 ≤ 5 ui ≥ 0

(14)

1. Iteration: Subproblem

Optimal solution:

¯

z1 = 20

¯

u = (5, 0, 0) Giving a new upper bound:

U P1 = min{z¯1, U P0(= ∞)} = 20. And arriving at the cut:

z0 ≥ −3y + (5, 0, 0)T ([4, 0, −13]T − [2, −1, −3]T y)

=

z ≥ −13y + 20

(15)

Thomas Stidsen 15

1. Iteration: Benders Master Problem

Min:

z1 s.t.:

z1 ≥ 20 − 13y y ∈ {0, . . . , 10}

(16)

1. Iteration: Benders Master Problem

Optimal solution

¯

z1 = −110

¯

y = 10

New lower bound:

LO1 = max{z¯1, LO0(= −∞)} = −110.

(17)

Thomas Stidsen 17

Graphical BMP, 1. iteration

Z >= 20 − 13y

Y Z

Optimum 20

40

60

80

100

120

1

10

(18)

2. iteration: Primal Subproblem

Max:

z2 = −16u1 + 10u2 + 17u3 − 30 s.t.:

u1 + 2u2 + u3 ≤ 5 ui ≥ 0

(19)

Thomas Stidsen 19

2. iteration: Primal Subproblem

Optimal solution:

¯

z2 = 55

¯

u = (0, 0, 5)

New upper bound: U P2 = min{z¯2, U P1(= 20)} = 20.

(20)

2. iteration: Benders Master Problem

Min:

z2 s.t.:

z2 ≥ 20 − 13y z2 ≥ −65 + 12y

y ∈ {0, . . . , 10}

(21)

Thomas Stidsen 21

2. iteration: Benders Master Problem

Optimal solution:

z2 = −19 y = 3

New upper bound:

LO2 = min{z¯2, LO1(−110)} = −19.

(22)

Graphical BMP, 2. iteration

Optimum

Y Z

20

40

60

80

100

120

1

10

Z >= 20 − 13y Z >= −65 + 12y

(23)

Thomas Stidsen 23

3. iteration: Primal Subproblem

Max:

z3 = −2u1 + 3u2 − 4u3 − 9 s.t.:

u1 + 2u2 + u3 ≤ 5 ui ≥ 0

(24)

3. iteration: Primal Subproblem

Optimal solution:

¯

z2 = −1.5

¯

u = (0, 2.5, 0)

New upper bound:

U P3 = min{z¯3, U P2(= 19)} = −2.5.

(25)

Thomas Stidsen 25

3. iteration: Benders Master Problem

Min:

z3 s.t.:

z3 ≥ 20 − 13y z3 ≥ −65 + 12y z3 ≥ −0.5y

y ∈ {0, . . . , 10}

(26)

3. iteration: Benders Master Problem

Optimal solution:

z3 = −2.5 y = 5

New

lowerbound:LO3 = max{z¯1, LO3(= −19)} = −2.5. Now: LO3 = U P3

(27)

Thomas Stidsen 27

Graphical BMP, 3. iteration

Z >= 20 − 13y

Y Z

Optimum 20

40

60

80

100

120

1

10

Z >= −65 + 12y

Z >= −0.5y

(28)

Exercise 10.1 (RKM)

Several constraints are added without improving bound (in case of minimization, non-increasing) why: Primal degeneracy: Possible to include new variables into the simplex tableau without changing the objective value (the new variables may stay at value zero). Dual degeneracy: If the current

“solution” has several active constraints.

(29)

Thomas Stidsen 29

Exercise 10.2 (RKM)

If the Bender’s subproblem is infeasible what does that imply about the original problem ?

Original problem un-bounded ! Why ? Bender’s Dual Sub-Problem is then un-bounded.

Bender’s Dual Sub-Problem is a restricted

version of the original problem meaning, hence the original problem is also un-bounded.

(30)

How did we get here ?

Original Problem

Full Benders Master Problem

Project out x variables

Relaxed Benders Problem

Benders Dual Sup−Problem (Original Problem)

Ray Generation Problem Drop some (all ?) constraints

Benders Sub−Problem

(31)

Thomas Stidsen 31

Master Problem: Lowerbound

Farka’s lemma guarantees direct

correspondence between original problem and the Full Benders Master Problem

The Relaxed Benders Master Problem will hence always give a lower bound ...

(32)

Sub Problem: Upperbound

Bender’s dual problem is a restricted version of the original problem, hence a solution to the

sub-problem is also a solution to the original problem

(33)

Thomas Stidsen 33

The Benders Sub-problem

Max:

fT y + (b − By)T u s.t.:

AT u ≤ c u ≥ 0

Problem: If the objective is un-bounded, how to find rays ?

(34)

Extreme rays

We need to find the extreme rays in the cone {u|AT u ≤ 0, u ≥ 0}, such that a cut

(ui)T (b − By) > 0 is found, see Proposition 10.3, hence:

Max:

(b − By)T u s.t.:

AT u ≤ 0

0 ≤ u ≤ L

(35)

Thomas Stidsen 35

Ray generation: An example

Min:

2x1 + 6x2 + 2y1 + 3y2 s.t.:

−x1 + 2x2 + 3y1 − y2 ≥ 5 x1 − 3x2 + 2y1 + 2y2 ≥ 4

x1, x2 ≥ 0 y ∈ {0, 1, 2}

(36)

Primal Subproblem

Max:

u1 · [5 − 3y1 + y2] + u2 · [4 − 2y1 − 2y2] s.t.:

−u1 + u2 ≤ 2 2u1 − 3u2 ≤ 6 u1, u2 ≥ 0

(37)

Thomas Stidsen 37

Visually

00 11

00 11

0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000

1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111

000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000

111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111

0000 0000 1111 1111

0000 0000 1111 1111

00 00 11 11

u2=(0,2)

u3=(3,0) (u1,u2)=(1,1)

u1=(0,0)

00 11

(u1,u2)=(3,2)

(38)

Objectives for subproblem

(5 − 3y1 + y2, 4 − 2y1 − 2y2), and y1, y2 ∈ {0, 1, 2}

(0,0) : (5,4) (0,1) : (6,2) (0,2) : (7,0) (1,0) : (2,2) (1,1) : (3,0) (1,2) : (4,2) (2,0) : (1,0) (2,1) : (0,2) (2,2) : (1,4)

(39)

Thomas Stidsen 39

Visually with possible objectives

(0,−2)

(3,0)

(7,0)

(4,−2)

(5,4) (6,2)

(1,−4)

00 11 00 11

00 11

0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000 0000000000000

1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111 1111111111111

000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000 000000000000

111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111 111111111111

(−1,0)

(2,2)

(40)

First iteration

Initial guess for (y1, y2) = (1, 1): Max:

u1 · [5 − 3y1 + y2] + u2 · [4 − 2y1 − 2y2] = 3u1 s.t.:

−u1 + u2 ≤ 2 2u1 − 3u2 ≤ 6 u1, u2 ≥ 0

(41)

Thomas Stidsen 41

Tabular LP form, first iteration

B.V. u1 u2 d1 d2 R.S. UB

Z -3 0 0 0 0

d1 -1 1 1 0 2 no limit

d2 2 -3 0 1 6 u162 = 3 ← min B.V.: Basic Variables

R.S.: Right hand side

(42)

Tabular LP form, first iteration

B.V. u1 u2 d1 d2 R.S. UB Z 0 -92 0 32 9

d1 0 -12 1 12 5 no limit u1 1 -32 0 12 3 no limit

We can increase u2 as much as we like !!! Ok, so what is the extreme ray ?

(43)

Thomas Stidsen 43

The simplex tableau as equations

−1

2u2 + d1 + 1

2d2 = 5 u1 − 3

2u2 + 1

2d2 = 3

But when we use the simplex algorithm, we only want to increase one variable at the time, and we hence freeze the slack variable d2 = 0

(44)

After the freeze

u1 = 3 + 3 2u2

d1 = 5 + 1 2u2

u2 = 2

3u1 − 2

(45)

Thomas Stidsen 45

To find extreme rays by problem modifications

Ok, that’s all very nice, but what about using computer codes for finding the rays ?

(46)

Extreme Ray

The extreme rays arises when our dual subproblem is unbounded:

Max:

dummyz s.t.:

dummyz = 0 fT y + (b − By)T u = 1 AT u ≤ 0 u ≥ 0

(47)

Thomas Stidsen 47

Modifications

Zero right hand sides

Dummy objective (the objective does not matter

!)

Fix value of objective function to 1

What solution will the simplex or dual-simplex solve find ?

(48)

Example

A good example with the fixed charge

Transportation Problem ... see the Erwin Kalvelagen note.

(49)

Thomas Stidsen 49

The Fixed Charge Transportation problem

Min: X

i,j

(fi,jyi,j + ci,jxi,j) s.t.:

X

j

xi,j = si ∀i X

i

xi,j = dj ∀j

xi,j ≤ Miyi,j ∀i, j xi,j ≥ 0 yi,j ∈ {0, 1}

(50)

Benders (primal) subproblem

Max: X

i

(−si)ui + X

j

djvj + X

i,j

(−Mi,jyi,j)wi,j

s.t.:

ui + vj − wi,j ≤ ci,j ∀i, j ui, vj, wi,j ≥ 0

(51)

Thomas Stidsen 51

Benders Master Problem

Min:

z s.t.:

z ≥ X

i,j

fi,jyi,j + X

i

(−si)uki + X

j

djvkj

+ X

i,j

(−Mi,jwki,j)yi,j ∀k

0 ≥ X

i

(−si)uki + X

j

djvkj

+ X

i,j

(−Mi,jwki,j )yi,j ∀k

(52)

Extreme rays

What about the extreme rays ? How does Kalvelagen handle these ?

How does he detect an extreme ray ? He adds an artificial upper bound on the objective !

If the optimal objective value is significantly less than the upper bound, he assumes it to be

correct ...

If there is an extreme ray, he adds the dummy objective adds the objective constraint and fix the original objective value to 1 and solve the

(53)

Thomas Stidsen 53

Changed Benders Subproblem

Max:

dummy s.t.:

dummy = 0 X

i

(−si)ui + X

j

djvj + X

i,j

(−Mi,jyi,j)wi,j = 1

ui + vj − wi,j ≤ ci,j ∀i, j ui, vj, wi,j ≥ 0

Referencer

RELATEREDE DOKUMENTER

- Joint Mandatory Half Tour Generation sub-models - Joint Non-Mandatory Tour Generation sub-models - Person Day Pattern sub-models. Impact of PFPT to other day

THEOREM 2: For arbitrary t ≥ 0 , algorithm SM(n,t) solves BG problem for at most t illoyal generals... PROOF of

same label as for the functional constraint in the primal problem that corresponds to this

Combination 1 with Simple Random Crossover and Steepest Improvement provided the best results when the slow algorithm was used to solve the small problems. For the large

A column for the access network must contain information on which nodes are in the access network and which of them is a hub. A column for the backbone network

For each data set we compare the results obtained using four different versions of the Benders heuristic; however, the only difference between the approaches is in the number of

The main axioms for the core and the nucleolus are consistency properties based on the reduced highway problem that arises from the original highway problem by eliminating any agent

Freedom in commons brings ruin to all.” In terms of National Parks – an example with much in common with museums – Hardin diagnoses that being ‘open to all, without limits’