Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Spreadsheets for Linear Programming with The Simplex Method A sample problem By: Jeffrey Bivin Lake Zurich High School Last Updated: October 11,

Similar presentations


Presentation on theme: "Using Spreadsheets for Linear Programming with The Simplex Method A sample problem By: Jeffrey Bivin Lake Zurich High School Last Updated: October 11,"— Presentation transcript:

1 Using Spreadsheets for Linear Programming with The Simplex Method A sample problem By: Jeffrey Bivin Lake Zurich High School Last Updated: October 11, 2005

2 A landscaper can buy three types of 100-pound bags of fertilizer, type A, type B, and type C. Each 100- pound bag of type A fertilizer costs $20 and contains 40 pounds of nitrogen, 30 pounds of phosphoric acid, and 10 pounds of potash. Each 100-pound bag of type B fertilizer costs $30 and contains 20 pounds of nitrogen, 20 pounds of phosphoric acid, and 55 pounds of potash. Each 100-pound bag of type C fertilizer costs $20 and contains no nitrogen, 30 pounds of phosphoric acid, and 40 pounds of potash. The landscaper requires 4000 pounds of nitrogen. 2000 pounds of phosphoric acid, and 2000 pounds of potash. How many bags of each type of fertilizer should the landscaper buy in order to minimize the cost? Also, find the minimum cost. Jeff Bivin -- LZHS

3 Analyzing the problem Nitrogen Phos. Acidpotash Type Ax1x1 $20403010 Type Bx2x2 $3020 55 Type Cx3x3 $2003040 needs40002000 Jeff Bivin -- LZHS

4 Define the Constraints 40x 1 + 20x 2 > 4000 30x 1 + 20x 2 + 30x 3 > 2000 10x 1 + 55x 2 + 40x 3 > 2000 x1 > 0 x2 > 0 x3 > 0 Jeff Bivin -- LZHS

5 Function to minimize z = 20x 1 + 30x 2 + 20x 3 Jeff Bivin -- LZHS

6 Initial Tableau x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000 3020300002000 1055400002000 20302000010 Jeff Bivin -- LZHS

7 Initial Tableau Analysis Jeff Bivin -- LZHS

8 A negative basic variable in s 1 leads us to use column x 1 as the pivot column. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000 3020300002000 1055400002000 20302000010 Jeff Bivin -- LZHS

9 A negative basic variable in s 1 leads us to use column x 1 as the pivot column. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000 3020300002000 1055400002000 20302000010 s 1 is a basic variable because it has only one non-zero element in the column Jeff Bivin -- LZHS

10 A negative basic variable in s 1 leads us to use column x 1 as the pivot column. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000 3020300002000 1055400002000 20302000010 We use Column x 1 as the pivot column because the 40 in column x 1 is the left most positive number in the row with the -1 value (negative basic variable). Jeff Bivin -- LZHS

11 Divide the value column by the pivot column. This adds an additional column at the right. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000100 302030000200066.667 1055400002000200 20302000010 Jeff Bivin -- LZHS

12 66.667 is the lowest non-negative quotient. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000100 302030000200066.667 1055400002000200 20302000010 Jeff Bivin -- LZHS

13 66.667 is the lowest non-negative quotient. Therefore, 30 is determined to be the pivot point. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000100 302030000200066.667 1055400002000200 20302000010 Jeff Bivin -- LZHS

14 Determine the row operations: row1 = 3 x row1 – 4 x row2 row3 = 3 x row3 – row2 row4 = 3 x row4 – 2 x row2 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000100 302030000200066.667 1055400002000200 20302000010 Jeff Bivin -- LZHS

15 Perform the row operations to determine Tableau 2 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=3r1-4r20-20-120-34004000 r23020300002000 r3=3r3-r201459001-304000 r4=3r4-2r205000203-4000 Jeff Bivin -- LZHS

16 2 nd Tableau Analysis Jeff Bivin -- LZHS

17 A negative basic variable in s 1 leads us to use column s 2 as the pivot column. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-34004000 3020300002000 01459001-304000 05000203-4000 Jeff Bivin -- LZHS

18 Divide the value column by the pivot column. This adds an additional column at the right. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-340040001000 3020300002000-2000 01459001-304000 05000203-4000 Jeff Bivin -- LZHS

19 1000 is the lowest non-negative quotient. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-340040001000 3020300002000-2000 01459001-304000 05000203-4000 Jeff Bivin -- LZHS

20 1000 is the lowest non-negative quotient. Therefore, 4 is determined to be the pivot point. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-340040001000 3020300002000-2000 01459001-304000 05000203-4000 Jeff Bivin -- LZHS

