1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of...

70
1 Mathematical Programming Mathematical Programming Linear Programming
  • date post

    15-Jan-2016
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of...

Page 1: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

1

Mathematical ProgrammingMathematical Programming

Linear Programming

Page 2: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

2

TThreehree Goals in this Chapter Goals in this Chapter

• Learn the principle of Simplex-Algorithm

• Learn how to formulate pbs as LP’s– Like brainteasers: can be fun– Many problems that do not look like

stereotypical “product mix” problems can be formulated as LP’s

– Spotting LP’s is an art

• Learn how to implement and solve LP’s in Excel

Page 3: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

3

LinearLinear Programming Programming

LP Models

Page 4: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

4

LP ModelLP Model

An optimization model is a linear program (or LP) if it has continuous variables, a single linear objective function, and all constraints are linear equalities or inequalities.

Page 5: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

5

LP ModelLP Model

• Linearity

• Divisibility (Continuous)

• Assumption of Certainty

Page 6: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

6

LP ModelLP Model

21 2420: xxMaximize

3224

6063..

21

21

xx

xxts

;0;0: 21 xxNNC

Page 7: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

7

Standard FormStandard Form

4321 002420: xxxxMin

3224

6063..

421

321

xxx

xxxts

;0;0

;0;0:

43

21

xx

xxNNC

Page 8: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

8

Linear ProgrammingLinear Programming

