0% found this document useful (0 votes)
16 views

Chapter Two-Linear Proramming

Uploaded by

eyobirhanu1992
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Chapter Two-Linear Proramming

Uploaded by

eyobirhanu1992
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 55

LINEAR PROGRAMMING

A linear program is an optimization problem where all involved


functions are linear; in particular, all the constraints are linear inequalities
and equalities. Linear programming is the subject of studying and solving
linear programs.
Linear programming (LP) is the most common type of
mathematical programming.
LP seeks to maximize or minimize a linear objective function subject
to a set of linear constraints .
LP assumes all relevant input data and parameters are known with
certainty (deterministic models).
Computers play an important role in the solution of LP
problems.
LP MODEL COMPONENTS AND
FORMULATION
 Decision variables - mathematical symbols representing
levels of activity of a firm.
 Objective function - a linear mathematical relationship
describing an objective of the firm, in terms of decision
variables, that is to be maximized or minimized.
 Constraints - restrictions placed on the firm by the
operating environment stated in linear relationships of
the decision variables.
 Parameters - numerical coefficients and constants used
in the objective function and constraint equations.
BASIC STEPS OF DEVELOPING A LP MODEL
1. Identification of the problem as solvable by LP: At this
step, the problem that needs solution to be identified
and checked whether to be solved by LP.

2. Formulation of the Model


 One of the most important phases in the solution of LP problem,
which translates words in to an objective function together with
the set of constraints.
 It refers to the transformation of word problems in to a
mathematical model that needs solutions.
BASIC STEPS OF DEVELOPING A LP MODEL
3. Solution
 Mathematical relationships resulting from formulation process
are solved to identify optimal solution.
4. Interpretation and What-if Analysis
 Problem solver or analyst works with the manager to:
o Interpret results and implications of problem solution.
o Investigate changes in input parameters and model
variables and impact on problem solution results.
LINEAR EQUATIONS AND INEQUALITIES

• This is a linear equation:


2A + 5B = 10
• This equation is not linear:
2A2 + 5B3 + 3AB = 10
• LP uses, in many cases, inequalities like:
A+BC or A + B  C
Maximization & Minimization Model
Example:
PROBLEM DEFINITION:
MAXIMIZATION PROBLEM

• Product mix problem of Pottery Company


• How many bowls and mugs should be produced to
maximize profits given labor and materials constraints?
• Product resource requirements and unit profit:

Resource Requirements
Labor Clay Profit
Product
(hr/unit) (lb/unit) ($/unit)
Bowl 1 4 40
Mug 2 3 50
Resource 40 120
PROBLEM DEFINITION EXAMPLE CONT’D

Resource 40 hrs of labor per day


Availability: 120 lps of clay
Decision Variables x1 = number of bowls to produce per day
x2 = number of mugs to produce per day

Objective Maximize Z = $40x1 + $50x2


Function: Where Z = profit per day
Resource 1x1 + 2x2  40 hours of labor
Constraints: 4x1 + 3x2  120 pounds of clay

Non-Negativity x1  0; x2  0
Constraints:
MODEL FORMULATION EXAMPLE

Complete Linear Programming Model:

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0
GRAPHICAL SOLUTION OF LINEAR
PROGRAMMING MODELS

 Graphical solution: is limited to linear programming


models containing only two decision variables.

 Graphical methods: provide visualization of how a


solution for a linear programming problem is obtained.
 Primary advantage of two-variable LP models is their
solution can be graphically illustrated using two-
dimensional graph.
 Allows one to provide an intuitive explanation of
how more complex solution procedures work for
larger LP models.
GRAPHICAL REPRESENTATION OF LP MODELS

60

50

40

30

20
Coordinates
for graphical
10
analysis

0 10 20 30 40 50 60
GRAPHICAL REPRESENTATION OF CONSTRAINTS:
COORDINATE AXES

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Coordinates for Graphical Analysis


GRAPHICAL REPRESENTATION OF
CONSTRAINTS:

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Graph of Labor Constraint


