Outline Chapter 3: Intro to LP Outline Introduction to...

28
Introduction to Linear Programming ISyE 323 – Fall 2008– Prof. Jeff Linderoth Chapter 3 Chapter 3: Intro to LP Outline Outline Wyndor Glass Case Study (Section 3.1) A More General Model (Section 3.2) Assumptions of Linear Programming (Section 3.3) Additional Examples of LP (Section 3.4) Excel Solver (Section 3.6) Chapter 3: Intro to LP 2 Chapter 3: Intro to LP Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section 3.1) Problem Statement Formulating the Model Graphical Method for Solving the Model A More General Model (Section 3.2) Assumptions of Linear Programming (Section 3.3) Additional Examples of LP (Section 3.4) Excel Solver (Section 3.6) Chapter 3: Intro to LP 3 Chapter 3: Intro to LP Wyndor Glass Case Study (Section 3.1) Problem Statement Case Study Wyndor Glass Co. Produces windows and doors Three plants Plant 1: aluminum frames and hardware Plant 2: wood frames Plant 3: glass and assembly Two new products to be introduced Product 1: 8-foot glass door with aluminum frame Product 2: 4 × 6-foot double-hung wood-framed window Product 1 requires plants 1 and 3 Product 2 requires plants 2 and 3 Demand is unlimited Capacity is limited Chapter 3: Intro to LP 4

Transcript of Outline Chapter 3: Intro to LP Outline Introduction to...

Page 1: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Introduction to Linear Programming

ISyE 323 – Fall 2008– Prof. Jeff Linderoth

Chapter 3

Chapter 3: Intro to LP

Outline

Outline

Wyndor Glass Case Study (Section 3.1)

A More General Model (Section 3.2)

Assumptions of Linear Programming (Section 3.3)

Additional Examples of LP (Section 3.4)

Excel Solver (Section 3.6)

Chapter 3: Intro to LP 2

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Outline

Wyndor Glass Case Study (Section 3.1)Problem StatementFormulating the ModelGraphical Method for Solving the Model

A More General Model (Section 3.2)

Assumptions of Linear Programming (Section 3.3)

Additional Examples of LP (Section 3.4)

Excel Solver (Section 3.6)

Chapter 3: Intro to LP 3

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Problem Statement

Case Study

I Wyndor Glass Co.I Produces windows and doors

I Three plantsI Plant 1: aluminum frames and hardwareI Plant 2: wood framesI Plant 3: glass and assembly

I Two new products to be introducedI Product 1: 8-foot glass door with aluminum frameI Product 2: 4× 6-foot double-hung wood-framed window

I Product 1 requires plants 1 and 3

I Product 2 requires plants 2 and 3

I Demand is unlimited

I Capacity is limited

Chapter 3: Intro to LP 4

Page 2: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Problem Statement

Problem Definition

The problem:

I Choose production quantity of each product

I To maximize total profit

I Subject to capacity restrictions at each plant

We might find:

I It is optimal to produce both products

I It is optimal to max out capacity with one product and notproduce the other

I It is optimal to produce neither product (can’t turn a profit)

I There is not enough capacity to produce either product (theproblem is infeasible)

Chapter 3: Intro to LP 5

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Problem Statement

Data Requirements

We need to know:

I Number of hours of production time available at each plantper week (the available capacity)

I Number of hours of production time required for one batch ofeach product at each plant

I Profit per batch of each product produced

Chapter 3: Intro to LP 6

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Problem Statement

Data Requirements, cont’d

After months of meetings with Wyndor Glass managers, we find:

Production Time(hrs/batch)

Plant Product 1 Product 2 Available Hours

1 1 0 42 0 2 123 3 2 18

Profit per Batch $3000 $5000

Chapter 3: Intro to LP 7

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Formulating the Model

Decision Variables

I LetI x1 = number of batches of product 1 produced per weekI x2 = number of batches of product 2 produced per week

I We don’t know the values of x1 and x2 yet—the model issupposed to decide

I These are called decision variables

Chapter 3: Intro to LP 8

Page 3: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Formulating the Model

Objective Function

I We want to maximize total profit

I Total profit (in $1000s) is given by

3x1 + 5x2

(recall: product 1 earns $3000/batch, product 2 earns$5000/batch)

I So we want tomaximize 3x1 + 5x2

I This is called the objective function

Chapter 3: Intro to LP 9

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Formulating the Model

ConstraintsI Each batch of product 1 requires 1 hour at plant 1

I Plant 1 has 4 hours available

I To avoid exceeding the capacity at plant 1, we have to say:

x1 ≤ 4

I Similarly, at plant 2:2x2 ≤ 12

I And at plant 3:3x1 + 2x2 ≤ 18

I Also, the production amounts have to be non-negative:

x1 ≥ 0, x2 ≥ 0

I These are called constraints

Chapter 3: Intro to LP 10

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Formulating the Model

The Linear Program

maximize 3x1 + 5x2

subject to x1 ≤ 42x2 ≤ 12

3x1 + 2x2 ≤ 18x1 ≥ 0

x2 ≥ 0

I This is called a linear program (LP)I “Linear” because the objective function and constraints are all

linear functions of the decision variablesI No x2

1,√x2, x1x2, etc.

I “Program”: Historically “plan”

Chapter 3: Intro to LP 11

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Formulating the Model

By the Way...

The layout of the LP should remind you of the data table:

max 3x1 + 5x2

s.t. 1x1 ≤ 42x2 ≤ 12

3x1 + 2x2 ≤ 18x1 ≥ 0

x2 ≥ 0

Prod. Time Avail.Plant P1 P2 Hrs.

