water resources development and management optimization (linear programming)

47
Water Resources Development and Management Optimization (Linear Programming) CVEN 5393 Feb 18, 2013

Upload: ocean

Post on 06-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

Water Resources Development and Management Optimization (Linear Programming). CVEN 5393 Feb 18, 2013. Acknowledgements Dr. Yicheng Wang (Visiting Researcher, CADSWES during Fall 2009 – early Spring 2010) for slides from his Optimization course during Fall 2009 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Water Resources Development and Management Optimization (Linear Programming)

Water Resources Development and Management

Optimization

(Linear Programming)

CVEN 5393

Feb 18, 2013

Page 2: Water Resources Development and Management Optimization (Linear Programming)

Acknowledgements •Dr. Yicheng Wang (Visiting Researcher, CADSWES during Fall 2009 – early Spring 2010) for slides from his Optimization course during Fall 2009•Introduction to Operations Research by Hillier and Lieberman, McGraw Hill

Page 3: Water Resources Development and Management Optimization (Linear Programming)

How to Solve LP Problems

• Graphical Solution

• Simplex Method for Standard form LP– Geometric Concepts – Setting up and Algebra– Algebraic solution of Simplex

• R-Resources

Page 4: Water Resources Development and Management Optimization (Linear Programming)

Prototype Model from Hillier and Lieberman

The Wyndor Glass Co. produces high-quality glass products, including windows and glass doors. It has three plants. Plant 1 produces Aluminum framesPlant 2 produces wood framesPlant 3 produces the glass and assembles the products.

The company has decided to produce two new products.

Product 1: An 8-foot glass door with aluminum framingProduct 2: A 4x6 foot double-hung wood framed window

Each product will be produced in batches of 20. The production rate is defined as the number of batches produced per week.

The company wants to know what the production rate should be in order to maximize their total profit, subject to the restriction imposed by the limited production capacities available in the 3 plants.

Page 5: Water Resources Development and Management Optimization (Linear Programming)

To get the answer, we need to collect the following data.

(a) Number of hours of production time available per week in each plant for these two new products. (Most of the time in the 3 plants is already committed to current products, so the available capacity for the 2 new products is quite limited).

Number of hours of production time available per week in Plant 1 for the new products: 4Number of hours of production time available per week in Plant 2 for the new products: 12Number of hours of production time available per week in Plant 3 for the new products: 18

(b) Number of hours of production time used in each plant for each batch produced of each new product (Product 1 requires some of the production capacity in Plants 1 and 3, but none in Plant 2. Product 2 needs only Plants 2 and 3).

Number of hours of production time used in Plant 1 for each batch produced of Product 1: 1Number of hours of production time used in Plant 2 for each batch produced of Product 1: 0Number of hours of production time used in Plant 3 for each batch produced of Product 1: 3

Number of hours of production time used in Plant 1 for each batch produced of Product 2: 0Number of hours of production time used in Plant 2 for each batch produced of Product 2: 2Number of hours of production time used in Plant 3 for each batch produced of Product 2: 2

Page 6: Water Resources Development and Management Optimization (Linear Programming)

(c) Profit per batch produced of each new product. Profit per batch produced of Product 1: $3,000 Profit per batch produced of Product 2: $5,000

The data collected are summarized in Table 3.1. This is a linear programming problem of the classic product mix type.

Page 7: Water Resources Development and Management Optimization (Linear Programming)

Formulation as a Linear Programming Problem

To formulate the LP model for this problem, let

x1 = number of batches of product 1 produced per week x2 = number of batches of product 2 produced per week Z = total profit ( in thousands of dollars) from producing the two new products.

Thus, x1 and x2 are the decision variables for the model. Using the data of Table 3.1, we obtain

(Plant 1:Total production time required) (Production time available)

(Plant 2:Total production time required) (Production time available)

(Plant 3:Total production time required) (Production time available)

Page 8: Water Resources Development and Management Optimization (Linear Programming)
Page 9: Water Resources Development and Management Optimization (Linear Programming)

(4) Graphical Solution

The Wyndor Glass Co. example is used to illustrate the graphical solution.

Fig. 3.1 Shaded area shows values of (x1, x2) allowed by x1 ≥ 0, x2 ≥ 0, x1 ≤ 4

Fig. 3.2 Shaded area shows values of (x1, x2) , called feasible region

Page 10: Water Resources Development and Management Optimization (Linear Programming)

