Chapter 4 (Linear Programming)

48
Page Page 1 ENGINEERING OPTIMIZATION Methods and Applications A. Ravindran, K. M. Ragsdell, G. V. Reklaitis Book Review

Transcript of Chapter 4 (Linear Programming)

Page 1: Chapter 4 (Linear Programming)

Page Page 11

ENGINEERING OPTIMIZATIONMethods and Applications

A. Ravindran, K. M. Ragsdell, G. V. Reklaitis

Book Review

Page 2: Chapter 4 (Linear Programming)

Page Page 22

Chapter 4: Linear Programming

Part 1: Abu (Sayeem) ReazPart 2: Rui (Richard) Wang

Review SessionJune 25, 2010

Page 3: Chapter 4 (Linear Programming)

Page Page 33

Finding the optimum of any given world – how cool is that?!

Page 4: Chapter 4 (Linear Programming)

Page Page 44

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 5: Chapter 4 (Linear Programming)

Page Page 55

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 6: Chapter 4 (Linear Programming)

Page Page 66

What is an LP?What is an LP?

An LP has • An objective to find the best value for a system• A set of design variables that represents the system• A list of requirements that draws constraints the design variables

The constraints of the system can be expressed as linear equations or inequalities and the objective function is a

linear function of the design variables

Page 7: Chapter 4 (Linear Programming)

Page Page 77

TypesTypes

Linear Program (LP): all variables are real

Integer Linear Program (ILP): all variables are integer

Mixed Integer Linear Program (MILP): variables are a mix of integer and real number

Binary Linear Program (BLP): all variables are binary

Page 8: Chapter 4 (Linear Programming)

Page Page 88

FormulationFormulation

Formulation is the construction of LP models of real problems:• To identify the design/decision variables • Express the constraints of the problem as linear equations or inequalities• Write the objective function to be maximized or minimized as a linear function

Page 9: Chapter 4 (Linear Programming)

Page Page 99

The Wisdom of Linear ProgrammingThe Wisdom of Linear Programming

“Model building is not a science; it is primarily an art that is developed mainly

by experience”

Page 10: Chapter 4 (Linear Programming)

Page Page 1010

Example 4.1Example 4.1Two grades of inspectors for a quality control inspection

• At least 1800 pieces to be inspected per 8-hr day• Grade 1 inspectors:

25 inspections/hour, accuracy = 98%, wage=$4/hour• Grade 2 inspectors:

15 inspections/hour, accuracy= 95%, wage=$3/hour• Penalty=$2/error• Position for 8 “Grade 1” and 10 “Grade 2” inspectors

Let’s get experienced!!

Page 11: Chapter 4 (Linear Programming)

Page Page 1111

Final Formulation for Example 4.1Final Formulation for Example 4.1

Page 12: Chapter 4 (Linear Programming)

Page Page 1212

Example 4.2Example 4.2

Page 13: Chapter 4 (Linear Programming)

Page Page 1313

NonlinearityNonlinearity“During each period, up to 50,000 MWh of electricity can be sold at $20.00/MWh, and excess power above 50,000 MWh can only be sold for $14.00/MW”

Piecewise Linear in the regions (0, 50000) and (50000, ∞)

Page 14: Chapter 4 (Linear Programming)

Page Page 1414

Let’s FormulateLet’s Formulate

Plant/Reservoir A Plant/Reservoir B

Conversion Rate per kilo-acre-foot (KAF) 400 MWh 200 MWh

Capacity of Power Plants 60,000 MWh/Period 35,000 MWh/Period

Capacity of Reservoir 2000 1500

Predicted Flow

Period 1 200 40

Period 2 130 15

Minimum Allowable Level 1200 800

Level at the beginning of period 1 1900 850

PH1 Power sold at $20/MWh MWh

PL1 Power sold at $14/MWh MWh

XA1 Water supplied to power plant A KAF

XB1 Water supplied to power plant B KAF

SA1 Spill water drained from reservoir A KAF

SB1 Spill water drained from reservoir B KAF

EA1 Reservoir A level at the end of period 1 KAF

EB1 Reservoir B level at the end of period 1 KAF

Page 15: Chapter 4 (Linear Programming)

Page Page 1515

Final Formulation for Example 4.2Final Formulation for Example 4.2

Page 16: Chapter 4 (Linear Programming)

Page Page 1616

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 17: Chapter 4 (Linear Programming)

Page Page 1717

DefinitionsDefinitions

• Feasible Solution: all possible values of decision variables that satisfy the constraints

• Feasible Region: the set of all feasible solutions

• Optimal Solution: The best feasible solution

• Optimal Value: The value of the objective function corresponding to an optimal solution

Page 18: Chapter 4 (Linear Programming)

Page Page 1818

Graphical Solution: Example 4.3Graphical Solution: Example 4.3

• A straight line if the value of Z is fixed a priori

• Changing the value of Z another straight line parallel to itself

• Search optimal solution value of Z such that the line passes though one or more points in the feasible region

Page 19: Chapter 4 (Linear Programming)

Page Page 1919

Graphical Solution: Example 4.4Graphical Solution: Example 4.4

• All points on line BC are optimal solutions

Page 20: Chapter 4 (Linear Programming)

Page Page 2020

RealizationsRealizations

• Unique Optimal Solution: only one optimal value (Example 4.1)

• Alternative/Multiple Optimal Solution: more than one feasible solution (Example 4.2)

• Unbounded Optimum: it is possible to find better feasible solutions improving the objective values continuously (e.g., Example 2 without )

Property: If there exists an optimum solution to a linear programming problem, then at least one of the corner points of the feasible region will always qualify to be an optimal solution!

Page 21: Chapter 4 (Linear Programming)

Page Page 2121

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 22: Chapter 4 (Linear Programming)

