You are on page 1of 14

# LINEAR PROGRAMMING

Foundations
Linear programming is one if the best known tools of management science. Its objective is to identify an optimal allocation
of an organizations limited resources among competing demands.
The study of the conditions in which an economic activity takes place with the aid of programming leads to system of
constraints that contain the problem variables and the technical coefficients. These relations are named constraints. The result is
dependent on the same variables that appear in the constraints and is represented in a form of a function, called objective
function (efficiency function). The optimum value of this function is an extreme: maximum or minimum.
Linear problems
A linear problem is that problem in which all the model components are linear functions of variables. The standard form of
a linear mathematical model is expressed as follows:
n
aij Xj bi , i 1,..., m
j1
Xj 0 , j 1,... ,n
max
min

(6.1)
(6.2)

c X
j

(6.3)

j 1

The relations (6.1) represent the system of constraints. Coefficients aij are technical coefficients representing input/output; bj are the available
resources.
The relations (6.2) are called non-negativity conditions, resulted from the economic character of the problem that imposes for Xj variables
positive or null values.
The relation (6.3) is the mathematical expression of the objective to be achieved.
1

Start

## The simplex method is an iterative algorithm that was developed

by G.B. Dantzig.
The method guarantees that an optimal solution, if it exists, will
be found in a finite number of iterations.

Standardize problem
format with the aid of
slack variables

Generate initial
solution

Is solution
optimal?

## Step 1. Standardize the problem into a linear programming

tableau, by adding the slack variables*.
YES
Find all optimal
solutions, if they exist

## Step 3. Test the solution for optimality. If is not optimal,

improve it.

NO
Identify incoming
variable

Identify outgoing
variable

Generate improved
solution

## Step 2. Generate the initial solution, called a basis.

End

Step 4. Identify one variable that will leave the basis and one
variable that will enter the basis
Step 5. Generate an improved solution and test is for optimality.
If is not optimal, continue in the same manner.
Step 6. Find if more than one optimal solution exists.
*Slack variable: a variable representing the difference between the use
of a resource and its availability. If the value obtained is nonzero, it means
there are unused quantities of that resource.

Example
The algorithm will be better understood by taking the following example, having constrains of the smaller-than-equal-to
type:
a11X1 a12X2 b1

a21X1 a22X2 b2
X1 0 , X2 0

## max Z c1X1 c2X2

Step 1. Standardize the problem into a linear programming tableau, by adding the slack variables to each type of constrains.
a11X1 a12X2 X3 b1

a21X1 a22X2 X4 b2
Xj 0 , j 1,... ,4

A=

a11
a21

a12
a22

1 0
0 1

## Step 2. Generate the initial solution, called a basis.

The slack variables X3 and X4 are considered the basis initial solution.

Iterations
For each iteration a tableau is built:
cj
i= 1,...,m
Xr,k

aij,k

bi,k

iI,k

j= 1,...,n,n+1,...n+m
k

j,k

Zk

## The symbols have the following meaning:

k - number of iteration;
xr,k - basis variables in k iteration;
cj - the coefficients of the objective function - the same for all iterations;
aij,k - the coefficients of the system in the standard form, in iteration k;
j,k - the criteria for determining the incoming variables;
bi,k - the values of the basis variable Xr,k;
iI,k - the criteria for determining the outgoing variable;
Zk - the value of the profit in iteration number k.

## Test for optimality

This is made by investigating j,k in the tableau:
For an optimal solution of a maximization problem, it is sufficient if all the coefficients of the j,k row are nonpositive:
j , k 0max ,

j 1,..., n, n 1,..., n m

(6.4)

If the solution is not optimal, it can be improved by exchanging one variable in the solution. The improvement is done by:

Identifying an incoming variable: that variable with the maximum value among negative values, max (j,k<0). This
incoming variable is noted with Xi,K and aiI,K is the column corresponding to Xi,K in the matrix.

Identifying an outgoing variable: once the incoming variable has been identified, the outgoing must to be found, by using
iI,k. The outgoing variable, noted XE,K, is that with the minimum positive value of iI,k.
min iI , k

bi , k
, aiI , k 0
aiI , k

(6.5)

The computation must be continued untill the optimum solution is achieved (iteration K+1 by replacing an X rk variables
with the Xik variable).

## Designing iteration number 0

The 0 iteration tableau is filled considering:

## the slack variables are the basis variables;

A0 is the matrix of the system in its standard form;
j,0 = - cj; j = 1,..., n;
the basis variables values are the terms bi,0 = bi; i = 1,..., m;
Z0 = 0.
c1

c2

X3

a11

a12

b1

X4

a21

a22

b2

k=0

-c1

-c2

Z0=0

## Generate an improved solution

The last row of the tableau is analysed and the decision to proceed the computation is taken function of:
if all j,k0 means that the optimum was reached and is Xr,k = bi,K;
if there are still negative values in the last row of the tableau, the computation must be further carried on as it is possible
to improve the solution.
6

The solution is improved by introducing the incoming variable into the basis and removing the outgoing variable. This is done
row by row on the old tableau, forming, in the process, a new one.
that XI,K variable that assures the largest increase of the objective function Z is introduced; as the column that
corresponds to variable Xi,K is known, the iI,k values can be computed;
XE,K variable is withdrawn from the basis;
The element placed at the intersection of the line of XE variable and the column of XI is called pivot.
Lets suppose that:
c2 > c1 > 0
a11 >0; a12 >0; a21 >0; a22 >0.
By examining the last row of the table one may notice that there are two negative values (-c1, -c2), so the computation must be
carried on. In the case of iteration 1, X2 will enter in the base for which max j,k<0, since -c1<-c2. The values are calculated as:
1I,0=12,0=(b1/a12); 22,0=(b2,0/arI,0)=(b2/a22)
Considering that 12,0<22,0, it means that variable X3 is the outgoing variable. The pivot is represented by a 12. The zero
iteration table looks like:

c1

c2

X3

a11

a12

X4

a21

a22

k=0

-c1

-c2

0
1

0
0

b1

b1/a11

b2

b2/a21

Z0=0

## The arrows were provided for XI,k and XE,K.

The trivial solution for this iteration, X1 = 0;
X2 = 0; X3 = b1; X4 = b2, shows that nothing is
produced and nothing is consumed.
The new iteration base will be X2 and X4.

## Designing of the next iteration

Taking into consideration the elements of K iteration, the next one, K+1 is computed in the following way:
a) the new basis is obtained by replacing XE with XI, in the former base k;
b) cj coefficients are the same;
c) the elements from the rectangle marked in the last tableau are computed as follows:
pivot becomes 1;
the elements from the pivot column becomes 0; the elements from the row of the pivot are divided by pivot;
all the other elements can be found out by applying the rectangle rule; for each element an imaginary rectangle is
built:
E

## -row of the computed element

B
P
-pivot line
Column
Pivot
of computed element
Column

where:
P = pivot = aPI,K (a12 in this case)
E = eij,K
B = epj,K
C = eiI,K.
The following relationship is applied:
eij, (k 1)

EP BC
BC
E
P
P

## The next iteration looks like:

c1

c2

X2

a11/a12

X4

a21-a11a22/a12

k=1

-c1+c2a11/a12

0
1/a12

-a22/ a12

c2/a12

0
0
1
0

b1/a12
b2-b1a22/ a12
Z1=c2b1/a12

The iterations must be continued with another one (k+1), in the same manner. The named steps are repeated till the optimum
solution is identified or a cycling process is noticed indicating that more optimal solutions exist.
Finally, the verifying of the solutions is done by replacing the true variables X 1 ,..., Xn values in the initial constraints system, and
checking if they are fulfilled.
9

Example
Solve the following linear program:
4 X1 X2 6 X3 4

X1 X2 5 X3 3
X1 0 , X2 0 , X3 0

max Z 4 X1 X2 3X3

Solution
1. Standardize by adding the slack variables:
4 X1 X2 6 X3 X4 4

X1 X2 5 X3 X5 3
Xj 0 , j 1,...5

max Z 4 X1 X2 3X3 0 X4 0 X5

2. Elaboration of 0 iteration:
Tableau 1.1
4

-1

X4

-6

X5

k=0

-4

-3

0
10

3. There are negative solutions on the last row of the tableau, the optimum solution was not found yet.
4. The variable that enters in the base, XI,0, is X1 that has 1,0=-4.
5. The values of the criteria are:
11,0=b1,0/a11,0=4/4=1;
21,0=3/1=3
6. The outgoing variable, XE,k, is X4.
7. The pivot is marked in the complete tableau of the 0 iteration (see tableau 1.2.)
Tableau 1.2
4

-1

X4

-6

X5

k=0

-4

-3

Z0=0

## 8. Computation of the 1 iteration elements.

The detailed calculation is showed for same elements; the complete iteration 1 is presented in tableau 1.3 that has the basis variables
X1, X5.
11

a11,1 = 1 (pivot);
a21,1 = 1,1 = 0 (elements from the pivot column);
a12,1 = a12,0/a11,0 = 1/4 ;.....b1,1 = b1,0/a11,0 = 4/4 (elements from the pivot raw);
a22,1 = 1 - (1x1/4) = 3/4 and so on.
Tableau 1.3
4

-1

X1

1/4

-3/2

1/4

X5

3/4

26/4

-1/4

k=1

-9

Z1=4

Due to the fact that still negative values are on the last raw, the optimum was not reached. So, variable X3 which has 31=-9 will
enter in the basis and variable X5 will leave the basis as this variable satisfies the relation 6.5.
The next iteration is computed as follows:
Tableau 1.4
4

-1

X1

11/26

X3

3/26

-1/26

k=2

79/26

17/13

18/13

0
5/26

0
3/13

19/13
4/13
Z2=88/13

12

As one may notice the optimum was reached, the solution being:
X1 = 19/13=1.46
X2 = 0
X3 = 4/13=0.31
maxZ = Z2 = 88/13=6.78
The slack variables are 0.

The optimal solution is verified by replacing the real variables X1, X2, X3 into the initial system:
19
4 76 24 52
06

4
13
13
13
13
19
4 19 20 39
05

3
13
13
13
13

## Conclusion: the solution found is correct.

Bibliography
1. Loomba, N.P., "Linear Programming. A Managerial Perspective", McMillan, London, 1976.
2. Turban, E., Meredith, J. R., Fundamentals of Management Science, 4th ed. Business Publications, Inc., Plano, 1988.
3. Kallrath, J., Wilson, J.M., Business Optimisation using Mathematical programming, MacMillan, London, 1997.
4. Radu C., Stanciu D.R., Momete D.C., Management industrial aplicatii practice, Editura Bren, 2001.
13

Case study

The production program of a dyes section of a chemical enterprise has planned to produce during a month three products from the
gamut of alchylic dyes, symbolised with P1, P2, and P3. To produce them three types of equipments are used: dosage,
homogenisation and scrubbing.
The time consumption, expressed in hours, for each batch of product and each equipment category is as follows:

Product
P1

Dosage

Homogenisation

Scrubbing

P2

P3

## The equipment is available, in hours, as follows:

- dosage: 200
- homogenisation: 200
- scrubbing: 800
The unity profits are: 230 RON for P1, 300 RON for P2 and 700 RON for P3.
Elaborate the program of manufacture that insures the maximum profit. Which is that profit?
Find the slacks.

14