For purposes of describing and analyzing algorithms, the problem is often stated in the standard form

}0,:min{ xbAxxcT

where x is the vector of n unknowns, c is the n dimensional cost vector, and A the constraint matrix (m rows and n

columns).

Page 9: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

9

Steps in Formulating a Linear Steps in Formulating a Linear Programming ProblemProgramming Problem

• Understand the problem• Identify the Decision Maker (DM)• Identify the decision variables• State the obj. function as a linear

combination of the decision variables• State the constraints as a linear

combination of the decision variables• Identify upper or lower bounds on DV’s

Page 10: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

10

LinearLinear Programming Programming

Solving and Sensitivity

Page 11: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

11

Linear ProgrammingLinear Programming

The feasible region described by the constraints is a polytope, or simplex, and at least one

member of the solution set lies at a vertex of this polytope

Each constraint (equation) defines a straight line in the space of the unknowns x

Page 12: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

12

Ways of Solving an LPWays of Solving an LP

• Graphical Method• Enumerating all extreme points• Simplex method invented by G. Dantzig

– Specialized software such as LINDO– General software such as Excel solver

• Interior point methods of the sort proposed by Karmarkar

• Specialized algorithms for special types of LP’s

Page 13: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

13

Sensitivity Analysis of LP’sSensitivity Analysis of LP’s• Simplex Method is a standard way to solve linear

programs• Its solution yields a “simplex tableau” with “dual

variables” which solve a closely related “dual” problem & which contain sensitivity analysis information for original problem concerning– How much could obj. fn. coefficients change without

changing optimal solution?– How would changing RHS values affect value of optimal

solution?– By how much could one change the RHS values without

changing the pattern (“nature”) of optimal solution?– Would it be optimal to produce a new product if it were

available?

Page 14: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

14

Simplex-Based Sensitivity Simplex-Based Sensitivity Analysis is Very LimitedAnalysis is Very Limited

• Can’t see “around corners”• Only relevant for linear programs• Was more relevant before CPU cycles

became cheap• Now more convenient to solve

iteratively and plot results, e.g., with– Spider Table– Solver Table

Page 15: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

15

LinearLinear Programming Programming

Various types of LP Models

Page 16: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

16

Next Topic: Learning Next Topic: Learning How to Formulate LP’sHow to Formulate LP’s

• Getting dec vars right is often the key• Don’t reinvent the wheel; get familiar with

common types of LP’s– Many problems are variants on these

common types– Many other problems have components

which are similar to one or more of the common types

• There are “tricks” for linearizing things that aren’t naturally linear

• No substitute for practice

Page 17: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

17

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 18: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

18

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 19: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

19

#1: Product Mix Decisions#1: Product Mix Decisions(Like the Howie’s Problem)(Like the Howie’s Problem)

• Decision: How many of each type of product should be made (offered)

• Decision variables– Xi = amount of product i to make (offer)

• Typical Constraints– Nonnegative production– Production capacity constraints (i.e, limits on

resources which are consumed in the process of producing products)

• Objective: Maximize profit (or min cost)

Page 20: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

20

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 21: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

21

#2: Make vs. Buy #2: Make vs. Buy DecisionsDecisions

• Several products, each can be made in house or purchased from vendors

• Decision: Not just how much of each product to obtain but also how much to make and how much to buy, so ...

• Decision variablesfor each product i:– Mi = amount of product i to make in house– Bi = amount of product i to purchase

Page 22: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

22

Make vs. Buy DecisionsMake vs. Buy Decisions

• Constraints– Meet demand– Production capacity constraints– Nonnegativity

• Objective: Minimize cost (or max profit)• Examples

– CHAMPUS (Civilian Health and Medical Program of the Uniformed Services)

– Outsourcing/privatization– Staffing courses with adjuncts

Page 23: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

23

Make vs. Buy DecisionsMake vs. Buy DecisionsMore General PerspectiveMore General Perspective

• Several products, each can be obtained through one or more sources

• Decision variables– Xij = amount of product i obtained from source j

• Constraints– Supply constraints on each source j– Demand constraints on each product i– Production capacity constraints– Nonnegativity

Page 24: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

24

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 25: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

25

#3: Investment/Portfolio #3: Investment/Portfolio AllocationAllocation

• Pool of resources (e.g., money or workers) needs to be allocated across a number of available “instruments”

• Decision: how much to put (e.g., invest) in each instrument, so ...

• Decision variablesfor each product i:– Xi = amount of invested in instrument i

Page 26: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

26

Investment/Portfolio Investment/Portfolio Allocation DecisionsAllocation Decisions

• Constraints– All resources allocated– Diversity constraints on amount invested in any

one instrument or type of instrument– Nonnegativity

• Objective: Maximize return/benefit• Examples

– Dollars to financial investments– Dollars to development projects– Staff/personnel to work projects

Page 27: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

27

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 28: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

28

#4: Scheduling Personnel (or #4: Scheduling Personnel (or Other Resources) to ShiftsOther Resources) to Shifts

• Outline of problem: Demand for services varies over time (time of day or day of week). You can have employees start at any time, but you have less control over when they stop. Typically they want to work in blocks of time of at least some minimum length and must be paid a bonus (OT) to work longer than the standard period. You could hire enough people at all times to meet the peak demand, but that would be wasteful. How can you find a more efficient schedule?

Page 29: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

29

Personnel Scheduling Natural Personnel Scheduling Natural Language DescriptionLanguage Description

• Decisions: How many people should be assigned to each shift (or shift type)– (Must explicitly identify shifts!)

• Objective: Minimize the cost of the assignment, which is the sum over all shifts of the number of people working that shift times the cost/person assigned to that shift

• Constraints: One for every time period. Meet demand in that period (& nonneg)

Page 30: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

30

Scheduling Example:Scheduling Example:Police Shift AssignmentPolice Shift Assignment

• Demand for police is defined for four hour blocks throughout a 24 hour day– (Typically would really look at 168 hour week and

pay attention to # of consecutive days officers worked too.)

• Officers can work 8 or 12 hour shifts• Police are paid double time for working

beyond 8 hours, so 12 hour shift costs twice as much as an 8 hour shift

Page 31: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

31

Demand Data for Police Demand Data for Police Shift Assignment ExampleShift Assignment Example

Period Times Officers Needed

1 11 pm - 3 am 30

2 3 am - 7 am 12

3 7 am - 11 am 16

4 11 am - 3 pm 20

5 3 pm - 7 pm 36

6 7 pm - 11 pm 34

Page 32: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

32

Algebraic Formulation of Police Algebraic Formulation of Police Scheduling ExampleScheduling Example

• Decision Variables– Xi = officers starting 8 hour shift in period i

– Yi = officers starting 12 hour shift in period i

• Objective: Minimize Labor Cost– Assume base pay equal for all officers, and

measure in terms of multiples of base pay for one shift

– Min Z = X1 + 2 Y1 + X2 + 2 Y2 + ...

Page 33: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

33

Algebraic Formulation (cont.)Algebraic Formulation (cont.)

• ConstraintsX6 + X1 + Y5 + Y6 + Y1 >= 30 (Period 1)

X1 + X2 + Y6 + Y1 + Y2 >= 12 (Period 2)

X2 + X3 + Y1 + Y2 + Y3 >= 16 (Period 3)

X3 + X4 + Y2 + Y3 + Y4 >= 20 (Period 4)

X4 + X5 + Y3 + Y4 + Y5 >= 36 (Period 5)

X5 + X6 + Y4 + Y5 + Y6 >= 34 (Period 6)

Xi, Yi >= 0 for all i

Page 34: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

34

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 35: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

35

#5: Transportation/#5: Transportation/Assignment ProblemsAssignment Problems

• Have various quantities of a commodity at multiple sources. Need to meet demand for that commodity at “sinks” (destinations). How much should you move that from each source to each sink in order to minimize the cost of meeting demand at each destination.

• Decision variables– Xij = amount sent from source i to sink j

• Cost parameters– cij = cost per unit of shipping from source i to sink j

Page 36: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

36

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 37: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

37

#6: Blending Problems#6: Blending Problems

• Several ingredients (feedstocks) are mixed to create different final products. How much of each ingredient should go into each product in order to minimize production costs while satisfying quality constraints on the products? E.g,– oil refining– producing animal feed mixes– production of dairy products– allocation of coal to power plants

Page 38: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

38

Blending ProblemsBlending Problems

• Decision Variables– Xij =units of ingredient i used in product j

– units could be pounds, tons, gallons, etc.

• Objective– Minimize cost of producing required

amounts of each product (typically driven by cost of ingredients)

Page 39: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

39

Blending Problems:Blending Problems:Constraint FormulationConstraint Formulation

• Demand constraint example– Need at least 8,000 pounds of product 1– X11 + X21 >= 8,000

• Quality constraint example– Ingredient 1 is 20% corn. Ingredient 2 is

50% corn.– Product 1 must be at least 30% corn.– 0.20 X11 + 0.50 X21 >= 0.30 (X11 + X21)

Page 40: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

40

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 41: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

41

#7: Multi-period Planning #7: Multi-period Planning ProblemsProblems

• These show up in many contexts, e.g.– investing (over time)– production planning (over time)– workforce planning (over time)

• Key characteristics– decisions about multiple time periods– some quantity is “conserved” over time, creating

constraints that span or link different time periods

Page 42: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

42

#7a: Multi-period Financial #7a: Multi-period Financial Planning ProblemsPlanning Problems

• Invest money to maximize return, manage cash flow during construction project, etc.

• Decision variables– Xij=amount invested in instrument i at time j

• Typical objectives– Maximize value in last period or– Minimize amount needed in first period

Page 43: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

43

Multi-period PlanningMulti-period PlanningConstraintsConstraints

• “Mass balance” constraint on money for each time periodRevenue at time t + $ maturing at time t =

amount invested at time t + payments

due at time t (for every period t)

• Constraints on mix of investments– Do not exceed maximum risk threshold– Maintain minimum level of liquidity– Etc.

Page 44: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

44

#7b: Multi-Period Planning:#7b: Multi-Period Planning:Trading Off OT and InventoryTrading Off OT and Inventory

• Suppose that in some periods demand exceeds normal production capacity. Three (costly) possible responses:– Use over-time– Produce ahead and hold in inventory– Fail to meet demand fully

• What balance of these strategies is best in each period?

Page 45: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

45

NotationNotation

• Decision variables– Xi = regular production in period i

– Yi = OT production in period i

– Zi = shortage in period i

– Ii = inventory carried into period i

• Parameters– Di = demand in period i

– I1 = initial inventory

– Cost parameters

Page 46: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

46

FormulationFormulation

• Minimize weighted sum of X’s, Y’s, Z’s, and I’s

• Subject to– Xi <= regular production capacity– Yi <= OT production capacity– Ii <= storage capacity– Ii + Xi + Yi + Zi = Di + Ii+1

mass balance constraint

Page 47: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

47

#7c: Multi-Period Planning:#7c: Multi-Period Planning:Work Force SchedulingWork Force Scheduling

• Size of (trained) labor force required varies over time (e.g., IRS staff)

• Can– Hire new employees, but they need to be trained

by experienced workers (which takes time away from primary task) and may not stay with organization

– (Sometimes) can lay-off employees– (Sometimes) can outsource or hire temps, but

typically at a high cost– (or proactively balance the workload)

Page 48: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

48

NotationNotation

• Decision variables– Wi = # of contractors hired in period i

– Xi = # employees hired & trained in period i

– Yi = # of experienced workers in period i

– Zi = # layed off at beginning of period i

• Parameters– Di = demand for exp. workers in period i

– Y0 = initial number of experienced workers

– Cost parameters

Page 49: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

49

FormulationFormulation

• Min weighted sum of W’s, X’s, Y’s, &Z’s• Suppose

– One exp worker can train four new hires– 95% retention of experienced workers– 50% retention of trainees

• Then constraints for each period i are – Wi Yi 0.25 Xi >= Di

– Yi + Zi = 0.95 Yi-1 + 0.5 Xi-1 mass balance– nonnegativity

Page 50: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

50

Review of Common Types Review of Common Types of LP Pbs.of LP Pbs.

1) Product mix problems

2) Make vs. buy