Page Page 2222

Standard Form (Equation Form)Standard Form (Equation Form)

Page 23: Chapter 4 (Linear Programming)

Page Page 2323

Standard Form (Matrix Form)Standard Form (Matrix Form)

(A is the coefficient matrix, x is the decision vector, b isthe requirement vector, and c is the profit (cost) vector)

Page 24: Chapter 4 (Linear Programming)

Page Page 2424

Handling InequalitiesHandling Inequalities

Using Bounds

Slack Using Equalities

Surplus

Page 25: Chapter 4 (Linear Programming)

Page Page 2525

Unrestricted VariablesUnrestricted Variables

In some situations, it may become necessary to introduce a variable that can assume both positive and negative values!

Page 26: Chapter 4 (Linear Programming)

Page Page 2626

Conversion: Example 4.5Conversion: Example 4.5

Page 27: Chapter 4 (Linear Programming)

Page Page 2727

Conversion: Example 4.5Conversion: Example 4.5

Page 28: Chapter 4 (Linear Programming)

Page Page 2828

RecapRecap

Page 29: Chapter 4 (Linear Programming)

Page Page 2929

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 30: Chapter 4 (Linear Programming)

Page Page 3030

Computer CodesComputer Codes• For small/simple LPs:

• Microsoft Excel

• For High-End LP:• OSL from IBM• ILOG CPLEX• OB1 in XMP Software

• Modeling Language:• GAMS (General Algebraic Modeling System)• AMPL (A Mathematical Programming Language)

• Internet• http: / /www.ece.northwestern.edu/otc

Page 31: Chapter 4 (Linear Programming)

Page Page 3131

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 32: Chapter 4 (Linear Programming)

Page Page 3232

Sensitivity AnalysisSensitivity Analysis

• Variation in the values of the data coefficients changes the LP problem, which may in turn affect the optimal solution.

• The study of how the optimal solution will change with changes in the input (data) coefficients is known as sensitivity analysis or post-optimality analysis.

• Why?• Some parameters may be controllable better optimal value • Data coefficients from statistical estimation identify the one that effects the objective value most obtain better estimates

Page 33: Chapter 4 (Linear Programming)

Page Page 3333

Example 4.9Example 4.9

100 hr of labor, 600 lb of material, and 300hr of administration per day

Product 1 Product 2 Product 3

Unit profit 10 6 4

Material Needed 10 lb 4 lb 5 lb

Admin Hr 2 hr 2 hr 6 hr

Page 34: Chapter 4 (Linear Programming)

Page Page 3434

SolutionSolution

A. Felt, ‘‘LINDO: API: Software Review,’’ OR/MS Today, vol. 29, pp. 58–60, Dec. 2002.

Page 35: Chapter 4 (Linear Programming)

Page Page 3535

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory

Page 36: Chapter 4 (Linear Programming)

Page Page 3636

Applications of LPApplications of LP

For any optimization problem in linear form with feasible solution time!

Page 37: Chapter 4 (Linear Programming)

Page Page 3737

Outline of Part 1Outline of Part 1

• Formulations

• Graphical Solutions

• Standard Form

• Computer Solutions

• Sensitivity Analysis

• Applications

• Duality Theory (Additional Topic)

Page 38: Chapter 4 (Linear Programming)

Page Page 3838

Duality of LPDuality of LP

Every linear programming problem has an associated linear program called its dual such that a solution to the original linear program also gives a solution to its dual

Solve one, get one free!!

Page 39: Chapter 4 (Linear Programming)

Page Page 3939

Find a Dual: Example 4.10Find a Dual: Example 4.10

Objective coefficients

Constraint constants

Reversed

Columns into constraints and constraints into columns

Page 40: Chapter 4 (Linear Programming)

Page Page 4040

Find a Dual: Example 4.10Find a Dual: Example 4.10

Page 41: Chapter 4 (Linear Programming)

Page Page 4141

Some TricksSome Tricks• “Binarization”

• If

• OR

• AND

• Finding Range

• Finding the value of a variable

http://networks.cs.ucdavis.edu/ppt/group_meeting_22may2009.pdf

Page 42: Chapter 4 (Linear Programming)

Page Page 4242

BinarizationBinarization

• x is positive real, z is binary, M is a large number

• For a single variable

• For a set of variable

xzM

ii

xz

M

*z x M

*ii

z x M

Page 43: Chapter 4 (Linear Programming)

Page Page 4343

IfIf

• Both x and y are binary• If two variables share the same value

• If y = 0, then x = 0• If y = 1, then x = 1

• If they may have different values

• If y = 1, then x = 1• Otherwise x can take either 1 or 0

x y

x y

Page 44: Chapter 4 (Linear Programming)

Page Page 4444

OROR

• A, x, y, and z are binary

• M is a large number• If any of x,y,z are 1 then A is 1• If all of x,y,z are 0 then A is 0

x y zAM

A x y z

Page 45: Chapter 4 (Linear Programming)

Page Page 4545

ANDAND

• x, y, and z are binary

• If any of x,y are 0 then z is 0• If all of x,y are 1 then z is 1

1

z xz yz x y

Page 46: Chapter 4 (Linear Programming)

Page Page 4646

RangeRange

• x and y are integers, z is binary• We want to find out if x falls within a range defined by y

• If x >= y, z is true

• If x <= y, z is true

1x yzM

1y xzM

Page 47: Chapter 4 (Linear Programming)

Page Page 4747

Finding a ValueFinding a Value

• A,B,C are binary

• If x = y, Cy is true

x takes the value of y if both the ranges are true

1

1

y

x yAM

y xBM

C A B

Page 48: Chapter 4 (Linear Programming)

Page Page 4848

Thank You!Thank You!

Now Part 2 begins….Now Part 2 begins….