23
MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Embed Size (px)

Citation preview

Page 1: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

MA3264 Mathematical ModellingLecture 9

Chapter 7Discrete Optimization Modelling Continued

Page 2: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Theorem 1 p. 257-258

1x

Question Where is objective function max?

2x

Increasing directionof objective function

Level curves

feasible region is blue

Page 3: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Theorem 1 p. 257-258

1x

Question Where is objective function max?

2x

Increasing directionof objective function

Page 4: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Theorem 1 p. 257-258

1x

Question Where is objective function max?

2x

Increasing directionof objective function

Page 5: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Example 1 page 261

How many tables and how many bookcases should a carpenter make each week to maximize profit? He realizes a profit of $25 per table and $30 per bookcase. He has 690 feet of lumber per week and 120 hours of labor per week. Each table requires 20 feet of lumber and 5 hours of labor. Each bookcase requires 30 feet of lumber and 4 hours of labor.

This Carpenter Problem has different parameters from that on page 238

Page 6: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Mathematical Formulation

Maximize

decisionvariables

21 3025 xx objectivefunction Subject to

6903020 21 xx12045 21 xx01 x02 x

constraints

explicitly stated

common sense

Page 7: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Figure 7.12 p. 261

6903020 21 xx

1x

)23,0(

)0,5.34(

Question Is the feasible region convex?

)30,0(

)0,24(

)15,12(

2x

12045 21 xx

02 x

01 x

Page 8: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Slack Variables

6903020 121 yxx

1x

)23,0(

)0,5.34(

Question SV satisfy which inequalities?

)30,0(

)0,24(

)15,12(

2x 12045 221 yxx

02 x

01 x

01 y

02 y

03025 21 zxx

Page 9: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Reformulation

6903020 121 yxx

1x

)23,0(

)0,5.34(

Question SV satisfy which inequalities?

)30,0(

)0,24(

)15,12(

2x

12045 221 yxx

02 x

01 x

01 y

02 y

Maximize z

03025 1 zx

Subject to

0,,, 2121 yyxx

Page 10: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

6903020 121 yxx

1x

)23,0(

)0,5.34(

Remark At each extreme point at least 2 of these 4 variables equal 0.

)30,0(

)0,24(

)15,12(

2x

12045 221 yxx

02 x

01 x

01 y

02 y

03025 1 zx

Always assume constraints

0,,, 2121 yyxxBut manipulate these

Page 11: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

1x

)23,0(

)0,5.34(

These pairs of independent variables depend on the extreme point

)30,0(

)0,24(

)15,12(

2x

02 x

01 x

01 y

02 y

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

At each step 1 independent variable and 1 dependent variable change places

Page 12: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

1x

)23,0(

)0,5.34(

)30,0(

)0,24(

)15,12(

2x

02 x

01 x

01 y

02 y

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

In step 1 independent variable 2x becomes dependent since it has the largest negativecoeff. in equation for the objective variable z

03025 21 zxx

Page 13: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

6903020 121 yxx

1x

)23,0(

)0,5.34(

The variable

)30,0(

)0,24(

)15,12(

2x

12045 221 yxx

02 x

01 x

01 y

02 y03025 21 zxx

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

1ythe eqn. it is in restricts 2x

becomes independent since

to be smallest.

Page 14: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

6903020 121 yxx

1x

)23,0(

)0,5.34(

Equations express dependent

)30,0(

)0,24(

)15,12(

2x

12045 221 yxx

02 x

01 x

01 y

02 y03025 21 zxx

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

zyy ,, 21

functions of 21, xxas

independent at

Page 15: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

2321301

132 xyx

1x

)23,0(

)0,5.34(

We pivot to express dependent

)30,0(

)0,24(

)15,12(

2x

2821152

137 yyx

02 x

01 x

01 y

02 y 6905 11 zyx

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

zyx ,, 22

functions of 11, yxas

independent at

Page 16: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

2321301

132 xyx

1x

)23,0(

)0,5.34(

In step 2 independent variable

)30,0(

)0,24(

)15,12(

2x

2821152

137 yyx

02 x

01 x

01 y

02 y 6905 11 zyx

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

1xdependent since it has the largest negative

becomes

coeff. in equation for the objective variable z

Page 17: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

2321301

132 xyx

1x

)23,0(

)0,5.34(

The variable

)30,0(

)0,24(

)15,12(

2x

2821152

137 yyx

02 x

01 x

01 y

02 y 6905 11 zyx

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

2y becomes independent since

the eqn. it is in restricts 1x to be smallest.

Page 18: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

15071429.028571.0 212 xyy

1x

)23,0(

)0,5.34(

We pivot to express dependent

)30,0(

)0,24(

)15,12(

2x

12057143.042857.0 112 xyy

02 x

01 x

01 y

02 y

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

zxx ,, 12

functions of 12 , yyas

independent at

750714286.014286.2 12 zyy

Page 19: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Simplex Method

15071429.028571.0 212 xyy

1x

)23,0(

)0,5.34(

We stop since in the equation for objective

)30,0(

)0,24(

)15,12(

2x

12057143.042857.0 112 xyy

02 x

01 x

01 y

02 y

Start at 120,690;0 2121 yyxx

Move to 28,23;0 2211 yxyxMove to 12,15;0 1212 xxyy

variable

750714286.014286.2 12 zyy

z all coeff. are nonnegative.

Page 20: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Tableau Format

Study Example 1 on pages 268-271

Observe that

Tableau 0 represents the 3 equations in vufoil 13

Tableau 1 represents the 3 equations in vufoil 15

Tableau 2 represents the 3 equations vufoil in 18

Page 21: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Suggested Reading

Linear Programming 2: Algebraic Solutions p. 259-263

Linear Programming 3: The Simplex Method p. 263-273

Page 22: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Tutorial 9 Due Week 27–31 Oct

Problem 1. Modify the Bus Stop Waiting program to write a program to compute the waiting time histogram assuming that people form a queue so that people who arrive first are the first to board a bus. Then RUN this program and compare the waiting times with those without queuing.

Problem 2. Do problem 5 on page 259. Suggestion: study how to formulate a Chebyshev approximation problem into a linear program on pages 107-109.

Page 23: MA3264 Mathematical Modelling Lecture 9 Chapter 7 Discrete Optimization Modelling Continued

Homework 3 Due Friday 31 October

7.4 Project 1 Write a computer program to perform the basic simplex algorithm. The program should print out the sequence of all tableaus from the initial to the final one. It should print out the coordinates of all of the extreme points and the values of the objective function at these points. Then use the program to solve problem 3 on p. 258.