Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linear Programming.

Similar presentations


Presentation on theme: "Linear Programming."— Presentation transcript:

1 Linear Programming

2 Linear Programming LINEAR PROGRAMMING, a specific class of mathematical problems, in which an objective is maximized (or minimized) given limited resources. The objective is formulated as a linear function subject to the given linear constraints. This problem class is broad enough to encompass many interesting and important applications, yet specific enough to be tractable even if the number of variables is large. Allocate a finite set of resources in an optimal way. Examples of important application areas include airline crew scheduling, shipping or telecommunication networks, oil refining and blending, and stock and bond portfolio selection.

3 Linear Programming Many applications in business and economics involve a process called optimization, in which we are required to find the minimum cost, the maximum profit, or the minimum use of resources. A two-dimensional linear programming problem consists of a linear objective function and a system of linear inequalities called constraints. The objective function gives the quantity that is to be maximized (or minimized), and the constraints determine the set of feasible solutions.

4 Formulation Max/min z = c1x1 + c2x2 + ... + cnxn subject to:
a11x1 + a12x a1nxn (≤, =, ≥) b1 a21x1 + a22x a2nxn (≤, =, ≥) b2 : am1x1 + am2x amnxn (≤, =, ≥) bm xj = decision variables bi = constraint levels cj = objective function coefficients aij = constraint coefficients

5 Linear Programming If a linear programming problem has a solution, it must occur at a vertex of the set of feasible solutions. If the problem has more than one solution, then at least one of them must occur at a vertex of the set of feasible solutions. In either case, the value of the objective function is unique.

6 Linear Programming At the four vertices of the blue region, the objective function z = 3x + 2y has the following values:

7 Linear Programming Graphical Method to solve the two variable problem:
1. Sketch the region corresponding to the system of constraints. (The points inside or on the boundary of the region are called feasible solutions.) 2. Find the vertices of the region. 3. Test the objective function at each of the vertices and select the values of the variables that optimize the objective function. For a bounded region, both a minimum and maximum value will exist. (For an unbounded region, if an optimal solution exists, then it will occur at a vertex.) Note: The math grows rapidly with number of equations. If we have c constraints and p variables (dimensions), the number of intersections is (c+p)! / c!p!

8 Linear Programming

9 Linear Programming

10 Linear Programming Enumeration Method:
Make all possible groups of n equations from the constraints. 2. Solve each group of equations. This gives you all the basic solutions. 3. Test each solution against the other constraints. 4. Throw out any solutions that aren't feasible. The ones that are left are the basic feasible solutions. 5. Calculate the value of object function for each basic feasible solution. 6. Pick the highest value as your answer.

11 Example RESOURCE REQUIREMENTS Labor Clay Revenue
PRODUCT (hr/unit) (lb/unit) ($/unit) Bowl Mug There are 40 hours of labor and 120 pounds of clay available each day Decision variables x1 = number of bowls to produce x2 = number of mugs to produce RESOURCE REQUIREMENTS

12 Example Maximize Z = $40 x1 + $50 x2 Subject to
x1 + 2x2 40 hr (labor constraint) 4x1 + 3x2 120 lb (clay constraint) x1 , x2 0 Solution is x1 = 24 bowls x2 = 8 mugs Revenue = $1,360

13 Graphical Solution Method
Plot model constraint on a set of coordinates in a plane Identify the feasible solution space on the graph where all constraints are satisfied simultaneously Plot objective function to find the point on boundary of this space that maximizes (or minimizes) value of objective function

14 Computing Optimal Values
x1 + 2x2 = 40 4x1 + 3x2 = 120 4x1 + 8x2 = 160 -4x1 - 3x2 = -120 5x2 = 40 x2 = 8 x1 + 2(8) = 40 x1 = 24 4 x1 + 3 x2 120 lb x1 + 2 x2 40 hr 40 – 30 – 20 – 10 – 0 – | 10 20 30 40 x1 x2 Z = $50(24) + $50(8) = $1,360 8 24

15 Extreme Corner Points x1 = 0 bowls x2 =20 mugs Z = $1,000 x2
A B C | 20 30 40 10 x1 x2 40 – 30 – 20 – 10 – 0 –

16 Objective Function 4x1 + 3x2 120 lb Z = 70x1 + 20x2 Optimal point:
40 – 30 – 20 – 10 – 0 – x2 4x1 + 3x2 120 lb Z = 70x1 + 20x2 Optimal point: x1 = 30 bowls x2 =0 mugs Z = $2,100 A B x1 + 2x2 40 hr | 10 | 20 | 30 C | 40 x1

17 Minimization Problem CHEMICAL CONTRIBUTION
Brand Nitrogen (lb/bag) Phosphate (lb/bag) Gro-plus 2 4 Crop-fast 4 3 Minimize Z = $6x1 + $3x2 subject to 2x1 + 4x2  16 lb of nitrogen 4x1 + 3x2  24 lb of phosphate x1, x2  0