Fig. 3.3 The value of (x1, x2) that maximize 3x1 + 5x2 is (2, 6)

Page 11: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

Objective Function: The function being maximized or minimized is called the objective function.

Constraint: The restrictions of LP Model are referred to as constraints. The first m constraints in the previous model are sometimes called functional constraints. The restrictions xj >= 0 are called nonnegativity constraints. Feasible Solution: A feasible solution is a solution for which all the constraints are satisfied.

Infeasible Solution: An infeasible solution is a solution for which at least one constraint is violated.

A feasible solution is located in the feasible region. An infeasible solution is outside the feasible region.

Feasible Region: The feasible region is the collection of all feasible solutions.

Page 12: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

No Feasible Solutions: It is possible for a problem to have no feasible solutions.

An Example

Fig. 3.4 The Wyndor Glass Co. problem would have no feasible solutions if the constraint 3x1 + 5x2 ≤ 50 were added to the problem.

In this case, there is no feasible region

Page 13: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

Optimal Solution: An optimal solution is a feasible solution that has the maximum or minimum of the objective function.

Multiple Optimal Solutions: It is possible to have more than one optimal solution.

An Example

Fig. 3.5 The Wyndor Glass Co. problem would have multiple optimal solutions if the objective function were changed to Z = 3x1 + 2x2

Page 14: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

Unbounded Objective: If the constraints do not prevent improving the value of the objective function indefinitely in the favorable direction, the LP model is called having an unbounded objective.

An Example

Fig. 3.6 The Wyndor Glass Co. problem would have no optimal solutions if the only functional constrait were x1 ≤ 4, because x2 then could be increased indefinitely in the feasible region without ever reaching the maximum value of Z = 3x1 + 2x2

Page 15: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

Corner-Point Feasible (CPF) Solution: A corner-point feasible (CPF) is a solution that lies at a corner of the feasible region.

Fig. 3.7 The five dots are the five CPF solutions for the Wyndor Glass Co. problem

Page 16: Water Resources Development and Management Optimization (Linear Programming)

Common Terminology for LP Model

Relationship between optimal solutions and CPF solutions : Consider any linear programming problem with feasible solutions and a bounded feasible region. The problem must posses CPF solutions and at least one optimal solution. Furthermore, the best CPF solution must be an optimal solution. Therefore, if a problem has exactly one optimal solution, it must be a CPF solution. If the problem has multiple optimal solutions, at least two must be CPF solutions.

The prototype model has exactly one optimal solution, (x1, x2)=(2,6), which is a CPF solution

(2,6)

(4,3)

The modified problem has multiple optimal solution, two of these optimal solutions , (2,6) and (4,3), are CPF solutions.

Page 17: Water Resources Development and Management Optimization (Linear Programming)

Matrix Standard Form of an LP Model To help you distinguish between matrices, vectors, and scalars, we use BOLDFACE CAPITAL letters to represent matrices, bold lowercase letters to represent vectors, and italicized letters in ordinary print to represent scalars.

Page 18: Water Resources Development and Management Optimization (Linear Programming)

Tabular Standard Form of an LP Model

Page 19: Water Resources Development and Management Optimization (Linear Programming)

Transforming Any LP Model into the Standard Form

(2) Some functional constraints with a less-than-or-equal-to inequality

Introduce the concept of slack variables. To illustrate, use the first functional constraint, x1 ≤ 4, in the Wyndor Glass Co. problem as an example. x1 ≤ 4 is equivalent to x1 + x2=4 where x2 ≥ 0. The variable x2 is called a slack variable.

(3) Some functional constraints with a greater-than-or-equal-to inequality

Introduce the concept of surplus variables.For example, a functional constraint x1 – 2x2 ≥ 5 is equivalent to x1 – 2x2 – x3 = 5 where x3 ≥ 0. The variable, x3 , is called a surplus variable.

Maximize Z΄ = – Z

(1) Minimizing rather than maximizing the objective

Page 20: Water Resources Development and Management Optimization (Linear Programming)

(4) Deleting the nonnegativity constraints for some decision variables

Transforming Any LP Model into the Standard Form

Example 1

Original Model Standard Form

Page 21: Water Resources Development and Management Optimization (Linear Programming)

Example 2

(1) Set Z΄ = – Z . Then the minimization of

Z becomes the maximization of Z΄.