3) Investment/Portfolio allocation pbs

4) Scheduling

5) Transportation/Assignment problems

6) Blending

7) Multi-period planning

8) Cutting stock problems

Page 51: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

51

#8: Cutting Stock Problem#8: Cutting Stock Problem

• Suppose you produce a wide, continuous sheet of material (steel, film, paper, fabric, etc.). Customers demand various quantities (lengths) of thinner strips. How should you cut the wide sheet into strips to meet demand while minimizing either amount of raw material cut or amount wasted?

Page 52: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

52

Cutting Stock Problem:Cutting Stock Problem:Decision VariablesDecision Variables

• There are a finite number of reasonable cutting patterns which are characterized by where the cutting blades are placed.

• Decision Variables– Xi = # of feet (length) of wide sheet cut according

to pattern i

• Suppose– Sheets are 36 feet wide and– Customers want 8, 12, and 16 foot strips

Page 53: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

53

Example of Patterns for 36 Foot Example of Patterns for 36 Foot Wide Raw MaterialWide Raw Material

Pattern 8' pieces 12' pieces 16' pieces Waste#1 4 0 0 4#2 3 1 0 0#3 2 0 1 4#4 1 2 0 4#5 1 1 1 0#6 0 3 0 0#7 0 0 2 4

Page 54: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

