0% found this document useful (0 votes)
40 views61 pages

Linear Programming Formulations

The document describes a linear programming problem about production planning at a fish processing plant. The objective is to maximize total profits by deciding how much of each fish product to produce fresh or smoked, with constraints on total production quantities and smoking capacities. Decision variables, objective function, and constraints are defined to formulate the linear programming model.

Uploaded by

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

Linear Programming Formulations

The document describes a linear programming problem about production planning at a fish processing plant. The objective is to maximize total profits by deciding how much of each fish product to produce fresh or smoked, with constraints on total production quantities and smoking capacities. Decision variables, objective function, and constraints are defined to formulate the linear programming model.

Uploaded by

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

Revision LP Assumptions Formulation Examples

LINEAR PROGRAMMING
FORMULATIONS
Revision LP Assumptions Formulation Examples

Consider our ore production LP problem:


minimize 18x1 + 16x2 (mil TZS)
subject to 6x1 + x2 ≥ 12
3x1 + x2 ≥ 8
4x1 + 6x2 ≥ 24
x1 ≤ 5
x2 ≤ 5
x, x2 ≥ 0
all variables continuous (i.e. can take fractional values)
a single objective (minimize)
the objective and constraints are linear
Revision LP Assumptions Formulation Examples

ASSUMPTIONS
1. Proportionality

There are four basic assumptions in LP:


The first assumption is Proportionality

The contribution of each decision variable is directly


proportional to its value in both the objective function and
in the constraints.

For example, the cost contribution of the first decision


variable in the objective function is 18x1 . This is directly
proportional to x1 with 18 as the constant of proportionality.
Revision LP Assumptions Formulation Examples

2. Additivity

The contribution to the objective function (or the


constraints) for any decision variable is independent of the
values of the other decision variables.

That is, the contribution of all the variables in the objective


function and the constraints is the sum of the individual
contributions of each variable.

For example, the total cost 18x1 + 16x2 which is the sum of
the individual costs 18x1 and 16x2 .
Revision LP Assumptions Formulation Examples

Divisibility & Certainty

Divisibility The decision variables are continuous and thus


can take on fractional values.

Certainty Each parameter is known with certainty. This


implies that all the objective and constraint
coefficients are deterministic, that is all the data
about cost, availability and requirements is
constant.
Revision LP Assumptions Formulation Examples

Steps Involved

The follows steps are involded in formulating a linear


programming problem:

1. Identify the decision variables.


2. Identify the set of constraints and express them as linear
equations/inequations in terms of the decision variables.
3. Identify the objective function and express it as a linear
function of decision variables.
4. Identify any upper or lower bounds on the decision
variables.
Revision LP Assumptions Formulation Examples

A Carpenter Problem

Example 1
A carpenter manufactures chairs and tables. He has 100m2 of woods
and 40 hours of production time per week. Total production cannot
exceed 70 items per week and the number of chairs cannot exceed the
number of tables by more than 35. A chair requires 2m2 of wood and
1 hour labor per chair. A table requires 1m2 of wood and 2 hours
labor per table. The carpenter makes profit of TZS 8,000 and TZS
5,000 for each chair and table, respectively. He is seeking a
production schedule that will maximize his profit.
Revision LP Assumptions Formulation Examples

Solution

1. Identify the Decision Variables


The decision variables correspond to the chair and tables
produced weekly. Thus we let:
x1 = The number of chair produced per week.
x2 = The number of table produced per week.

2. Identify the Objective Function


In our example, the goal is to maximize the weekly profit.
We make a profit of TZS 8,000 on each table, TZS 5000 on
each chair. This leads to the following quantity we want to
maximize:
profit = 8000x1 + 5000x2
Revision LP Assumptions Formulation Examples

Solution, cont..

3. Identify the Constraints


We have the following constraints

2x1 + x2 ≤ 100 (wood)


x1 + 2x2 ≤ 40 (production time)
x1 + x2 ≤ 70 (total production)
x1 − x2 ≤ 35 (mix)

4. Lower bounds
We cannot have negation production, thus we have:

x1 , x2 ≥ 0 (non − negative)
Revision LP Assumptions Formulation Examples

Solution, cont...