(2) Add a slack variable x6 to the left-hand side of the first functional constraints.

(3) Subtract a surplus variable x7 from the left-hand side of the second functional constraints.

(4) Substitute x4 – x5 for x3 where x4 and x5 are nonnegative variables.

Original Model

Standard Form

Page 22: Water Resources Development and Management Optimization (Linear Programming)

1. Solving Linear Programming Problems: The Simplex Method

(1) The Essence of the Simplex Method

Geometric Concepts of Simplex Method

Fig.4.1 Contraint boundaries and corner-point solutions for the Wyndor Glass Co. Problem

Constraint boundary : a line that forms the boundary of the feasible region.

Corner-point solutions: the points of intersection.

The five points A, B, C, D and E are the corner-point feasible solutions (CPF solutions). F

G

H

C

D

B

A E

The 8 points A, B, C, D, E, F, G, and H are corner-point solutions.

The points F, G and H are called corner-point infeasible solutions.

Page 23: Water Resources Development and Management Optimization (Linear Programming)

Fig.4.1 Contraint boundaries and corner-point solutions for the Wyndor Glass Co. Problem

In this example, each corner-point solution lies at the intersection of two constraint boundaries. For a linear programming problem with n decision variables, each of its corner-point solutions lies at the intersection of n constraint boundaries.

Geometric Concepts of Simplex Method

Page 24: Water Resources Development and Management Optimization (Linear Programming)

Geometric Concepts of Simplex Method

Adjacent CPF Soluionts

For a two-variable problem, a constraint boundary = a line. For a three-variable problem, a constraint boundary = a plane. For an n-variable problem, a constraint boundary = a hyperplane

C

D EA

B

C

D

FG

Page 25: Water Resources Development and Management Optimization (Linear Programming)

Optimality test

C

D

B

Z=36 at point C (2,6)

Z=27 at point D (4, 3)

Z=30 at point B (0, 6)

Page 26: Water Resources Development and Management Optimization (Linear Programming)

C

D

B

A E

Z=36 at point C

Z=27 at point D

Z=12 at point E

Z=30 at point B

Z=0 at point A

Solving the example

Page 27: Water Resources Development and Management Optimization (Linear Programming)

The Key Solution Concepts

Page 28: Water Resources Development and Management Optimization (Linear Programming)

The Key Solution Concepts

Page 29: Water Resources Development and Management Optimization (Linear Programming)

The Key Solution Concepts

C

D

B

A E

Page 30: Water Resources Development and Management Optimization (Linear Programming)

The Key Solution Concepts

C

D

B

A E

Page 31: Water Resources Development and Management Optimization (Linear Programming)

(2) Setting Up the Simplex Method

Original Form of the Model

Augmented Form of the Model

Page 32: Water Resources Development and Management Optimization (Linear Programming)

F

G

H

C

D

B

A EH(3,2)

Augmented Form of the Model

For example, H(3,2) is a solution for the original model, which yields the augmented solution ( x1, x2, x3, x4, x5) = (3, 2 ,1 ,8, 5)

For example, G(4,6) is a corner-point infeasible solution, which yields the corresponding basic solution ( x1, x2, x3, x4, x5) = (4, 5 ,0 ,0, -6)

F

G

H

C

D

B

A EH(3,2)

Page 33: Water Resources Development and Management Optimization (Linear Programming)

The only difference between basic solutions and corner-point solutions is whether the values of the slack variables are included

Relationship between Corner-Point Solutions and Basic Solutions

In the original model, we have

Corner-point solution

Corner-point feasible (CPF) solution

In the augmented model, we have

Basic solution

Basic Feasible (BF) solution

Page 34: Water Resources Development and Management Optimization (Linear Programming)

The corner-point solution (0,0) in the original model corresponds to the basic solution (0, 0, 4,12, 18) in the augmented form, where x1 =0 and x2=0 are the nonbasic variables, and x3=4, x4=12, and x5=18 are the basic variables

F

G

H

C

D

B

A E

Page 35: Water Resources Development and Management Optimization (Linear Programming)

Example:

The CPF solution (0,0) in the original model corresponds to the BF solution (0, 0, 4,12, 18) in the augmented form, where x1 =0 and x2=0 are the nonbasic variables, and x3=4, x4=12, and x5=18 are the basic variables

Choose x1 and x4 to be the nonbasic variables that are set equal to 0. The three equations then yield, respectively, x3=4, x2=6 , and x5=6 as the solution for the three basic variables as shown below.

