Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linear Programming – Introduction

Similar presentations


Presentation on theme: "Linear Programming – Introduction"— Presentation transcript:

1 Linear Programming – Introduction
What is Linear Programming ? A simple example. Components of a linear programming problem. Feasible, infeasible and optimal solutions.

2 Linear Programming Linear Programming (LP) is a tool for solving optimization problems. Simplex algorithm: A tool for solving LP problems (Dantzig 1947). LP has been used to solve optimization problems in various industries, e.g. forestry, banking, trucking etc.

3 An Example Example 1: A company makes 2 types of wooden toys: dolls and trucks. A doll sells for $27, uses $10 of raw material and increases other costs by $14. A truck sells for $21, uses $9 of raw material and increases other costs by $10. A doll requires 2 hours of painting and 1 hour of carpentry work. A truck requires 1 hour of painting and 1 hour of carpentry work. Each week only 100 painting hours and 80 carpentry hours are available. Raw material supply is unlimited. Demand for trucks is unlimited, but at most 40 dolls can be sold per week. Formulate a LP problem to maximize the company’s profit.

4 Decision Variables Decision variables : should completely define the decisions to be made. x1 = no. of dolls produced per week x2 = no. of trucks produced per week

5 Objective Function In any LP problem the decision maker wants to maximize (usually revenue or profit) or minimize (usually costs) some function of the decision variables. The function to be maximized or minimized is called the objective function. What is the objective in Example 1? Maximize profit = revenues – costs Costs Fixed costs: does not depend on decision variables (e.g. rent) Variable costs: raw material costs + other variable costs. Revenues weekly revenues from dolls + weekly revenues from trucks.

6 Objective Function Revenues = weekly revenues from dolls + weekly revenues from trucks. = (selling price per doll * no. of dolls per week) + (selling price per truck * no. of trucks per week) = 27*x1 + 21*x2.

7 Objective Function Weekly raw material costs =
10 x1 + 9 x2 Other weekly variable costs = = 14 x x2 So, profits = (27 x x2) – (10 x1 +9 x2) – (14 x x2) = 3x1 +2x2 Therefore, objective function = Maximize z = 3*x1 +2*x2 The coefficient of a decision variable in the objective function is called an objective function coefficient. The variable z is used to represent the objective function value of any LP.

8 Constraints Constraints : restrictions that limit the values of the decision variables. Constraints for Example 1: c1) No more than 100 hours of painting time can be used per week. c2) No more than 80 hours of carpentry time can be used per week. c3) Due to limited demand, at most 40 dolls should be produced per week.

9 Constraint c1 c1) No more than 100 hours of painting time can be used per week. Total painting hours per week = (painting hours per doll * no. of dolls per week) + (painting hours per truck * no. of trucks per week) = 2 * x1 + 1 * x2 = 2 x1 + x2 c1: 2 x1 + x2 < (2) The coefficient of a decision variable in a constraint is often called a technological coefficient

10 Constraint c2 c2) No more than 80 hours of carpentry time can be used per week. Total carpentry hours per week = (carpentry hours per doll * no. of dolls per week) + (carpentry hours per truck * no. of trucks per week) = 1 * x1 + 1 * x2 = x1 + x2 c2: x1 + x2 < 80 (3)

11 Constraint c3 c3) Due to limited demand, at most 40 dolls should be produced per week. No. of dolls per week = x1 Maximum no. of dolls produced per week = 40 c3: x1 < 40 (4)

12 Sign Restrictions Can the decision variable assume only non-negative values or both positive and negative values? If a decision variable (xi)can take only non-negative values, we add sign restriction xi > 0. Otherwise we say xi is unrestricted in sign (urs).

13 LP Formulation for Example 1
Maximize z = 3*x1 +2*x2 (1) Objective function subject to (s.t.) 2*x1 + x2 < 100 (2) painting constraint x1 + x2 < (3) carpentry constraint x < 40 (4) demand constraint x1 > 0 (5) sign restriction x > 0 (6) sign restriction

14 Some Definitions Definition 1: Definition 2:
A function f(x1, x2,…, xn) of x1, x2,…, xn is a linear function if and only if for some set of constants c1, c2,…, cn, f(x1, x2,…, xn) = c1x1+c2x2+…+cnxn For example, f(x1, x2) = 2x1 + x2 is a linear function of x1 and x2, but f(x1, x2) = x12 x2 is not a linear function of x1 and x2 Definition 2: For any linear function f and any number b, the inequalities f(x1, x2,…, xn) ≤ b and f(x1, x2,…, xn) ≥ b are linear inequalities. Thus, 2x1 + 3x2 ≤ 3 and 2x1 + x2 ≥ 3 are linear inequalities, but x12x2≥3 is not a linear inequality.

