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

Post on 14-Dec-2015

222 views 1 download

Tags:

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

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

Standard Form

Max 7x1 + 5x2

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

2x1 + 1x2 <=100

x1 >=0

x2 >=0

electronics

assembly

Graphical Solution

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3X2

X1

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

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

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

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

Isoprofit Lines

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

$210

$280X2

X1

Isoprofit Lines

0 20 40 60 80

80

20

40

60

0

100

DVD players

mp3

$210

$280

$350

X2

X1

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

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?

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)

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)

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

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

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.

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

Minimization Example

Min 8x1 + 12x2

s.t. 5x1 + 2x2 ≥20

4x1 + 3x2 ≥ 24

x2 ≥ 2

x1 , x2 ≥ 0

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

Graphical Solution

0 2 4 6 8

8

2

4

6

0

10

5x1 +

2x2 =20

X2

X1

4x1 +

3x2 =24

x2=2

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)

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)

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

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

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