2. Content
1. What linear Programming
2. Three basic components of linear programming (LP)
3. Steps of Mathematical Linear Programming model
4. Two-Variable Model LP Model
4.1. Example 1
4.2. Example 2
5. Graphical LP Solution
5.1. Example 1
5.2 Example 2
3. LINEAR PROGRAMMING
(LP)
• linear programming(LP): is a technique for
optimization of a linear objective function,
subject to linear equality and linear
inequality constraints.
• Linear programming determines the way to
achieve the best outcome (such as
maximum profit or lowest cost) in a given
mathematical model and given some list
of requirements represented as linear
equations.
4. Three basic components of linear
programming (LP)
• All OR models, LP included, consist of three
basic components:
1. Decision variables that we seek to determine
2. Objective (goal) that we need to optimize
(maximize or minimize).
3. Constraints that the solution must satisfy.
The proper definition of the decision variables is
an essential first step in the development of the
model.
5. Basics
• In the case of linear programming (LP), the
objective function and the constraints are all
linear functions of the decision variables.
• Linear function: for example: Y = X1 + X2
• Linear constraints are linear functions that
are restricted to be “less than or equal to ” ”
equal to” Or “greater than or equal to ” a
constant.
6. Steps of Mathematical Linear
Programming Model
• Step 1:
Identify the decision variables of the problem
• Step 2:
Construct the objective function as an LP
combination of the decision variables
• Step 3:
Identify the constraints of the problem such as
resource limitation, interrelation between
variables
7. Example 1
• A factory produces two types of products A and B.
• Each unit of A requires 50 minutes of processing time
on machine one and 30 minutes on machine two.
• Each unit of B requires 24 minutes on machine one
and 33 minutes on machine two
• Machine one is going to be available for 40 hours and
machine two is available for 35 hours
• The profit per unit of A is $25 and the profit per unit
of B is $30.
• Company policy is to determine the production
quantity of each product in such a way as to
maximize
constrain
Objective
8. Solution
• 1. Define the decision variables.
– X1: the number of product A to be produced.
– X2: the number of product B to be produced.
– Clearly X1, X2 ≥ 0
• 2. Write the objective in terms of the decision
variables.
– The factory gets a profit of $25 for product A and
$30 for product B.
– the objective function is to maximize profit (P).
• P= 25 X 1 + 30 X 2
9. Solution
• 3. Write the constraints in terms of the decision
variables.
– If we produce X1 units of A and X2 units of B,
machine one should be used for 50 X1 + 24 X2
minutes
– Since each unit of A requires 50 minutes of
processing time on machine one and each unit of
B requires 24 minutes of processing time on
machine one
– On the other hand, machine one is available for
40 hours or equivalently for 2400 minutes This
imposes the following constraint:
• 50 X1 + 24 X2 ≤ 2400.
10. Solution
• Similarly, machine two should be used for 30
X1 + 33 X2 minutes
• since each unit of A requires 30 minutes of
processing time on machine two and
• each unit of B requires 33 minutes of
processing time on machine two.
• On the other hand, machine two is available
for 35 hours or equivalently for 2100
minutes.
• This imposes the following constraint:
• 30X1 +33 X2 ≤ 2100.
12. Example 2
Reddy Mikks problem: The goal of Reddy
Mikks is to maximize (i.e., increase as
much as possible) the total daily profit
of both paints.
The following table provides the basic
data of the problem:
13. Example 2
𝑥1 = Tons produced daily of exterior paint
𝑥2 = Tons produced daily of interior paint
Profit from exterior paint = 5𝑥1(thousand dollars)
Profit from interior paint = 4𝑥2 1thousand2 dollars
• Step 1 : formulate objective function
Letting 𝑧 represent the total daily profit (in
thousands of dollars), the objective (or goal) of
Reddy Mikks is expressed
Maximize 𝑧 = 5𝑥1+ 4𝑥2
14. • Step 2 : construct the constraints that restrict raw material usage
and product demand.
Thus, the raw material constraints are:
6𝑥1 + 4𝑥2 ≤ 24 (RM of M1)
𝑥1+ 2𝑥2 ≤ 6 (RM of M2)
• first restriction on product demand stipulates that the daily production of
interior paint cannot exceed that of exterior paint by more than 1 ton
𝑥2 − 𝑥1 ≤ 1
• second restriction limits the daily demand of interior paint to 2 tons
𝑥2 ≤ 2
16. Linear Optimization Models
Developing an Optimization Model
1. Define the decision variables.
2. Identify the objective (goal) that we need to optimize
(maximize or minimize).
3. Identify all appropriate constraints that the solution must
satisfy.
4. Write the objective function and constraints as mathematical
expressions.
Characteristics of Linear Optimization Models
The objective function and all constraints are linear
functions of the decision variables
All variables are continuous (fractional values are allowed)
17. Example 2
• Niki holds two part-time jobs, Job I and Job II.
She never wants to work more than a total of 12
hours a week. She has determined that for every
hour she works at Job I, she needs 2 hours of
preparation time, and for every hour she works
at Job II, she needs one hour of preparation
time, and she cannot spend more than 16 hours
for preparation.
• If Niki makes $40 an hour at Job I, and $30 an
hour at Job II, how many hours should she work
per week at each job to maximize her income?
18. Objective
• Let the number of hours per week Niki will
work at Job I = x
• Let the number of hours per week Niki will
work at Job II = y
• Now we write the objective function. Since
Niki gets paid $40 an hour at Job I, and $30
an hour at Job II, her total income I is given
by the following equation.
Z=40x+30y
19. Constraints
Our next task is to find the constraints. The
second sentence in the problem states, "She
never wants to work more than a total of 12 hours
a week." This constraint translates mathematically
to:
x+y≤12
20. Constraints
The third sentence states, "For every hour she
works at Job I, she needs 2 hours of preparation
time, and for every hour she works at Job II,
she needs one hour of preparation time, and she
cannot spend more than 16 hours for
preparation." The translation follows.
2x+y≤16
The fact that x and y can never be negative is
represented by the following two constraints:
x≥0, and y≥0.
26. Feasible region
• To determine the correct side, designate any
point not lying on the straight line as a reference
point. If the chosen reference point satisfies the
inequality, then its side is feasible; otherwise,
the opposite side becomes the feasible half-
space.
• The origin (0, 0) is a convenient reference point
and should always be used so long as it does not
lie on the line representing the constraint.
• x+y≤12 0+0 ≤12
• 2x+y≤16 2(0)+0 ≤16
27. Determination of the Feasible Solution Space
0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12 14
Axis
Title
Axis Title
Y-Values
Infeasible space
28. The vertices of the Feasible Solution
Space
• In practice, a typical LP may include hundreds or
even thousands of variables and constraints.
• Of what good then is the study of a two-variable
LP? The answer is that the graphical solution
provides a key result: The optimum solution of
an LP, when it exists, is always associated with a
corner point of the solution space, thus limiting
the search for the optimum from an infinite
number of feasible points to a finite number of
corner points.
29. 0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12 14
Axis
Title
Axis Title
Y-Values
The vertices of the Feasible Solution Space
Infeasible space
C
D
A
B
30. Determine the optimum point
• The values of x and y associated with the optimum point C are determined
by solving the equations associated with lines (1) and (2):
• x+y≤12 *2 2x+2y=24 2x+2(8)=24
- 2x+16=24
• 2x+y≤16 *1 2x+y=16 2x=24-16
x=8/2
y=24-16 X=4
y=8
31. The vertices of the Feasible
Solution Space
A (0,0)
B (0,12)
C (4,8)
D (8,0)
0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12 14
Axis
Title
Axis Title
Y-Values
C
D
B
A
32. The maximum (or minimum) value of the
objective function
(X,Y) F(X,Y)=40x+30y Max
(0,0) 40(0)+30(0) 0
(0,12) 40(0)+30(12) 360
(8,0) 40(8)+30(0) 320
(4,8) 40(4)+30(8) 400
(X,Y) F(X,Y)=40x+30y Min
(0,0) 40(0)+30(0) 0
(0,12) 40(0)+30(12) 360
(8,0) 40(8)+30(0) 320
(4,8) 40(4)+30(8) 400
The solution is X = 4 and Y = 8 with z = 40*4+30*8 = 400.
Therefore, we conclude that Niki should work 4 hours at Job I, and 8 hours at Job II.
33. Example 2
Use graphical method to solve the
following linear programming model.
Maximize z = 5x1 + 4x2
subject to
1. 6x1 + 4x2 ≤ 24
2. 6x1 + 3x2 ≤ 22.5
3. x1 + x2 ≤ 5
4. x1 + 2x2 ≤ 6
5. -x1 + x2 ≤ 1
6. x2 ≤ 2
7. x1, x2 ≥ 0
42. Feasible region
• To determine the correct side, designate any point not
lying on the straight line as a reference point. If the chosen
reference point satisfies the inequality, then its side is
feasible; otherwise, the opposite side becomes the feasible
half-space.
• The origin (0, 0) is a convenient reference point and should
always be used so long as it does not lie on the line
representing the constraint.
1. 6x1 + 4x2 ≤ 24 6(0) + 4(0) ≤ 24
2. 6x1 + 3x2 ≤ 22.5 6(0) + 3(0) ≤ 22.5
3. x1 + x2 ≤ 5 (0) + (0) ≤ 5
4. x1 + 2x2 ≤ 6 (0) + 2(0) ≤ 6
5. -x1 + x2 ≤ 1 -(0) + (0) ≤ 1
6. x2 ≤ 2 (0) ≤ 2
44. The vertices of the Feasible Solution Space
• In practice, a typical LP may include hundreds or even
thousands of variables and constraints.
• Of what good then is the study of a two-variable LP? The
answer is that the graphical solution provides a key
result: The optimum solution of an LP, when it exists, is
always associated with a corner point of the solution
space, thus limiting the search for the optimum from an
infinite number of feasible points to a finite number of
corner points.
45. The vertices of the Feasible Solution Space
0
1
2
3
4
5
6
7
8
-2 -1 0 1 2 3 4 5 6 7
Axis
Title
Axis Title
Y-Values
A
B
C D
E
F
46. Determine the optimum point
• The values of x and y associated with the optimum point E are determined
by solving the equations associated with lines (1) and (4):
• 6x1 + 4x2 ≤ 24 *1 6x1 + 4x2 ≤ 24 6x1 + 4(1.5) ≤ 24
-
6x1 + 12x2 ≤ 36 6x1 + 6 ≤ 24
• x1 + 2x2 ≤ 6 *6
-8x2= -12 6x1 ≤ 24 - 6
x2 = -12/-8 6x1 ≤ 18
x2 = 1.5 x1 ≤ 18/6
x1 = 3
47. The vertices of the Feasible Solution Space
0
1
2
3
4
5
6
7
8
-2 -1 0 1 2 3 4 5 6 7
Axis
Title
Axis Title
Y-Values
A (0,0)
B (0,1)
C (1,2)
D (2,2)
E (3,1.5)
F (3.75,0)
A
B
C D
E
F
48. The maximum value of the objective function
(X1,X2) F(X,Y)=5x1 + 4x2 Max
(0,0) 5(0) + 4(0) 0
(0,1) 5(0) + 4(1) 4
(1,2) 5(1) + 4(2) 13
(2,2) 5(2) + 4(2) 18
(3,1.5) 5(3) + 4(1.5) 21
(3.75,0) 5(3.75) + 4(0) 18.75
The solution is X1 = 3 and X2 = 1.5 with z = 5*3 + 4*1.5 = 21.
(X1,X2) F(X,Y)=5x1 + 4x2 Min
(0,0) 5(0) + 4(0) 0
(0,1) 5(0) + 4(1) 4
(1,2) 5(1) + 4(2) 13
(2,2) 5(2) + 4(2) 18
(3,1.5) 5(3) + 4(1.5) 21
(3.75,0) 5(3.75) + 4(0) 18.75