54

Cutting Stock Cutting Stock Problem ConstraintsProblem Constraints

• Meet demand for 8 foot strips4 X1 + 3 X2 + 2 X3 + X4 + X5 >= b1

• Meet demand for 12 foot stripsX2 + 2 X4 + X5 + 3 X6 >= b2

• Meet demand for 16 foot stripsX3 + X5 + 2 X7 >= b3

• NonnegativityXi >= 0 for all i

Page 55: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

55

LinearLinear Programming Programming

Solving LP‘s in MS Excel

Page 56: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

56

Solving LP’s in ExcelSolving LP’s in Excel

• Organize data for model in spreadsheet

• Reserve cells for decision variables

• Create formula for the obj. function val.

• For each constraint, create– algebraic expression for LHS value– RHS constraint value

• Label everything!

Page 57: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

57

Recall Course Mix Example’sRecall Course Mix Example’sAlgebraic FormulationAlgebraic Formulation

• Decision variables– X1 = # of seminars offered– X2 = # of lectures offered

• Maximize Z = 3 X1 + 2 X2

s.t.X1 + 2 X2 <= 34 (faculty time)X2 <= 10 (lecture rooms)X1 <= 20 (seminar rooms)25 X1 + 100 X2 >= 800 (enrollment)X1, X2 >= 0 (non-negativity)

Page 58: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

58

Course Mix Example:Course Mix Example:Spreadsheet FormulationSpreadsheet Formulation

X1 = # of X2 = # ofSeminars Lectures Course

0 0 # offered Variety3 2 Unit Variety Score Index0 0 Variety Total 0

<= constraints Used Available1 2 0 34 Faculty Time0 1 0 10 Lecture Halls1 0 0 20 Seminar Rooms

>= constraints Available Needed25 100 0 800 Enrollment

