Linear Program 1
Linear Program 1
Dr. Chew Ek Peng Office: E1A-06-06 Tel: 6516-6554 Email: isecep@nus.edu.sg Dr. Ng Kien Ming Office: Tel: 6516-5541 Email: isenkm@nus.edu.sg
Topics
Topics
Textbook
Introduction to Mathematical Programming (Operations Research: Volume One), Wayne L. Winston & Munirpallam Venkataramanan, Thomson, 4th edition IVLE
Lecture note Assignments
Assessment
Assignments: 10% Term Paper: 15% Midterm Examination: 15% (5th October) Final Examination: 60%
Operations Research
Scientific approach to managerial decision making that seeks to best design and operate a system, usually under conditions requiring the allocation of scarce resources.
A system is an organization of interdependent components that work together to accomplish the goal of the system
6
World War II
allocate scarce resources to various military operations and to activities within each operations complexity and specialization in organizations
Industrial after WW II
On December 16, 1944, in the last year of World War II, two German panzer armies, supported by a third army of infantry, together totaling more than 250,000 men, staged a massive counteroffensive in northern France, overwhelming the American First Army in the Ardennes. The offensive emanated from the German defensive line along the Our River, north of the city of Luxembourg, and was directed almost due west toward Namur and Liege in Belgium. The result, after several days of fighting, was a huge "bulge" in the Allied line and, therefore, this last major ground battle of World War II became known as the Battle of the Bulge.
8
On December 20, General Dwight D. Eisenhower, Supreme Allied Commander, called on General George Patton to attack the German offensive with his Third Army, which was then situated near Verdun, approximately 100 miles due south of the German left flank. Patton's immediate objective was to relieve the 101st Airborne and elements of Patton's own 9th and 10th Armored Divisions surrounded at Bastogne. Within 48 hours, on December 22, Patton was able to begin his counteroffensive, with three divisions totaling approximately 62,000 men. The winter weather was cold with snow and fog, and the roads were icy, making the movement of troops, tanks, supplies, and equipment a logistical nightmare. Nevertheless, on December 26 Bastogne was relieved, and on January 12, 1945, the Battle of the Bulge effectively ended in one of the great Allied victories of the war.
9
10
11
An Introduction to Modeling
A Modeling Example Eli Daisy produces the drug Wozac in huge batches by heating a chemical mixture in a pressurized container. Each time a batch is produced, a different amount of Wozac is produced. The amount produced is the process yield (measured in pounds). Daisy is interested in understanding the factors that influence the yield of Wozac production process. The solution on subsequent slides describes a model building process for this situation.
Daisy is interested in determining the factors that influence the process yield. This would be referred to as a descriptive model since it describes the behavior of the actual yield as a function of various factors. Daisy might determine the following factors influence yield: Container volume in liters (V) Container pressure in milliliters (P) Container pressure in degrees centigrade (T) Chemical composition of the processed mixture
Letting A, B, and C be the percentage of the mixture made up of chemical A, B, and C, then Daisy might find , for example, that:
Yield = 300 + 0.8V +0.01P + 0.06T + 0.001T*P - 0.01T2 0.001P2 + 11.7A + 9.4B + 16.4C + 19A*B + 11.4A*C 9.6B*C
To determine this relationship, the yield of the process would have to measured for many different combinations of the previously listed factors. Knowledge of this equation would enable Daisy to describe the yield of the production process once volume, pressure, temperature, and chemical composition were known.
The Objective Function The Daisy example seeks maximize the yield for the production process. In most models, there will be a function we wish to maximize or minimize. This function is called the models objective function. To maximize the process yield we need to find the values of V, P, T, A, B, and C that make the yield equation (below) as large as possible.
Yield = 300 + 0.8V +0.01P + 0.06T + 0.001T*P - 0.01T 0.001P + 11.7A + 9.4B + 16.4C + 19A*B + 11.4A*C 9.6B*C
2 2
In many situations, an organization may have more than more objective. For example, in assigning students to the two high schools in Bloomington, Indiana, the Monroe County School Board stated that the assignment of students involve the following objectives: equalize the number of students at the two high schools minimize the average distance students travel to school have a diverse student body at both high schools
Constraints In most situations, only certain values of the decision variables are possible. For example, certain volume, pressure, and temperature conditions might be unsafe. Also, A, B, and C must be nonnegative numbers that sum to one. These restrictions on the decision variable values are called constraints.
Suppose the Daisy example has the following constraints: 1. Volume must be between 1 and 5 liters 2. Pressure must be between 200 and 400 milliliters 3. Temperature must be between 100 and 200 degrees centigrade 4. Mixture must be made up entirely of A, B, and C 5. For the drug to perform properly, only half the mixture at most can be product A.
0.001P + 11.7A + 9.4B + 16.4C + 19A*B + 11.4A*C 9.6B*C Subject to (s.t.) V5 V1 P 400 P 200 T 200 T 100 A + B + C = 1.0 A 0.5 A0 B0 C0
Any specification of the decision variables that satisfies all the models constraints is said to be in the feasible region. For example, V = 2, P = 300, T = 150, A = 0.4, B = 0.3 and C = 0.3 is in the feasible region. An optimal solution to an optimization model any point in the feasible region that optimizes (in this case maximizes) the objective function.
A company will manufacture a product for the next four months: March, April, may and June. The demands for each month are 520, 720, 520, and 620 units, respectively. The company has a steady workforce of 10 employees but can meet fluctuating production needs by hiring and firing temporary workers, if necessary. The extra costs of hiring and firing in any month are $200 and $400 per worker, respectively. A permanent worker can produce 12 units per month, and a temporary worker, lacking comparable experience, only produce 10 units per month. The company can produce more than needed in any month and carry the surplus over to the succeeding month at a holding cost of $50 per unit per month. Develop an optimal hiring/firing policy for the company over the four month planning horizon.
24
A personnel manager must schedule the security force in such a way as to satisfying requirements shown in the following table:
Time Midnight 4am 4am 8am 8am Noon Noon 4pm 4pm 8pm 8pm Midnight Minimum number of officers required 5 7 15 7 12 9
25
(Cont.)
Officers work 8 hour shifts. There are 6 such shifts each day. The starting and ending times for each shift are given as table below:
Shift 1 2 3 4 5 6 Starting Time Midnight 4am 8am Noon 4pm 8pm Ending Time 8am Noon 4pm 8pm Midnight 4am
26
Types of Models
Static and Dynamic Models
A static model is one in which the decision variables do not involve sequences of decisions over multiple periods. A dynamic model is a model in which the decision variables do involve sequences of decisions over multiple periods. In a static model, we solve a one shot problem whose solutions are prescribe optimal values of the decision variables at all points in time. The Daisy problem is an example of a static model.
Modeling Techniques
32
Some application areas: - Project Planning - Capital Budgeting - Inventory Analysis - Production Planning - Scheduling - Waiting Time Analysis - Distribution Network Design
33
34
Chapter Topics
Model Formulation A Maximization Model Example Graphical Solutions of Linear Programming Models A Minimization Model Example Irregular Types of Linear Programming Models Simplex Approach Characteristics of Linear Programming Problems
35
Objectives of business decisions frequently involve maximizing profit or minimizing costs. Linear programming is an analytical technique in which linear algebraic relationships represent a firms decisions, given a business objective, and resource constraints. Steps in application:
Identify problem as solvable by linear programming. Formulate a mathematical model of the unstructured problem. Solve the model. Implementation
36
Model Components
Decision variables - mathematical symbols representing levels of activity of a firm. Objective function - a linear mathematical relationship describing an objective of the firm, in terms of decision variables - this function is to be maximized or minimized. Constraints requirements or restrictions placed on the firm by the operating environment, stated in linear relationships of the decision variables. Parameters - numerical coefficients and constants used in the objective function and constraints.
37
Step 1 : Clearly define the decision variables Step 2 : Construct the objective function Step 3 : Formulate the constraints
38
Product mix problem - Beaver Creek Pottery Company How many bowls and mugs should be produced to maximize profits given labor and materials constraints? Product resource requirements and unit profit:
39
40
41
42
Feasible Solutions
A feasible solution does not violate any of the constraints: Example x1 = 5 bowls x2 = 10 mugs Z = $40x1 + $50x2 = $700 Labor constraint check: 1(5) + 2(10) = 25 < 40 hours, within constraint Clay constraint check: 4(5) + 3(10) = 70 < 120 pounds, within constraint
43
Infeasible Solutions
An infeasible solution violates at least one of the constraints: Example x1 = 10 bowls x2 = 20 mugs Z = $1400 Labor constraint check: 1(10) + 2(20) = 50 > 40 hours, violates constraint
44
Graphical solution is limited to linear programming models containing only two decision variables (can be used with three variables but only with great difficulty). Graphical methods provide visualization of how a solution for a linear programming problem is obtained.
45
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Definitions
A feasible solution is a solution for which all constraints are satisfied A feasible region is the collection of all feasible solution An optimal solution is a feasible solution that has the most favorable value of the objective function
51
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Alternative Objective Function Solution Lines Graphical Solution of Maximization Model (8 of 12)
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
55
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Extreme (Corner) Point Solutions Graphical Solution of Maximization Model (11 of 12)
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Optimal Solution for New Objective Function Graphical Solution of Maximization Model (12 of 12)
Maximize Z = $70x1 + $20x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Two brands of fertilizer available - Super-Gro, Crop-Quick. Field requires at least 16 pounds of nitrogen and 24 pounds of phosphate. Super-Gro costs $6 per bag, Crop-Quick $3 per bag. Problem: How much of each brand to purchase to minimize total cost of fertilizer given following data ?
59
60
Minimize Z = $6x1 + $3x2 subject to: 2x1 + 4x2 16 4x1 + 3x2 24 x1, x2 0
Minimize Z = $6x1 + $3x2 subject to: 2x1 + 4x2 16 4x1 + 3x2 24 x1, x2 0
Minimize Z = $6x1 + $3x2 subject to: 2x1 + 4x2 16 4x1 + 3x2 24 x1, x2 0
65
Solve the following model graphically: Maximize Z = 4x1 + 5x2 subject to: x1 + 2x2 10 6x1 + 6x2 36 x1 4 x1, x2 0 Step 1: Plot the constraints as equations
Figure 2.23 Constraint Equations
68
Maximize Z = 4x1 + 5x2 subject to: x1 + 2x2 10 6x1 + 6x2 36 x1 4 x1, x2 0 Step 2: Determine the feasible solution space
Maximize Z = 4x1 + 5x2 subject to: x1 + 2x2 10 6x1 + 6x2 36 x1 4 x1, x2 0 Step 3 and 4: Determine the solution points and optimal solution
Figure 2.25 Optimal Solution Point
70
For some linear programming models, the general rules do not apply. Special types of problems include those with:
71
Objective function is parallel to to a constraint line. Maximize Z=$40x1 + 30x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0 Where: x1 = number of bowls x2 = number of mugs
An Infeasible Problem
Every possible solution violates at least one constraint: Maximize Z = 5x1 + 3x2 subject to: 4x1 + 2x2 8 x1 4 x2 6 x1, x2 0
An Unbounded Problem
Value of objective function increases indefinitely: Maximize Z = 4x1 + 2x2 subject to: x1 4 x2 2 x1, x2 0
Simplex Approach
More than two variables Convert all constraint in standard form Standard form requires that all constraints be in the form of equations (equalities). Introduction of slack variables
75
Slack Variables
Standard form requires that all constraints be in the form of equations (equalities). A slack variable is added to a constraint or is subtracted from a constraint to convert it to an equation (=) . When a slack variable is added to a constraint, it typically represents an unused resource. When a slack variable is subtracted from a constraint, it typically represents an excess above a constraint requirement level A slack variable contributes nothing to the objective function value.
76
Maximize Z = $40x1 + $50x2 subject to: 1x1 + 2x2 40 4x1 + 3x2 120 x1, x2 0
Standard form Max Z = 40x1 + 50x2 + 0s1 + 0s2 subject to:1x1 + 2x2 + s1 = 40 4x1 + 3x2 + s2 = 120 x1, x2, s1, s2 0
Max Z = 40x1 + 50x2 + 0s1 + 0s2 subject to:1x1 + 2x2 + s1 = 40 4x1 + 3x2 + s2 = 120 x1, x2, s1, s2 0 Where: x1 = number of bowls x2 = number of mugs s1, s2 are slack variables
Minimize Z = $6x1 + $3x2 subject to: 2x1 + 4x2 16 4x1 + 3x2 24 x1, x2 0 Standard form Min Z = $6x1 + $3x2+ 0s1 + 0s2 subject to: 2x1 + 4x2 - s1 =16 4x1 + 3x2 - s2 = 24 x1, x2 ,s1, s2 0
Optimum Solution Point
79
Minimize Z = $6x1 + $3x2 + 0s1 + 0s2 subject to: 2x1 + 4x2 s1 = 16 4x1 + 3x2 s2 = 24 x1, x2, s1, s2 0
Standard LP Form
Suppose an LP with m constraints and n variables has been converted into standard form. The form of such an LP is: max ( or min) z = c1x1 + c2x2 + +cnxn s.t. a11x1 + a12x2 + + a1nxn =b1 a21x1 + a22x2 + + a2nxn =b2 . . . . . .
Basic Solution
If we define:
The constraints may be written as a system of equations Ax = b. Consider a system Ax = b of m linear equations in n variables (where n m). A basic solution to Ax = b is obtained by setting n m variables equal to 0 and solving for the remaining m variables. This assumes that setting the n m variables equal to 0 yields a unique value for the remaining m variables, or equivalently, the columns for the remaining m variables are linearly independent.
- x2 + x3 = -1
x1 + x2
=3
- x2 + 0 = -1
Since this system has no solution, there is no basic solution corresponding to BV = {x1, x2}.
Properties of LP
Any basic solution in which all variables are nonnegative is called a basic feasible solution ( or bfs). For the basic solutions on the previous slides, x1 = 2, x2 = 1, x3 = 0 and x1 = 0, x2 = 3, x3 = 2 are basic feasible solutions, but the basic solution x1 = 3, x2 = 0, x3 = -1 fails to be a bfs (because x3 < 0). The following two theorems explain why the concept of a basic feasible solution is of great importance in linear programming: Theorem 1 The feasible region for any linear programming problem is a convex set. Also, if an LP has an optimal solution, there must be an extreme point of the feasible region that is optimal. Theorem 2 For any LP, there is a unique extreme point of the LPs feasible region corresponding to each basic feasible solution. Also, there is at least one bfs corresponding to each extreme point in the feasible region.
87
Examples
y x x y x y
(a)
(b)
(c)
Convexity of a set. (a) convex set; (b) convex set (polyhedron); (c) non-convex set
88
89
Max Z = 40x1 + 50x2 + 0s1 + 0s2 subject to:1x1 + 2x2 + s1 = 40 4x1 + 3x2 + s2 = 120 x1, x2, s1, s2 0
Both inequalities are satisfied in the shaded area. The extreme points are of the feasible region are 0, A, B, and C.
Simplex Algorithm
General description of the simplex algorithm solving an LP in a maximization problem:
Step 1 Find a bfs to the LP. We will call this bfs the initial bfs. In general, the most recent bfs will be called the current bfs, so at the beginning of the problem, the initial bfs is the current bfs. Step 2 Determine if the current bfs is an optimal solution to the LP. If it is not, find an adjacent bfs that has a larger zvalue. Step 3 Return to Step 2, using the new bfs as the current bfs.
Algebraic Form of LP
Consider Max z = cx subject to Ax = b x0 Max Z = 40x1 + 50x2 subject to:1x1 + 2x2 + s1 = 40 4x1 + 3x2 + s2 = 120 x1, x2, s1, s2 0
x0
The above equation can be decomposed into basic and non-basic variables of the following Max z = cBxB + cN xN subject to BxB + NxN = b xB 0, xN = 0 Let x1 and s1 be NBV
xB 0, xN = 0
94
We can expressed the BV as a function of NBV BxB + NxN = b BxB = b - NxN xB = B-1b - B-1NxN Substituting into the objective function, we have z = cBxB + cN xN z = cB(B-1b - B-1NxN) + cN xN z = cBB-1b + (cN - cBB-1N)xN Overall the LP model is z = cBB-1b + (cN - cBB-1N)xN s.t. xB = B-1b - B-1NxN xB 0, xN = 0
xB 0, xN = 0
96
The LP model z = cBB-1b + (cN - cBB-1N)xN s.t. xB = B-1b - B-1NxN xB 0, xN = 0 Let x1 and s1 be NBV
xB 0, xN = 0
97
xB 0, xN = 0
xB 0, xN = 0
98
Max z = cBB-1b + {j in N}(cj -zj)xj subject to xB = B-1b - B-1NxN xB 0, xN = 0 where -(cj -zj ) is sometimes known as the reduced costs
xB 0, xN = 0
Max Z = 40x1 + 50x2 + 0s1 + 0s2 subject to:1x1 + 2x2 + s1 = 40 4x1 + 3x2 + s2 = 120 x1, x2, s1, s2 0 Where: x1 = number of bowls x2 = number of mugs s1, s2 are slack variables
Linear Programming
What are the assumptions made when applying LP models in the real world problems?
101
Proportionality - The rate of change (slope) of the objective function and constraint equations is constant. Additivity - Terms in the objective function and constraint equations must be additive. Divisibility -Decision variables can take on any fractional value and are therefore continuous as opposed to integer in nature. Certainty - Values of all the model parameters are assumed to be known with certainty (non-probabilistic).
102
Properties of LP
If there is exactly one optimal solution, then it must be a corner-point feasible solution. If there are multiple optimal solutions, then at least two must be adjacent corner-point feasible solution There are only a finite number of corner-point feasible solutions If a corner-point solution has no adjacent corner-point feasible solutions that are better, then there are no better corner-point feasible solutions anywhere, i.e., it is optimal.
103
End of Chapter
104