1 / 51

Linear Programming

Linear Programming. 虞台文. 大同大學資工所 智慧型多媒體研究室. Content. Examples Forms of LP Geometric View of LP Intuitive View of the Simplex Method. Linear Programming. Examples. 大同大學資工所 智慧型多媒體研究室. Unit Market Price. Unit Value. Raw Material. Stock. Product.  1. b 1.  1.  2. b 2.  2.

jross
Download Presentation

Linear Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linear Programming 虞台文 大同大學資工所 智慧型多媒體研究室

  2. Content • Examples • Forms of LP • Geometric View of LP • Intuitive View of the Simplex Method

  3. Linear Programming Examples 大同大學資工所 智慧型多媒體研究室

  4. Unit Market Price Unit Value Raw Material Stock Product 1 b1 1 2 b2 2 3 b3 . . . . . . . . . . . . . . . m bm n Managing a Production Facility

  5. Unit Market Price Unit Value Raw Material Unit Profit Stock Product 1 b1 1 c1 2 b2 2 c2 3 b3 . . . . . . . . . . . . . . . . . . m bm n cn aij: number of units of the ith raw material needed to produce one unit of the jth product. Managing a Production Facility xj: the number of units of the jth product produced.

  6. Unit Market Price Unit Value Raw Material Unit Profit Stock Product 1 b1 1 c1 2 b2 2 c2 3 b3 . . . . . . . . . . . . . . . . . . m bm n cn aij: number of units of the ith raw material needed to produce one unit of the jth product. The Resource Allocation Problem xj: the number of units of the jth product produced. Maximize Subject to

  7. Unit Price Required Units Food Nutrient c1 b1 c2 b2 c3 . . . . . . . . . . . . cm bn aij: number of units of nutrient i in one unit food j. xj: number of units of food j in the diet. The Diet Problem Minimize Subject to

  8. Linear Programming Forms of LP 大同大學資工所 智慧型多媒體研究室

  9. The Linear Programming Problem • An application of linear algebra. • Its central goal is to maximize or minimize a linear function on a domain defined by linear inequalities and equations.

  10. x1, …, xn: decision variables The General Form Maximize or minimize Subject to

  11. A set of linear constraints • linear inequalities or • linear equations x1, …, xn: decision variables The General Form A linear objective function Maximize or minimize Subject to

  12. The Canonical Form “greater than” only Minimize Subject to Non-negative

  13. This can also be considered canonical. The Canonical Form “ less than” only Minimize Subject to Non-negative

  14. The Standard Form Minimize Subject to

  15. How to convert among these forms? Equivalence of LP Forms

  16. Maximization  Minimization Maximize Minimize E.g., Minimize

  17. Surplus/Slack Variables Surplus variable Slack variable

  18. Replace Unrestricted Variables Replace each unrestricted variables with the difference of two nonnegative variables. For example: Let x be an unrestricted variable.

  19. Example Maximize Minimize Subject to Subject to Canonical Form

  20. Example Minimize Subject to Standard Form

  21. Forms of LP Standard Form Canonical Form General Form These forms are all equivalent.

  22. The Standard Form

  23. a convex function Local optimality  Global optimality LP  Convex Programming a convex set The optimal solution is at a corner of the convex polytope.

  24. a convex function Local optimality  Global optimality The Simplex Algorithm Finding optimum by moving around the corner of the convex polytope in cost descent sense. a convex set basic feasible solution at a corner The optimal solution is at a corner of the convex polytope.

  25. Linear Programming Geometric View of LP 大同大學資工所 智慧型多媒體研究室

  26. 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 An Example of 2 Decision Variables y Maximize Subject to x

  27. y 8 7 6 5 4 3 2 1 x 1 2 3 4 5 6 7 8 An Example of 2 Decision Variables Maximize Subject to

  28. y 8 7 6 5 4 3 2 1 x 1 2 3 4 5 6 7 8 An Example of 2 Decision Variables Optimum solution Maximize Subject to * (6, 2)

  29. y 8 Maximize 7 Subject to 6 5 4 3 2 1 x 1 2 3 4 5 6 7 8 The feasible region determined by a collection of linear inequalities is the collection of points that satisfy all of the inequalities. Feasible LP Problems A feasible LP problem Nonempty feasible region

  30. y 6 5 4 3 2 1 2 1 x 0 1 2 3 4 5 6 1 2 Infeasible LP Problems Maximize Subject to An infeasible LP problem The feasible region is empty

  31. y 6 5 4 3 2 1 2 1 x 0 1 2 3 4 5 6 1 2 Unbounded LP Problems Maximize Subject to An unbounded LP problem • The feasible region is unbounded. • Some coefficients of objective function is non-negative.

  32. Linear Programming Intuitive View of the Simplex Method 大同大學資工所 智慧型多媒體研究室

  33. Objective Function Two possible ways to help maximization: 1. Increase the variables with positive coefficients. 2. Decrease the variables with negative coefficient. An Example Maximize 0 Subject to

  34. An Example Maximize Subject to

  35. Converting the LP into Standard Form Maximize Subject to

  36. Basic Solutions

  37. Basic Solutions Such a basic solution is feasible if and only if all bi’s are feasible.

  38. Adjust their values to increase  progressively. How?

  39. Two possible ways to help maximization: 1. Increase the variables with negate coefficients. 2. Decrease the variables with positive coefficient. How? 0

  40. The variable whose corresponding column has only one nonzero entry is active; otherwise, it is inactive. Active/Inactive Variables Inactive Variables Active Variables

  41. 2 3 1 1 0 0 0 5 4 1 2 0 1 0 0 11 3 4 2 0 0 1 0 8 5 3 4 0 0 0 1 0 Set Up the Initial Tableau w1 = 5 w2 = 11 w3 = 8  = 0

  42. Select the Pivot Column 2 3 1 1 0 0 0 5 w1 = 5 4 1 2 0 1 0 0 11 w2 = 11 3 4 2 0 0 1 0 8 w3 = 8 5 3 4 0 0 0 1 0  = 0 • From bottom row, choose the negative number with the largest magnitude. • Its column is the pivot column. • If there are two candidates, choose either one • If all the numbers in the bottom row are zero or positive, then you are done, and the basic solution is the optimal solution.

  43. Select the Pivot in the Pivot Column 5/2 2 3 1 1 0 0 0 5 =30/12 w1 = 5 4 1 2 0 1 0 0 11 11/4 =33/12 w2 = 11 8/3 =32/12 3 4 2 0 0 1 0 8 w3 = 8 5 3 4 0 0 0 1 0  = 0 • The pivot must always be a positive number. • For each positive entry b in the pivot column, compute the ratio a/b, where a is the number in the rightmost column in that row. We call this a test ratio. • Of these ratios, choose the smallest one. The corresponding number b is the pivot.

  44. Clear the Pivot Column 5/2 2 3 1 1 0 0 0 5 =30/12 w1 = 5 4 1 2 0 1 0 0 11 11/4 =33/12 w2 = 11 8/3 =32/12 3 4 2 0 0 1 0 8 w3 = 8 5 3 4 0 0 0 1 0  = 0 2 3 1 1 0 0 0 5 x1 = 2.5 5 2 0 0 1 0 0 1 w2 = 1 0.5 1.5 0 0.5 0 1 0 0.5 w3 = 0.5 0.5 11.5 2.5 0 0 0 1 12.5  =12.5

  45. Select the Pivot Column 2 3 1 1 0 0 0 5 x1 = 2.5 5 2 0 0 1 0 0 1 w2 = 1 0.5 1.5 0 0.5 0 1 0 0.5 w3 = 0.5 0.5 11.5 2.5 0 0 0 1 12.5  =12.5

  46. Select the Pivot in the Pivot Column 5/1 =5 2 3 1 1 0 0 0 5 x1 = 2.5 5 2 0 0 1 0 0 1 w2 = 1 0.5/0.5 =1 0.5 1.5 0 0.5 0 1 0 0.5 w3 = 0.5 0.5 11.5 2.5 0 0 0 1 12.5  =12.5

  47. Clear the Pivot Column 2 2 4 0 4 0 0 4 x1 = 2 5 2 0 0 1 0 0 1 w2 = 1 0.5 1.5 0 0.5 0 1 0 0.5 x3 = 1 11 1 0 0 0 1 1 13  =13 5/1 =5 2 3 1 1 0 0 0 5 x1 = 2.5 5 2 0 0 1 0 0 1 w2 = 1 0.5/0.5 =1 0.5 1.5 0 0.5 0 1 0 0.5 w3 = 0.5 0.5 11.5 2.5 0 0 0 1 12.5  =12.5

  48. The Optimum 2 2 4 0 4 0 0 4 x1 = 2 5 2 0 0 1 0 0 1 w2 = 1 All of them are positive. 0.5 1.5 0 0.5 0 1 0 0.5 x3 = 1 11 1 0 0 0 1 1 13  =13 The optimal solution is here

  49. The Optimum Maximize Subject to

  50. The Optimum 13 Maximize 5 Subject to 10 8

More Related