Summing up the Formulation

We have now defined the objective function and all of the


constraints. This is the formulation of the linear
programming problem as shown below:

Maximize 8000x1 + 5000x2


Subject to 2x1 + x2 ≤ 100 (wood)
x1 + 2x2 ≤ 40 (production time)
x1 + x2 ≤ 70 (total production)
x1 − x2 ≤ 35 (mix)
x1 , x2 ≥ 0
Revision LP Assumptions Formulation Examples

Advertisement

Example 2
Dorian makes luxury cars and jeeps for high-income men and women.
It wishes to advertise with 1 minute spots in comedy shows and
football games. Each comedy spot costs £50K and is seen by 7M
high-income women and 2M high-income men. Each football spot
costs £100K and is seen by 2M high-income women and 12M
high-income men. How can Dorian reach 28M high-income women
and 24M high-income men at the least cost.
Revision LP Assumptions Formulation Examples

Solution

1. Identify the Decision Variables


The decision variables are
x1 = the number of comedy spots.
x2 = the number of football spots.
2. Identify the Objective Function
We want to minimize

cost z = 50x1 + 100x2 .


Revision LP Assumptions Formulation Examples

Solution, cont

...
3. Identify the Constraints
We have the following constraints

7x1 + 2x2 ≥ 28 (number of women viewers)


2x1 + 12x2 ≥ 24 (number of men viewers)

4. Lower bounds
We cannot have negation number of slots, thus we have:

x1 , x2 ≥ 0
Revision LP Assumptions Formulation Examples

Solution, cont...

Summing up the Formulation

Combining steps 1-4, we get:

Minimize z = 50x1 + 100x2


Subject to 7x1 + 2x2 ≥ 28
2x1 + 12x2 ≥ 24
x1 , x2 ≥ 0.
Problem formulation

Fish Processing Plant


A local fishing plant in Musoma produces 480kg of Sangara, 400kg of
Sato and 230kg of Kamongo every day. Each of these products can be
sold either fresh or smoked. The total amount of Sangara, Sato and
Kamongo that can be smoked during a normal working day is 420kg, in
addition, up to 250kg can be smoked on overtime at higher cost. The
net profits are as follows

Fresh Smoked on regular time Smoked on over time


Sangara 800 1400 1100
Sato 400 1200 700
Kamongo 400 1300 900

How should production be organized so as to get maximum profit?

ISA
Problem formulation

Solution
Identify decision variables

x1 = kgs of smoked Sangara produced on regular time


x2 = kgs of smoked Sangara produced on over time
x3 = kgs of smoked Sato produced on regular time
x4 = kgs of smoked Sato produced on over time
x5 = kgs of smoked Kamongo produced on regular time
x6 = kgs of smoked Kamongo produced on over time
x7 = kgs of fresh Sangara produced
x8 = kgs of fresh Sato produced
x9 = kgs of fresh Kamongo produced

ISA
Problem formulation

Objective function and Constraints

Max z (Hundreds) = 14x1 + 11x2 + 12x3 + 7x4 + 13x5 + 9x6 + 8x7


+ 4x8 + 4x9

Subject to
x1 + x2 + x7 ≤ 480 (kgs of Sangara produced)
x3 + x4 + x8 ≤ 400 (kgs of Sato produced)
x5 + x6 + x9 ≤ 230 (kgs of Kamongo produced)
x1 + x3 + x5 ≤ 420 (Total kgs Smoked on regular time)
x2 + x4 + x6 ≤ 250 (Total kgs Smoked on over time)
x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 ≥ 0

ISA
Problem formulation

Alpha Limited
Alpha Limited produces and sells 2 different products under the brand
name black & white. The profit per unit on these products is TZS 5,000
& TZS 4,000 respectively. Both black & white employ the same
manufacturing process which has a fixed total capacity of 50,000
man-hours. As per the estimates of the marketing research department
of Alpha Limited, there is a market demand for maximum 8,000 units of
Black & 10,000 units of white. Subject to the overall demand, the
products can be sold in any possible combination. If it takes 3 hours to
produce one unit of black & 2 hours to produce one unit of white,
formulate the problem as a linear programming model.

ISA
Problem formulation
Solution
Decision variables: Let