18 Graphical Solution x1 = 0 bags of Gro-plus x2 = 8 bags of Crop-fast
14 – 12 – 10 – 8 – 6 – 4 – 2 – 0 – x1 = 0 bags of Gro-plus x2 = 8 bags of Crop-fast Z = $24 A Z = 6x1 + 3x2 B C | 2 | 4 | 6 | 8 | 10 | 12 | 14 x1

19 Simplex Method A mathematical procedure for solving linear programming problems according to a set of steps Slack variables added to ≤ constraints to represent unused resources x1 + 2x2 + s1 = 40 hours of labor 4x1 + 3x2 + s2 = 120 lb of clay Surplus variables subtracted from ≥ constraints to represent excess above resource requirement. For example 2x1 + 4x2 ≥ 16 is transformed into 2x1 + 4x2 - s1 = 16 Slack/surplus variables have a 0 coefficient in the objective function Z = $40x1 + $50x2 + 0s1 + 0s2

20 Simplex Method It speeds up the enumeration method by moving step-by-step from one basic feasible solution to another with higher profit until the best is found. The simplex method requires first putting the problem into a standard form. Change the constraints from inequalities into equalities by adding slack (or surplus) variables. Add one slack variable for each constraint. It represents how much of your capacity in that particular regard that you aren't using. Simplex method is more efficient than the enumeration method (or graphical method) when the dimensions or the number of variables are more than 2)

21 Simplex Method (Example)
The Manufacturing Problem A manufacturer makes wooden desks (X ) and tables (Y). Each desk requires 2.5 hours to assemble, 3 hours for buffing, and 1 hour to crate. Each table requires 1 hour to assemble, 3 hours to buff, and 2 hours to crate. The firm can do only up to 20 hours of assembling, 30 hours of buffing, and 16 hours of crating per week. Profit is $3 per desk and $4 per table. Maximize the profit.

22 Simplex Method (Example)
add one slack variable s for each constraint The numbers (-3 -4) are the negatives of their actual values of the objective function s1 = 20 – 2.5x – y s2 = 30 -3x -3y s3 = 16 –x – 2y P = x + 4y x, y, s1, s2, s3 >=0 s1 = 12 – 2x + 0.5s3 s2 = x + 1.5s3 y = 8 – 0.5x – 0.5s3 P = x – 2s3 s1 = s s3 x = s2 + s3 y = 6 – 0.33s2 – s3 P = s2 – s3 P=36 (max) when s2=0 and s3=0 x = 4; y = 6; s1 = 4

23 Simplex Method (Example)
add one slack variable s for each constraint The numbers (-3 -4) are the negatives of their actual values of the objective function

24 Simplex Method (Example)
The simplex method is thus "iterative." You repeat it until it tells you to stop. Here's what you repeat. Choose a "pivot column" – In the last row, the column that has the smallest (biggest negative) number. 2. Choose the "pivot row" -- divide each element in the right-most column by the corresponding element in the pivot column. Choose the row with the smallest quotient that is bigger than 0. (Not the special bottom row.) The pivot element is the 2

25 Simplex Method (Example)
3. Change the pivot element to 1 by dividing everything in its row by 2. That'll leave an equation that's still true. (0.5x + 1y + 0s1 + 0s s3 = 8) New pivot row 4. Fill out a new matrix by using Gaussian elimination to make all the other elements in the pivot column 0. For each other row, multiply this new row by the element in the pivot column, then subtract across. For example: In the 2nd row, each element is the old second row minus 3 times the corresponding element in the new pivot row. Do the same to the bottom row. Multiply the new pivot row by 4 and add each element.

26 Simplex Method (Example)
Now the original set of equations has become the new set of equations. They are equivalent. For example: One of the basic solutions in the original set x = 0, y = 0, s1 = 20, s2 = 30, s3 = 16 Equivalent to a different basic solution in the new set, namely x = 0, y = 8, s1 = 12, s2 = 6, s3 = 0.

27 Simplex Method (Example)
5. If there are no negative numbers left in the last row, stop. Otherwise, go back to step 1 and go through the steps again. s1 = 12 – 2x + 0.5s3 s2 = x + 1.5s3 y = 8 – 0.5x – 0.5s3 P = x – 2s3 Divide everything in row 2, the pivot row, by 1.5, the pivot element, to change it to:

28 Simplex Method (Example)
6. When there are no negative numbers left in the last row, stop s1 = s s3 x = s2 + s3 y = 6 – 0.33s2 – s3 P = s2 – s3 P=36 (max) when s2=0 and s3=0 x = 4; y = 6; s1 = 4 1st row: the 1 is under s1. The 4 on the right means that we use 4 of slack variable 1 (assembling). In other words, in our optimal solution we'll have 4 hours of assembly time left over. 2nd row has the 1 under x. The 4 on the right means that we produce 4 of x. The third row says we produce 6 of y. The bottom right element tells us we'll make $36.

29 Comparison: Enumeration Method (Example)

30 Comparison: Enumeration Method (Example)
There are 5 constraint equations, counting the non-negativity conditions, so there are 10 possible pairs of equations. That means 10 solutions.


Download ppt "Linear Programming."

Similar presentations


Ads by Google