Page 59: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

59

Course Mix Example:Course Mix Example:Spreadsheet FormulasSpreadsheet Formulas

X1 = # of X2 = # of

Seminars Lectures Course

0 0 # offered Variety

3 2 Unit Variety Score Index

=A3*A4 =B3*B4 Variety Total =A5+B5

<= constraints Used Available

1 2 =A$3*A8+B$3*B8 34 Faculty Time

0 1 =A$3*A9+B$3*B9 10 Lecture Halls

1 0 =A$3*A10+B$3*B10 20 Seminar Rooms

>= constraints Available Needed

25 100 =A$3*A13+B$3*B13 800 Enrollment

Page 60: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

60

Spreadsheet Solution:Spreadsheet Solution:Cells Specified to SolverCells Specified to Solver

X1 = # of X2 = # ofSeminars Lectures Course

0 0 # offered Variety3 2 Unit Variety Score Index0 0 Variety Total 0

<= constraints Used Available1 2 0 34 Faculty Time0 1 0 10 Lecture Halls1 0 0 20 Seminar Rooms

>= constraints Available Needed25 100 0 800 Enrollment

Page 61: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

61

The Solver Dialog BoxThe Solver Dialog Box

• Enter target cell, changing cells, and constraint cells information– can just point to cells; no need to type– can highlight sets of constraints at once– nonnegativity constraints are just like other

constraints; for RHS just type in 0

• Under options– Check “Assume linear model”– All other defaults should be fine

Page 62: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

62

Spreadsheet Solution:Spreadsheet Solution:Obtained by SolverObtained by Solver

X1 = # of X2 = # ofSeminars Lectures Course

20 7 # offered Variety3 2 Unit Variety Score Index

60 14 Variety Total 74

<= constraints Used Available1 2 34 34 Faculty Time0 1 7 10 Lecture Halls1 0 20 20 Seminar Rooms

>= constraints Available Needed25 100 1200 800 Enrollment

Page 63: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

63

Suppose Had One More Suppose Had One More Faculty: Enter ‘35’Faculty: Enter ‘35’

X1 = # of X2 = # ofSeminars Lectures Course

20 7 # offered Variety3 2 Unit Variety Score Index

60 14 Variety Total 74

<= constraints Used Available1 2 34 35 Faculty Time0 1 7 10 Lecture Halls1 0 20 20 Seminar Rooms

>= constraints Available Needed25 100 1200 800 Enrollment

Page 64: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

64

Pull Down Solver andPull Down Solver andClick on ‘Solve’Click on ‘Solve’

X1 = # of X2 = # ofSeminars Lectures Course

20 7.5 # offered Variety3 2 Unit Variety Score Index

60 15 Variety Total 75

<= constraints Used Available1 2 35 35 Faculty Time0 1 7.5 10 Lecture Halls1 0 20 20 Seminar Rooms

>= constraints Available Needed25 100 1250 800 Enrollment

Page 65: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

65

Spreadsheet Design Spreadsheet Design GuidelinesGuidelines

• Build model around display of data

• Don’t bury constants in formulas

• Logically close quantities should be physically close

• Design so formulas can be copied

• Use color, shading, borders, and protection

• Document with text boxes & cell notes

Page 66: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

66

Some Excel Functions That Are Some Excel Functions That Are Useful in LP FormulationUseful in LP Formulation

• SUMPRODUCT(array1, array2)• IF(logical expression,

value if true, value if false)• OR(logical exp., logical exp., ...)• ISTEXT(value)• VLOOKUP(lookup_value, table_array,

col_index_num)

Page 67: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

67

Summary of Solving LP’s Summary of Solving LP’s with Excel’s Solverwith Excel’s Solver

• Excel facilitates entering & solving LP’s

• Easy to explore “what if” variations

• To minimize errors– Think hard about layout of spreadsheet– Check for typos in formulas– Look at solution obtained; does it make

sense?

• Can use text’s examples as templates

Page 68: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

68

Mathematical ProgrammingMathematical Programming

Linear Programming

MS Excel Solver

Cases

Page 69: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

69

LinearLinear Programming Programming

Homework

Page 70: 1 Mathematical Programming Linear Programming. 2 Three Goals in this Chapter Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s.

70

BreakBreak