Linear Programming
BRAC University
Managerial Economics
Linear Programming (LP)
A model consisting of linear relationships
representing a firm’s objective and resource
constraints
LP is a mathematical modeling technique used
to determine a level of operational activity in
order to achieve an objective, subject to
restrictions called constraints
What is LP
Linear Programming is a technique for solving a
special set of constrained optimization problem
where
OBJECTIVE function is linear and there are one or
more
CONSTRINTS, which are also linear.
ALL THE IMPORTANT RELATIONSHIPS IN A LINEAR PROGRAMMING PROBLEM MUST BE LINEAR
Includes:
• Production
• Total Cost
• Total Revenue
• Profit Function
Linearity means:
• Constant return to scale
• Price of output is constant
• Price of inputs are constant
• Production cost per unit is constant
• Profit per unit of output is constant
Constraint Profit Maximization
LP Model Formulation
Decision variables
mathematical symbols representing levels of activity of an
operation
Objective function
a linear relationship reflecting the objective of an operation
most frequent objective of business firms is to maximize profit
most frequent objective of individual operational units (such as a
production or packaging department) is to minimize cost
Constraint
a linear relationship representing a restriction on decision making
LP Model Formulation (cont.)
Max/min z = c1x1 + c2x2 + ... + cnxn
subject to:
a11x1 + a12x2 + ... + a1nxn (≤, =, ≥) b1
a21x1 + a22x2 + ... + a2nxn (≤, =, ≥) b2
:
am1x1 + am2x2 + ... + amnxn (≤, =, ≥) bm
xj = decision variables
bi = constraint levels
cj = objective function coefficients
aij = constraint coefficients
Structuring the Problem
Firm producing two goods, A and B. Its profit
equation,
п = aQA + bQB
Where
п = total profit
a = profit per unit of A, b = profit per unit of B
Example 1
П = 120 П = 90 П = 60
QA QB QA QB QA QB
0 120 0 90 0 60
10 90 10 60 10 30
20 60 20 30 20 0
30 30 30 0
40 0
The management problem is to maximize profit
given the resources constraints.
SUPPOSE: to produce A and B three machines (x y
z) are needed.
Structuring the Problem
Structuring the Problem: Constraints
Constraints:
For X machine
1QA + 3QB ≤ 90
For Y machine
2QA + 2QB ≤ 80
For Z machine
2QA ≤ 60
Non Negativity Constraints
QA ≥ 0
QB ≥ 0
Without this constraint, solution would be easier but would be meaningless.
The Model
Maximize the Objective function subject to
constraints
π= 3QA + 1QB Objective function
Subject to
1QA + 3QB ≤ 90 Machine X constraint
2QA + 2QB ≤ 80 Machine Y constraint
2QA ≤ 60 Machine Z constraint
QA ≥ 0 and QB ≥ 0 Non-negativity constraint
Feasibility Region
First rewrite the constraints in the following fashion:
1QA + 3QB ≤ 90
or, QB = 30 - 1/3 QA
Again
2QA + 2QB ≤ 80
or, QB = 40 – QA
And
2QA ≤ 60
QA = 30
Feasibility Region: Graphically
Feasibility Region: Definition
The feasibility region consists of all values of
the decision variables that that satisfy all the
constraints simultaneously.
Graphic Solution
Graphical Solution
QA = 30, QB = 10
π = 3QA + 1QB
= 3(30) + 10 =100
Algebraic Solution
Maximize
π = 3QA + 1QB
subject to
1QA + 3QB ≤ 90
2QA + 2QB ≤ 80
2QA ≤ 60
and
QA ≥ 0 and QB ≥ 0
Algebraic Solution: Contd.
At corner e At corner g
1QA + 3QB = 90 2QA + 2QB = 80
0 + 3QB = 90 2QA = 60
Therefore, QB = 30 Therefore, QB = 10 and
At corner f QA = 30
At corner h
1QA + 3QB = 90
or 2QA + 6QB = 180 2QA = 60
2QA + 2QB = 80 Therefore QA = 30
Therefore, 4QB = 100
or QB = 25 and QA = 15
Algebraic Solution
LP Model: Example
RESOURCE REQUIREMENTS
Labor Clay Revenue
PRODUCT (hr/unit) (lb/unit) ($/unit)
Bowl 1 4 40
Mug 2 3 50
There are 40 hours of labor and 120 pounds of clay
available each day
Decision variables
x1 = number of bowls to produce
x2 = number of mugs to produce
LP Formulation: Example
Maximize Z = $40 x1 + 50 x2
Subject to
x1 + 2x2 40 hr (labor constraint)
4x1 + 3x2 120 lb (clay constraint)
x1 , x2 0
Solution is x1 = 24 bowls x2 = 8 mugs
Revenue = $1,360
Graphical Solution Method
1. Plot model constraint on a set of coordinates
in a plane
2. Identify the feasible solution space on the
graph where all constraints are satisfied
simultaneously
3. Plot objective function to find the point on
boundary of this space that maximizes (or
minimizes) value of objective function
Graphical Solution: Example
x2
50 –
40 –
4 x1 + 3 x2 120 lb
30 –
Area common to
20 – both constraints
10 – x1 + 2 x2 40 hr
| | | | | |
0–
10 20 30 40 50 60 x1
Computing Optimal Values
x1 + 2x2 = 40
x
402 – 4x1 + 3x2 = 120
4 x1 + 3 x2 120 lb 4x1 + 8x2 = 160
30 – -4x1 - 3x2 = -120
5x2 = 40
20 – x2 = 8
x1 + 2 x2 40 hr
10 – x1 + 2(8) = 40
x1 = 24
0 –8
| | x1
24 | |
10 20 30 40
Z = $50(24) + $50(8) = $1,360
Simplex Method
A mathematical procedure for solving linear programming problems
according to a set of steps
Slack variables added to ≤ constraints to represent unused resources
x + 2x + s =40 hours of labor
1 2 1
4x + 3x + s =120 lb of clay
1 2 2
Surplus variables subtracted from ≥ constraints to represent excess
above resource requirement. For example
2x + 4x ≥ 16 is transformed into
1 2
2x + 4x - s = 16
1 2 1
Slack/surplus variables have a 0 coefficient in the objective function
Z = $40x + $50x + 0s + 0s
1 2 1 2
Solving LP Problems with Excel
Click on “Tools”
to invoke “Solver.”
Objective function
=E6-F6
=E7-F7
=C6*B10+D6*B11
=C7*B10+D7*B11
Decision variables – bowls
(x1)=B10; mugs (x2)=B11
Solving LP Problems with Excel (cont.)
After all parameters and
constraints have been input, click
on “Solve.”
Objective function
Decision variables
C6*B10+D6*B11≤40
C7*B10+D7*B11≤120
Click on “Add” to
insert constraints
Solving LP Problems with Excel (cont.)
Another Example
Suppose an MFI wants to maximize profit. It has two loan portfolio,
Business Loan (x1) and Housing Loan (x2). The interest for x1 is 13 and for
x2 is 11.
In village 1, there are 4 Groups who wants Business Loan and 5 Groups who
wants Housing Loans but their loan taking capacity is maximum of Tk. 1500
(in thousands).
In village 2, there are 5 and 3 Groups who wants Business Loans and
Housing Loans respectively. But their capacity of loan taking is Tk. 1575 (in
thousands).
In village 3, there are 1 and 2 Groups respectively with maximum capacity
of Tk. 420 (in thousands).
No loans can be negative.
Find out the amount of different loans which would maximize the profit.
[Answer Tk. 270 and Tk. 75 thousands.]
• The linear programming model for this example can be summarized as:
Another Example
…..Eq (4)
Dual Example
Maximize
Z = x1 + x2
Subject to
X1 ≥ 0
X2 ≥ 0
and
How to Transform to Dual
Objective
x1 + x2
Transform to dual problem
Minimize
4y1+ 12y2+y3
Where
y1 ≥ 0
y2 ≥ 0