0% found this document useful (0 votes)
4 views12 pages

3 Matrix Formulation

Opti matrix

Uploaded by

f20220818
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)
4 views12 pages

3 Matrix Formulation

Opti matrix

Uploaded by

f20220818
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/ 12

MATRIX FORMULATION

of
LINEAR PROGRAMMING PROBLEM

Dr. Anil Kumar


A-408

Consider the following LPP (in standard form)

Max (or Min) z = c1 x1 + c2 x2 + ... + cn xn


Subject to the constraints
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1 + a22 x2 + ... + a2 n xn = b2

am1 x1 + am 2 x2 + ... + amn xn = bm
x1 , x2 ,..., xn ³ 0
b1 , b2 ,..., bm ³ 0
Anil Kumar, BITS Goa 2
Using the notations

c = [c1 , c2 ,…, cn ],

é x1 ù é b1 ù é a11 a12 . . a1n ù


êx ú êb ú êa a22 . . a2 n úú
ê 2ú ê 2ú ê 21
X = ê . ú, b = ê . ú, A=ê . ú.
ê ú ê ú ê ú
ê.ú ê . ú ê . ú
êë xn úû êëbm úû êë am1 am 2 . . amn úû

Anil Kumar, BITS Goa 3

We can write LPP in Matrix Form as follows:

Maximize (or Minimize) z = c X


subject to AX = b
X ≥ 0, b ≥ 0.

The problem can be written equivalently as

1 −# & 0
= (1)
0 % ' )

Anil Kumar, BITS Goa 4


Let B be an m×m non-singular sub-matrix of the coefficient
matrix A.
Let XB be the corresponding set of basic variables with cB as its
associated objective vector.
The corresponding solution (and the objective function value)
may be computed as follows:

æ 1 -cB ö æ z ö æ0ö
ç ÷ ç ÷= ç ÷
è 0 B ø è XB ø èb ø
-1
æ z ö æ 1 -cB ö æ 0 ö æ 1 cB B ö æ 0 ö æ cB B b ö
-1 -1

ç ÷=ç ÷ ç ÷ =ç -1 ÷ ç ÷
b
= ç -1 ÷
X
è Bø è 0 B b
ø è ø è 0 B øè ø è B b ø
Anil Kumar, BITS Goa 5

Then the complete simplex tableau in matrix form can be derived


from the original standard equations as:

æ 1 cB B-1 ö æ 1 -c ö æ z ö æ 1 cB B-1 ö æ 0 ö
ç -1 ÷ ç ÷ç ÷=ç -1 ÷ ç ÷
è0 B ø è 0 A ø è ø è 0 B ø èb ø
X

Multiplying out the matrices, we get

æ 1 cB B-1A - c ö æ z ö æ cB B-1 b ö
ç -1 ÷ ç ÷ = ç -1 ÷
è0 B A ø èXø è B b ø

Anil Kumar, BITS Goa 6


é1 ù
ê0ú
ê ú
Thus, in the new simplex tableau, the z column will be ê  ú
ê ú
ë0û
The column of xj (in the constraint equations) will be
B-1 Aj , where Aj is the jth column of A.

The solution column will be B-1 b .

In the z-row, the coefficient of xj will be cBB-1 Aj - c j = z j - c j

Finally, the solution entry in the z-row will be cBB -1 b

Anil Kumar, BITS Goa 7

In matrix form the new tableau will look like

Basic z X Solution
z 1 cB B-1 A - c c B B -1 b

XB 0 B A-1
B-1 b

8
Anil Kumar, BITS Goa
In terms of the components xj , the new tableau will
look like

Basic z xj Solution

z 1 cB B-1 Aj - c j c B B -1 b

XB 0 -1
B Aj B-1 b

Anil Kumar, BITS Goa 9

Example: Consider the following LPP


Maximize
z = x1 - x2 + 2 x3
subject to 2 x1 - 2 x2 + 3x3 £ 5
x1 + x2 - x3 £ 3
x1 - x2 + x3 £ 2
x1 , x2 , x3 ³ 0
After introducing the slack variables s1 , s2 , s3 to the respective
constraints, the problem becomes

Maximize z = x1 - x2 + 2 x3

Subject to 2 x1 - 2 x2 + 3x3 + s1 =5
x1 + x2 - x3 + s2 =3
x1 - x2 + x3 + s3 = 2
x1 , x2 , x3 , s1 , s2 , s3 ³ 0

