LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

26
LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke

Transcript of LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Page 1: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

LP EXAMPLES: ANOTHER MAX AND A MIN

Dr. Ron Lembke

Page 2: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Example 2

mp3 - 4 min electronics- 2 min assembly

DVD - 3 min electronics- 1 min assembly

Min available: 240 (elect) 100 (assy) Profit / unit: mp3 $7, DVD $5

X1 = number of mp3 players to make

X2 = number of DVD players to make

Page 3: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Standard Form

Max 7x1 + 5x2

s.t. 4x1 + 3x2 <=240

2x1 + 1x2 <=100

x1 >=0

x2 >=0

electronics

assembly

Page 4: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Graphical Solution

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3X2

X1

Page 5: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Graphical Solution

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

X1 = 0, X2 = 80

X1 = 60, X2 = 0

Electronics Constraint

X2

X1

4x1+ 3x2 <= 240

x1 =0, x2 =80

x2 =0, x1 =60

Page 6: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Graphical Solution

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

X1 = 0, X2 = 100

X1 = 50, X2 = 0

Assembly Constraint

X2

X1

2x1+ 1x2 <= 100

x1 =0, x2 =100

x2 =0, x1 =50

Page 7: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Graphical Solution

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

Assembly Constraint

Electronics Constraint

Feasible Region – Satisfies all constraintsX2

X1

Page 8: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3Isoprofit Line:

$7X1 + $5X2 = $210

(0, 42)

(30,0)

Isoprofit Lnes

X2

X1

Page 9: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Isoprofit Lines

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

$210

$280X2

X1

Page 10: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Isoprofit Lines

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

$210

$280

$350

X2

X1

Page 11: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Isoprofit Lines

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

(0, 82)

(58.6, 0)

$7X1 + $5X2 = $410

X2

X1

Page 12: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Mathematical Solution

Obviously, graphical solution is slow We can prove that an optimal solution

always exists at the intersection of constraints.

Why not just go directly to the places where the constraints intersect?

Page 13: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Constraint Intersections

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

X1 = 0 and 4X1 + 3X2 <= 240So X2 = 80

X2

X1

4X1 + 3X2 <= 240

(0, 0)

(0, 80)

Page 14: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Constraint Intersections

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3X2 = 0 and 2X1 + 1X2 <= 100So X1 = 50

X2

X1

(0, 0)

(0, 80)

(50, 0)

Page 15: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Constraint Intersections

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

4X1+ 3X2 = 2402X1 + 1X2 = 100 – multiply by -2

X2

X1

(0, 0)

(0, 80)

(50, 0)

4X1+ 3X2 = 240-4X1 -2X2 = -200 add rows together

0X1+ 1X2 = 40 X2 = 40 substitute into #2

2X1+ 40 = 100 So X1 = 30

Page 16: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Constraint Intersections

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3X2

X1

(0, 0)$0

(0, 80)$400

(50, 0)$350

(30,40)$410

Find profits of each point.

Substitute into$7X1 + $5X2

Page 17: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Do we have to do this?

Obviously, this is not much fun: slow and tedious

Yes, you have to know how to do this to solve a two-variable problem.

We won’t solve every problem this way.

Page 18: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Constraint Intersections

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3X2

X1

Start at (0,0), or some other easy feasible point.1. Find a profitable direction to go along an edge2. Go until you hit a corner, find profits of point.3. If new is better, repeat, otherwise, stop.

Good news:Excel can do this for us.Using the Simplex Algorithm

Page 19: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Minimization Example

Min 8x1 + 12x2

s.t. 5x1 + 2x2 ≥20

4x1 + 3x2 ≥ 24

x2 ≥ 2

x1 , x2 ≥ 0

Page 20: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Minimization ExampleMin 8x1 +

12x2

s.t. 5x1 +2x2 ≥ 20

4x1 +3x2 ≥ 24

x2 ≥ 2

x1 , x2

≥ 0

5x1 + 2x2 =20

If x1=0, 2x2=20, x2=10 (0,10)If x2=0, 5x1=20, x1=4 (4,0)

4x1 + 3x2 =24

If x1=0, 3x2=24, x2=8 (0,8)If x2=0, 4x1=24, x1=6 (6,0)

x2= 2

If x1=0, x2=2No matter what x1 is, x2=2

Page 21: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Graphical Solution

0 2 4 6 8

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +

3x2 =24

x2=2

Page 22: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

0 2 4 6 8

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +3x

2 =24

x2 =2

(0,10)[5x1+ 2x2 =20]*3

[4x1 +3x2 =24]*2

15x1+ 6x2 = 60

8x1 +6x2 = 48- 7x1 = 12

x1 = 12/7= 1.71

5x1+2x2 =20

5*1.71 + 2x2 =20

2x2 = 11.45

x2 = 5.725

(1.71,5.73)

(1.71,5.73)

Page 23: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

0 2 4 6 8

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +3x

2 =24

x2 =2

(0,10)

(1.71,5.73)

4x1 +3x2 =24

x2 =2

4x1 +3*2 =24

4x1 =18

x1=18/4 = 4.5

(4.5,2)

(4.5,2)

Page 24: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

0 2 4 6 8

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +3x

2 =24

x2 =2

(0,10)

(1.71,5.73)

Z=8x1 +12x2

8*0 + 12*10 = 120

(4.5,2)

Z=8x1 +12x2

8*1.71 + 12*5.73 = 82.44

Z=8x1 +12x2

8*4.5+ 12*2 = 60

Lowest Cost

Page 25: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

IsoCost Lines

0 2 4 6 8 10 12

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +

3x2 =24

x2=2

Z=8x1 +12x2

Try 8*12 = 96x1=0

12x2=96, x2=8

x2=0

8x1=96, x1=12

Page 26: LP EXAMPLES: ANOTHER MAX AND A MIN Dr. Ron Lembke.

Summary Method for solving a two-variable

problem graphically1. Find end points of each constraint

2. Draw constraints

3. Figure out which intersections are interesting

4. Use algebra to solve for intersection pts

5. Find profits (or costs) of intersections

6. Choose the best one Iso-profit (or Iso-Cost) lines can help find

the most interesting points