x1 = Number of black produced


x2 = Number of white produced

Objective Function: Maximize profit defined by

f (x1 , x2 ) = 5000x1 + 4000x2

Constraints:

3x1 + 2x2 ≤ 50000 (Man-hours capacity)


x1 ≤ 8000 (Demand for black)
x2 ≤ 10000 (Demand for white)

ISA
Problem formulation

Solution cont.
Non-negative constraints:

x1 , x2 ≥ 0

Therefore the LP formulation is

Maximize 5000x1 + 4000x2


Subject to
3x1 + 2x2 ≤ 50000
x1 ≤ 8000
x2 ≤ 10000
x1 , x2 ≥ 0

ISA
Problem formulation

Chemical processes
The management of Chemical company is considering the optimal mix of
two possible processes. The values of input & output for both these
process are given as follows:

Units–inputs Units–outputs
Process I1 I2 O1 O2
X 2 6 3 7
Y 4 8 5 9

Maximum 500 units of Input I1 and 300 units of I2 are available to


company in the local market. The forecasted demand for outputs O1 &
O2 are at least 5,000 units & 7,000 units respectively. The respective
profits from process X & Y are TZS 75,000 & TZS 90,000 – per
production run. You are required to formulate the above as a linear
programming model.

ISA
Problem formulation
Solution cont.
3) Market requirement is to produce at least 5000 units of O1
3x1 + 5x2 ≥ 5000
4) Market requirement is to produce at least 7000 units of O2
7x1 + 9x2 ≥ 7000
5) Non-negative constraints x1 , x2 ≥ 0

Finally, LP Problem

Maximize 75000x1 + 90000x2


Subject to 2x1 + 4x2 ≤ 500
6x1 + 8x2 ≤ 300
3x1 + 5x2 ≥ 5000
7x1 + 9x2 ≥ 7000
x1 , x2 ≥ 0
ISA
Introduction Isoprofit Line Method Extreme Point Method Special Cases

GRAPHICAL SOLUTION
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Introduction
An LP with two decision variables can be solved graphically.
The method consists of two phases
Finding the values of the decision variables for which all the
constraints are met. That is, we find feasible region of the
solution space
Determining the optimal solution from all the points in the feasible
region.
We use the following steps to find the Feasible Region
1. Use the axis in a 2-dimensional graph to represent the values that
the decision variables can take
2. For each constraint, replace the inequalities with equations and
graph the resulting straight line on the 2-dimensional graph
3. For the inequality constraints, find the side (half-space) of the
graph meeting the original conditions (evaluate whether the
inequality is satisfied at the origin)
4. Find the intersection of all feasible regions defined by all the
constraints. The resulting region is the (overall) feasible region.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Example
consider the following problem

Example

Max z = 350x1 + 300x2


S.t x1 + x2 ≤ 200
9x1 + 6x2 ≤ 1566
12x1 + 16x2 ≤ 2880
x1 , x2 ≥ 0

A feasible region for this problem is in Figure 1


Introduction Isoprofit Line Method Extreme Point Method Special Cases

Figure

Figure :
Introduction Isoprofit Line Method Extreme Point Method Special Cases

We can use one of the two approaches in solving LP graphically

Iso-profit method

Extreme points method


Introduction Isoprofit Line Method Extreme Point Method Special Cases

Isoprofit Line Method


This method proceeds as follows:
Find a line on which all points have the same z-value. In a max
problem, such a line is called isoprofit line (in min problem, an
isocost line).
To draw an isoprofit line, choose any point in the feasible region
and calculate its z-value. Let us choose (100, 0). For (100, 0) ,
z = 350 × 100 + 300 × 0 = 35000. Thus (100, 0) lies on the
isoprofit line z = 350x1 + 300x2 = 35000. Since all isoprofit lines
are of the form 350x1 + 300x2 = constant, all isoprofit lines have
the same slope.
This mean that once we have drawn one isoprofit line, we can
find all other isoprofit lines by moving parallel line to the isoprofit
line we have drawn.
Generate other isoprofit lines by moving parallel to the drawn
isoprofit line in a direction that increases z (for a maximum
problem).
The last isoprofit line intersecting (touching) the feasible region
define the largest z-value of any point in the feasible region
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Figure

