Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

SOLVING LINEAR

PROGRAMMING
PROBLEMS

The Simplex Method


Quantitative DM Approach
Defining the Problem Develop a clear & concise statement of the problem

Model is a representation of a situation. The type of model may be


Developing the Model physical, scale, schematic and/or mathematical.

Acquiring input data Be careful of GIGO. Meticulous effort is required in collecting relevant input
data to solve the problem.

Developing a solution Using engineering-mgt knowledge and mathematics tools

Check consistency & relevance of solution with the problem description.


Testing the solution Review and update input data, mathematical technique used and
appropriateness of developed model to get logical & rational solution

Analyzing the results Workout implications of the obtained solution and check sensitivity of the
model with different input data and mathematical model (sensitivity
analysis)
Implementing results
Limitations to LPP
• The optimal solution may be buy 6.7 trucks or manufacture 5.3 parts. Obviously
one would buy either 6 or 7 trucks or manufacture 5 or 6 parts instead of the
mixed number solution. Therefore, the optimal solution is rounded either up or
down , as appropriate.
• There is another algorithm, called Integer Programming, that provide solution
integer (whole number ) solution.
• Very often, the objective function and constraints / resources are not relate
linearly with the variables.
• Non Linear programming techniques are available to deal with such cases.
• LP does not deal with uncertainty but real life problems often deal with
uncertainty.
• Methods such as chance constrained programming or LP under uncertainty
may be used in such cases.
Case Study # 1
Scheduling Planes of Delta Airlines
• Each time an airliner takes off with an empty seat, a revenue opportunity is lost for ever.
For Delta airlines, which flies more than 2400 domestic flights per day using 450 aircraft of
10 different models, flight schedule is the heartbeat of the airline. One flight leg for Delta
might consist of Boeing 757 jet assigned to fly at 6:21 am from Atlanta to arrive in Boston
at 8:45 am carrying 235 passengers and 12 crew members. Delta problem, the same as that
of every competitor, is to match airplanes such as 747s, 757s, 767s, etc to flight legs
between A to B and fill maximum seats with passengers.
• Advances in LP algorithms and computer hardware have made it possible to solve
optimization problems of this scope. Delta runs its huge LP model (Cold start) everyday
and was the first airline to solve a problem of this scope.
• Typical size of daily Cold Start model is about 40,000 constraints and 60,000 variables. The
constraints are aircraft availability, balancing arrivals and departures at airports, airplane
maintenance needs and schedules, and so on. Cold Start Objective is to minimize a
combination of operating costs and lost passenger revenues (spill cost).

Delta airlines reported savings of 0.25Millon$ per day by optimizing its flight
scheduling, close to a saving of 100 Million$ per year. (case study of 1994)
Case Study # 2
Purchase of new airplanes by PIA
PIA owns an aging fleet of Boeing-727 jet airplanes. It is considering a major
purchase of new models of Boeing aircrafts; B‐757 and B‐767, to maximize
passenger travelling (max seat occupancy).
The decision must take into account numerous cost and capability factors,
including the following:
A. purchase of up to 17 new models of Boeing aircrafts; B‐757 and B‐767
B. airline can finance up to $400 million in purchases; each B‐757 will cost $35 million
while each B‐767 will cost $22 million
C. at least one third of the planes purchased should be longer range B‐757
D. annual budget is to be no more than $8 Million; annual maintenance cost per B‐757
is estimated to be $800,000, and $500,000 for each B‐767
E. each B‐757 can carry 125,000 passengers per year, while each B‐767 can fly 81,000
passengers annually.

Formulate the problem as Integer Programming problem and solve using Simplex
method. Interpret the solution and give your comments.
Simplex Method

• Used for solving LP problems will be presented


• Put into the form of a table, and then a number of mathematical
steps are performed on the table
• Moves from one extreme point on the solution boundary to another
until the best one is found, and then it stops
• A lengthy and tedious process but computer software programs are
now used easily instead
• Programs do not provide an in-depth understanding of how those
solutions are derived
• Can greatly enhance one's understanding of LP
Transforming Rules
• Rules for transforming all three types of model constraints
• Are as follows