GRAPHICAL REPRESENTATION OF
CONSTRAINTS: (LABOR CONSTRAINT AREA)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Labor Constraint Area


GRAPHICAL REPRESENTATION OF
CONSTRAINTS: (CLAY CONSTRAINT AREA)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Clay Constraint Area


GRAPHICAL REPRESENTATION OF
CONSTRAINTS: (BOTH CONSTRAINTS AREA)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Graph of Both Model Constraints


FEASIBLE SOLUTION AREA:

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Feasible Solution Area


GRAPHICAL SOLUTION METHOD

 Optimal solution is the point in feasible region that


produces highest profit.
 There are many possible solution points in region.
 How do we go about selecting the best one, one
yielding highest profit?
 Let objective function (that is, $$40x 1 + $50x2) guide
one towards optimal point in feasible region.
 Plot line representing objective function on graph as a
straight line.
OPTIMAL SOLUTION COORDINATES:

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1 , x2  0

Optimal Solution Coordinates


Locating the Solution Corners
COORDINATES:
From the graph it is clear that the shaded region
is the feasible region , which is the space
bounded by the lines. The feasible solutions
from the graph are the six (6) corners. However,
from the 6 corners, 2 of them are out of the
solution. Let’s represent X-axis by (1), Y-axis
by (2), the first inequality by (3), and the 2nd Optimal Solution Coordinates
inequality by (4)
Then:
Lines Corners
1 and 2 (0, 0)
2 and 3 ( 0,20)
1 and 4 (30,0)
3 and 4 (24, 8)
Locating the Solution Corners

 Evaluate the objective function, that is the


maximum profit

Corners Z= $40x1 + $50x2


(0,0) 0
(0,20) $1000
(30,0) $1200
(24,8) $1360
THE GRAPHICAL SOLUTION METHODS :
Cost Minimization

1. Consider the same example C= $40x1+50x2 as a


cost function. If the inequalities were of opposite
sense, what is the solution of the LPP?
 Therefore, the LPP model to minimize the Cost
which the cost function,

Minimize C = $40x1 + $50x2


subject to: 1x1 + 2x2 > 40
4x1 + 3x2 > 120
x1 , x2  0
SUMMARY OF THE GRAPHICAL SOLUTION
METHODS

Lines Corner
2 and 4 (0,40)
1 and 3 (40, 0)
(3 and 4) (24, 8)

Corners C=$40x1 + $50x2


(0,40) $2000
(40, 0) $1600
(24, 8) $1360
 Therefore, the Minimum cost (C)= $1360, when x1 = 24 and x2 =
8. So that produce 24 bowls and 8 mugs which will allow to
minimize the total production cost to $1360, the minimum
possible.
The Simplex Method for Solving LP
Models
 A mathematical modeling technique called linear
programming (LP) is introduced.

 To solve LP models with numerous decision variables


and constraints, one need a solution procedure such as
simplex algorithm.
The simplex method for solving LP models
 Simplex method is a linear-programming algorithm that
can solve problems having more than two decision
variables.
 The simplex technique involves generating a series of
solutions in tabular form, called tableaus.
 By inspecting the bottom row of each tableau, one can
immediately tell if it represents the optimal solution.
 Each tableau corresponds to a corner point of the feasible
solution space.
 The first tableau corresponds to the origin.
 Subsequent tableaus are developed by shifting to an
adjacent corner point in the direction that yields the highest
(smallest) rate of profit (cost).
 This process continues as long as a positive (negative) rate of
profit (cost) exists.
The Simplex Method for Solving LP
Models
 Steps in Simplex method for solving LP models:

1. Initialization:
a. Transform all the constraints to equality by introducing
slack, surplus, and artificial variables as follows:

Constraint type Variable to be added

≥ + slack (s)

≤ - Surplus (s) + artificial (A)

= + Artificial (A)
The Simplex Method for Solving LP Models

2. Test for optimality:

Case 1: Maximization problem:


 The current basic feasible (BF) solution is optimal if every
coefficient in the objective function row is non-negative.

Case 2: Minimization problem:


 The current BF solution is optimal if every coefficient in the
