Linear Programming
Linear programming is an optimization technique that involves the maximization or minimization of a linear function, called objective function subject to linear constraints also.
The optimization criterion is usually an economic purpose, for example to maximize profit or minimize cost and for this reason is called economic role or objective function.
Example 1.
A company produces two types of can opener: manual and electric. Each requires in its manufacture the use of three machines: A, B, and C. Each manual can opener requires the use of machine A for 2 hours, machine B for 1 hour, and machine C for 1 hour. An electric can opener requires 1 hour on A, 2 hours on B, and 1 hour on C. Furthermore, suppose the maximum number of hours available per month for the use of machine A, B, and C are 180, 160, and 100, respectively. The profit on a manual can opener is $4, and on an electric can opener it is $6. If the company can sell all the can openers it can produce, how many of each type should be make in order to maximize the monthly profit?
Manual Electric Hours
available
A 2 hr 1 hr 180
B 1 hr 2 hr 160
C 1 hr 1 hr 100
Profit/Unit $4 $6
To solve the problem, let x and y denote the number of manual and electric can openers, respectively, that are made in a month. Since the number of can openers made is not negative,
x≥0 and y≥0
For the machine A the time needed for working on x manual can openers is 2x hours, and the time needed for working on y electric can openers is 1y hour. The sum of these times cannot be greater than 180, so
2x+y≤180
Similarly, the restrictions for machines B and C give
X+2y≤160 and x+y≤100
The profit is a function of x and y and is given by the
profit function
Summarizing, we want to maximize the
Objective function
Subject to the condition that x and y must be a solution of the system of constraints:
Solution: let’s do it geometrically.
The solution was done in class
SIMPLEX METHOD TO MAXIMIZE OBJECTIVE FUNCTIONS:
Problem:
Maximize Z = C1
x
1+C2x
2+C3x
3Subject to
a
11x
1+ a
12x
2+ a
13x
3≤ b
1a
21x
1+ a
22x
2+ a
23x
3≤ b
2a
31x
1+ a
32x
2+ a
33x
3≤ b
3a
41x
1+ a
42x
2+ a
43x
3≤ b
4Where
x
1,x
2,x
3 and b1, b2, b3, b4 are nonnegative.1. Set up the Initial simplex table:
B x1 x2 x3 S1 S2 S3 S4 Z R
S1 a11 a12 a13 1 0 0 0 0 b1
S2 a21 a22 a23 0 1 0 0 0 b2
S3 a31 a32 a33 0 0 1 0 0 b3
S4 a41 a42 a43 0 0 0 1 0 b4
Z -C1 -C2 -C3 0 0 0 0 1 0
i n d i c a t o r s
There are four slack variables: S1, S1, S3, S4 -- one for each constraint.
and mark the column in which the most negative indicator appear. This
pivot column
gives the entering variable. (If more than one column contains the most negative indicator, the choice of pivot column is arbitrary.)3. Divide each
positiv
e entry above the objective row in the entering-variable columninto
the corresponding value of column R.4. Mark the entry in the pivot column that corresponds to the smallest quotient in step 3. This is the pivot entry, and the row in which it is located is the
pivot row
. The departing variable is the one that labels thepivot row.
5. Use elementary row operations to transform the table into a new equivalent table that has a 1 where the pivot entry was and 0’s elsewhere in that column.
6. In the labels column B, of this table, the entering variable replaces the departing variable.
7. If the indicators of the new table are all nonnegative, we have an optimum solution. The maximum value of Z is the entry in the blast row and last column. It occurs when the basic variables as found in the label column, B, are equal to the corresponding entries in column R. all other variables are 0. If at least one of the indicators is negative, repeat the process, beginning with step 2 applied to the new table.
Example 2:
Maximize Z = 5x1 + 4x2 subject to
x
1+
x
2≤ 20
2
x
1+
x
2≤ 35
-3
x
1+
x
2≤12
And
x
1,
x
2≥ 0
Solution: This linear programming problem fits the standard form, the initial simplex table is.
enterin g variabl e
B x1 x2 S1 S2 S3 Z R
Quotient
S1 1 1 1 0 0 0 20 20 ÷ 1 =20
departing
variable S2 2 1 0 1 0 0 35 35 ÷ 2 = 35/2
Z -5 -4 0 0 0 1 0
i n d i c a t o r s
The most negative indicator, -5 accours in the X1 column. Thus X1 is the entering variable. The smaller quotient is 35/2, so S2 is the departing variable. The pivot entry is 2. Using elementary roe operation to get 1 in the pivot position and 0’s elsewhere in its column, we have
1 1 1 0 0 0 20
R2
1 1/2 0 1/2 0 0 35/2
-3 1 0 0 1 0 12
-5 -4 0 0 0 1 0
-1R2+R1 0 1/2 1 -1/2 0 0 5/2
3R2+R3 1 1/2 0 1/2 0 0 35/2
5R2+R4 0 5/2 0 3/2 1 0 129/2
0 -3/2 0 5/2 0 1 175/2
Our new table is
entering variable
B x1 x2 S1 S2 S3 Z R Quotient
departing variable S1 0 1/2 1 -1/2 0 0 5/2
x1 1 1/2 0 1/2 0 0 35/2
S3 0 5/2 0 3/2 1 0 129/2
Z 0 -3/2 0 5/2 0 1 175/2
i n d i c a t o r s
Note that in column B, which keeps track of which variables are basic, x1 has replaced S2. Since we still have a negative indicator, -3/2, we must continue our ´process, evidently, -3/2 is the most negative indicator and the entering variable is now X2. The smallest quotient is 5. Hence, S1 is the departing variable and ½ is the pivot entry. Using elementary row operations we have
0 1/2 1 -1/2 0 0 5/2
1 1/2 0 1/2 0 0 35/2
0 5/2 0 3/2 1 0 129/2
0 -3/2 0 5/2 0 1 175/2
0 1/2 1 -1/2 0 0 5/2
-1R1+R2 1 0 -1 1 0 0 15
-5R1+R3 0 0 -5 4 1 0 52
3R1+R4 0 0 3 1 0 1 95
2R1 0 1 2 -1 0 0 5
1 0 -1 1 0 0 15
0 0 -5 4 1 0 52
0 0 3 1 0 1 95
B x1 x2 S1 S2 S3 Z R
X2 0 1 2 -1 0 0 5
X1 1 0 -1 1 0 0 15
S3 0 0 -5 4 1 0 52
Z 0 0 3 1 0 1 95
Where X2 replaced S1 in column B. since all indicators are nonnegative, the maximum value of Z is 95 and occurs when X2 = 5 and X1 = 15 (and S3 = 52, S1 = 0, and S2 = 0)
Exercises:
1.
Graphing the constraints, Maximize P = 9x + 7ySubject to 2x + y ≤ 40 x + 3y ≤ 30 x, y ≥ 0
Appling the Simplex Method, find the maximum of:
2.
Maximize profit = 10x + 8y Subject to4x + 2y ≤ 80 x + 2y ≤ 50 x, y ≥ 0
3.
Maximize Z = x1 + 2x2 Subject to2x1 + x2 ≤ 8 2x1 + 3x2 ≤ 12 x2, x2 ≥ 0
4.
Maximize Z = -x1 + 2x2 Subject to3x1 + 2x2 ≤ 5 -x1 + 3x2 ≤ 3 x2, x2 ≥ 0
5.
Maximize W = 2x1 +x2Subject to
x1 - x2 ≤ 1 5x1 + 4x2 ≤ 20 x1 + 2x2 ≤ 8 x2, x2 ≥ 0
6.
The Toones Company has $30,000 for the purchase of materials to make three types
of MP3 players. The company has allocated a total of 1200 hours of assembly time and 180 hours of packaging time for the players. The following table gives the cost per player, the number of hours per player, and the profit per player for each type:Type 1
Type 2
Type 3
Cost/Player
$300
$300
$400
Assembly Hours/
Player
15
15
10
Packaging Hours/
Player
2
2
3
Profit
$150
$250
$200