CH 2
CH 2
Programming/Optimizati
on
05/20/2025 1
Introduction
Linear programming(LP), also called linear
optimization is a mathematical model in which the
objective function and constraint functions are linear in the
decision variables.
LP is a method to achieve the best outcome in a
mathematical model whose requirements are represented
by linear relationships.
LP is a problem solving approach developed to make
decisions (Solve business problems)
LP Models are mathematical representation of LP problems
05/20/2025 2
Components of LP models
The major components of LP Models are:
1. Objective function- maximization or
minimization
2. Decision variables- unknown quantities to
be solved for
3. Constraints –availability of resource
(restriction)
4. Parameters- Fixed values that specify the
impact that one unit of each decision variable
will have on the objective
05/20/2025 3
Characteristics of LP Models
• The relationship between variables
and constraints must be linear
• The model must have an objective
function
• The model must have structural
constraints
• The model must have non-negativity
constraint
05/20/2025 4
Assumptions of LP Models
The assumptions reveal the condition under
which the model will be valid
1. Linearity
2. Divisibility(Integer values for some
quantities)
3. Certainty (Parameters are known
&constant and all relevant constraints are
included in the model )
4. Non- negativity assumptions (negative
values of variables are unrealistic)
05/20/2025 5
Example of LP Model
05/20/2025 8
Formulating Linear Programming Models
Minimization Example
Min Z= C1X1 + C2X2 + C3X3 + C4X14… CnXn
Subject to:
A11 x1 + A12x2+ A13x3+ A14x4+ A15x5+ A16x6+ A17x7+ …. + A1nxn >R1
A21 x1 + A22x2+ A23x3+ A24x4+ A25x5+ A26x6+ A27x7+ …. + A2nxn >R2
Ai1 x1 + Ai2x2+ Ai3x3+ Ai4x4+ Ai5x5+ Ai6x6+ Ai7x7+ …. + Ainxn > Rn
Xij > o for J= 1, 2,3,4… n
05/20/2025 11
Application Area of LP
Production management (product mix, blending
problems, production planning, Assembly, line
balancing…),
Marketing management (media selection,
revenue determination, physical distribution, etc)
Personnel management (staffing problem,
Determination of equitable salary and etc)
Financial management (portfolio selection,
profit planning)
Agricultural application
Military applications
05/20/2025 12
Example 1
Given: A firm that assembles computer equipments is
about to start production of two new micro computers
(type 1 and type2). Each type of micro computer will
require assembly time, inspection time and storage
space. The amount of each of these resources that can be
devoted to the production of the micro computers is
limited. The manager of the firm would like to determine
the quantity of each micro computer to be produced in
order to maximize the profit generated by the sale of the
micro computers.
05/20/2025 13
Further information
Type1
Type 2
Unit profit $60 $50
Assembly time/unit 4 10
Inspection time/unit 2 1
Storage space/unit 3 3
The manager has also information on the availability of
company resources:
Resources Amount available
Assembly time 100hrs
Inspection time 22hrs
Storage space 39cubic
feet
05/20/2025
X1, X2 > 0 16
Solution
05/20/2025 17
Minimization Example
Two machines C1 and C2 produce two grades of tyres
A and B. In one hour of operation, machine C1
produces 50 units of grade A and 30 units of grade B
tyres while machine C2 produces 30 units of grade A
and 40 units of grade B tyres. The machines are
required to meet a production schedule of at least
1400 units of grade A and 1200 units of grade B tyres.
The cost of operating machine C1 is $50 per hour and
the cost of operating machine C2 is $80 per hour.
Required
• Formulate the LPM if the objective is to minimize the
cost of operating the machines.
05/20/2025 18
Solution
Step 1: Define the Problem
Determine the number of hours the two machines
operate in order to minimize the cost, meeting the
production requirement.
Step 2: Determine the decision variables
Let x1= be the number of hours machine C1 should
operate
x2= be the number of hours machine C2 should
operate
Z= be the total cost
Step 3: Formulate the objective function
Min Z = 50x1 + 80x2
05/20/2025 19
Solution
Step 4: List the constraints
Grade A: 50x1 + 30x2 > 1400
Grade B: 30x1 + 40x2 > 1200
Step 5: Non-negativity
x1, x2 > 0
Therefore ,The complete LPM is
Min Z = 50x1 + 80x2
Subject to:
50x1 + 30x2 > 1400
30x1 + 40x2 > 1200
x1, x2 > 0
05/20/2025 20
Solving LP Problems (LPP)
• There are two methods to solve LP
problems
1.Graphical Method
2.Simplex Method
05/20/2025 21
Graphical Method
05/20/2025 26
Solution
Step 2: Plot the constraints on the graph by
taking two coordinates satisfying the equation
5X1 + 20X2 < 400 i.e. X1 + 4X2 < 80
- - - (a)
10X1 + 15X2 < 450 i.e. 2X1 + 3X2 <
90 - - - (b)
X1, X2 > 0
Converting (a) and (b) to equality, we get
X1 + 4X2 = 80 . . . . (1)
2X1 + 3X2 = 90 . . . (2)
05/20/2025 27
Solution
Step 3: Identify the area that satisfies the entire set of
constraints (Feasible region), determine corners and their
coordinate either from graphing procedure or by the elimination
procedure.
the minimum.
If two corners have the same optimal value, then the
05/20/2025 33
Solution
Exercise the next steps
Step 2: Plot the constraints on the graph
Step 3: Identify the feasible region
Step 4: Evaluate the objective function at
each corner points
05/20/2025 34
Solution
Coordinate of corner Objective Function Value
point Min Z= 50x1 +
80x2
(0,46.7) 0 + 80× 46.7 3736
(18.18, 16.40) 50 ×18.18+ 80× 2221
16.40
(40,0) 40× 50+
Therefore, the company can80 ×0 2000*
minimize its cost
to $2000 by operating machine 1 for 40
hours.
05/20/2025 35
Graphical Solutions for the Special Cases of
LP problems
1. Unbounded problems
2. Problems with no feasible solutions
3. Redundancy in constraints
4. Problems with Multiple optimal
solutions
05/20/2025 36
Un bounded Problems
An unbounded problem occurs when the value of decision
variable increased indefinitely without violating any of the
constraints. The reason for it may be concluded to be
wrong formulation of the problem such as incorrectly
maximizing instead of minimizing and/or errors in
the given problem.
Example : Max Z = 10X1 + 20X2
Subject to:
2X1 + 4X2 > 16
X1 + 5X2 > 15
05/20/2025
X1, X2 > 0 37
Problems with no feasible solutions
Infeasibility is a condition that arises when there is
no solution to a LP problem that satisfies all the
constraints. This problem occurs when the problem
has a mix of greater and less than constraints ( LPP
formulated with conflicting constraints).
Example: Max Z = 3X1+2X2
Subject to:
2X1 + X2 < 2
3X1 + 4X2 > 12
X1, X2 > 0
05/20/2025 38
Redundancy in constraints
• In some cases, a constraint does not form a unique boundary
of the feasible solution space.
• Such a constraint is called a redundant constraint. A constraint is
redundant if its removal would not alter the feasible solution
space. Redundancy of any constraint does not cause any difficulty
in solving an LP problems graphically. Constraints appear
redundant when it may be more binding (restrictive) than others.
Example: Max Z= x1 + x2
Subject to:
2x1+3x2<60
2X1+x2<20
X2<25
X1, x2>0
05/20/2025 39
Problems with Multiple optimal solutions
05/20/2025 41
The simplex Method
• Graphical method of solving LPP can be
used when we have two decision variables
in the problem.
• If we have more than two decision
variables, we can’t use graphical method
• There fore, SIMPLEX Method is useful to
solve LPP with two and more decision
variables
05/20/2025 42
The simplex Method
• Simplex method deals with iterative
process, which consists of first designing a
Basic Feasible Solution and proceed
towards the Optimal Solution and testing
each feasible solution for Optimality to
know whether the solution on hand is
optimal or not.
05/20/2025 43
Comparison b/n graphical and Simplex
05/20/2025 47
The Simplex Method: Maximization
Example
05/20/2025 52
Maximization Example
Max Z = 60X1+50X2
Subject to:
4X1+10X2 < 100
2X1+ X2 < 22
3X1+ 3X2 <39
X1, X2 > 0
05/20/2025 53
Solution
Step 1: Formulate the linear programming model
of the real world problem i.e mathematical
representation of LPP
Step 2: Put in Standard form
Max Z = 60X1+50X2+0S1+0S2+0S3
Subject to:
4X1+10X2+S1 = 100
2X1+ X2+ S2 = 22
3X1+ 3X2+ S3 = 39
X1, X2, S1, S2, S3 > 0
05/20/2025 54
Solution
Step 3: Design the initial feasible solution.
X1= X2=0 so S1= 100 S2= 22 S3=39
Step 4: Set up the initial simplex tableau
Cj 60 50 0 0 0 Quantity
Basic Variables X1 X2 S1 S2 S3
S1 0 4 10 1 0 0 100
S2 0 2 1 0 1 0 22
S3 0 3 3 0 0 1 39
Zj 0 0 0 0 0 0
Cj-Zj 60 50 0 0 0
05/20/2025 55
Initial Tableau
Cj 60 50 0 0 0 Quantity
BVs X1 X2 S1 S2 S3
S1 0 4 10 1 0 0 100 100/4= 25
2
S2 0 1 0 1 0 22 22/2= 11
S3 0 3 3 0 0 1 39 39/3=13
Zj 0 0 0 0 0 0 0
Cj-Zj 60 50 0 0 0
Smallest non-negative
quotient
Pivot Row Pivot Column Pivot Element
05/20/2025 56
Second tableau
Cj60 50 0 0 0 Quantity
X1 X2 S1 S2 S3
S1 0 0 8 1 -2 0 56
X1 60 1 1/2 0 1/2 0 11
S3 0 0 3/2 0 -3/2 1 6
Zj 60 30 0 30 0 660
Cj-Zj 0 20 0 -30 0
05/20/2025 57
Third tableau
Cj 60 50 0 0 0 Quantity
X1 X2 S1 S2 S3
S1 0 0 0 1 6 -16/3 24
X1 60 1 0 0 1
-1/3 9
X2 50 0 1 0 -1 2/3 4
Zj 60 50 0 10 40/3 740
Cj-Zj 0 0 0 -10 -40/3
05/20/2025 59
Minimization Example
The various steps involved in using simplex
method for minimization problems are:
Step1: Formulate the linear programming
model, and express the mathematical model
of LPP in the standard form by introducing
surplus and artificial variables in the left
hand side of the constraints.
Assign a 0 (zero) and +M as coefficient for
surplus and artificial variables
respectively in the objective function.
M is considered to be a very large number
so as to finally drive out the artificial variables
out of basic solution.
05/20/2025 60
Minimization Example
• Artificial variables have no physical
interpretation, they merely serve as a
device to enable us to use simplex process.
• During simplex process, any artificial
variables are quickly eliminated from the
solution and hence the optimal solution
should never contains an artificial variable
with a non-zero value.
• Artificial variables are required only for
manual solution; computer codes do not
require to input artificial variables
05/20/2025 61
Minimization Example
Step 2: Set up an initial solution
• Just to start the solution procedure, the
initial basic feasible solution is obtained by
assigning zero value to decision variables.
• This solution is summarized in the initial
simplex tableau.
• Complete the initial simplex tableau by
adding two final rows Zj, and Cj- Zj. These
two rows help us to know whether the
current solution is optimum or not.
05/20/2025 62
Minimization Example
Step 3: Test for optimality of the
solution
If all the entries of Cj - Zj, row are
positive and zero, then the solution is
optimum.
However, this situation may come after a
number of iterations.
But if at least one of the Cj - Zj values is
less than zero, the current solution can be
further improved by removing one basic
variable from the basis and replacing it by
some non-basic one.
05/20/2025 63
Minimization Example
Step 4: (i) Determine the entering variable
into the basic solution. To do this, we identify the
column with the largest negative value in the
Cj - Zj row of the tableau (the variable in this
column is entering variable)
(ii) Next, determine the departing variable from
the basic solution. If an artificial variable goes out
of solution, then we discard it totally and even
this variable may not form part of further
iterations. Same procedure, as in maximization
case, is employed to determine the departing
and entering variable.
05/20/2025 64
Minimization Example
Step 5: Update the new solution
• We evaluate the entries for next
simplex tableau in exactly the same
manner as was discussed earlier in the
maximization example.
65
Minimization Example
Step 6: Step (3-5) are repeated until an
optimum solution is obtained
• So the following are the essential things to observe
in solving for minimization problems:
• The entering variable is the one with the largest
negative value in the Cj-Zj row while the leaving
variable is the one with the smallest non-
negative ratio.
• The optimal solution is obtained when the Cj-Zj
05/20/2025 66
Example
Min Z = 7X1+9X2
Subject to
3X1+6X2 > 36
8X1+4X2 > 64
X1, X2 > 0
05/20/2025 67
Solution
First, put the LPM in standard
form
Min Z = 7X1+9X2+0S1+0S2+MA1+MA2
Subject to
3X1+6X2-S1+A1 = 36
8X1+4X2-S2+ A2 = 64
X1, X2 , S1,S2,A1, A2> 0
05/20/2025 68
Solution
Then, develop the Initial Simplex
Tableau
Cj 7 9 0 0 M M
BV X1 X2 S1 S2 A1 A2 Quantity
A1 M 3 6 -1 0 1 0 36
A2 M 8 4 0 -1 0 1 64
Zj 11M 10M -M -M M M 100M
Cj-Zj 7-11M 9-10M M M 0 0
05/20/2025 69
Solution
Next, develop the second Simplex
Tableau
Cj 7 9 0 0 M
X1 X2 S1 S2 A1 Quantity
A1 M 0 9/2 -1 3/8 1 12
X1 7 1 ½ 0 -1/8 0 8
Zj 7 7/2+9/2M -M 3/8M-7/8 M 56+12M
Cj-Zj 0 11/2-9/2M M 7/8-3/8M 0
05/20/2025 70
Solution
Next, develop the third Simplex Tableau
Cj 7 9 0 0
X1 X2 S1 S2 Quantity
X2 9 0 1 -2/9 1/12 8/3
X1 7 1 0 1/9 -1/6 20/3
Zj 7 9 -11/9 -5/12 212/3
Cj-Zj 0 0 11/9 5/12
05/20/2025 71
Post optimality Analysis
1. Duality in LPP
2. Sensitivity Analysis
Sensitivity analysis involves an
examination of the potential impact of
changes in any of the parameters
(numerical values) of a problem where as
the dual involves setting up and solving LP
problem that is almost a “mirror image”
of LP problem that has been formulated.
05/20/2025 72
Duality in LPP
• Every linear programming problem can have two
forms: the original formulation of the problem is
referred to as its primal form. The other form is
referred to as its dual form.
• The dual is just a mirror image of the primal
and hence it is called an alternate form of
linear programming problem
• The solution to the primal problem contains the
solution to the dual problem, and vice versa.
• If so, why are we interested in dual form?
05/20/2025 73
Duality in LPP
• We need to have the dual LPP for an economic
analysis.
• Analysis of the dual help the manager to evaluate
the potential impact of a new product, and it
can be used to determine the marginal value of
resources (Constraints).
• Relative to the new product, a manager would
want to know what impact adding a new product
would have on the solution quantities and the
profit; relative to resources, a manager can refer
to dual solution to determine how much profit one
unit of each resource is equivalent to.
05/20/2025 74
Formulating the dual
• A LPP formulated directly from the
description of the problem is a primal
problem.
• The dual, on the other hand, is an
alternate formulation of the problem
that requires the existence of the
primal.
• Let’s take an example how the dual is
formulated from the primal problem
05/20/2025 75
Formulating the dual from the primal
Max Z= 60x1 + 50x2
Min Z = 100y1 +
Subject to: 22y2+ 39y3
4x1 + 10x2 < 100
2x1 + x2 < 22 Subject to:
3x1 + 3x2 < 39 4y1 + 2y2 + 3y3 >
60
x1, x2 > 0
10y1 + y2 +3y3> 50
y1, y2 ,y3 > 0
Primal problem
05/20/2025 76
Sensitivity Analysis
• Sensitivity analysis (A Post optimality
analysis) is made beyond the
determination of optimal solution
• It starts from the final simplex
tableau.
• The purpose is to explore how changes
in any of the parameters of a problem,
such as the coefficient of the objective
function, or the right-hand side values,
would affect the solution
05/20/2025 77
•
Sensitivity Analysis
• The parameters are assumed to be
constant, but in real life there is nothing
constant. Hence, the optimal values of the
decision variable may be wrong.
• Therefore, we need to check how sensitive is
the solution to the alternate values of
parameters.
• Hence, the decision maker usually would
want to perform sensitivity analysis before
implementing the solution
05/20/2025 78
Sensitivity Analysis
• If the additional analysis satisfies the
decision maker that the solution is
reasonable, the decision maker can
proceed with greater confidence in
using the solution
• Conversely, if sensitivity analysis
indicates that the solution is sensitive
to the changes that are within the
realm of possibility, the decision maker
will be warned that more precise
05/20/2025 79
information on parameters are needed.
Thank you