objective function row is non-positive.
The Simplex Method for Solving LP
Models
1. Initialization:
b. Construct the initial simplex tableau:

Basic X1 … Xn S1 …... Sn A1 … An RHS


variable .
S b1
Coefficient of the constraints
A bm
Z Objective function coefficient Z
In different signs value
The Simplex Method for Solving LP Models

3. Iteration:
Step 1: determine the entering basic variable by selecting
the variable (automatically a non-basic variable) with
the most negative value (in case of maximization) or
with the most positive (in case of minimization) in the
last row (Z-row).

 Put a box around the column above this variable, and


call it the “pivot column”.
5.4.The Simplex Method for Solving LP Models

Step 2: Determine the leaving basic variable by applying


the minimum ratio test as following:
1. Pick out each coefficient in the pivot column that is
strictly positive (>0).
2. Divide each of these coefficients into the right hand side
entry for the same row.
3. Identify the row that has the smallest of these ratios.
4. The basic variable for that row is the leaving variable,
so replace that variable by the entering variable in the
basic variable column of the next simplex tableau.
 Put a box around this row and call it the “pivot row”
5.4 The Simplex Method for Solving LP
Models
Step 3: Solve for the new BF solution by using elementary row
operations (multiply or divide a row by a non-zero constant;
subtract a multiple of corresponding coefficients of pivot
column and corresponding values of pivot row from the old
row values) to construct a new simplex tableau, and then return
to the optimality test.
 The specific elementary row operations are as follows:
1. Divide the pivot row by the “pivot number” (the number in
the intersection of the pivot row and pivot column)
2. Compute each other row new entry by using New tableau
row values = Old value of the row – (the coefficient of this
row in the pivot column) x (new pivot row).
3. Enter the calculated values to the new tableau row.
The Simplex Method for Solving LP Models

 Example (All constraints are )


 Solve the following problem using the simplex method
Maximize
Z = 3X1+ 5X2
Subject to
X1  4
2 X2  12
3X1 +2X2  18
X1 , X2  0
The Simplex Method for Solving LP Models

 Solution
 Initialization
1. Standard form Sometimes it is called
Maximize Z, the augmented form of
the problem because the
Subject to
original form has been
Z - 3X1- 5X2 =0 augmented by some
supplementary variables
X1 + S1 = 4 needed to apply the
simplex method.
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18
X 1 , X 2, S 1, S 2, S 3  0
The Simplex Method for Solving LP Models

 A basic solution is an augmented corner point solution.


 A basic solution has the following properties:
1. Each variable is designated as either a non-basic variable or
a basic variable.
2. The number of basic variables equals the number of
functional constraints. Therefore, the number of non-basic
variables equals the total number of variables minus the
number of functional constraints.
3. The non-basic variables are set equal to zero.
4. The values of the basic variables are obtained as
simultaneous solution of the system of equations (functional
constraints in augmented form). The set of basic variables
are called “basis”.
5. If the basic variables satisfy the non-negativity constraints,
the basic solution is a Basic Feasible (BF) solution.
The Simplex Method for Solving LP Models
Entering
2. Initial tableau variable

Basic X1 X2 S1 S2 S3 RHS
variable

S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Z -3 -5 0 0 0 0

Leaving Pivot column Pivot Pivot row


variable number
The Simplex Method for Solving LP Models

Notes:
 The basic feasible solution at the initial tableau
is (0, 0, 4, 12, 18) where:
X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z = 0
Where S1, S2, and S3 are basic variables.
X1 and X2 are non-basic variables.
 The solution at the initial tableau is associated
to the origin point at which all the decision
variables are zero.
The Simplex Method for Solving LP Models

Optimality test:

By investigating the last row of the initial


tableau, we find that there are some negative
numbers. Therefore, the current solution is not
optimal.
The Simplex Method for Solving LP Models

 Iteration:
Step 1: Determine the entering variable by selecting the
variable with the most negative in the last row.
 From the initial tableau, in the last row (Z row), the
