You are on page 1of 5

LINEAR PROGRAMMING: ALGEBRAIC SOLUTION

The Standard form of an LP model

The properties of the standard LP


1. All the constraints are equations with nonnegative right-hand side
2. All the variables are nonnegative
3. The objective function may be maximization or minimization

Sample:
Write the following LP model in the standard from

Minimize y = 2x1 + 3x2


s.t:
x1 + x2 = 10
-2x1 + 3x2 -5
7x1 - 4x2 6
x1,x2 0

How to convert inequalities to equations:

1. 2x1 + 3x2 180


LHS RHS

let s1 = unused labor or slack variable

2x1 + 3x2 + s1 = 180

2. 2x1 + 3x2 180


LHS RHS

let s2 = surplus variable

2x1 + 3x2 s2 = 180

3. If the RHS is negative

multiply the inequalities by (-1). The direction of inequalities is reversed

ex. -2 > -4; 2 < 4

Solution:
1.multiply the second inequalities by (-1). and subtract a surplus variable s 2
2x1 3x2 s2 = 5

2.add slack variable s3 to the third constraint.


7x1 4x2 + s3 = 6

the standard LP form: Minimize y = 2x 1 + 3x2


s.t:
x 1 + x2 = 10
2x1 3x2 s2 = 5
7x1 4x2 + s3 = 6
x1,x2,s2,s3 0
System of Linear Equation:

Ax = b where A is m x n
m = rows
n = columns

3 possibilities
1. square system m=n unique solution
2. tall system m>n many representation
3. long system m<n infinite or many solutions

but we are interested on many solutions

Def: An m x n system is in canonical form if the columns to the identity matrix Im maybe found
among its n column (not necessarily appearing in the proper order)

Ex. 2x1 + x3 = 10
3x1 + x2 + 5x4 = 20
x1 + x4 + x5 = 30

3 x 5 system

is it in canonical form?

Tableau:
x1 x2 x3 x4 x5 RHS
2 0 1 0 0 10
3 1 0 5 0 20
1 0 0 1 1 30

x3 x2 x5
1 0 0
0 1 0 = I3
0 0 1

the m variable associated to these special columns are called BASIC VARIABLES, the
remaining n-m are called non basic variables.
From the given example
x3,x2,x5 are basic variables
x1 and x4 are the non basic variables

x1* = 0 , x2* = 20, x3* 10, x4* = 0, x5* = 30 ( optimal solution)

Simplex Method (PIVOTING)


Def: A pivot on the ars element of an m x n system is a sequence of row operations with
the aim to converting sth column into rth column of the identity matrix.

TABLEAU:

x1 x2 x3 x4 x5 RHS
a b c d e B1
f g h i j B2
k l m n o B3
0
convert x4 to: 1
0

1. divide R2 by i pivot element


2. how to make 0 the value of d in R1
R1 + [-d(R2)]
R3 + [-n(R2)]

Short cut:
TABLEAU:

x1 x2 x3 x4 x5 RHS
a b c d e B1
f g h i j B2
k l m n o B3

anew = aold (PCe)(PRe)


Pe
PCe column element
PRe row element
Pe pivot element

Simplex Method in Tableau Format

Given: max y = 30x1 + 50x2


s.t:
x1 50
2x2 120
3x1 + 2x2 180
x1,x2 0

step 1: test for optimality(for max)


Scan the objective function row for possible coefficients. If there are none, STOP.
The current solutions are maximal. If there is at leas tone positive coefficient
GOTO 2.
step 2: Entrance Rule (which non basic variable will be increase)
Pick any non basic variable with positive coefficients (or the most positive) in the
objective function row. This is called the entering variable and the associated
column is the pivot column.
step 3: Exit rule (which non-basic variable reach zero first)
Scan the pivot column for positive coefficients. This will indicate the basic variable
in danger of becoming negative. For these basic variables, compute the ratio
between RHS and the pivot column component and pick the smallest ratio but not
negative. The associated variable is called the leaving variable and the
associated row is the pivot row.
step 4: pivot to get the new feasible canonical form
step 5: GOTO 1

X1 X2 S1 S2 S3 RHS
S1 1 0 1 0 0 50
PIVOT ROW
S2 0 2 0 1 0 120
S3 3 2 0 0 1 180
.-Y 30 50 0 0 0 0

X1 X2 S1 S2 S3 RHS
PIVOT
S1 1 0 1 0 0 50
COLUMN
X2 0 1 0 1/2 0 60
S3 3 0 0 -1 1 60
.-Y 30 0 0 -25 0 -3000

X1 X2 S1 S2 S3 RHS
S1 0 0 1 - 1/3 1/3 30
X2 0 1 0 1/2 0 60
X1 1 0 0 - 1/3 1/3 20
.-Y 0 0 0 -15 -10 -3600

therefore:
X1 = 20
X2 = 60
S1 = 30
S2 = 0
S3 = 0
Y = 3,600

Remarks:
1. If the objective is to minimize y, choose the variable with a negative coefficient (or
the most negative). Exit rule and pivoting routines remain the same.
2. If there are ties for the entering variable. Simply pick any one of the tied variable.
3. if there is a tie for a leaving variable, this is dangerous since it will give a
degenerated solution which might cause the non-termination or cycling the
algorithm
4. if there is no positive component in the PIVOT column, STOP. This means LP
problem is unbounded.
5. If at the objective function row of the optimal tableau, all the coefficient of the non
basic variables are negative (positive) the Basic feasible solution is the unique
maximizing (minimizing) solution. If there is a non-basic variable with zero
coefficient in the objective function row of the optimal tableau, there may or may
not be an alternative optimal solution.

You might also like