Solving Examples of Linear Programming...

65
Solving Examples of Linear Programming Models Prof. Yong Won SEO ([email protected]) College of Business Administration, CAU

Transcript of Solving Examples of Linear Programming...

  • Solving Examples of Linear Programming Models

    Prof. Yong Won SEO

    ([email protected])

    College of Business Administration, CAU

  • Chapter Topics

    A Product Mix Example

    A Diet Example

    An Investment Example

    A Marketing Example

    A Transportation Example

    A Blend Example

    A Multiperiod Scheduling Example

    A Data Envelopment Analysis Example

  • Product Mix Example

  • Four-product T-shirt/sweatshirt manufacturing company.

    ■ Must complete production within 72 hours

    ■ Truck capacity = 1,200 standard sized boxes.

    ■ Standard size box holds12 T-shirts.

    ■ One-dozen sweatshirts box is three times size of standard box.

    ■ $25,000 available for a production run.

    ■ 500 dozen blank T-shirts and sweatshirts in stock.

    ■ How many dozens (boxes) of each type of shirt to produce?

    Product Mix Example

  • Processing Time (hr) Per dozen

    Cost ($)

    per dozen

    Profit ($)

    per dozen

    Sweatshirt - F 0.10 $36 $90

    Sweatshirt – B/F 0.25 48 125

    T-shirt - F 0.08 25 45

    T-shirt - B/F 0.21 35 65

    Resource requirements for the product mix example.

    Product Mix Example

  • Decision Variables:

    x1 = sweatshirts, front printing

    x2 = sweatshirts, back and front printing

    x3 = T-shirts, front printing

    x4 = T-shirts, back and front printing

    Objective Function:

    Maximize Z = $90x1 + $125x2 + $45x3 + $65x4

    Model Constraints:

    0.10x1 + 0.25x2+ 0.08x3 + 0.21x4 72 hr

    3x1 + 3x2 + x3 + x4 1,200 boxes

    $36x1 + $48x2 + $25x3 + $35x4 $25,000

    x1 + x2 500 dozen sweatshirts

    x3 + x4 500 dozen T-shirts

    Product Mix Example

  • Product Mix Example

    • Model solution is:

    • x1=175.56 boxes of front-only sweatshirts

    • x2=57.78 boxes of front and back sweatshirts

    • x3 = 500 boxes of front-only t-shirts

    • Z=$45,522.22 profit

  • Product Mix Example: Sensitivity

    • Additional 1 hour of processing time means $233.33 increased profit

  • Breakfast to include at least 420 calories, 5 milligrams of iron,

    400 milligrams of calcium, 20 grams of protein, 12 grams of

    fiber, and must have no more than 20 grams of fat and 30

    milligrams of cholesterol.

    Breakfast Food Cal

    Fat (g)

    Cholesterol (mg)

    Iron (mg)

    Calcium (mg)

    Protein (g)

    Fiber (g)

    Cost ($)

    1. Bran cereal (cup) 2. Dry cereal (cup) 3. Oatmeal (cup) 4. Oat bran (cup) 5. Egg 6. Bacon (slice) 7. Orange 8. Milk-2% (cup) 9. Orange juice (cup)

    10. Wheat toast (slice)

    90 110 100

    90 75 35 65

    100 120

    65

    0 2 2 2 5 3 0 4 0 1

    0 0 0 0

    270 8 0

    12 0 0

    6 4 2 3 1 0 1 0 0 1

    20 48 12

    8 30

    0 52

    250 3

    26

    3 4 5 6 7 2 1 9 1 3

    5 2 3 4 0 0 1 0 0 3

    0.18 0.22 0.10 0.12 0.10 0.09 0.40 0.16 0.50 0.07

    Diet Example

  • x1 = cups of bran cereal

    x2 = cups of dry cereal

    x3 = cups of oatmeal

    x4 = cups of oat bran

    x5 = eggs

    x6 = slices of bacon

    x7 = oranges

    x8 = cups of milk

    x9 = cups of orange juice

    x10 = slices of wheat toast

    Diet Example

  • Minimize Z = 0.18x1 + 0.22x2 + 0.10x3 + 0.12x4 + 0.10x5 + 0.09x6 + 0.40x7 + 0.16x8 + 0.50x9 + 0.07x10

    subject to:

    90x1 + 110x2 + 100x3 + 90x4 + 75x5 + 35x6 + 65x7+ 100x8 + 120x9 + 65x10 420 calories

    2x2 + 2x3 + 2x4 + 5x5 + 3x6 + 4x8 + x10 20 g fat

    270x5 + 8x6 + 12x8 30 mg cholesterol

    6x1 + 4x2 + 2x3 + 3x4+ x5 + x7 + x10 5 mg iron

    20x1 + 48x2 + 12x3 + 8x4+ 30x5 + 52x7 + 250x8+ 3x9 + 26x10 400 mg of calcium

    3x1 + 4x2 + 5x3 + 6x4 + 7x5 + 2x6 + x7+ 9x8+ x9 + 3x10 20 g protein

    5x1 + 2x2 + 3x3 + 4x4+ x7 + 3x10 12

    xi 0, for all j

    Diet Example

  • Diet Example : Solution

    • X3=1.025

    • X8=1.241

    • X10=2.975

    • Z=$0.509 per meal

  • Diet Problem History

    • The first problem tested on by Dantzig

    • Originally formulated in 1945 by Nobel economist George Stigler– An important military issue during WW II.

    • Consisted of 77 unknowns and 9 equations– 9 clerks using hand-operated desk calculators

    – 120 MD to obtain the optimal Simplex solution

    • Solution– $39.69 per year using wheat flour, cabbage, dried navy beans

    (1939 prices)

    – Simplex solution was better than Stiegler’s (using his own method), by 24 cents

  • An investor has $70,000 to divide among several instruments. Municipal

    bonds have an 8.5% return, CD’s a 5% return, t-bills a 6.5% return, and

    growth stock 13%.

    The following guidelines have been established:

    1.No more than 20% in municipal bonds

    2.Investment in CDs should not exceed the other three alternatives

    3.At least 30% invested in t-bills and CDs

    4.More should be invested in CDs and t-bills than in municipal bonds and

    growth stocks by a ratio of 1.2 to 1

    5.All $70,000 should be invested.

    Investment Example

  • Maximize Z = $0.085x1 + 0.05x2 + 0.065 x3+ 0.130x4subject to:

    x1 $14,000

    x2 - x1 - x3- x4 0

    x2 + x3 $21,000

    -1.2x1 + x2 + x3 - 1.2 x4 0

    x1 + x2 + x3 + x4 = $70,000

    x1, x2, x3, x4 0

    where

    x1 = amount ($) invested in municipal bonds

    x2 = amount ($) invested in certificates of deposit

    x3 = amount ($) invested in treasury bills

    x4 = amount ($) invested in growth stock fund

    Investment Example

  • Total investment requirement,

    =D10*B13+E10*B14+F10*B15+G10*B16

    First guideline,

    =D6*B13

    Objective function, Z,

    for total return

    Investment Example

  • Shadow price for the

    amount available to invest

    Investment Example: Sensitivity

    • Additional $1 investment yiels $0.095 (9.5%) increase in profit, with no upper bound

  • Investment Example: variation

    • If the following guideline is removed, how to model?

    5. All $70,000 should be invested.

  • [Case] Investment Application of GE Asset Mgt

  • Exposure (people/ad or commercial)

    Cost

    Television Commercial 20,000 $15,000

    Radio Commercial 2,000 6,000

    Newspaper Ad 9,000 4,000

    Budget limit $100,000

    Television time available for 4 commercials

    Radio time available for 10 commercials

    Newspaper space available for 7 ads

    Resources for no more than 15 commercials and/or ads

    Marketing Example

  • Maximize Z = 20,000x1 + 12,000x2 + 9,000x3subject to:

    15,000x1 + 6,000x 2+ 4,000x3 100,000

    x1 4

    x2 10

    x3 7

    x1 + x2 + x3 15

    x1, x2, x3 0

    where

    x1 = number of television commercials

    x2 = number of radio commercials

    x3 = number of newspaper ads

    Marketing Example

  • Marketing Example

    • TV: 1.818, Radio: 10, Newspaper ads: 3.182 (????)– Total Exposures 185000

    – Round down?

  • Exhibit 4.12

    Decision variables

    Click on “int” for

    integer.

    Marketing Example: Forcing Integer

  • Exhibit 4.14

    Integer solution Better solution—17,000

    more total exposures—than

    rounded-down solution

    Marketing Example: Integer Solution

  • Warehouse supply of Retail store demand

    Television Sets: for television sets:

    1 - Cincinnati 300 A - New York 150

    2 - Atlanta 200 B - Dallas 250

    3 - Pittsburgh 200 C - Detroit 200

    Total 700 Total 600

    Unit Shipping Costs:

    From Warehouse To Store

    A B C

    1 $16 $18 $11

    2 14 12 13

    3 13 15 17

    Transportation Example

  • Minimize Z = $16x1A + 18x1B + 11x1C + 14x2A + 12x2B + 13x2C +

    13x3A + 15x3B + 17x3C

    subject to:

    x1A + x1B+ x1C 300

    x2A+ x2B + x2C 200

    x3A+ x3B + x3C 200

    x1A + x2A + x3A = 150

    x1B + x2B + x3B = 250

    x1C + x2C + x3C = 200

    All xij 0

    Transportation Example

  • =C5+C6+C7

    =C5+D5+E5

    Transportation Example: Solution

  • ■ Determine the optimal mix of the three components in each grade

    of motor oil that will maximize profit. Company wants to produce

    at least 3,000 barrels of each grade of motor oil.

    Blend Example

  • Component Maximum Barrels

    Available/day Cost/barrel

    1 4,500 $12

    2 2,700 10

    3 3,500 14

    Blend Example

    Grade Component Specifications Selling Price ($/bbl)

    Super At least 50% of 1

    Not more than 30% of 2 $23

    Premium At least 40% of 1

    Not more than 25% of 3

    20

    Extra At least 60% of 1 At least 10% of 2

    18

  • Blend Example

    • Decision variables: The quantity of each of the three components

    used in each grade of gasoline (9 decision variables); xij = barrels

    of component i used in motor oil grade j per day, where i = 1, 2, 3

    and j = s (super), p (premium), and e (extra).

  • Maximize Z = 11x1s + 13x2s + 9x3s + 8x1p + 10x2p + 6x3p + 6x1e+ 8x2e + 4x3e

    subject to:x1s + x1p + x1e 4,500 bbl.x2s + x2p + x2e 2,700 bbl.x3s + x3p + x3e 3,500 bbl.

    0.50x1s - 0.50x2s - 0.50x3s 00.70x2s - 0.30x1s - 0.30x3s 00.60x1p - 0.40x2p - 0.40x3p 00.75x3p - 0.25x1p - 0.25x2p 00.40x1e- 0.60x2e- - 0.60x3e 00.90x2e - 0.10x1e - 0.10x3e 0

    x1s + x2s + x3s 3,000 bbl.x1p+ x2p + x3p 3,000 bbl.x1e+ x2e + x3e 3,000 bbl.

    all xij 0

    Blend Example

  • =B7+B10+B13

    Decision variables—B7:B15 =B7+B8+B9=0.5*B7-0.5*B8-0.5*B9

    Blend Example: Solution

  • Blend Example: Sensitivity

    • Component 1 seems the most critical resource– 1 barrel increase means $20 additional profit, up to 6200 barrels

  • [Case] Blending Problem of Petroleum Industry

  • Production Capacity: 160 computers per week

    50 more computers with overtime

    Assembly Costs: $190 per computer regular time;

    $260 per computer overtime

    Inventory Holding Cost: $10/computer per week

    Order schedule:Week Computer Orders

    1 1052 1703 2304 1805 1506 250

    Multi-period Scheduling Example

  • Decision Variables:

    rj = regular production of computers in week j

    (j = 1, 2, …, 6)

    oj = overtime production of computers in week j

    (j = 1, 2, …, 6)

    ij = extra computers carried over as inventory in week j

    (j = 1, 2, …, 5)

    Multi-period Scheduling Example

  • Model summary:

    Minimize Z = $190(r1 + r2 + r3 + r4 + r5 + r6) + $260(o1+o2+o3 +o4+o5+o6) + 10(i1 + i2 + i3 + i4 + i5)

    subject to:

    rj 160 computers in week j ( j = 1, 2, 3, 4, 5, 6)oj 150 computers in week j ( j = 1, 2, 3, 4, 5, 6)r1 + o1 - i1 = 105 week 1r2 + o2 + i1 - i2 = 170 week 2r3 + o3 + i2 - i3 = 230 week 3r4 + o4 + i3 - i4 = 180 week 4r5 + o5 + i4 - i5 = 150 week 5r6 + o6 + i5 = 250 week 6rj, oj, ij 0

    Multi-period Scheduling Example

  • Exhibit 4.20

    Decision variables for

    regular production –

    B6:B11

    Decision variables for

    overtime production –

    D6:D11

    B7+D7+I6; regular

    production + overtime

    production + inventory

    from previous week

    G7-H7

    Multi-period Scheduling: Solution

  • [Case] Employee Scheduling Problem

  • DEA compares a number of decision making units(DMU) of the

    same type based on their inputs (resources) and outputs.

    The result indicates if a particular unit is less productive, or efficient,

    than other units.

    DEA (Data Envelopment Analysis)

  • [Case] DEA to compare ports’ efficiency

  • Comparing the efficiency

    • Which department is more efficient?

    • Comparing Sales/Labor cost

    42

    Department Input:Labor Cost($)

    Output:Sales(# of contracts)

    A 2000 1500

    B 1500 1100

    Department

    Input:Labor Cost($)

    Output:Sales(# of contracts)

    Sales/Labor Cost

    A 2000 1500 0.75

    B 1500 1100 0.73

  • Comparing the efficiency is not easy

    • Which department is more efficient?

    • Measuring the efficiency(or performance) of different organizations is difficult because organizations have multiple input measures (number of workers, cost of labor, cost of machine operations, pay scale for employees, and cost of advertising) and multiple output measures (profit, sales, and market share).

    43

    Department

    Input 1:Labor Cost($)

    Input 2:Office Space(ft2)

    Output:Sales(# of contracts)

    A 2000 10000 1500

    B 1500 6900 1100

  • Calculating Efficiency

    • DEA offers a variety of models that use multiple inputs and outputs to compare the efficiency of two or more processes.

    • The ratio model is based on the following definition of efficiency:

    44

    Weighted Sum of OutputsEfficiency =

    Weighted Sum of Inputs

  • Calculating Efficiency (cont’d)

    • Suppose we have the following input and output data:

    • Defining efficiency based on the ratio model:

    • The rationale is : “Choose whatever weights that would make your efficiency value maximum”

    45

    Department Labor Cost(input)

    Sales(output 1)

    Customer Satisfaction(output 2)

    A 10 10 10

    B 15 30 12

    C 12 36 6

    D 22 25 16

    Laborv

    CSwSaleswEfficiency

    21

  • Building an LP for Department D

    46

    0,,

    122

    1625

    112

    636

    115

    1230

    110

    1010

    22

    1625

    21

    21

    21

    21

    21

    21

    vww

    v

    ww

    v

    ww

    v

    ww

    v

    ww

    toSubject

    v

    wwMaximize

    0,,

    221625

    12636

    151230

    101010

    122

    1625

    21

    21

    21

    21

    21

    21

    vww

    vww

    vww

    vww

    vww

    v

    toSubject

    wwMaximize

    LP

  • DEA Solution Meaning

    • 4 DEA formulations can be made– To Evaluate A, B, C, D each

    • If Z=1, the school is efficient one

    • If Z

  • Graphical Analysis

    48

    Efficient frontier

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    0 0.5 1 1.5 2 2.5 3 3.5

    Sales/Labor Cost

    CS/Labor Cost

    A

    B

    C

    D

  • DEA Example

    Elementary school comparison:

    Input 1 = teacher to student ratio

    Input 2 = supplementary funds/student

    Input 3 = average educational level of parents

    Output 1 = average reading SOL score

    Output 2 = average math SOL score

    Output 3 = average history SOL score

  • Inputs Outputs

    School 1 2 3 1 2 3

    Alton .06 $260 11.3 86 75 71

    Beeks .05 320 10.5 82 72 67

    Carey

    .08

    340

    12.0

    81

    79

    80

    Delancey

    .06

    460

    13.1

    81

    73

    69

    DEA Example: 4 schools’ data

  • DEA Example

    • Objective: To compare 4 schools’ efficiency

    – 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 =𝑂𝑢𝑡𝑝𝑢𝑡

    𝐼𝑛𝑝𝑢𝑡

    • Multiple elements in I/O : weights needed

    – 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 =𝑂𝑢𝑡𝑝𝑢𝑡

    𝐼𝑛𝑝𝑢𝑡=

    𝑦1𝑂1+𝑦2𝑂2+𝑦3𝑂3

    𝑥1𝐼1+𝑥2𝐼2+𝑥3𝐼3

    • Evaluation can vary with weight settings– What weight values seems fair to you?

    • Rationale: “Choose whatever weights that would make your efficiency value maximum”

  • DEA to evaluate Delancey

    0 variablesAll

    11.1346006.0

    697381

    10.1234008.0

    807981

    15.1032005.0

    677282

    13.1126006.0

    717586

    1.1346006.0

    697381

    321

    321

    321

    321

    321

    321

    321

    321

    321

    321

    yyy

    xxx

    yyy

    xxx

    yyy

    xxx

    yyy

    xxx

    toSubject

    yyy

    xxxMaximize

  • Decision Variables:

    xi = weight per unit of each output where i = 1, 2, 3

    yi = weight per unit of each input where i = 1, 2, 3

    Model Summary:

    Maximize Z = 81x1 + 73x2 + 69x3subject to:

    .06 y1 + 460y2 + 13.1y3 = 1

    86x1 + 75x2 + 71x3 .06y1 + 260y2 + 11.3y382x1 + 72x2 + 67x3 .05y1 + 320y2 + 10.5y381x1 + 79x2 + 80x3 .08y1 + 340y2 + 12.0y381x1 + 73x2 + 69x3 .06y1 + 460y2 + 13.1y3

    xi, yi 0

    DEA to evaluate Delancey – LP form

  • Exhibit 4.22

    Value of outputs, also in cell H8

    =B5*B12+C5*B13+D5*B14

    =E8*D12+F8*D13+G8*D14

    DEA Solution: Z=Efficiency

  • Integer Programming (IP)

    Prof. Yongwon Seo

    ([email protected])

    College of Business Administration, CAU

  • Types of Integer Programming(IP) Problems

    56

    Total Integer Model: All decision variables required to have

    integer solution values.

    0-1 Integer Model: All decision variables required to have

    integer values of zero or one.

    Mixed Integer Model: Some of the decision variables (but not all) required to have integer values.

  • Total Integer Model

    • Machine shop obtaining new presses and lathes.

    • Marginal profitability: each press $100/day; each lathe $150/day.

    • Resource constraints: $40,000 budget, 200 sq. ft. floor space.

    • Machine purchase prices and space requirements:

    57

    Machine

    Required Floor Space (ft.2)

    Purchase Price

    Press Lathe

    15

    30

    $8,000

    4,000

  • Total Integer Model

    58

    Maximize Z = $100x1 + $150x2

    subject to:

    $8,000x1 + 4,000x2 $40,000

    15x1 + 30x2 200 ft2

    x1, x2 0 and integer

  • 0-1 Integer Model

    • Recreation facilities selection to maximize daily usage by residents.

    • Resource constraints: $120,000 budget; 12 acres of land.

    • Selection constraint: either swimming pool or tennis center (not both).

    59

    Recreation

    Facility

    Expected Usage (people/day)

    Cost ($)

    Land Requirement (acres)

    Swimming pool Tennis Center Athletic field Gymnasium

    300 90 400 150

    35,000 10,000 25,000 90,000

    4 2 7 3

  • 0-1 Integer Model

    60

    x1 = construction of a swimming pool

    x2 = construction of a tennis center

    x3 = construction of an athletic field

    x4 = construction of a gymnasium

    Maximize Z = 300x1 + 90x2 + 400x3 + 150x4

    subject to:

    $35,000x1 + 10,000x2 + 25,000x3 + 90,000x4 $120,000

    4x1 + 2x2 + 7x3 + 3x4 12 acres

    x1 + x2 1 facility

    x1, x2, x3, x4 = 0 or 1

  • Mixed Integer Model

    • $250,000 available for investments providing greatest return after one year.

    • Data: – Condominium cost $50,000/unit; $9,000 profit if sold after one

    year.

    – Land cost $12,000/ acre; $1,500 profit if sold after one year.

    – Municipal bond cost $8,000/bond; $1,000 profit if sold after one year.

    – Only 4 condominiums, 15 acres of land, and 20 municipal bonds available.

    61

  • Mixed Integer Model

    62

    x1 = condominiums purchased

    x2 = acres of land purchased

    x3 = bonds purchased

    Maximize Z = $9,000x1 + 1,500x2 + 1,000x3

    subject to:

    50,000x1 + 12,000x2 + 8,000x3 $250,000

    x1 4 condominiums

    x2 15 acres

    x3 20 bonds

    x2 0

    x1, x3 0 and integer

  • Why Integer Programming Complex

    • Rounding non-integer solution values up to the nearest integer value can result in an infeasible solution.

    • A feasible solution by rounding down non-integer solution values may result in a less than optimal (sub-optimal) solution.

    63

  • Example of IP solution

    64

    Maximize Z = $100x1 + $150x2subject to:

    8,000x1 + 4,000x2 $40,000

    15x1 + 30x2 200 ft2

    x1, x2 0 and integer

    LP Optimal Solution:

    Z = $1,055.56

    x1 = 2.22 presses

    x2 = 5.55 lathes

  • How to solve?

    • Branch-and-Bound Method– Traditional approach to solving integer programming problems.

    – Feasible solutions can be partitioned into smaller subsets

    – Smaller subsets evaluated until best solution is found.

    – Method is a tedious and complex mathematical process

    65