Page 36: Water Resources Development and Management Optimization (Linear Programming)

Example:

A(0,0) and B(0,6) are two CPF solutions The corresponding BF solutions are ( x1, x2, x3, x4, x5) = (0, 0 ,4 ,12, 18) and ( x1, x2, x3, x4, x5) = (0, 6 ,4 ,0, 6)

F

G

H

C

D

B

A EH(3,2)

A(0,0) and C(2,6) are two CPF solutions The corresponding BF solutions are ( x1, x2, x3, x4, x5) = (0, 0 ,4 ,12, 18) and ( x1, x2, x3, x4, x5) = (2, 6 ,2 ,0, 0)

Page 37: Water Resources Development and Management Optimization (Linear Programming)
Page 38: Water Resources Development and Management Optimization (Linear Programming)

The Algebra of the Simplex Method

Use the Wyndor Glass Co. Model to illustrate the algebraic procedure

Initialization

Geometric interpretation Algebraic interpretation

C

D

B

A E

Page 39: Water Resources Development and Management Optimization (Linear Programming)

Optimality Test

Geometric interpretation Algebraic interpretation

C

D

B

A E

A(0,0) is not optimal.

Conclusion: The initial BF solution (0,0,4,12,18) is not optimal.

The objective function:

The rate of improvement of Z by the nonbasic variable x1 is 3

The rate of improvement of Z by the nonbasic variable x2 is 5

Page 40: Water Resources Development and Management Optimization (Linear Programming)

Iteration1 Step1: Determining the Direction of Movement

Geometric interpretation Algebraic interpretation

C

D

B

A E

Move up from A(0,0) to B(0,6)

Page 41: Water Resources Development and Management Optimization (Linear Programming)

Iteration1 Step2: Where to Stop

Geometric interpretation Algebraic interpretation

C

D

B

A E

Stop at B. Otherwise, it will leave the feasible region.

Step 2 determine how far to increase the entering basic variable x2.

Page 42: Water Resources Development and Management Optimization (Linear Programming)

Thus x4 is the leaving basic variable for iteration 1 of the example.

Page 43: Water Resources Development and Management Optimization (Linear Programming)

Iteration1 Step3: Solving for the New BF Solution

Geometric interpretation Algebraic interpretation

C

D

B

A E

The intersection of the new pair of constraint boundary: B(0,6) Nonbasic variables

Basic variables

Nonbasic variables

Basic variables

Page 44: Water Resources Development and Management Optimization (Linear Programming)

(0)

(1)

(2)

(3)

Nonbasic variables: x1= 0

x2= 0Basic variables: x3= 4

x4 =12

x5= 18

Initial BF Solution

Nonbasic variables: x1= 0

x4= 0Basic variables: x3= ?

x2 =6

x5= ?

New BF Solution(0)

(1)

(2)

(3)

Basic variables: x3= 4

x2 =6

x5= 6

Page 45: Water Resources Development and Management Optimization (Linear Programming)

Optimality Test

Geometric interpretation Algebraic interpretation

C

D

B

A E

B(0,6) is not optimal, because moving from B to C increases Z.

Conclusion: The BF solution (0,6,4,0,6) is not optimal.

The objective function:

The rate of improvement of Z by the nonbasic varialle x1 is 3

The rate of improvement of Z by the nonbasic varialle x4 is -5/2

Page 46: Water Resources Development and Management Optimization (Linear Programming)

Iteration2

Step1: Determining the Direction of Movement

Choose x1 to be the entering basic variable

Step2: Where to Stop

The minimum ratio test indicates that x5 is the leaving basic variable

Step3: Solving for the New BF Solution(0)

(1)

(2)

(3)

Nonbasic variables: x1= 0, x4= 0

Basic variables: x3= 2, x2 =6, x1= 2

New BF Solution

Page 47: Water Resources Development and Management Optimization (Linear Programming)

Optimality Test

The objective function:

The coefficients of the nonbasic variables x4 and x5 are negative. Increasing either x4 or x5 will decrease Z, so (x1, x2, x3, x4, x5) = (2, 6, 2, 0, 0) must be optimal with Z = 36.

C

D

B

A E

In terms of the original form of the problem (no slack variables), the optimal solution is (x1, x2) = (2, 6) , which yields Z = 3x1+5x2=36.