Linear Programming: Linear Programming (LP, Also Called Linear Optimization) Is A Method To Achieve The Best Outcome
Linear Programming: Linear Programming (LP, Also Called Linear Optimization) Is A Method To Achieve The Best Outcome
Linear Programming: Linear Programming (LP, Also Called Linear Optimization) Is A Method To Achieve The Best Outcome
Objective Function
The objective function in a mathematical optimization problem is the re
is to be either minimized or maximized over the set of feasible alternatives. I
Example 1:A self-employed carpenter earns $90 for the sale of a table an
for him to make a table and 5 hours to manufacture a rocking chair. He
The average manufacturing cost is $15 per table and $45 per rocking chair. He
at $ 315 per week. How many tables and rocking chairs should he mak
Determine the maximum profit he make per week.
S = 90T + 180R
Constraints
The linear inequalities or equations or restrictions on the variables of
The conditions x ≥ 0, y ≥ 0 are called non-negative restrictions
A linear constraint is a mathematical expression where linear terms (
are added or subtracted and the resulting expression is forced
or exactly equal to a right-hand side value.
The constraints are the restrictions or limitations on the decision variab
Some examples of constraints are time, budget, resources av
2T + 5R < 40
ajor components:
ctive function, and (3) constraints.
uantities that need to be determined in order to solve the problem;
t values of the variables have been identified.
on-maker controls. For example, in an optimization model for labor scheduling,
he morning shift in an emergency room may be a decision variable.
s to produce, the number of vaccines to manufacture, the amount of money to invest,
variable like x, y, a, b, etc.
(minimization example)
the sale of a table and $180 for the sale of a rocking chair. It takes 2 hours
re a rocking chair. He is limited to working 40 hours per week.
45 per rocking chair. He wishes to keep his manufacturing costs
chairs should he make to maximize his weekly sales?
(maximization example)
on the decision variables. They usually limit the value of the decision variables.
budget, resources availability, etc.
niques improve
heduling,
oduction goals.
straints.
ariables.
on problem).
traints.
A self-employed carpenter earns $90 for the sale of a table and $180
Example 1:
for him to make a table and 5 hours to manufacture a rocking chair. He is limit
The average manufacturing cost is $15 per table and $45 per rocking chair. He wishes
at $ 315 per week. How many tables and rocking chairs should he make to ma
Determine the maximum profit he make per week.
T R Objective Function:
Sales $90 $180 S = 90T + 180R
Time 2hrs 5hrs
Cost $15 $45 Subject to Constraints: 2T + 5R < 40
2T + 5R < 40 2T + 5(0) = 40
15T + 45R < 315 T = 20
T, R > 0 (20,0)
R 2(0) + 5R = 40
R=8
(0, 8)
2T + 5R = 40
15T + 45R = 315
2T + 5R = 40
2(15) + 5R = 40
5R = 40-30
(0,8) 2T + 5R < 40 R=2
8
15T + 45R < 315
(0,7)
(0,0)
Objective Function:
S = 90T + 180R
Corner Pts T R Sales
(0,0) 0 0 0 Subject to Constraints:
(0,7) 0 7 1260 2T + 5R < 40 time-constraint
(15,2) 15 2 1710 15T + 45R < 315 cost-costraint
(20,0) 20 0 1800 T, R > 0 non-neg
P = S-C
P = 1800 - 315
P = $1485
a table and $180 for the sale of a rocking chair. It takes 2 hours
chair. He is limited to working 40 hours per week.
g chair. He wishes to keep his manufacturing costs
d he make to maximize his weekly sales?
x - intercept/ t - intercept
2T + 5R < 40 15T + 45R < 315
2T + 5(0) = 40 15T + 45(0) = 315
T = 21
(21,0)
y - intercept/ r - intercept
2(0) + 5R = 40 15(0) + 45R = 315
R=7
(0,7)
by elimination of variables
2T + 5R = 40 18T + 45R = 360
-
15T + 45R = 315 15T + 45R = 315
3T =45
2T + 5R = 40 T=15
2(15) + 5R = 40
5R = 40-30 (15,2)
C (T,R) = (15,2)
(20,0) (21,0)
20 T
A company receives in sales $20 per book and $18 per calculato
Example 2:
calculator are $5 and $4 respectively. The monthly (30 day) cost must no
equipment used by the company takes 5 minutes to produce a book and 15 minu
and calculators should the company make to maximize profit? Determine
Objective Function:
Subject to Constraints:
$18 per calculator. The cost per unit to manufacture each book and
ay) cost must not exceed $27,000 per month. If the manufactuting
book and 15 minutes to produce a calculator, how many books
rofit? Determine the maximum profit the company earns in a 30 day period.
Simplex Method
Maximize P = 5x + 4y
Subject to: 3x + 5y < 78 3x + 5y + S1 = 78
4x + y < 36 4x + y + S2 = 36
non-negativity constraints x, y > 0 -5x - 4y + P = 0
x y S1 S2 P
x y S1 S2 P
3 5 1 0 0
1 1/4 0 1/4 0
-5 -4 0 0 1
Convert all other elements (except for key element) in the key column
to zero to make the variable as basic variable
New R1 = Old R1 - 3R2
New R3 = Old R3 + 5 R2
x y S1 S2 P
0 17/4 1 -3/4 0
1 1/4 0 1/4 0
Choose the column (key column) of 0 -11/4 0 5/4 1
most negative value at the bottom row
x y S1 S2 P
0 1 4/17 -3/17 0
1 1/4 0 1/4 0
0 -11/4 0 5/4 1
Convert all other elements (except for key element) in the key column
to zero to make the variable as basic variable
THEREFORE, x=6 S1 = 0
y = 12 S2 = 0
P = 78
P = 5x + 4y
3x + 5y < 78 3x + 5y + S1 = 78
4x + y < 36 4x + y + S2 = 36
x, y > 0 -5x - 4y + P = 0
C
C
78 (78/3 = 26) take the row of the
36 (36/4 = 9) lower value as the key row
0
78
9
0
12
9
45
x y z S1
3 10 5 1
5 2 8 0
8 10 3 0
-3 -4 -1 0
x y z S1
3 10 5 1
5/2 1 4 0
8 10 3 0
-3 -4 -1 0
x y z S1
-22 0 -35 1
5/2 1 4 0
-17 0 -37 0
7 0 15 0
x=0 S1 = 90
y=3 S2 = 0
z=0 S3 = 75
P =12
P = 3x + 4y + z
30 < 120 3x + 10y + 5z < 120 3x + 10y + 5z + S1 = 120
6=6 5x + 2y + 8z < 6 5x + 2y + 8z + S2 = 6
30 < 105 8x + 10y + 3z < 105 8x + 10y + 3z + S3 = 105
x, y, z > 0 -3x -4y - z + P = 0
S2 S3 P
0 0 0 120 120/10 12
1 0 0 6 6/2 3
0 1 0 105 105/10 10.5
0 0 1 0
S2 S3 P
0 0 0 120
1/2 0 0 3
0 1 0 105
0 0 1 0
S2 S3 P
-5 0 0 90
1/2 0 0 3
-5 1 0 75
2 0 1 12
Minimize C = x + y + 3z
Subject to: 2x + y + 3z > 6
x + 2y + 4z > 8
3x + y - 2z > 4
non-negativity constraints x, y, z > 0
x y z Constant
2 1 3 6
1 2 4 8
3 1 -2 4
1 1 3
Maximize P = 6u + 8v + 4w
u v w x
2 1 3 1
1 2 1 0
3 4 -2 0
-6 -8 -4 0
u v w x
2 1 3 1
1/2 1 1/2 0
3 4 -2 0
-6 -8 -4 0
NewR1 = OldR1 - R2
NewR3 = OldR3 -4R2
NewR4 = OldR4 + 8R2
u v w x
1 1/2 0 2 1/2 1
1/2 1 1/2 0
1 0 -4 0
-2 0 0 0
u v w x
1 0 1 2/3 2/3
1/2 1 1/2 0
1 0 -4 0
-2 0 0 0
u v w x
1 0 1 2/3 2/3
0 1 - 1/3 - 1/3
0 0 -5 2/3 - 2/3
0 0 3 1/3 1 1/3
w = 10/3
x = 4/3
y = 10/3
C14/3
Maximize P = 6u + 8v + 4w
u v w Constant
2 1 3 1 2u + v +3w < 1
transpose to => 1 2 1 1 u + 2v + w < 1
3 4 -2 3 3u + 4v - 2w < 3
6 8 4
y z P Constant
0 0 0 1 1/1 1
1 0 0 1 1/2 0.5
0 1 0 3 3/4 0.75
0 0 1 0
y z P Constant
0 0 0 1
1/2 0 0 1/2
0 1 0 3
0 0 1 0
y z P Constant
- 1/2 0 0 1/2 1/2
1/2 0 0 1/2 1
-2 1 0 1 1
4 0 1 4
y z P Constant
- 1/3 0 0 1/3
1/2 0 0 1/2
-2 1 0 1
4 0 1 4
y z P Constant
- 1/3 0 0 1/3
2/3 0 0 1/3
-1 2/3 1 0 2/3
3 1/3 0 1 4 2/3
u, v , z, P = 0