Objective Function
Coefficient

Constraint Adjustment Max Min


≤ Add a slack variable 0 0

= Add an artificial variable -M M

≥ Subtract a surplus variable 0 0


add an artificial variable -M M
Difference of slack, Surplus and Artificial Variables
Particulars Slack Variable Surplus Variable Artificial variable
Meaning Unused resources of the Excess amount of resources No physical or economic
idle resources utilized meaning, It is Fictitious.
When used With <= Constraints With >= constraints With >= and =
constraints
Coefficient in +1 -1 +1
Constraint
Coefficient in Object 0 0 -M for Maximization
Function problems & +M for
Minimization problems
As Initial Program Used as starting point. Can’t be used since unit matrix It is initially used but
Variable condition is not satisfied later on eliminated
In Optimal Table Used to help interpreting It indicates infeasible
idle & key resources Solution
Conversion to standard form of Simplex Method -
First Step

A manufacturer of wooden articles produces tables and chairs which require


two types of inputs mainly labor and wood. Each chair requires one labor and
4 wood logs however, each table requires two labor and 3 wood logs. A total of
labor used should not exceed 40 and the available woods logs are 120 or less.
each chair produced earns a profit of $40 and each table produced earns a
profit of $ 50 First step is to convert model into standard form:
• s1 and s2, represent amount of unused labor and wood
• No chairs and tables are produced, s1=40 and s2=120 (according to the
available resources)
• Unused resources contribute nothing to profit, Z=0
Assigning (n-m) Variables Equal to Zero
• Determine values of variables at every possible solution point
• Have two equations and four unknowns, which makes direct
simultaneous solution impossible
• Assigns n-m variables=0
• n=number of variables
• m=number of constraints
• Have n = 4 variables and m = 2 constraints
• x1 = 0 and s1 = 0 and substituting them results in x2 = 20 and
s2=60
Feasible and Basic Feasible Solution
• Solution corresponds to A
• Referred to as a basic feasible solution
• Feasible solution is any solution that satisfies
the constraints X1=0 chairs
S1=0
X2=20 tables
• Basic feasible solution not only satisfies the A
S2=60

constraints but also contains as many variables


with nonnegative values as there are model
constraints
• m variables with nonnegative values and n-m B
values equal to zero
C
Feasible and Basic Feasible Solution
• x2=0 and s2=0, results in x1=30 and s1=10
• Corresponds to point C
• s1=0 and s2=0, results in two equations
with two unknown variables
A
• Get a solution which corresponds to
point B, where x1=24, x2=8, s1=0, and s2=
0
X1=30 chairs
B S1=10
• Previously identified as optimal solution X2=0 tables

point
S2=0
C
Two very important Questions

Two questions can be raised by the identification


of solutions at points O, A, B, and C
• How was it known which variables to set equal
to zero?
X1=0 chairs
• How is the optimal solution identified? S1=0
A X2=20 tables X1=24 chairs
• Answers these questions by performing a set of S2=60 S1=0
X2=8 tables
mathematical steps S2=0

• Determines at each step which variables should B X1=30 chairs


S1=10
equal zero and when an optimal solution has X2=0 tables
been reached C
S2=0
Initial Tableau

Model is put into the form of a table, or tableau


• Our maximization model
Z = 40x1 + 50x2 + 0s1 + 0s2
Subject to
Basic Z x1 x2 s1 s2 Solution
x1 + 2x2+ s1 = 40
Z 1 -40 -50 0 0 0
4x1 + 3x2 + s2 =120
s1 0 1 2 1 0 40
x1, x2 , s1, s2 ≥ 0
• Initial simplex tableau with various column and row headings s2 0 4 3 0 1 120

• Record the model decision variables, followed by the slack