Figure :

The optimal solution occurs where the equations x1 + x2 = 200 and


9x1 + 6x2 = 1566 intersect. This occurs where x1 = 122 and x2 = 78.
Therefore the optimal solution is z = 66, 100.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Special Cases
The previous LP problem had a unique optimal solution. We now
discuss other three types of LPs that do not have unique optimal
solution.
These are:
LP has many solutions
LP has no solution
LP is unbounded.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Many Solution

Example
Solve the following

Max z = 3x1 + 2x2


S.t x1 + x2 ≤ 50
3x1 + 2x2 ≤ 120
x1 , x2 ≥ 0
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Many Solution

Figure :
We note that last point in the feasible region to intersect an isoprofit
line is the entire line segment AE.
This mean that any point on the line segment AE is optimal. Hence,
this problem has infinite number of optimal solutions.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Infeasible LP
Condider the following LP.

Example

Max z = 3x1 + 2x2


S.t x1 + x2 ≤ 50
3x1 + 2x2 ≤ 120
x1 ≥ 30
x2 ≥ 20
x1 , x2 ≥ 0
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Figure

Figure :

No point satisfy all constraints in the problem. This implies that the
problem has an empty feasible region, and is an infeasible LP.
Consequently, it has no solution.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Unbounded
For a max problem, an unbounded LP occurs if it is possible to
find points in the feasible region with arbitrary large z-values.
For a min problem, an LP is unbounded if there are points in the
feasible region with an arbitrary small z-values.
Graphically, we can spot an unbounded LP as follows: A max
problem (min problem) is unbounded if, when move parallel to
the original isoprofit (isocost) line in the direction of increasing
(decreasing) z, we never entirely leave the feasible region.
Consider the following problem.
Example

Max z = 2x1 − x2
S.t x1 − x2 ≤ 1
2x1 + x2 ≥ 6
x1 , x2 ≥ 0
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Figure

Figure :
This feasible region is unbounded. Thus there are points in the
feasible region that have arbitrary large z-value.
Introduction Isoprofit Line Method Extreme Point Method Special Cases

Summary
From the above discussion, we see that every LP with two variables
must fall into one of the following four cases:

Case 1: The LP has a unique optimal solution.

Case 2: The LP has an alternative optimal solutions: Two or


more extreme points are optimal, and the LP will have
an infinite number of optimal solutions.

Case 3: The LP is infeasible. The feasible region contains no


point.

Case 4: The LP is unbounded. There are point in the feasible


region with arbitrarily large z-values (max problem) or
arbitrarily small z-values (min problem).
Extreme points method

Convex set
A set of points S is convex set if given any two points; x1 and x2 in S, then
λx1 + (1 − λ)x2 ∈ S for any λ ∈ [0, 1]. Interpretation: Definition above
implies that a set of points S is a convex set if any line segment joining a
pair of two points in S is wholly contained in S.
Examples of convex sets are

Figure 1: Examples of convex sets

ISA
Non-convex
Examples of non-convex sets are

Figure 2: Examples of non-convex sets

Extreme point
Let S be a convex set. A point x0 ∈ S is extreme point of S if there are
no points x1 and x2 (x1 6= x0 or x2 6= x0 ) so that x0 = λx1 + (1 − λ)x2
for some λ ∈ (0, 1).

ISA
Extreme point cont.
Interpretation: Implies that for any convex set S, a point P in S is an
extreme point (or corner point) if each line segment that lies completely
in S and contains the point P has P as an end point of the line segment.

Remarks
It is an easy task to verify that the feasible region for any LP is a
convex

Theorem
If a linear programming problem has a solution, then it must occur at an
extreme point of the feasible region associated with the problem

ISA
Extreme point method steps
The theorem gives us an alternative method to solve an LP problem.
The Method proceeds as follows
1 Graph the feasible set.
2 Find the coordinates of all extreme point (corner points) of the
feasible region.
3 Evaluate the objective function at each extreme point.
4 Find the vertex that renders the objective function a maximum
(minimum). If there is only one such vertex, then this extreme point
constitutes a unique solution to the problem. If the objective
function is maximized (minimized) at two adjacent extreme of S,
there are infinitely many optimal solutions given by the points on
the line segment determined by these two vertices.