So the starting simplex tableau is

Basic z x1 x2 x3 x4 x5 x6 Sol

z 1 -1 1 -2 0 0 0 0
s1 0 2 -2 3 1 0 0 5
s2 0 1 1 -1 0 1 0 3
s3 0 1 -1 1 0 0 1 2

Anil Kumar, BITS Goa 12


After we apply the simplex method a portion of the tableau
is as follows:

Basic z x1 x2 x3 s1 s2 s3 Sol

z 1 1 1
x2 3
0 1 0
s3 0 0 1 1
x3 0 1 2 0
Identify the missing numbers.
Anil Kumar, BITS Goa 13

Simplex Table

Basic z xj Solution

z 1 cB B-1 Aj - c j c B B -1 b
-1
XB 0 B Aj -1 B b

Anil Kumar, BITS Goa 14


Since x2 , s3 , x3 are the basic variables in the final tableau
in that order, the basic matrix B is formed by the columns
corresponding to these variables in the starting tableau in
that order.
é -2 0 3ù
B = êê 1 0 -1úú
êë -1 1 1úû

Anil Kumar, BITS Goa 15

é1 3 0 ù
B-1 = êê0 1 1 úú
êë1 2 0 úû
The new column corresponding to x1 in the final tableau is

é1 3 0 ù é 2 ù é 5 ù
B-1 A1 = êê0 1 1 úú êê1 úú = êê 2úú
êë1 2 0 úû êë1 úû êë 4úû

Anil Kumar, BITS Goa 16


The new column corresponding to x2 in the final tableau
is 1 é ù
ê0ú
ê ú
êë 0 úû
as it is the first basic variable in the final tableau.
The new column corresponding to x3 in the final tableau is

é0ù
ê0ú
ê ú as it is the third basic variable in
êë 1 úû the final tableau.
Anil Kumar, BITS Goa 17

The solution column (in the constraint equations) in the


final tableau is
é1 3 0ù é5 ù é14 ù
B-1b = êê0 1 1úú êê3úú = êê 5 úú Now CB = [-1 0 2]
êë1 2 0úû êë 2úû êë11úû
Thus, entry below x1 in z-row is CB B-1 A1 - c1 = 3-1=2
Entries below x2, x3 in z-row are zero as they are basic
variables.
Finally, sol. = z = CB B-1b = [ -1 0 2] é14 ù
ê5ú =8
ê ú
êë11úû
Anil Kumar, BITS Goa 18
All these are shown below.
Answer:

Basic z x1 x2 x3 s1 s2 s3 Sol

z 1 2 0 0 1 1 0 8
x2 0 5 1 0 1 3 0 14
s3 0 2 0 0 0 1 1 5
x3 0 4 0 1 1 2 0 11

Anil Kumar, BITS Goa 19

Example 2: Consider the following LPP


Maximize z = 4 x1 + 3x2 + x3 + 2 x4
subject to

4 x1 + 2 x2 + x3 + x4 £ 5
3x1 + x2 + 2 x3 + x4 £ 4
x1 , x2 , x3 , x4 ³ 0
After we apply the Simplex method a portion of the final
tableau is as follows:

Basic z x1 x2 x3 x4 s1 s2 Sol

z 1 1 1
x2 0 -1
x4 0

Find the missing entries.

Anil Kumar, BITS Goa 22

All these are shown below.

Answer:

Basic z x1 x2 x3 x4 s1 s2 Sol

z 1 3 0 2 0 1 1 9
x2 0 1 1 -1 0 1 -1 1
x4 0 2 0 3 1 -1 2 3

Anil Kumar, BITS Goa 23


Example
• Given optimal simplex tableau

Basic x1 x2 x3 x4 x5 solution

z 0 0 0 3 2 ?
x3 0 0 1 1 -1 2
x2 0 1 0 1 0 6
x1 1 0 0 -1 1 2
where x3, x4, and x5 are slack variables.

• Reconstruct the original LPP.

Anil Kumar, BITS Goa 24

Example

• Prepare the simplex tableau when [R1, s1, x2] are the basic
variables for the following LPP.

max $ = 5'! + 6'" − +,!


subject to
−2'! + 3'" + ,! = 3
'! +2'" + 0! =5
6'! + 7'" + 0" =3
where '! , '" , 0! , 0" , ,! ≥ 0.

Anil Kumar, BITS Goa 25

You might also like