coefficient of X1 is -3 and the coefficient of X2 is -5;
therefore, the most negative is -5.
 Consequently, X2 is the entering variable.
 X2 is surrounded by a box and it is called the pivot
column.
The Simplex Method for Solving LP Models

Step 2: Determining the leaving variable by using


the minimum ratio test as following:
Basic Entering RHS Ratio
variable variable X2
(1) (2) (2)(1)
S1 0 4 None
S2 2 12 6
Leaving Smallest ratio
S3 2 18 9
The Simplex Method for Solving LP Models

Step 3: Solving for the new BF solution by using


the eliminatory row operations as following:
1. New pivot row = old pivot row  pivot number
Basic X1 X2 S1 S2 S3 RHS
variable
S1
X2 0 1 0 1/2 0 6
S3
Z
Note that X2 becomes in the basic
variables list instead of S2
The Simplex Method for Solving LP Models

Iteration:
2. For the other row apply this rule:
New row = old row – (the coefficient of this row in the pivot column) x (new
pivot row).
For S1
1 0 1 0 0 4
-
0 (0 1 0 1/2 0 6)
1 0 1 0 0 4
For S3

3 2 0 0 1 18
-
2 (0 1 0 1/2 0 6)
3 0 0 -1 1 6
for Z Substitute this values in
-3 -5 0 0 0 0 the table
-
-5(0 1 0 1/2 0 6)
-3 0 0 5/2 0 30
5.4. The Simplex Method for Solving LP Models
 Iteration:
This solution is not optimal, since there is a negative numbers in
the last row
Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6
Z -3 0 0 5/2 0 30
The most negative value; The smallest ratio is
therefore, X1 is the 6/3 =2; therefore, S3 is
entering variable the leaving variable
The Simplex Method for Solving LP Models

Iteration:
 Apply the same rules we will obtain this solution:

Basic X1 X2 S1 S2 S3 RHS
variable
S1 0 0 1 1/3 -1/3 2
X2 0 1 0 1/2 0 6
X1 1 0 0 -1/3 1/3 2
Z 0 0 0 3/2 1 36
This solution is optimal; since there is no negative solution in the last row: basic variables are X 1 =
2, X2 = 6 and S1 = 2; the non-basic variables are S2 = S3 = 0,Z = 36.
 Exercise:
The Plastic manufacturing company produces two products:
Bowls/Product I and mugs/Product II. The raw material
requirements, space needed for storage, production rates, and
selling prices for these products are given below:
Constraints Bowls / Product I Mugs/ Product II
Storage space (m2/unit 4 5
Raw material (Ib/ unit) 5 3
Production rate 1 2
(Units/hr=60 minutes)
Selling price ($/unit 13 11

The total amount of raw material available per day for both products is 1575Ib.
The total storage space for all products is 1500 m2, and a maximum of 420 minutes
per day can be used for production.
How many units of bowls/product I and mugs/product II product should the
company to produce per day to maximize its total income/profit? ( Use simplex
method).
Notes on the Simplex tableau
1. In any Simplex tableau, the intersection of any basic variable with itself is always
one and the rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of
the nonbasic variables. This means that under any basic variable (in any tableau)
there is a zero in the Z row. For the non basic there is no condition ( it can take
any value in this row).
3. If there is a zero under one or more nonbasic variables in the last tableau
(optimal solution tableau), then there is a multiple optimal solution.
4. When determining the leaving variable of any tableau, if there is no positive ratio
(all the entries in the pivot column are negative and zeroes), then the solution is
unbounded.
5. If there is a tie (more than one variables have the same most negative or positive)
in determining the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the
leaving variable. In this case a zero will appear in RHS column; therefore, a
“cycle” will occur, this means that the value of the objective function will be the
same for several iterations.
7. A Solution that has a basic variable with zero value is called a “degenerate
solution”.
8. If there is no Artificial variables in the problem, there is no room for “infeasible
solution”
© 2002 Prentice-Hall, Inc Ch 2-46
Simplex method incase of Artificial variables
“Big M method”
• Solve the following linear programming problem
by using the simplex method:
• Min Z =2 X1 + 3 X2
S.t.
½ X1 + ¼ X 2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0
© 2002 Prentice-Hall, Inc Ch 2-47
Big M method
• Solution
Step 1: standard form
Min Z,
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X 2 + S 1 =4
X1 + 3X2 - S 2 + A1 = 20
X1 + X 2 + A2 = 10
X1, X2 ,S1, S2, A1, A2  0
Where: M is a very large number
© 2002 Prentice-Hall, Inc Ch 2-48
• Notes
Big M method
M, a very large number, is used to ensure that the values of A 1 and A2, …, and An will
be zero in the final (optimal) tableau as follows:
1. If the objective function is Minimization, then A1, A2, …, and An must be added to
the RHS of the objective function multiplied by a very large number (M).
Example: if the objective function is Min Z = X1+2X2, then the obj. function should be
Min Z = X1 + X2+ MA1 + MA2+ …+ MAn
OR
Z – X1 - X2- MA1 - MA2- …- MAn = 0

2. If the objective function is Maximization, then A1, A2, …, and An must be


subtracted from the RHS of the objective function multiplied by a very large
number (M).
Example: if the objective function is Max Z = X1+2X2, then the obj. function should
be Max Z = X1 + X2- MA1 - MA2- …- MAn
OR
Z - X1 - X2+ MA1 + MA2+ …+ MAn = 0
© 2002 Prentice-Hall, Inc Ch 2-49
N.B.: When the Z is transformed to a zero equation, the signs are changed
Big M method
• Step 2: Initial tableau

Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M

S1 ½ ¼ 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z -2 -3 0 0 -M -M 0

Note that one of the simplex rules is violated, which is the basic variables A 1,
and A2 have a non zero value in the z row; therefore, this violation must be
corrected before proceeding in the simplex algorithm as follows.
© 2002 Prentice-Hall, Inc Ch 2-50
Big M method
• To correct this violation before starting the simplex
algorithm, the elementary row operations are used
as follows:
New (Z row) = old (z row) ± M (A1 row) ± M (A2 row)
In our case, it will be positive since M is negative in the Z row,
as following:
Old (Z row): -2 -3 0 0 -M -M 0
M (A1 row): M 3M 0 -M M o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M
© 2002 Prentice-Hall, Inc Ch 2-51
It becomes zero
Big M method
• The initial tableau will be:
Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M

S1 1/2 1/4 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z 2M-2 4M-3 0 -M 0 0 30M

• Since there is a positive value in the last row, this solution is not optimal
• The entering variable is X2 (it has the most positive value in the last row)
• The leaving variable is A1 (it has the smallest ratio)
© 2002 Prentice-Hall, Inc Ch 2-52
Big M method
• First iteration

Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M

S1 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3

A2 2/3 0 0 1/3 -1/3 1 10/3

Z 2M-1 0 0 1/3M-1 1-4/3M 0 20+10/3M


3
• Since there is a positive value in the last row, this solution is not optimal
• The entering variable is X1 (it has the most positive value in the last row)
• The leaving variable is A2 (it has the smallest ratio)
© 2002 Prentice-Hall, Inc Ch 2-53
Big M method
• Second iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables
S1 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5

X1 1 0 0 1/2 -1/2 3/2 5

Z 0 0 0 -1/2 ½-M 3/2-M 25

This solution is optimal, since there is no positive value in the last row. The
optimal solution is:
X1 = 5, X2 = 5, S1 = ¼
© 2002 Prentice-Hall, Inc Ch 2-54
A = A = 0 and Z = 25
1 2
Special cases
• In the final tableau, if one or more artificial variables (A1, A2, …)
still basic and has a nonzero value, then the problem has an
infeasible solution
• If there is a zero under one or more non-basic variables in the last
tableau (optimal solution tableau), then there is a multiple
optimal solution.
• When determining the leaving variable of any tableau, if there is
no positive ratio (all the entries in the pivot column are negative
and zeroes), then the solution is unbounded.

© 2002 Prentice-Hall, Inc Ch 2-55

You might also like