variables
• Bottom rows represent constraint equations whose right-hand
sides are given in the “solution” column
• z-row is obtained from
z -40x1-50x2=0
Determining Basic Feasible Solution
Know which two variables will form the basic feasible
solution and which will be assigned a value of zero?
• Selects the origin as the initial basic feasible solution
Basic Z x1 x2 s1 s2 Solution
• x1= 0 and x2= 0; variables in basic feasible solution are
Z 1 -40 -50 0 0 0
s1 and s2 which are listed under column "Basic" and
their values, 40 and 120, are listed under column s1 0 1 2 1 0 40
“solution“
s2 0 4 3 0 1 120
• Z=0 under column “solution”
Entering Variable

Interested in giving us either some chairs or some tables


• What non-basic variables will enter solution and
become basic?
• z-row values represent increase per unit of entering a Basic Z x1 x2 s1 s2 Solution
non-basic variable into the basic solution
Z 1 -40 -50 0 0 0
• Make as much money as possible
s1 0 1 2 1 0 40
• Select variable x2 as the entering basic variable as it has 0 4 3 0 1 120
the greatest increase in profit per unit, $50—the most s2
negative value in the z-row
• x2 column is highlighted and is referred to as the pivot
column
Entering Variable by Graphical Solution
• Demonstrated by the graph
• At the origin nothing is produced
• Moves from one solution point to an
adjacent point X1=0 chairs
X2=20 tables
A
• Move along either the x1 axis or the x2 axis X1=24 chairs
X2=8 tables
• Chooses x2 as the entering variable
B
X1=30 chairs
X2=0 tables

O C
Leaving Basic Variable

• One of s1 or s2 must leave and become zero


R
• Produce tables as many as possible
• Check availability of our resources
Wood constraint
• Using labor constraint, maximum number of tables
we can produce is 20
A Labor constraint
• Using wood, maximum number of tables we can
produce is 40
• Therefore, fulfilling all constraints, number of tables
that can be produced is limited to 20 tables B

• Point A is feasible, whereas point R is infeasible


C
Leaving Variable
• Determined by dividing RHS values by pivot column
values
Basic x2 Solution Ratio

s1 2 40 40/2=20
s2 3 120 120/3=40 Basic Z x1 x2 s1 s2 Solution
Z 1 -40 -50 0 0 0
• Leaving basic variable is variable with minimum
nonnegative ratio s1 0 1 2 1 0 40

• s1 is leaving variable s2 0 4 3 0 1 120

• s1 row is referred to as pivot row


• Value of 2 is called pivot number or pivot element
• Entering variable, x2, in the new solution also equals 20
• Z also increases from 0 to 1000
Second Tableau

• Non-basic and basic variables at solution point


Non-basic: x1 and s1
Basic: x2 and s2
Basic Z x1 x2 s1 s2 Solution
• Various values are computed using pivot row and all Z 1 -40 -50 0 0 0
other rows
x2 -50 1/2 1 1/2 0 20
• First, x2 row, is computed by using every value in
pivot row of first (old) tableau and divide it by pivot s2 0 4 3 0 1 120
number, or
(0/2 1/2 2/2 1/2 0/2 40/2)
• New row values are shown in Table
0-(3)*0=0
4-(3)*1/2=-5/2 1-(-50)*0=1
3-(3)*1=0 Second Tableau-Cont. -40-(-50)*1/2= -15
-50-(-50)*1=0
0-(3)*1/2=--3/2
1-(3)*0=1 0-(-50)*1/2=25
120-(3)*20=60 0-(-50)*0=0
0-(-50)*20=1000
• For the remaining row values, use
Basic Z x1 x2 s1 s2 Solution
New row=(current row)-(its pivot column Z 1 -15 0 25 0 1000
coefficient) x (New pivot row)
x2 -50 1/2 1 1/2 0 20
• Requires use of both old tableau and new
one s2 0 5/2 0 -3/2 1 60

• Various values for new z-row and s2-row:


Z-row= current z-row – (-50)x new pivot
row Basic Z x1 x2 s1 s2 Solution

S2-row=current s2-row – (3)x new pivot row Z 1 -40 -50 0 0 0

• Values are inserted in Table s1 0 1 2 1 0 40

s2 0 4 3 0 1 120
Checking Optimal Solution
• Set non-basic variables x1 and s1 to zero, solution column
provides new basic solution x2=20, s2=60 and z=1000
• Is not optimal
• x1 has a negative coefficient
• Select variable x1 as entering basic variable Basic Z Solution
x1 x2 s1 s2
• Ratio computations, show that s2 is the leaving variable Z 1 -15 0 25 0 1000

Basic x1 Solution Ratio x2 -50 1/2 1 1/2 0 20

x2 1/2 20 20/0.5=40 s2 0 5/2 0 -3/2 1 60

s2 5/2 60 60/2.5=24

• Steps are repeated to develop the third tableau


• Pivot row, pivot column, and pivot number are indicated
in Table
Third Tableau

Basic Z x1 x2 s1 s2 Solution
• New pivot row, x1, is computed using the
same formula Z 1 0 0 16 6 1360

• All old pivot row values are divided by 5/2 x2 -50 0 1 4/5 -1/5 8
• Values for z-row and s2-row are computed
here and shown in Table x1 -40 1 0 -3/5 2/5 24

Basic Z x1 x2 s1 s2 Solution

Z 1 -15 0 25 0 1000
x2 -50 1/2 1 1/2 0 20
s2 0 5/2 0 -3/2 1 60
Checking Optimal Solution

Basic Z x1 x2 s1 s2 Solution
Z 1 0 0 16 6 1360
• Coefficient of non-basic variables are positive
x2 -50 0 1 4/5 -1/5 8
• Optimal solution has been reached
x1 -40 1 0 -3/5 2/5 24
• x1 = 24 chairs, x2= 8 tables and z= $1,360 profit
• Corresponds to point B shown previously
Summary of the Simplex

1. Transform constraint inequalities into equations


2. Set up the initial tableau
3. Determine the pivot column (entering nonbasic solution variable)
4. Determine the pivot row (leaving basic solution variable)
5. Compute the new pivot row values
6. Compute all other row values
7. Determine whether or not the new solution is optimal
1. If these coefficients are zero or positive, the solution is optimal
2. If a negative value exists, return to step 3 and repeat the simplex steps
Minimization Problem

A minimization problem requires a few changes


• Recall the minimization model
minimize Z = 6 x1 + 3 x2
subject to
2 x1 + 4 x2 ≥ 16
4 x1 + 3 x2 ≥ 24
x1 and x2 ≥ 0
• Transformed this model into standard form by subtracting surplus variables
2 x1 + 4 x2 – s1 = 16
4 x1 + 3 x2 – s2 = 24
Introducing Artificial Variable

Simplex method requires initial basic solution at the origin


A
• Test this solution at origin violates the constraints as solution at Feasible area
origin is outside feasible solution space
• Add an artificial variable (A1) to the constraint equation
• Create an artificial positive solution at the origin
• Artificial solution helps get the simplex process started
• Our first constraint becomes
B
2 x1 + 4 x2 – s1 + A1= 16

C
Effect of Surplus and Artificial Variables on
Objective Function

• Surplus variable has no effect on objective function therefore, 0 is assigned to


each surplus variable
• One must also ensure that an artificial variable is not in the final solution.
• This is achieved by assigning a very large cost
• Assign a value of M, which represents a large positive cost for minimization
problems
• Produces objective function:
• Minimization model can now be summarized as
minimize Z = 6 x1 + 3 x2 + MA1 + MA2
subject to 2 x1 + 4 x2 – s1 + A1 = 16
4 x1 + 3 x2 – s2 + A2 = 24

x1, x2, s1, s2 , A1, A2 ≥ 0.


Initial Tableau

• Use A1 and A2 as a starting basic solution:


x1=x2=s1=s2=0 and A1=16 and A2=24
• Notice that the origin is not in the feasible solution
area but an artificially created solution
• Simplex process moves toward feasibility in Basic Z x1 x2 s1 s2 A1 A2 Solution
subsequent tableaus
Z 1 -6 -3 -M -M 0 0 0
• Decision variables are listed first, then surplus
variables, and finally artificial variables 0 2 4 -1 0 1 0 16
A1
• z=24xM+16xM=40M instead of 0
A2 0 4 3 0 -1 0 1 24
Modification in Initial Tableau

• Inconsistency exists because A1 and A2 coefficient have nonzero coefficient


• Eliminate this inconsistency by substituting out A1 and A2 in the z-row
• We can write A1 =16-2 x1 -4 x2 +s1
A2 = 24-4 x1 -3 x2 + s2
• Substituting A1 and A2 in objective function
Z = 6 x1 + 3 x2 + M (16-2 x1 -4 x2 +s1 )+ M(24-4 x1 -3 x2 + s2 )
Z = 40M+x1 ( 6-6M)+x2 (3-7M) +Ms1+ Ms2
• Transforming objective function into standard form
Z +x1 ( -6+6M)+x2 (-3+7M)-Ms1- Ms2= 40M
• Must be used as the z-row
Entering and Leaving Variables

Modified tableau thus becomes:


• z=40M, which is consistent now with values
of the starting basic feasible solution A1=24
Basic Z Solution
and A2=16 x1 x2 s1 s2 A1 A2

Z 1 6M-6 7M-3 -M -M 0 0 40M


• x2 column is selected as the entering
variable because 7M - 3 is the largest value
in z-row A1 0 2 4 -1 0 1 0 16

• A1 is selected as leaving basic variable


because the ratio of 4 A2 0 4 3 0 -1 0 1 24

• Second tableau is developed using simplex


formulas
Second Tableau

• A1 row has been eliminated


• Once an artificial variable leaves basic feasible,
it will never return

Basic Z x1 x2 s1 s2 A1 A2 Solution
Z 1 2.5M-4.5 0 0.75M-0.75 -M -1.75M+0.75 0 12M+12

x2 0 0.5 1 -0.25 0 0.25 0 4

A2 0 2.5 0 0.75 -1 -0.75 1 12


Third Tableau
Basic Z x1 x2 s1 s2 A1 A2 Solution
Z 1 2.5M-4.5 0 0.75M-0.75 -M -1.75M+0.75 0 12M+12

x2 0 0.5 1 -0.25 0 0.25 0 4

A2 0 2.5 0 0.75 -1 -0.75 1 12

• Third tableau starts replacing A2


with x1 Basic Z x1 x2 s1 s2 A1 A2 Solution
Z 1 0 0 0.6 -1.8 -M-0.6 M-1.8 33.6
• A1 and A2 rows have been now
eliminated x2 0 0 1 -0.4 0.2 0.4 -0.2 1.6

• x1 row was selected as the pivot row 0 1 0 0.3 -0.4 -0.3 0.4 4.80
x1
Forth Tableau (Optimal Solution)
• Starts replacing s1 with x1
Basic Z x1 x2 s1 s2 A1 A2 Solution
• Turns out into final tableau which gives Z 1 0 0 0.6 -1.8 -M-0.6 -M+1.8 33.6
optimal solution
x2 0 0 1 -0.4 0.2 0.4 -0.2 1.6
• z-row contains no positive values
x1 0 1 0 0.3 -0.4 -0.3 0.4 4.80
• Optimal solution:
• x1=0, s1=16, x2=8, s2= 0, and Z = $24
Basic Z x1 x2 s1 s2 A1 A2 Solution
Z 1 -2 0 0 -1 -M -M+1 24

x2 0 1.33 1 0 -0.33 0 0.33 8

s1 0 3.33 0 1 -1.33 -1 1.33 16

You might also like