21 Determine the row operations: row2 = 4 x row2 + row1 row3 = 4 x row3 – row1 row4 = 2 x row4 – row1 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-34004000 3020300002000 01459001-304000 05000203-4000 Jeff Bivin -- LZHS

22 Perform the row operations to determine Tableau 3 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000 r2=4r2+r1120600-300012000 r3=4r3-r1060048030-12012000 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

23 3 rd Tableau Analysis Jeff Bivin -- LZHS

24 A negative basic variable in s 3 leads us to use column x 2 as the pivot column. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000 r2=4r2+r1120600-300012000 r3=4r3-r1060048030-12012000 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

25 Divide the value column by the pivot column. This adds an additional column at the right. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000-200 r2=4r2+r1120600-300012000200 r3=4r3-r1060048030-1201200020 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

26 66.667 is the lowest non-negative quotient. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000-200 r2=4r2+r1120600-300012000200 r3=4r3-r1060048030-1201200020 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

27 66.667 is the lowest non-negative quotient. Therefore, 30 is determined to be the pivot point. x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000-200 r2=4r2+r1120600-300012000200 r3=4r3-r1060048030-1201200020 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

28 Determine the row operations: row1 = 30 x row1 + row3 row2 = 10 x row2 – row3 row4 = 5 x row4 – row3 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 0-20-120-34004000 120600-300012000 060048030-12012000 0120 3006-12000 Jeff Bivin -- LZHS

29 Perform the row operations to determine Tableau 4 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=30r1+r300-3120-87120-120132000 r2=10r2-r312000-480-330120108000 r3060048030-12012000 r4=52r4-r300120120 30-72000 Jeff Bivin -- LZHS

30 4 th Tableau Analysis Jeff Bivin -- LZHS

31 Now we can determine the solutions x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 00-3120-87120-120132000 12000-480-330120108000 060048030-12012000 00120120 30-72000 Basic Variables x 1, x 2, and s 2 are all positive and the bottom row has all positive variable coefficients Jeff Bivin -- LZHS

32 Determining the solutions: from row 1: s 2 = 132000 / 120 = 1100 from row 2: x 1 = 108000 / 1200 = 90 from row 3: x 2 = 12000 / 600 = 20 from row 4: z = -(-72000 / 30) = 2400 also: x 3 = s 1 = s 3 = 0 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=30r1+r300-3120-87120-120132000 r2=10r2-r312000-480-330120108000 r3060048030-12012000 r4=52r4-r300120120 30-72000 Jeff Bivin -- LZHS

33 Results x 1 = 90 x 2 = 20 x 3 = 0 s 1 = 0 s 2 = 1100 s 3 = 0 z = 2400 Jeff Bivin -- LZHS

34 Process Complete Answer the Question The minimum cost is $2400 when you order 90 bags of type A fertilizer 20 bags of type B fertilizer 0 bags of type C fertilizer Jeff Bivin -- LZHS

35 A Quick Recap Jeff Bivin -- LZHS

36 Initial Tableau x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues 402000004000100 302030000200066.667 1055400002000200 20302000010 Jeff Bivin -- LZHS

37 Perform the row operations to determine Tableau 2 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=3r1-4r20-20-120-340040001000 r23020300002000-2000 r3=3r3-r201459001-304000 r4=3r4-2r205000203-4000 Jeff Bivin -- LZHS

38 Perform the row operations to determine Tableau 3 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r10-20-120-34004000-200 r2=4r2+r1120600-300012000200 r3=4r3-r1060048030-1201200020 r4=2r4-r10120 3006-12000 Jeff Bivin -- LZHS

39 Perform the row operations to determine Tableau 4 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=30r1+r300-3120-87120-120132000 r2=10r2-r312000-480-330120108000 r3060048030-12012000 r4=52r4-r300120120 30-72000 Jeff Bivin -- LZHS

40 x1x1 x2x2 x3x3 s1s1 s2s2 s3s3 zValues r1=30r1+r300-3120-87120-120132000 r2=10r2-r312000-480-330120108000 r3060048030-12012000 r4=52r4-r300120120 30-72000 Determine the solutions from the 4 th Tableau from row 1: s 2 = 132000 / 120 = 1100 from row 2: x 1 = 108000 / 1200 = 90 from row 3: x 2 = 12000 / 600 = 20 from row 4: z = -(-72000 / 30) = 2400 also: x 3 = s 1 = s 3 = 0 Jeff Bivin -- LZHS

41 Process Complete Answer the Question The minimum cost is $2400 when you order 90 bags of type A fertilizer 20 bags of type B fertilizer 0 bags of type C fertilizer Jeff Bivin -- LZHS


Download ppt "Using Spreadsheets for Linear Programming with The Simplex Method A sample problem By: Jeffrey Bivin Lake Zurich High School Last Updated: October 11,"

Similar presentations


Ads by Google