ISA
Example 1
A company makes two products (X and Y) using two machines (A and
B). Each unit of X that is produced requires 50 minutes processing time
on machine A and 30 minutes processing time on machine B. Each unit
of Y that is produced requires 24 minutes processing time on machine A
and 33 minutes processing time on machine B. At the start of the
current week there are 30 units of X and 90 units of Y in stock.
Available processing time on machine A is forecast to be 40 hours and on
machine B is forecast to be 35 hours. The demand for X in the current
week is forecast to be 75 units and for Y is forecast to be 95 units.
Company policy is to maximize the combined sum of the units of X and
the units of Y in stock at the end of the week.
Formulate the problem as linear programming problem and solve by using
the Graphical method using both isoprofit/isocost line and extreme point
methods

ISA
Solution

Let x1 be the number of units of X produced in the current week


x2 be the number of units of Y produced in the current week

Then the constraints are:


1 50x1 + 24x2 ≤ 40(60) machine A time
2 30x1 + 33x2 ≤ 35(60) machine B time
3 x1 ≥ 75 − 30, i.e x1 ≥ 45, so production of X ≥ demand(75) -
initial stock (30)
4 x2 ≥ 95 − 90 i.e. x2 ≥ 5, so production of Y ≥ demand (95) - initial
stock (90)
Objective function: The company want to maximize number of units at
the end of the week

Maximize f (x1 , x2 ) = (x1 + 30 − 75) + (x2 + 90 − 95)


= (x1 + x2 − 50)
ISA
Solution cont.

Figure 3: Graphical solution

Observe the diagram above, the maximum occurs at the intersection of


x1 = 45 and 50x1 + 24x2 = 2400. Solving simultaneously, rather than by
reading values off the graph, we find x1 = 45 and x2 = 6.25 with the
value of the objective function being 1.25
ISA
Repeat the solution with extreme points approach
Compute the extreme points by solving the intersecting equations

Example 2
A firm produces two components which are then assembled into a final
product. The cost per unit of these components is 0.60 and 1.00
respectively. The minimum amount of the various grades of raw material
required for the manufacturing process are as follows:

Raw material required


Components R1 R2 R3
C1 10 5 2
C2 4 5 6

Due to the requirement for a better quality product, the minimum usage
value of the raw materials should be 20 units, 20 units & 12 units
respectively. Formulate as a LP problem & solve graphically.

ISA
Introduction Terminology The Simplex Algorithm

SIMPLEX METHOD
Introduction Terminology The Simplex Algorithm

Introduction

Graphical method is simple way to solve LP problems.


Unfortunately we can get graphical solutions of LP problem with
2 and 3 decision variables only.
Therefore we need to find an alternative method to get optimal
solutions of LP problems with more than 3 decision variables.
One of the best known method is simplex method.
Simplex method is an algebraic, iterative method to solve linear
programming problems.
The simplex method identifies an initial basic solution (Extreme
point) and then systematically moves to an adjacent basic
solution, which improves the value of the objective function.
Eventually, this new basic solution will be the optimal solution.
Introduction Terminology The Simplex Algorithm

The Simplex algorithm for solving LP’s requires that all


constraints are equations (with exception of sign constraints on
the variables) and all variables are nonnegative. A LPP in this
form is said to be in standard form. Any LPP can be converted
into an equivalent one in standard form.

Example

Convert the following LP problem into standard form

max z = 20x1 + 15x2


s.t. x1 ≤ 100
x2 ≤ 100
50x1 + 35x2 ≤ 6000
20x1 + 15x2 ≥ 2000
x1 , x2 ≥ 0
Introduction Terminology The Simplex Algorithm

Solution
max z = 20x1 + 15x2
s.t. x1 +s1 = 100
x2 +s2 = 100
50x1 + 35x2 +s3 = 6000
20x1 + 15x2 −e4 = 2000
x1 , x2 , s1 , s2 , s3 , e4 ≥ 0

s variables are called slack variables.