1 1 0 42 0 2 123 3 2 18

Profit $3000 $5000

Chapter 3: Intro to LP 12

Page 4: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

What Values of x1 and x2 are Allowed?

x1 ≥ 0x2 ≥ 0x1 ≤ 42x2 ≤ 123x1 + 2x2 ≤ 18

The shadedarea is thefeasible region

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

x1 = 4

2x2 = 12

3x1 + 2x2 = 18

Chapter 3: Intro to LP 13

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

The Optimal Solution

I Every solution (x1, x2) in the feasible region is a valid solutionfor our LP

I NB: “Solution” does not necessarily mean the final or bestanswer to a problem!

I Such solutions are called feasible solutions

I We want to find the feasible solution that maximizes theobjective function

I The best feasible solution is called the optimal solution

I There may be many such solutions

Chapter 3: Intro to LP 14

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Graphical Method for Finding the Optimal Solution

Is there a solutionwith the objectivefunction equal to50?

No, since the line3x1 + 5x2 = 50does not intersectthe feasible region.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

Chapter 3: Intro to LP 15

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Graphical Method for Finding the Optimal Solution

How about equalto 10?

Yes, there are lotssince the line3x1 + 5x2 = 10goes through thefeasible region.But they aren’t op-timal. x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

3x1 + 5x2 = 10

Chapter 3: Intro to LP 15

Page 5: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Graphical Method for Finding the Optimal Solution

Equal to 40?

No.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

3x1 + 5x2 = 10

3x1 + 5x2 = 40

Chapter 3: Intro to LP 15

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Graphical Method for Finding the Optimal Solution

20?

Yes.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

3x1 + 5x2 = 10

3x1 + 5x2 = 40

3x1 + 5x2 = 20

Chapter 3: Intro to LP 15

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Graphical Method for Finding the Optimal Solution

36?

Yes, if x1 = 2and x2 = 6, then3x1 + 5x2 = 36,and (2,6) is feasi-ble. This is the op-timal solution.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

3x1 + 5x2 = 10

3x1 + 5x2 = 40

3x1 + 5x2 = 20

3x1 + 5x2 = 36

Chapter 3: Intro to LP 15

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

The Objective Function

I All of the objective function lines are parallel

I They all have the same slope

I To see this, convert to slope-intercept form:

x2 = −35x1 +

15Z

I Z is the “guess” objective function value

Chapter 3: Intro to LP 16

Page 6: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Weird Situations

It’s possible forthere to be manyoptimal solutions.

For ex., if theobjective functionwere

3x1 + 2x2.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

3x1 + 2x2 = 18

Chapter 3: Intro to LP 17

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Weird Situations

It’s possible forthere to be nooptimal solution.

For ex., if theconstraints

2x2 ≤ 12 and

3x1 + 2x2 ≤ 18

weren’t there.x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

103x1 + 5x2 = 50

3x1 + 5x2 = 10

3x1 + 5x2 = 40

3x1 + 5x2 = 20

Chapter 3: Intro to LP 17

Chapter 3: Intro to LP

Wyndor Glass Case Study (Section 3.1)

Graphical Method for Solving the Model

Weird Situations

It’s possible forthere to be nofeasible solutions.

For ex., if therewere also aconstraint

3x1 + 5x2 ≥ 50.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

x1 = 4

2x2 = 12

3x1 + 2x2 = 18

3x1 + 5x2 = 50

Chapter 3: Intro to LP 17

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Outline

Wyndor Glass Case Study (Section 3.1)

A More General Model (Section 3.2)TerminologyStandard FormSolution Terminology

Assumptions of Linear Programming (Section 3.3)

Additional Examples of LP (Section 3.4)

Excel Solver (Section 3.6)

Chapter 3: Intro to LP 18

Page 7: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Terminology

LP Terminology

I In general, an LP involves setting the level of a number ofactivities to minimize or maximize some performancemeasure, with constraints on the resources.

I For example, choose the production rate for each product tomaximize profit subject to production capacities.

I Common notation:I n = number of activitiesI m = number of resourcesI Z = overall performance measure (objective function value)I xj = level of activity j, j = 1, . . . , nI cj = increase in Z that would result from 1 unit increase in xj

(i.e., cost or revenue per unit)I bi = amount of resource i available, i = 1, . . . ,mI aij = amount of resource i consumed by 1 unit of activity j

Chapter 3: Intro to LP 19

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Terminology

Terminology, cont’d

I Recall:I xj are called decision variablesI Z is called the objective function value

I cj , bi, and aij are called parameters or data or inputs orconstants

Chapter 3: Intro to LP 20

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Terminology

Data Required for an LP

Resource Usage perUnit of Activity Amount of

Resource 1 2 · · · n Resource Avail.

1 a11 a12 · · · a1n b12 a21 a22 · · · a2n b2...

......

. . ....

...m am1 am2 · · · amn bm

Contribution to Z c1 c2 · · · cnper unit of activity

This should remind you of the table from earlier.

Chapter 3: Intro to LP 21

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Standard Form

Standard Form of the LP Model

maximize Z = c1x1 + c2x2 + . . . + cnxn

subject to a11x1 + a12x2 + . . . + a1nxn ≤ b1

a21x1 + a22x2 + . . . + a2nxn ≤ b2

...am1x1 + am2x2 + . . . + amnxn ≤ bm

x1 ≥ 0x2 ≥ 0

...xn ≥ 0

This is called the standard form of the LP model.

Chapter 3: Intro to LP 22

Page 8: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Standard Form

More Terminology

I The standard form consists of:I Objective functionI Functional constraintsI Non-negativity constraints