15 Some Definitions (cont’d)
A linear programming problem (LP) is an optimization problem for which we do the following: 1. We attempt to maximize ( or minimize) a linear function of the decision variables. The function that is to be maximized or minimized is called the objective function. 2. The values of the decision variables must satisfy a set of constraints. Each constraint must be a linear equation or linear inequality. 3. A sign restriction is associated with each variable. For any variable xi, the sign restriction specifies either that xi must be nonnegative ( xi ≥ 0) or that xi may be unrestricted in sign (urs)

16 Feasible Region The feasible region for an LP is the set of points satisfying all its constraints and sign restrictions. Is the point (x1 = 40, x2 = 20 ) in the feasible region for Example 1: Put these values (of x1 and x2) in each constraint (2)-(6) and check if the constraint is satisfied for each case. Ans: (x1 = 40, x2 = 20 ) is in the feasible region. Is the point (x1 = 15, x2 = 70 ) in the feasible region of Example 1: No, it violates (3) Is the point (x1 = 40, x2 = -20 ) in the feasible region of Example 1: No, it violates (6), i.e. sign restriction on x2. Any point that is not in an LP’s feasible region is called an infeasible point.

17 Optimal Solution For a maximization (minimization) problem, an optimal solution to an LP is a point in the feasible region with the largest (smallest) objective function value. Most LPs have one optimal solution. Some LPs have no optimal solution; some have an infinite number of solutions. What is the objective function value for (x1 = 30, x2 = 40 ) ? Is this optimal ? What is the objective function value for (x1 = 40, x2 = 20 ) ? What is the objective function value for (x1 = 20, x2 = 60 ) ?

18 Graphical Solution Any LP with only 2 variables can be solved graphically. Consider a constraint: 2*x1 + 3*x2 < 6 (c1) The set of points on or below the line 2*x1 + 3*x2 = 6 satisfies (c1) In 2 dimensions, the set of points satisfying a linear inequality f(x1, x2) ~ b, includes the points on the line f(x1, x2) = b and all points on ONE side of it. x2 5 4 3 2 1 x1

19 Feasible Solution for Example 1
constraints 2 – 6 only points in first quadrant satisfy sign restrictions. (2) is satisfied by all lines on or below line AB (3) is satisfied by all lines on or below CD (4) is satisfied by all points to the left of EF Feasible region is bounded by polygon DGFEH. B 100 80 D G 60 40 20 F H C A x1 10 20 30 40 50 60 70 80 E

20 Optimal Solution for Example 1
Optimal solution is the point in the feasible region with the largest value of z=3x1+2x2 Draw a single isoprofit (isocost for min problem) line, z =60 Generate other isoprofit lines by moving parallel to the drawn isoprofit line, such as z=100 Point G is the last isoprofit line to intersect the feasible region. And the optimal value is 180 B 100 80 D G 60 40 20 F C E A x1 10 20 30 40 50 60 70 80 Z = 60, 100, 180

21 Some Assumptions Proportionality Assumption: Additivity Assumption:
The contribution of the objective function from each decision variable is proportional to the value of the decision variable. The contribution of each variable to the left-hand side of each constraint is proportional to the value of the variable. Additivity Assumption: The contribution to the objective function for any variable is independent of the values of the other decision variables. The contribution of a variable to the left-hand side of each constraint is independent of the values of the variables.

22 Some Assumptions (cont’d)
Divisibility Assumption: each decision variable allowed to assume fractional values E.g. , in Example 1, it implies that it is acceptable to produce 1.5 dolls, or 1.63 trucks. If divisibility is not valid, rounding off each variable in the optimal LP solution to an integer may yield a reasonable solution. Certainty Assumption: each parameter ( objective function coefficient, right-hand side, and technological coefficient ) is known with certainty. E.g if we were unsure of the exact amount of carpentry hours required to build a truck, the Certainty Assumption would be violated.

23 Infeasible LP x2 B It is possible for an LP’s feasible region to be empty (contain no points). This results in an infeasible LP. An infeasible LP has no optimal solution e.g. in Example 1, suppose the company is required to make at least 90 trucks per week. x2 > 90 (7) 100 I J 80 D G 60 40 20 F C A x1 10 20 30 40 50 60 70 80 E

24 Unbouned LP x2 B For a max (or min) problem, the LP is unbounded if it is possible to find points in the feasible region with arbitrarily large (or small) objective values. Should not occur in a correctly formulated LP e.g. in Example 1, suppose there is no restriction on the amount of labour available. remove constraints (2) and (3) 100 80 D G 60 40 20 F C A x1 10 20 30 40 50 60 70 80 E