e variables are called surplus variable.
We usually refer to both the slack and surplus variables as
‘slacks’. Slack variables are the ‘fictitious’ variables which
indicate how much of a particular resource remains unused in
any solution. These variables can not be assigned negative
values. A zero value indicates that all the resources are fully
used up in the production process.
Introduction Terminology The Simplex Algorithm

Write the following problem into standard form


Min z= c1 x1 + c2 x2 + ··· cn xn
s.t. a11 x1 + a12 x2 + ··· a1n xn ≥ b1
a21 x1 + a22 x2 + ··· a2n xn ≥ b2
..
.
am1 x1 + am2 x2 + · · · amn xn ≥ bm
x1 , x2 , . . . , xn ≥ 0

Solution
Min z = c1 x1 + c2 x2 + ··· cn xn
s.t. a11 x1 + a12 x2 + ··· a1n xn −y1 = b1
a21 x1 + a22 x2 + ··· a2n xn −y2 = b2
..
.
am1 x1 + am2 x2 + ··· amn xn −ym = bm
x1 , x2 , . . . , xn ≥ 0
y1 , y2 , . . . , ym ≥ 0
Introduction Terminology The Simplex Algorithm

Suppose we have an LP in standard form with n variables and m


constraints. For convenience, we label the variables x1 , x2 , . . . , xn .

max (or min) z= c1 x1 + c2 x2 + ··· cn xn


s.t. a11 x1 + a12 x2 + ··· a1n xn = b1
a21 x1 + a22 x2 + ··· a2n xn = b2
..
.
am1 x1 + am2 x2 + · · · amn xn = bm
x1 , x2 , . . . , xn ≥ 0

 
 x1
  
a11 a12 ··· a1n  x2  b1
 a21 a22 ···  a2n    b2 
Let A =  , x =  , b =  .. , then
     
.. .. ..
 . .  .  ..   . 
 . 
am1 am2 · · · amn bm
xn
the equation constraints of the LP can be written in matrix form as
Ax = b.
Introduction Terminology The Simplex Algorithm

Definition
A basic solution to the system of equations Ax = b is obtained by
1 setting n − m variables equal to 0,
2 solving for the m remaining variables, and
3 confirming that the solution for these m remaining variables is
unique.

The n − m variables that are fixed equal to 0 are called nonbasic


variables (NBV). The remaining m variables are called basic
variables (BV).
Note that, in general, different choices of nonbasic and basic
variables will yield different (basic) solutions to the system of
equations Ax = b.
Introduction Terminology The Simplex Algorithm

Definition
A nonnegative basic solution is a called a basic feasible solution
(bfs) since it is feasible to Ax = b, xi ≥ 0. In other words, a feasible
Solution is a solution for which all the constraints are satisfied.

Definition
An Optimal Solution is a feasible solution that has the most
favourable value of the objective function.
Introduction Terminology The Simplex Algorithm

The algorithm proceeds as follows


1 Convert the LP to standard form
2 Obtain a basic feasible solution (bfs) from the standard form
3 Determine whether the current bfs is optimal. If it is optimal, stop.
4 If the current bfs is not optimal, determine which nonbasic variable
should become a basic variable and which basic variable should
become a nonbasic variable to find a new bfs with a better
objective function value
5 Go back to Step 3.

Example
Solve
max z = 60x1 + 30x2 + 20x3
s.t 8x1 + 6x2 + x3 ≤ 48
4x1 + 2x2 + 1.5x3 ≤ 20
2x1 + 1.5x2 + 0.5x3 ≤ 8
x2 ≤ 5
x1 , x2 , x3 , x4 ≥ 0
The Simplex Algorithm

The algorithm proceeds as follows


1 Convert the LP to standard form
2 Obtain a basic feasible solution (bfs) from the standard form
3 Determine whether the current bfs is optimal. If it is optimal, stop.
4 If the current bfs is not optimal, determine which nonbasic variable
should become a basic variable and which basic variable should
become a nonbasic variable to find a new bfs with a better
objective function value
5 Go back to Step 3.

Example
Solve
max z = 60x1 + 30x2 + 20x3
s.t 8x1 + 6x2 + x3 ≤ 48
4x1 + 2x2 + 1.5x3 ≤ 20
2x1 + 1.5x2 + 0.5x3 ≤ 8
x2 ≤ 5
x1 , x2 , x3 , x4 ≥ 0
The Simplex Algorithm