Chapter 3: Intro to LP 23

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Standard Form

Other FormsThe model may use variations on the standard form:

I Minimization:

minimize c1x1 + c2x2 + . . .+ cnxn

I Greater-than-or-equal-to constraints:

ai1x1 + ai2x2 + . . .+ ainxn ≥ biI Equality constraints:

ai1x1 + ai2x2 + . . .+ ainxn = bi

I Non-positive or unrestricted variables:

xj ≤ 0

xj unrestricted

Chapter 3: Intro to LP 24

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Solution Terminology

I A solution is any specification of the decision variables(x1, x2, . . . , xn).

I A feasible solution is a solution for which all constraints aresatisfied.

I An infeasible solution is a solution for which at least oneconstraint is violated.

I An optimal solution is a feasible solution that maximizes(minimizes) the objective function.

I The feasible region is the set of all feasible solutions.

Chapter 3: Intro to LP 25

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Solutions to the Wyndor Glass Problem

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

feasible solution

infeasible solution

optimal solution

Chapter 3: Intro to LP 26

Page 9: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Number of Optimal Solutions

Recall that an LP may have:

A single optimalsolution.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 27

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Number of Optimal Solutions

Recall that an LP may have:

Many optimalsolutions. (In fact, aninfinite number.)

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 27

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Number of Optimal Solutions

Recall that an LP may have:

No optimal solution(an unboundedproblem).

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 27

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Number of Optimal Solutions

Recall that an LP may have:

No feasible solution (aninfeasible problem).

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 27

Page 10: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

Corner-Point Feasible Solutions

A corner-pointfeasible (CPF)solution is a solutionthat lies at a corner ofthe feasible region.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 28

Chapter 3: Intro to LP

A More General Model (Section 3.2)

Solution Terminology

CPF Solutions, cont’d

I Consider a feasible, bounded LP.

I Is there always a CPF solution?

I Is there always an optimalsolution?

I Does the best CPF solution haveto be optimal?

If the problem has exactly one optimalsolution, it must be a CPF solution.If the problem has multiple optimal so-lutions, at least two must be CPF solu-tions.

x1

x2

1 532 4 6 7

1

3

4

2

6

5

7

8

9

8

10

Chapter 3: Intro to LP 29

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Outline

Wyndor Glass Case Study (Section 3.1)

A More General Model (Section 3.2)

Assumptions of Linear Programming (Section 3.3)ProportionalityAdditivityDivisibilityCertaintySummary

Additional Examples of LP (Section 3.4)

Excel Solver (Section 3.6)Chapter 3: Intro to LP 30

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Proportionality Assumption

Proportionality Assumption

I The contribution of each activity to the objective function isproportional to the level of the activity.

I The contribution of each activity to the left-hand side of eachfunctional constraint is proportional to the level of the activity.

In other words:

I The objective function term for activity j is of the form cjxj

I The constraint terms for activity j are of the form aijxj

No exponents other than 1!

Chapter 3: Intro to LP 31

Page 11: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

What Does Proportionality Look Like?

Objective function: 3xj

xj

Contribution of xj to Z

1 2 3

6

3

9

4

12

Chapter 3: Intro to LP 32

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Start-Up Costs Violate Proportionality

Objective function:

{3xj − 1, if xj > 00, if xj = 0

xj

Contribution of xj to Z

1 2 3

6

3

9

4

12

Chapter 3: Intro to LP 33

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Increasing Marginal Profits Violate Proportionality

Objective function: 3x1.5j

xj

Contribution of xj to Z

1 2 3 4

Chapter 3: Intro to LP 34

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Decreasing Marginal Profits Violate Proportionality

Objective function: 3x0.5j

xj

Contribution of xj to Z

1 2 3 4

Chapter 3: Intro to LP 35

Page 12: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Quantity Discounts Violate Proportionality

xj

Contribution of xj to Z

1 2 3 4

Chapter 3: Intro to LP 36

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Proportionality

Is Proportionality a Reasonable Assumption?

I Often real-life problems violate proportionality in one or moreof these ways.

I But it’s often reasonable to assume proportionality even if it’sviolated.

I There are ways of handling some forms of non-proportionality.

I Otherwise, use mixed-integer programming (Chapter 11) ornon-linear programming (Chapter 12).

Chapter 3: Intro to LP 37

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Additivity

Additivity Assumption

Additivity Assumption

Every function (objective function or left-hand side of constraints)is the sum of the individual contributions of the respective activities.

In other words:The variables in the objective functions and constraints are addedtogether, never multiplied.

For example, no terms like 3x1x2.

Chapter 3: Intro to LP 38

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Additivity

Example: Non-Additive Objective Function

Suppose the objective function for the Wyndor Glass problem were

Z = 3x1 + 5x2 + x1x2

I Is proportionality satisfied?

I When might this occur?

I When might Z = 3x1 + 5x2 − x1x2 occur?

Chapter 3: Intro to LP 39

Page 13: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Additivity

Example: Non-Additive Constraint

Suppose the production time required at plant 3 were given by

3x1 + 2x2 + 0.5x1x2,

so that the constraint is

3x1 + 2x2 + 0.5x1x2 ≤ 18.

I When might this occur?

Chapter 3: Intro to LP 40

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Divisibility

Divisibility Assumption

Divisibility Assumption

The decision variables are allowed to take on any values that satisfythe functional and non-negativity constraints.

In other words:The values of the decision variables may be fractional.

I Does the divisibility assumption hold in the Wyndor Glassexample?

I (Recall: the decision variables represented # of batches.)

I What if the decision variables represented the number ofdoors and windows to produce?

Chapter 3: Intro to LP 41

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Certainty

Certainty Assumption

Certainty Assumption

The value assigned to each parameter is a known constant.

In other words:All of the parameters cj , bi, and aij are known with certainty.

I Why might the parameters not be known with certainty?

I Is the certainty assumption reasonable?

I Sensitivity analysis: how much would the answer change if theparameters changed?

Chapter 3: Intro to LP 42

Chapter 3: Intro to LP

Assumptions of Linear Programming (Section 3.3)

Summary

Assumptions: Summary

Assumptions for LP

1. Proportionality

2. Additivity

3. Divisibility

4. Certainty

I In practice, all of these assumptions may be violated.

I If they’re not violated too badly, we can just assume that theyhold.

I If they are violated badly:I We can still formulate many of these problems.I But solving them may be much more difficult.

Chapter 3: Intro to LP 43

Page 14: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Outline

Wyndor Glass Case Study (Section 3.1)

A More General Model (Section 3.2)

Assumptions of Linear Programming (Section 3.3)

Additional Examples of LP (Section 3.4)Diet ProblemControlling Air PollutionPersonnel SchedulingYummy – A Blending ProblemSkippy’s Fine, Fine Bourbon

Excel Solver (Section 3.6)Chapter 3: Intro to LP 44

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Gentlemen, Clog Your Arteries!

I What I was young and foolish, likeyourselves, I thought I could eat everymeal at McDonald’s.

I However, I was at least “intelligent”(read geeky) about the way I was goingto go about it.

I Let’s build a mathematical model tpdetermine how many McDonald’s itemsto eat.

Chapter 3: Intro to LP 45

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

You Deserve a Break Today

Mmmmmmmmmmm.

I QP: Quarter Pounder

I MD: McLean Deluxe

I BM: Big Mac

I FF: Filet-O-Fish

I MC: McGrilled Chicken

I FR: Small Fries

I SM: Sausage McMuffin

I 1M: 1% Milk

I OJ: Orange Juice

Nutrients

I Prot: Protein

I VitA: Vitamin A

I VitC: Vitamin C

I Calc: Calcium

I Iron: Iron

I Cals: Calories

I Carb: Carbohydrates

Chapter 3: Intro to LP 46

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Elements of an Optimization

Variables

I Q: What are we trying to decide?

I A: How many of each item to eat.I Let xj : Be the number of item j to eat.

I (e.g. xQP : Number of quarter pounders).

Objective

I Let’s minimize our cost

I But how much does a daily menu cost?

I It (of course) is a function of what I eat.

Chapter 3: Intro to LP 47

Page 15: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Data

QP MD BM FF MC FR SM 1M OJ Req’dCost 1.84 2.19 1.84 1.44 2.29 0.77 1.29 0.6 0.72Prot 28 24 25 14 31 3 15 9 1 55VitA 15 15 6 2 8 0 4 10 2 100VitC 6 10 2 0 15 15 0 4 120 100Calc 30 20 25 15 15 0 20 30 2 100Iron 20 20 20 10 8 2 15 0 2 100Cals 510 370 500 370 400 220 345 110 80 2000Carb 34 33 42 38 42 26 27 12 20 350

Chapter 3: Intro to LP 48

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Costing

I So if I bought my regular lunch: 3 quarter pounders, 2 smallfries, and a 1% milk, my cost would be

3($1.84) + 2($1.44) + 1($0.6) = $9.00

I A general expression for my cost as a function of my decisionon what to buy is

1.84xQP + 2.19xMD + 1.84xBM + 1.44xFF + 2.29xMC

+ 0.77xFR + 1.29xSM + 0.6x1M + 0.72xOJ

I This is a linear function of the decision variables x

Chapter 3: Intro to LP 49

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Nag, Nag, Nag :-)

I My wife tells me that I need to get 100% of my dailynutritional requirements from eating at McDonald’s

I A general expression for the daily amount of Vitamin A that Iget by eating at McDonald’s is1

15xQP + 15xMD + 6xBM + 2xFF + 8xMC

+ 4xSM + 10x1M + 2xOJ

I This quantity needs to be 100:

15xQP + 15xMD + 6xBM + 2xFF + 8xMC

+ 4xSM + 10x1M + 2xOJ ≥ 100I You can write similar constraints for each nutrient:1I could eat 50 Filet-O-Fish to get my Vitamin A requirements!

Chapter 3: Intro to LP 50

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

The Final Model (1 of 3)

minimize

1.84xQP + 2.19xMD + 1.84xBM + 1.44xFF + 2.29xMC

+ 0.77xFR + 1.29xSM + 0.6x1M + 0.72xOJ

subject to

Protein: 28xQP + 24xMD + 25xBM + 14xFF + 31xMC

+ 3xFR + 15xSM + 9x1M + xOJ ≥ 55

Vitamin A: 15xQP + 15xMD + 6xBM + 2xFF + 8xMC

+ 4xSM + 10x1M + 2xOJ ≥ 100

Chapter 3: Intro to LP 51

Page 16: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Final McDonald’s Model (2 of 3)

Vitamin C: 6xQP + 10xMD + 2xBM + 15xMC + 15xFR

+ 4x1M + 120xOJ ≥ 100

Calcium: 30xQP + 20xMD + 25xBM + 15xFF + 15xMC

+ 20xSM + 30x1M + 2xOJ ≥ 100

Iron: 20xQP + 20xMD + 20xBM + 10xFF + 8xMC

+ 2xFR + 15xSM + 2xOJ ≥ 100

Chapter 3: Intro to LP 52

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Diet Problem

Final McDonald’s Model (3 of 3)

Calories: 510xQP + 370xMD + 500xBM + 370xFF + 400xMC

+ 220xFR + 345xSM + 110x1M + 80xOJ ≥ 2000

Carbs: 34xQP + 35xMD + 42xBM + 38xFF + 42xMC + 26xFR

+ 27xSM + 12x1M + 20xOJ ≥ 350

xQP , xMD, xBM , xFF , xMC , xFR, xSM , x1M , xOJ ≥ 0

Chapter 3: Intro to LP 53

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Problem Statement

I The Nori & Leets Steel Co. needs to reduce its emissions ofI ParticulatesI Sulfur oxidesI Hydrocarbons

I It can reduce all emissions byI Adding taller smokestacksI Adding filtersI Using better fuels

in both itsI Blast furnacesI Open-hearth furnaces

I The goal is to meet the reduction requirements at theminimum possible cost.

Chapter 3: Intro to LP 54

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Reduction Requirements

I The company must reduce emissions by the followingamounts, in million pounds per year:

Pollutant Required reduction

Particulates 60Sulfur oxides 150Hydrocarbons 125

Chapter 3: Intro to LP 55

Page 17: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Abatement Methods

I Each abatement method can be used to its full extent, orpartially

I Costs and emissions benefits are proportional to extent of use

I Here are the emissions reductions for each abatement methodon each type of furnace if used fully:

Taller Smokestacks Filters Better FuelsPollutant BF OHF BF OHF BF OHF

Particulates 12 9 25 20 17 13Sulfur oxides 35 42 18 31 56 49Hydrocarbons 37 53 28 24 29 20

I Clearly, more than one method must be chosen.

Chapter 3: Intro to LP 56

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Costs

I The cost to implement each abatement method in full, inmillions of dollars per year, is:

Abatement Method Blast Furnaces Open-Hearth Furnaces

Taller smokestacks 8 10Filters 7 6Better fuels 11 9

I The cost to use a method partially is proportional.I For example, to use filters for blast furnaces at 75% strength

costs 0.75× 7 = 5.25

Chapter 3: Intro to LP 57

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Decision Variables

I Decision variables represent the fraction of each method used.

I 0 = don’t use at all, 1 = use fully

I Or anywhere in between

I Indexed as follows:

Abatement Method Blast Furnaces Open-Hearth Furnaces

Taller smokestacks x1 x2

Filters x3 x4

Better fuels x5 x6

Chapter 3: Intro to LP 58

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Objective Function

I The objective is to minimize the total cost.

I The objective function is given by

Z = 8x1 + 10x2 + 7x3 + 6x4 + 11x5 + 9x6

Chapter 3: Intro to LP 59

Page 18: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

ConstraintsThree types of constraints:

1. Emission reduction:

12x1 + 9x2 + 25x3 + 20x4 + 17x5 + 13x6 ≥ 6035x1 + 42x2 + 18x3 + 31x4 + 56x5 + 49x6 ≥ 15037x1 + 53x2 + 28x3 + 24x4 + 29x5 + 20x6 ≥ 125

2. Technological limit:

xj ≤ 1 ∀j = 1, 2, . . . , 6

3. Non-negativity:

xj ≥ 0 ∀j = 1, 2, . . . , 6

Chapter 3: Intro to LP 60

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

The LP

minimize Z = 8x1 + 10x2 + 7x3 + 6x4 + 11x5 + 9x6

subject to 12x1 + 9x2 + 25x3 + 20x4 + 17x5 + 13x6 ≥ 6035x1 + 42x2 + 18x3 + 31x4 + 56x5 + 49x6 ≥ 15037x1 + 53x2 + 28x3 + 24x4 + 29x5 + 20x6 ≥ 125

x1 ≤ 1x2 ≤ 1

x3 ≤ 1x4 ≤ 1

x5 ≤ 1x6 ≤ 1

x1 ≥ 0x2 ≥ 0

x3 ≥ 0x4 ≥ 0

x5 ≥ 0x6 ≥ 0

Chapter 3: Intro to LP 61

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Controlling Air Pollution

Solving the LP

I Since this problem uses more than 2 decision variables, wecan’t use the graphical method.

I The method of choice for solving LPs is the simplexmethod—more on this in the next chapter.

I The optimal solution turns out to be:

(x1, x2, x3, x4, x5, x6) = (1.000, 0.623, 0.343, 1.000, 0.048, 1.000).

I The optimal cost is

8×1+10×0.623+7×0.343+6×1+11×0.048+9×1 = 32.16,

or $32.16 million.

Chapter 3: Intro to LP 62

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Problem Statement

I Union Airways needs to schedule customer service agents atcheck-in desks and gates.

I A 24-hour day is divided into 5 (overlapping) 8-hour shifts:

1. 6:00 AM – 2:00 PM2. 8:00 AM – 4:00 PM3. 12:00 PM – 8:00 PM4. 4:00 PM – 12:00 AM5. 10:00 PM – 6:00 AM

I Agents’ pay is different for different shifts

I The airline knows how many workers are required for eachportion of the day.

I The goal is to find the schedule of workers to cover therequirements at minimum cost.

Chapter 3: Intro to LP 63

Page 19: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Shifts and Requirements

The requirements for each time period, the shifts that cover them,and the pay for each shift, are given by:

Shift Minimum Number ofTime Period 1 2 3 4 5 Agents Needed

6 AM–8 AM • 488 AM–10 AM • • 7910 AM–12 PM • • 6512 PM–2 PM • • • 872 PM –4 PM • • 644 PM –6 PM • • 736 PM –8 PM • • 828 PM –10 PM • 4310 PM–12 AM • • 5212 AM–6 AM • 15

Cost/day/agent $170 $160 $175 $180 $195

Chapter 3: Intro to LP 64

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Decision Variables and Objective Function

I Let xj = the number of agents assigned to shift j,j = 1, . . . , 5

I Is divisibility assumption satisfied?

I The objective function is given by

Z = 170x1 + 160x2 + 175x3 + 180x4 + 195x5.

We want to minimize Z.

Chapter 3: Intro to LP 65

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Functional Constraints

I The number of agents on duty during each time period mustbe greater than or equal to the required number.

I For example, from 2 PM–4 PM, we need at least 64 workers.

I Since shifts 2 and 3 both cover the 2 PM–4 PM time slot, weknow

x2 + x3 ≥ 64

I NB: these constraints come from the data table just like inprevious examples if we treat the •’s as 1’s

Chapter 3: Intro to LP 66

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

The LP

minimize Z = 170x1 + 160x2 + 175x3 + 180x4 + 195x5

subject to x1 ≥ 48 (6–8 AM)

x1 + x2 ≥ 79 (8–10 AM)

x1 + x2 ≥ 65 (10 AM–12 PM)

x1 + x2 + x3 ≥ 87 (12 PM–2 PM)

x2 + x3 ≥ 64 (2 PM–4 PM)

x3 + x4 ≥ 73 (4 PM–6 PM)

x3 + x4 ≥ 82 (6 PM–8 PM)

x4 ≥ 43 (8 PM–10 PM)

x4 + x5 ≥ 52 (10 PM–12 AM)

x5 ≥ 15 (12 AM–6 AM)

xj ≥ 0 ∀j = 1, . . . , 5

Some of these constraints are redundant—which are they?

Chapter 3: Intro to LP 67

Page 20: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Optimal Solution

I The optimal solution to this LP is

(x1, x2, x3, x4, x5) = (48, 31, 39, 43, 15).

I The optimal objective function value is

Z = 170×48+160×31+175×39+180×43+195×15 = 30, 610.

I I didn’t round off the solution—the values happened to beinteger.

I This does not normally occur.

I If the solution had been fractional, what should we have doneto convert to a feasible integer solution?

Chapter 3: Intro to LP 68

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

The ConstraintsI Let’s check that the constraints are satisfied:

48 = 48 ≥ 48 (1)48 + 31 = 79 ≥ 79 (2)48 + 31 = 79 ≥ 65 (3)48 + 31 + 39 = 118 ≥ 87 (4)

31 + 39 = 70 ≥ 64 (5)39 + 43 = 82 ≥ 73 (6)39 + 43 = 82 ≥ 82 (7)

43 = 43 ≥ 43 (8)43 + 15 = 58 ≥ 52 (9)

15 = 15 ≥ 15 (10)

I Constraints 1, 2, 7, 8, and 10 are bindingI Constraints 3, 4, 5, 6, and 9 are non-binding

I Removing them would not change the optimal solution.I But we didn’t know that in advance!I (Non-binding is different from redundant.)

Chapter 3: Intro to LP 69

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

More About Binding and Non-Binding Constraints

Recall the feasible regionfor the Wyndor problem.

What are the bindingconstraints for eachsolution pictured?

x1

x2 x1 = 4

2x2 = 12

3x1 + 2x2 = 4

1 2

3

45

6

8

7

Chapter 3: Intro to LP 70

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

CPFs and Binding Constraints

I In this example, everycorner-point solution(CPF) has exactly 2binding constraints.

I In every 2-dimensionalproblem, it is true thatevery CPF has at least2 binding constraints.

I Two CPFs are calledadjacent if they share 1binding constraint.

I Ex: 2 and 3 areadjacent, 1 and 5 areadjacent, etc.

x1

x2 x1 = 4

2x2 = 12

3x1 + 2x2 = 4

1 2

3

45

6

8

7

Chapter 3: Intro to LP 71

Page 21: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Personnel Scheduling

Simplex Method Preview

I Start at any CPF.

I Move to an adjacentCPF with a betterobjective function value.

I Continue until noadjacent CPF has abetter objectivefunction value.

I How do we know this issufficient?

I How to implement foran n-dimensionalproblem? x1

x2

Chapter 3: Intro to LP 72

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Another example – Yummy

I Yummy Foods is planning on creating a new snack productthat is manufactured by blending a combination of vegetableand non-vegetable oils. (Sounds Delicious!!!!!)

I Analysis has determined the following:I The two types of oils are produced separately.I In any month, it is not possible to produce more than 200 tons

of vegetable oil and more than 250 tons of non-vegetable oil.I According to food experts, the “yummy coefficient” of the

final product must be between 3 and 6 in order to meet qualitystandards.

Chapter 3: Intro to LP 73

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Yummy Example, Cont.

I Market analysis reveals that the final product can be sold for$15,000 per ton.

I The cost and yummy coefficient for each oil is shown below:

Veg1 Veg2 NVeg1 NVeg2 NVeg3

Cost ($1000/ton) 11 12 13 11 11.5Yummyness 8.8 6.1 2.0 4.2 5.0

Chapter 3: Intro to LP 74

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Decision Variables

I Clearly define the decision variables.I x1 : Number of tons of Veg1 used in a monthI x2 : Number of tons of Veg2 used in a monthI x3 : Number of tons of NVeg1 used in a monthI x4 : Number of tons of NVeg2 used in a monthI x5 : Number of tons of NVeg3 used in a month

Chapter 3: Intro to LP 75

Page 22: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Constraints—Key Physical Quantities

I Tons of YummySnack produced.I x1 + x2 + x3 + x4 + x5

I What assumption did I make here?

I Number of Tons of Vegetable Oil Per MonthI x1 + x2 (≤ 200)

I Number of Tons of Non-Vegetable Oil Limited Per MonthI x3 + x4 + x5 (≤ 250)

I Yummy Coefficient : weighted average of the yummycoefficients of the individual oil components.

I 8.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5/∑5

i=1 xi

Chapter 3: Intro to LP 76

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Yummy Problem

Maximize Net profit:

15(x1 + x2 + x3 + x4 + x5)− 11x1 − 12x2 − 13x3 − 11x4 − 11.5x5

subject to

x1 + x2 ≤ 200x3 + x4 + x5 ≤ 250

8.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5∑5i=1 xi

≤ 6

8.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5∑5i=1 xi

≥ 3

xi ≥ 0 ∀i = 1, 2, . . . 5

Chapter 3: Intro to LP 77

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Is This a Linear Problem

I OK, did we just write our second linear program?

I What about...

8.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5∑5i=1 xi

≤ 6

I Is this a linear function?

Chapter 3: Intro to LP 78

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

NO! : 2x1+x2

x1+x2

Chapter 3: Intro to LP 79

Page 23: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Making the Nonlinear Into Linear

I By doing some algebra, we can write the set of pointssatisfying this (nonlinear) inequality as a linear inequality...

I Multiply both sides of the inequality by∑5

i=1 xi

I Gather the terms...

2.8x1 + 0.1x2 − 4x3 − 1.8x4 − x5 ≤ 0

I What (very important) assumption did I just make?

I∑5

i=1 xi > 0I Sometimes it is useful to have definitional variables:

I y : The total quantity of product that should be made in amonth

Chapter 3: Intro to LP 80

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Yummy Problem – with Definitional Variables

Maximize Net profit:

150y − 110x1 − 120x2 − 130x3 − 110x4 − 115x5

subject to

x1 + x2 ≤ 200x3 + x4 + x5 ≤ 250

8.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5 − 6y ≤ 08.8x1 + 6.1x2 + 2x3 + 4.2x4 + 5x5 − 3y ≥ 0

x1 + x2 + x3 + x4 + x5 − y = 0xi ≥ 0 ∀i = 1, 2, . . . 5y ≥ 0

Chapter 3: Intro to LP 81

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Yummy – A Blending Problem

Tips

I What you just learned was commonly called a blendingconstraint

I Sometimes things that look nonlinear are really linear.I Try a variable substitution, and/or some simple algebra.

I Use “definitional” constraints if you need them.I They often make the model easier to read

I The best way to get better at modeling is to

1. Practice2. Practice3. Practice

Chapter 3: Intro to LP 82

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Modeling Multi-Period Problems

I Multi-period planning! One of the most important uses ofoptimization is in multi-period planning.

I Partition time into a number of periods.

I Usually distinguished by Inventory or Carry-Over variables.

I Suppose there is a “planning horizon” T = {1, 2, . . . , |T |}.I Also suppose there is a known demand dt for each t ∈ TI Define...

I Pt : Production level in period t, ∀t ∈ TI It : Inventory level in period t,∀t ∈ T

Chapter 3: Intro to LP 83

Page 24: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Modeling Multi-Period Problems

I

P

d

I

t

t

t

t+1t−1

t

I0 + P1 = d1 + I1

I1 + P2 = d2 + I2

It−1 + Pt = dt + It

I To model “losses orgains”, just putappropriate multipliers(not 1) on the arcs

Chapter 3: Intro to LP 84

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Fine Bourbon

Skippy’s Fine Liquors makes small-batch bourbon.

I Forecast demands dt.I The demand (in numbers of barrels) of bourbon for each time

period t ∈ T def= {1, 2, . . . , |T |}.I Costs α ($/period/barrel) to carry inventory.I Costs β ($/period/barrel) to change the production level from

one period to the nextI “Hiring and Firing” costs: We will show how to model

absolute value functions with linear constraints.

I Initial Inventory I0I Initial Production level P0

Chapter 3: Intro to LP 85

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Model

Decision Variables

I Pt : Number of barrels of bourbon to make in time periodt ∈ T

I It : Inventory of bourbon after time period t ∈ T

Key Algebraic Quantities

I Inventory Cost: α∑|T |

t=1 It

I Production Level Change Cost: β∑|T |

t=1 |Pt−1 − Pt|.

Chapter 3: Intro to LP 86

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

More of Skippy’s Fine Bourbon

I Skippy need to meet demand over all time periods in amanner that...

1. Minimizes inventory holding costs from one period to the next2. Minimizes hiring and firing costs incurred by changing the

production rate from one period to the next

Chapter 3: Intro to LP 87

Page 25: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Absolutely Cool Trick

I Can we leave | · | in the objective function?I No! This is not a linear function

The Trick

1. Add constraint/variables, x = x+ − x−.

2. Make objective: min c(x+ + x−)

I Dt : Decrease in Production Level (Barrels) in period tI Ut : Increase in Production Level (Barrels) in period tI Ut −Dt = Pt − Pt−1, ∀t = 1, 2, . . . |T |.I Objective will have Ut +Dt terms

Chapter 3: Intro to LP 88

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Data

I Four time periods. T = {1, 2, 3, 4} (|T | = 4)I Demands: 20, 30, 50, 60.

I Inventory carrying cost α = $700/barrel/period

I Production Change Cost β = $600/barrel

I Initial Inventory: I0 = 0

I Initial Production Rate: P0 = 40 barrels/period

Chapter 3: Intro to LP 89

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Instance – Objective

I Objective:

min 7004∑

t=1

It + 6004∑

t=1

|Pt − Pt−1|

I Recall that this is equivalent to

min 7004∑

t=1

It + 6004∑

t=1

(Ut +Dt)

if we just make sure that

(Pt − Pt−1) = Ut −Dt ∀t = 1, 2, 3, 4

Chapter 3: Intro to LP 90

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Instance – Constraints

I0 + P1 = 20 + I1

I1 + P2 = 30 + I2

I2 + P3 = 50 + I3

I3 + P4 = 60 + I4

U1 −D1 = P1 − P0

U2 −D2 = P2 − P1

U3 −D3 = P3 − P2

U4 −D4 = P4 − P3

I0 = 40P0 = 40

Chapter 3: Intro to LP 91

Page 26: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Adding Ending Boundary Conditions

I Now suppose that we want the inventory and production rateconditions to be the same at the end as at the beginning.

What to do?

I Want I4 = 0 : Inventory at end of period 4 to be 0

I Want the production rate in period “5” to be 40.

I If production rate in period 4 is different from 40, weshould have to pay the price.

I Add variables P5 (and then U5 and D5)

Chapter 3: Intro to LP 92

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Where, Oh Where, Has my Bourbon Gone?

I Over time, Skippy has noticed that his inventory of bourbonfrom one period to the next seems to disappear.

I This could be because...I Bourbon evaporatesI Skippy’s workers steal his Bourbon

I Skippy would like to model that his Bourbon inventory willdecrease by 5% from one period to the next.

I If there are 100 units of Bourbon in inventory at time t, therewill be 95 units Bourbon in inventory at time t+ 1.

Chapter 3: Intro to LP 93

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Evaporation Model – 1

min 7004∑

t=1

It + 6005∑

t=1

(Ut +Dt)

0.95I0 + P1 = 20 + I1

0.95I1 + P2 = 30 + I2

0.95I2 + P3 = 50 + I3

0.95I3 + P4 = 60 + I4

Chapter 3: Intro to LP 94

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

Skippy’s Evaporation Model – 2

U1 −D1 = P1 − P0

U2 −D2 = P2 − P1

U3 −D3 = P3 − P2

U4 −D4 = P4 − P3

I0 = 40P0 = 40

Chapter 3: Intro to LP 95

Page 27: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Additional Examples of LP (Section 3.4)

Skippy’s Fine, Fine Bourbon

More Examples

I There are more examples of LP models in Section 3.4

I There are descriptions of classic case studies in Section 3.5

I Read both of these sections!!

Chapter 3: Intro to LP 96

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Outline

Wyndor Glass Case Study (Section 3.1)

A More General Model (Section 3.2)

Assumptions of Linear Programming (Section 3.3)

Additional Examples of LP (Section 3.4)

Excel Solver (Section 3.6)

Chapter 3: Intro to LP 97

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Spreadsheet as Solvers

I The McGreasy’s problem is a linear program: An algebraicmodel describing our system (decision) that we wantoptimized.

I All of the functions we wrote down were linear functions ofour decision variables!

I It is best to always write down an algebraic model of theproblem you are trying to optimize.

I How can we solve the program?

1. Spreadsheet: Excel Solver (Section 3.6)2. Algbraic Modeling Language: MPL (Section 3.7)

Chapter 3: Intro to LP 98

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Spreadsheet as Solvers

1. Decision Variables = Changing Cells

2. Objective Function = Target Cell

3. Constraints = Constraints

Show and Tell

I We will (interactively) setup Excel here to demonstratesolver

Chapter 3: Intro to LP 99

Page 28: Outline Chapter 3: Intro to LP Outline Introduction to ...pirun.ku.ac.th/~fengpppa/02206232/or02-4up.pdf · Wyndor Glass Case Study (Section 3.1) Outline Wyndor Glass Case Study (Section

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Excel Tip

I Using Range Names in Formulae is a good idea

I Manage with “Name Manager” dialog box

Chapter 3: Intro to LP 100

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Installing/Preparing Excel Solver: Excel 2007

1. Click the Microsoft Office Button Button image, and then click ExcelOptions.

2. Click Add-Ins, and then in the Manage box, select Excel Add-ins.

3. Click Go.

4. In the Add-Ins available box, select the Solver Add-in check box, and

then click OK.

I Tip: If Solver Add-in is not listed in the Add-Ins availablebox, click Browse to locate the add-in.

I If you get prompted that the Solver Add-in is not currentlyinstalled on your computer, click Yes to install.

5. After you load the Solver Add-in, the Solver command is available in theAnalysis group on the Data tab.

Chapter 3: Intro to LP 101

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

SpreadSheet Solver

1. Objective: In the Set Target Cell

2. Decision Variables: Put range in the “By Changing Cells”box

3. Constraints: Click on “Add” button to add constraints

4. Nonnegativity. I am not bulimic, I cannot eat a non-negativeamount of food. Click on “Options” and check “Assumenon-negative” box.

5. Linear Model. Like we mentioned, all of the functions we aremodeling are linear functions of the changing cells. To makesure that Excel uses the most efficient algorithm, click on“Assume Linear Model.”

6. Optimize Away!: Click on the “Solve” button

Chapter 3: Intro to LP 102

Chapter 3: Intro to LP

Excel Solver (Section 3.6)

Good Form for Spreadsheet Models

I Use names in formulae

I Use relation labels like <=, >=, and =I After Solve: Always pay attention to the message from the

solver.I Those messaages might tell you if one of LP’s “weird

situations” has arisen.

Chapter 3: Intro to LP 103