24
Lecture 8: Column Generation (3 units) Outline I Cutting stock problem I Classical IP formulation I Set covering formulation I Column generation I A dual perspective 1 / 24

Class Bfs 121109080773803

Embed Size (px)

DESCRIPTION

class

Citation preview

  • Lecture 8: Column Generation

    (3 units)

    Outline

    I Cutting stock problemI Classical IP formulationI Set covering formulationI Column generationI A dual perspective

    1 / 24

  • Cutting stock problem

    2 / 24

  • Problem description

    I A paper mill has a number of rolls of paper of fixed width.Different customers want different numbers of rolls ofvarious-sized widths.

    I How are you going to cut the rolls so that you minimize thewaste (amount of left-overs)?

    3 / 24

  • An exampleThe width of large rolls: 5600mm. The width and demand of customers:

    Width 1380 1520 1560 1710 1820 1880 1930 2000 2050 2100 2140 2150 2200Demand 22 25 12 14 18 18 20 10 12 14 16 18 20

    An optimal solution:

    4 / 24

  • Classical IP formulation

    I Suppose the fixed width of large rolls is W . The m customerswant ni rolls of width wi (i = 1, . . . ,m), (wi W ).

    I Notations:I K: Index set of available rollsI yk = 1 if roll k is cut, 0 otherwiseI xki : number of times item i is cut on roll k

    I The IP formulation of Kantorovich:

    (P1) minkK

    yk

    s.t.kK

    xki ni , i = 1, . . . ,m, (demand)ni=1

    wixki Wyk , k K, (width limitation)

    xki Z+, yk {0, 1}.5 / 24

  • I However, the IP formulation (P1) is inefficient both fromcomputational and theoretical point views. For example, whenthe number of rolls is 100 and the number of items is 20, theproblem could not be solved to optimality in days (CPLEX).

    I The main reason is that the linear program (LP) relaxation of(P1) is poor. Actually, the LP bound of (P1) is

    mi=1 winiW .

    ZLP =kK

    yk =kK

    mi=1

    wixki

    W

    =mi=1

    wikK

    xkiW

    =mi=1

    winiW

    .

    I Question: Is there an alternative IP formulation?

    6 / 24

  • Set covering formulation of Gilmore and Gomory

    I LetI xj = number of times pattern j is usedI aij = number of times item i is cut in pattern j

    I For example, the fixed width of large rolls is W = 100 and thedemands are ni = 100, 200, 300, wi = 25, 35, 45 (i = 1, 2, 3).The large roll can be cut intoI Pattern 1: 4 rolls each of width w1 = 25 a11 = 4I Pattern 2: 1 roll with width w1 = 25 and 2 rolls each of width

    w2 = 35 a12 = 1, a22 = 2I Pattern 3: 2 rolls with width w3 = 45 a33 = 2I

    7 / 24

  • I Set covering formulation:

    (P2) minnj=1

    xj

    s.t.nj=1

    aijxj ni , i = 1, . . . ,m, (demand)

    xj Z+, j = 1, . . . , n,

    where n is the total number of cutting patterns satisfyingmi=1 wiaij W .

    I Each column in (P2) represents a cutting pattern.I How many columns (cutting patterns) are there? It could be

    as many as m!k!(mk)! , where k is the average number of items

    in each cutting patterns. Exponentially large!.

    8 / 24

  • I Lets first consider the LP relaxation of (P2):

    (LPM) minnj=1

    xj

    s.t.nj=1

    aijxj ni , i = 1, . . . ,m, (demand)

    xj R+, j = 1, . . . , n,

    which is called Linear Programming Master Problem. Thesolution to (LPM) could be fractional, It is possible to roundup the fractional solution to get a feasible solution to (P2).

    I The Simple algorithm for Master LP:I Select initial solutionI Find the most negative reduced cost (new basic variable)I Find variable to replace (new non-basic var)I Repeat until there exists no variables with negative reduced

    cost exists

    9 / 24

  • I Consider the standard LP and its dual:

    min cT x

    s.t. Ax = bx 0

    min bTpi

    s.t. ATpi c

    I Simplex TableauxB xN rhs

    B N b

    cTB cTN 0

    =xB xN rhs

    I B1N b0 cTN cTB B1N cTB1b

    I Reduced cost of non-basic variable: cj cTB B1aj , where aj isa column of A. If cj cTB B1aj < 0 implies the current basiscan be improved, otherwise, if cj cTB B1aj 0 for allj N , then the current solution is optimal and piT = cTB B1is dual feasible (optimal).

    10 / 24

  • I What if we have extremely many variables?I Even if we had a way of generating all the columns (cutting

    patterns), the standard simplex algorithm will need tocalculate the reduced cost for each non-basic variable, whichis impossible if n is huge (out of memory).

    I A crucial insight: The number of non-zero variables (the basisvariables) is equal to the number of constraints, hence even ifthe number of possible variables (columns) may be large, weonly need a small subset of these columns in the optimalsolution. In the case of cutting stock problem, the number ofitems is usually much smaller than the number of cuttingpatterns.

    11 / 24

  • I The main idea of column generation is to start with a smallsubset P {1, . . . , n} such that the following subproblem isfeasible:

    (RLPM) minjP

    xj

    s.t.jP

    aijxj ni , i = 1, . . . ,m,

    xj 0, j P,I Recall that the dual problem of (LPM) is

    maxmi=1

    nipii

    s.t.mi=1

    aijpii 1, j P,

    pii 0, i = 1, . . . ,m.12 / 24

  • Generating columns

    I Our next task is to find a column (cut pattern) in{1, . . . , n} \ P that could improve the current optimal solutionof the linear relaxation (RLPM).

    I Given the optimal dual solution pi of (RLPM), the reducedcost of column j {1, . . . , n} \ P is

    1mi=1

    aij pii .

    I A naive way of finding the new column:

    min{1mi=1

    aij pii | j {1, . . . , n} \ P},

    which is impractical because we are not able to list all cuttingpatterns in real applications.

    13 / 24

  • Knapsack subproblem

    I We can look for a column (cut pattern) such that:

    min 1mi=1

    piiyi = 1maxmi=1

    piiyi

    s.t.mi=1

    wiyi W ,

    yi Z+, i = 1, . . . ,m,

    where y = (y1, . . . , ym) represents a column (a1j , . . . , amj)T (a

    cutting pattern) and the constraintsm

    i=1 wiyi W , y Zm+,enforce that y satisfies the conditions for a feasible cuttingpattern.

    I This is a Knapsack Problem (an an easy NP-hard problem)and can be solved in O(mW ) time by dynamic programming.

    14 / 24

  • Column generation algorithm

    The Column Generation Algorithm

    Start with initial columns A of (LPM). For instance,use the simple pattern to cut a roll into bW /wic rollsof width wi , A is a diagonal matrix.

    repeat

    1. Solve the restricted LP master problem (RLPM).Let pi be the optimal multipliers (piT = cTB B

    1).2. Identify a new column by solving the knapsack

    subproblem with optimal value .3. Add the new column to master problem (RLPM)

    until 0

    15 / 24

  • An example

    I A steel company wants to cut the steel rods of width 218cm.The customers want 44 pieces of width 81 cm., 3 pieces ofwidth 70 cm. and 48 pieces of width 68 cm.

    I Initial master problem (one item in each large rod):

    min x1 + x2 + x3

    s.t. x1 44,x2 3,x3 48.

    Optimal multipliers: pi = (1, 1, 1)T .

    I Initial knapsack subproblem:

    max y1 + y2 + y3

    s.t. 81y1 + 70y2 + 68y3 218,y Z3+.

    16 / 24

  • I Optimal solution to the initial knapsack subproblem:y = (0, 0, 3)T with = 1 3 = 2 < 0.

    I Second master problem:

    min x1 + x2 + x3 + x4

    s.t. x1 44,x2 3,x3 + 3x4 48,

    Optimal multipliers: pi = (1.0, 1.0, 0.33)T .

    I Second knapsack subproblem:

    max y1 + y2 + 0.33y3

    s.t. 81y1 + 70y2 + 68y3 218,y Z3+.

    Optimal solution: y = (0, 3, 0)T with = 1 3 = 2 < 0.Continue ...

    17 / 24

  • Getting integer solutions

    I After solving the master linear program, we still have to findthe integer solution to the original problem (P2).

    I Let x j = bxjc, xj is integral andn

    j=1 aijxj

    nj=1 aijxj ni .

    So the rounding up solution is feasible to (P2).

    I We can also use branch-and-bound framework to get theoptima; integral solution. Branch-and-Price algorithm.

    18 / 24

  • A Dual perspective

    I Consider the classical formulation of cutting stock problem:

    (P1) minkK

    yk

    s.t.kK

    xki ni , i = 1, . . . ,m, (demand)ni=1

    wixki Wyk , k K, (width limitation)

    xki Z+, yk {0, 1}.I How to get a Lagrangian relaxation? Observe that if the

    demand constraints are removed, the problem can bedecomposed into K knapsack problem!

    19 / 24

  • I For ui 0, i = 1, . . . ,m, the Lagrangian function is

    L(u) = minkK

    yk +mi=1

    ui

    (ni

    kK

    xki

    )

    s.t.mi=1

    wixki Wyk , k K,

    xki Z+, yk {0, 1}.I So

    L(u) =kK

    Lk(u) +mi=1

    niui

    where

    Lk(u) = min yk mi=1

    uixki

    s.t.mi=1

    wixki Wyk ,

    xki Z+, yk {0, 1}.20 / 24

  • I Ls(u) = min(0, 1 z), where

    z = maxmi=1

    uixki

    s.t.mi=1

    wixki W ,

    xki Z+.

    This is a knapsack problem. Notice that Ls(u) is independentof k.

    L(u) = KLs(u) +mi=1

    niui ,

    where K = |K|.

    21 / 24

  • I Theorem: the dual problem maxu0 L(u) = v(LPM).I Proof: Let zj = (a1j , . . . , amj)T , j = 1, . . . , n, be the extreme

    points of the convex hull of the integer set

    X = {x Zm+ |mi=1

    wixi W }.

    Then

    Ls(u) = min(0, 1 maxj=1,...,n

    mi=1

    aijui ) = minj=1,...,n

    min(0, 1mi=1

    aijui ).

    So that

    maxu0

    L(u) = maxu0

    minj=1,...,n

    (K min(0, 1

    mi=1

    aijui ) +mi=1

    niui

    )

    22 / 24

  • I This can be reduced to

    max z

    s.t. z mi=1

    niui ,

    z K (1mi=1

    aijui ) +mi=1

    niui , j = 1, . . . , n,

    ui 0, i = 1, . . . ,m.The dual of the above problem is

    minnj=1

    Kj

    s.t. 0 +nj=1

    j = 1,

    ni (0 +nj=1

    j) +nj=1

    aijKj 0, i = 1, . . . ,m

    j 0, j = 0, 1, . . . , n. 23 / 24

  • I Notice that 0 can be eliminated from the second constraint.So the constraint 0 +

    nj=1 j = 1 is redundant provided

    that there is (1, . . . , n) satisfying

    nj=1

    aijKj ni , i = 1, . . . ,m, andnj=1

    j 1.

    This is always possible when K is large (enough rolls).

    I Now, let xj = Kj , we obtain

    minnj=1

    xj

    s.t.nj=1

    aijxj ni , i = 1, . . . ,m,

    xj 0, j = 0, 1, . . . , n.

    This is exactly the LP relaxation (LPM).

    24 / 24