Step 2 Obtain a starting bfs.


As (x1 , x2 , x3 ) = (0, 0, 0) is feasible for the original problem, x1 , x2 and
x3 become non-basic variables and the four other variables (the
basic variables) are determined by the four equalities. Thus a basic
feasible solution is x1 = x2 = x3 = 0, s1 = 48, s2 = 20, s3 = 8, s4 = 5
and z = 60 × 0 + 30 × 0 + 20 × 0 = 0.

Step 3 Determine whether the current bfs is optimal.


Determine whether there is any way that z can be increased by
increasing some nonbasic variable. If each nonbasic variable has a
nonnegative coefficient in the objective function row (R0 ), current bfs
is optimal. That is, for in a max (min), the optimum is reached when
all the nonbasic coefficients in the z-equation are nonnegative
(nonpositive).

However, in this case all nonbasic variables have negative


coefficients. Hence, it is not optimal.
The Simplex Algorithm

Step 4 Find a new bfs


First we select an entering variable from the current nonbasic
variables. The entering variable in max (min) is one with the
most negative (positive) coefficient in the objective z-equation. A
column associated with entering variable will be called the
entering column.
Here z increases most rapidly when x1 is made non-zero, i.e., x1
is the entering variable.
Examining R1 , x1 can be increased only to 6. More than 6 makes
s1 < 0. Similarly R2 , R3 , and R4 , give limits of 5, 4, and no limit
for x1 (ratio test). The smallest ratio is the largest value of
the entering variable that will keep all the current basic
variables nonnegative. Thus by R3 , x1 can only increase to
x1 = 4 when s3 becomes 0 (i.e., look for the least positive of the
ratios 48 20 8 5
8 = 6, 4 = 5, 2 = 4, 0 = ∞). We say s3 is the leaving
variable and R3 is the pivot equation and the element at the
intersection of the entering column and the pivot equation is
called the pivot element.
The Simplex Algorithm

Now we must rewrite the system so the values of the basic variables
can be read off.
The new pivot equation (R3 /2) is

R03 x1 + 0.75x2 + 0.25x3 +0.5s3 = 4

Then use R03 to eliminate x1 in all the other rows. Generally, we


proceed as follows:
1 Pivot equation:

New pivot equation = old pivot equation ÷ pivot element


2 All other equations, including z:

New equation = (Old Equation) − ((its entering column coefficient)


×(new pivot equation))
The Simplex Algorithm

We obtain;

R00 :z− +15x2 −5x3 +30s3 = 240; (R0 + 60R30 )


R01 : −x3 +s1 −4s3 = 16; (R1 − 8R30 )
R02 : −x2 +0.5x3 +s2 −2s3 = 4; (R2 − 4R30 )
R03 : x1 +0.75x2 +0.25x3 +0.5s3 = 4; (R30 )
R04 : x2 +s4 = 5; (R4 − 0R30

The new bfs is x2 = x3 = s3 = 0, x1 = 4, s1 = 16, s2 = 4, s4 = 5


making z = 240.
The Simplex Algorithm

Step 5 Go back to Step 3. Repeat until an optimal solution is


obtained
x3 is entering variable
Using ratio test we see s2 is the leaving variable. Thus the pivot
equation is R20 .
Rearranging the pivot equation gives

R002 : − 2x2 + x3 +2s2 −4s3 = 8 (R20 ÷ 0.5)

Step 4 Find a new bfs.

R000 z +5x2 +10s2 +10s3 = 280


R100 −2x2 +s1 +2s2 −8s3 = 24
R200 −2x2 +x3 +s2 −4s3 =8
R300 x1 +1.25x2 −0.5s2 1.5s3 =2
R400 x2 s4 =5

The new bfs is x2 = s2 = s3 = 0, x1 = 2, x3 = 8, s1 = 24, s4 = 5,


making z = 280.
The Simplex Algorithm

Each nonbasic variable has a nonnegative coefficient in row 0.


Therefore, the current solution is optimal.
The optimal solution is z = 280, for x1 = 2, x2 = 0 and x3 = 8.

You might also like