25 Your Turn ... Example 2: A company sells luxury goods and wants to reach High-income Men (HM) and High-income Women (HW), by advertising on comedy shows and football games. A 1-minute spot on a comedy show is seen by 7M HW and 2M HM. A 1-minute spot on football game is seen by 2M HW and 12M HM. A 1-minute comedy ad costs $50,000 and a 1-minute football ad costs $100,000. The company wants to reach at least 28M HW and 24M HM. Formulate a LP problem to minimize the company’s advertising costs.

26 Variables & Objective x1 = no. 1-minute comedy ads purchased x2 = no. 1-minute football ads purchased Total cost = cost of comedy ads + cost of football adds (cost per comedy ad * no. of comedy ads)+(cost per football ad * no. of football ads) 50,000 x ,000 x2 50 x x2 (in thousands of dollars) objective function: min z = 50 x x (8)

27 Constraints c1) must reach at least 28 million HW
no. of HW = (HW per comedy add * no. of comedy ads)+ (HW per football add * no. of football ads) = 7 x1 + 2 x2 > 28 (9) in millions of viewers c2) must reach at least 24 million HM no. of HM = (HM per comedy add * no. of comedy ads)+ (HM per football add * no. of football ads) = 2 x x2 > 24 (10) in millions of viewers sign restrictions: x1 > 0 ; x2 > 0;

28 LP Formulation Min z = 50 x1 + 100 x2 s.t. 7x1 + 2x2 > 28

29 Graphical Solution x2 c1 satisfied by point on or above line AB 7x1 + 2x2 = 28 c2 satisfied by point on or above line CD 2x x2 = 24 unbounded feasible region isocost line through (x1 = 4, x2 = 4); z = 600 E is last point in feasible region to intersect isocost line E = (x1 = 3.6, x2 = 1.4); optimal z = 320 14 B 12 10 8 6 (4,4) 4 2 E D C x1 2 A 4 6 8 10 12 14 16 Z=320, Z=600

30 A word of caution ... Some assumptions may not be accurate in the real world. proportionality: e.g. each comedy ad must add exactly 7M HW and 2M HM. empirical evidence shows advertising yields diminishing returns after a certain point. additivity: e.g. total viewers = viewers from comedy ads + viewers from football adds. in reality there will be some overlap, same person may see more than 1 type of commercial; so, effectiveness of a comedy ad actually depends on the no. of football ads etc.

31 A word of caution (cont’d)
Some assumptions may not be accurate in the real world. divisibilty: does it make sense to buy 3.6 comedy ads or 1.4 football adds? If not, divisibilty assumption is violated and the problem should be considered an integer programming problem. certainty: can we know for sure exactly how many viewers are reached by each type of commercial? Despite these drawbacks, LP can be used effectively to solve real world optimization problems.

32 Your Turn ... Example 3: A company makes glass windows and doors. A batch of windows requires 1 hour in plant#1 and 3 hours in plant#3, and generates $3000 in profits. A batch of doors requires 2 hours in plant#2 and 2 hours in plant#3, and generates $5000 in profits. The company can sell as many products as they make. A total of 4 hours are available in plant#1 per day. A total of 12 hours are available in plant#2 per day. A total of 18 hours are available in plant#3 per day. Formulate a LP to maximize the company’s profits.

33 Variables & Objective x1 = no. of batches of windows made x2 = no. of batches of doors made Total profit = profit from windows + profit from doors (profit per batch* no. of batches of windows)+(profit per batch* no. of batches of doors) 3,000 x1 + 5,000 x2 3 x1 + 5 x2 (in thousands of dollars) objective function: max z = 3 x x (11)

34 Constraints c3) At most 18 hours are available in plant#3
= x1 < 4 (12) c2) At most 12 hours are available in plant#2 = 2 x2 < 12 (13) (or equivalently, x2 < 6) c3) At most 18 hours are available in plant#3 = 3 x1 +2 x2 < 18 (14) sign restrictions: x1 > 0 ; x2 > 0;

35 LP Formulation Max z = 3 x1 + 5 x2 s.t. x1 < 4 x2 < 6

36 Graphical Solution c1 satisfied by point on left of line AB x1 = 4
c2 satisfied by point on or below line CD x2 = 6 c3 satisfied by point on or below line CD 3x1+2 x2 = 18 bounded feasible region isoprofit line through (x1 = 0, x2 = 2); z = 3x1+5x2 = 10 isoprofit line through (x1 = 0, x2 = 4); z = 3x1+5x2 = 20 G is last point in feasible region to intersect isoprofit line G = (x1 = 2, x2 = 6); optimal z = 36 14 A B 12 10 E F 8 G D C 6 4 Z=36 2 x1 2 4 6 8 10 12 14 16


Download ppt "Linear Programming – Introduction"

Similar presentations


Ads by Google