Primal Method in Linear Programming
Primal Method in Linear Programming
Samia Kerdjoudj
kerdjoudj_samia@[Link]
University of Blida 1.
2 novembre 2025
Chapter 3
Primal Method for Solving a Linear Program
Remarks
A linear programming problem is said to be in canonical form if :
All variables x1 , x2 , . . . , xn are required to be non-negative.
All other constraints are inequalities :
Minimization case : All constraints are of the form ≥ (i.e., lower
bound constraints).
Maximization case : All constraints are of the form ≤ (i.e., upper
bound constraints).
Remarks
A linear programming problem is said to be in canonical form if :
All variables x1 , x2 , . . . , xn are required to be non-negative.
All other constraints are inequalities :
Minimization case : All constraints are of the form ≥ (i.e., lower
bound constraints).
Maximization case : All constraints are of the form ≤ (i.e., upper
bound constraints).
Theorem
Every linear program can be transformed into an equivalent linear
program in canonical form.
Writing Rules
1 Any variable x ∈ R can be replaced by the difference of two
j
non-negative variables :
x′j = −xj ≥ 0
Writing Rules
1 Any equality constraint can be written as two inequality constraints :
n
X
aij xj ≤ b
n
X j=1
aij xj = b ≡ X n
j=1
aij xj ≥ b
j=1
LP in General Form
max(Z) = x1 − x2 − x3
5x + x2 + x3 ≥ 30
1
(P ) 4x1 − x2 − x3 = 5
x1 + x2 − x3 ≤ 10
x ≥ 0, x ≤ 0, x ∈ R
1 2 3
Transformations
1 Let x′ = −x ≥ 0
2 2
max(Z) = x1 + x′2 − x′3 + x′′3
−5x1 + x′2 − x′3 + x′′3 ≤ −30
4x1 + x′ − x′ + x′′ ≤ 5
2 3 3
(Pc )
−4x1 − x2 + x3 − x′′3 ≤ −5
′ ′
′ ′ ′′
x1 − x2 + x3 − x3 ≤ 10
x1 , x′2 , x′3 , x′′3 ≥ 0
LP in General Form
min(Z) = 7x1 + x2 + 10x3
x + x2 + x3 ≤ 20
1
(P ) 5x1 − 3x2 + x3 = 25
2x1 − x2 + x3 ≥ 10
x ≤ 0, x ≥ 0, x ∈ R
1 2 3
Transformations
1 Let x′ = −x ≥ 0
1 1
min(Z) = −7x′1 + x2 + 10x′3 − 10x′′3
′
x1 − x2 − x′3 + x′′3 ≥ −20
5x′ + 3x2 − x′ + x′′ ≥ −25
1 3 3
(Pc )
−5x1 − 3x2 + x3 − x′′3 ≥ 25
′ ′
′ ′ ′′
−2x1 − x2 + x3 − x3 ≥ 10
′
x1 , x2 , x′3 , x′′3 ≥ 0
Example :
Standard Form
n
X
max or min(Z) = cj xj
j=1
Xn
(Ps )
s.t aij xj = bi , ∀i ∈ {1, 2, · · · , m}
j=1
xj ≥ 0, ∀j ∈ {1, 2, · · · , n}
Remarks
A linear programming problem is said to be in standard form if :
All variables x1 , x2 , . . . , xn are required to be non-negative.
All constraints (other than variable non-negativity) are expressed
as equalities.
Remarks
A linear programming problem is said to be in standard form if :
All variables x1 , x2 , . . . , xn are required to be non-negative.
All constraints (other than variable non-negativity) are expressed
as equalities.
Theorem
Every linear program can be transformed into an equivalent linear
program in standard form.
a11 a12 ··· a1n
a21 a22 ··· a2n
Let A =
.. .. .. ..
be the constraint matrix (m × n) .
. . . .
am1 am2 · · · amn
We define :
Rank of a Matrix
Let A be an (m × n)-matrix.
1 The rank of A, denoted by rg(A), is the maximum number of
linearly independent columns (or rows) of A.
2 The matrix A is said to be of full rank if rg(A) = m.
Theorem
Let the system S = {AX = b} where A ∈ Rm×n , X ∈ Rn×1 , and
b ∈ Rm×1 .
Let (A|b) be the augmented matrix of S.
1 If rg(A) < rg(A|b), then S is inconsistent and has no solution.
2 If rg(A) = rg(A|b), then S is consistent. Furthermore :
If rg(A) < m, then S is redundant.
If rg(A) = m, then :
If m = n, then S has a unique solution X = A−1 b.
If m < n, then S has infinitely many solutions.
Remarks
1 Under the full rank assumption, at least one non-empty basis exists.
n
2 There are at most m possible basiss.
3 Without loss of generality, by reordering the columns of A, we can always
write the following block decompositions :
A = (AJ A!
J
), AJ is the matrix formed by the columns Aj , j ∈
/ J.
XJ
X= .
XJ
The system AX = b is equivalent to : AJ XJ + AJ XJ = b.
AX = b ⇒ AJ XJ + AJ XJ = b
Example
Determine the basic solutions and the basic feasible solutions of the
following linear program :
max(Z) = 2x1 +3x2
x1 +x2 ≤ 6
(P )
x2 ≤3
x1 , x2 ≥0
Standard Form of (P )
max(Z) = 2x1 +3x2
x1 +x2 +x3 =6
(Ps )
x2 +x4 = 3
x1 , x2 , x3 , x4 ≥0
Standard Form of (P )
max(Z) = 2x1 +3x2
x1 +x2 +x3 =6
(Ps )
x2 +x4 = 3
x1 , x2 , x3 , x4 ≥0
Standard Form of (P )
max(Z) = 2x1 +3x2
x1 +x2 +x3 =6
(Ps )
x2 +x4 = 3
x1 , x2 , x3 , x4 ≥0
Standard Form of (P )
max(Z) = 2x1 +3x2
x1 +x2 +x3 =6
(Ps )
x2 +x4 = 3
x1 , x2 , x3 , x4 ≥0
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
! x1 !
1 1 1 0 x 6
AX = b ⇔ . 2 =
0 1 0 1 x 3 3
x4
! ! ! !
x2
J5 −1 1 0 6 6
XJ5 = = A ×b= = ⇐ x4 ≤ 0
x4 −1 1 3 −3
! x1 !
1 1 1 0 x 6
2
AX = b ⇔ . =
0 1 0 1 x 3 3
x4
Corollary
If there is an optimal solution, then there is an optimal basic feasible
solution.
Geometric Interpretation
Solving a linear program means walking along the edges of the feasible
region from vertex to vertex, seeking the one that maximizes (or
minimizes) the objective.
Example
max(Z) = 2x1 +3x2
x1 +x2 ≤6
(P )
x2 ≤3
x1 , x2 ≥0
x2
E non-feasible basis
D
D feasible basis
x1
feasible basis A
x1 + x2 = 6
max(Z) = 2x1 +3x2
x1 +x2 ≤6
(P )
x2 ≤3
x , x2 ≥0
1
Definition
A linear program written in standard form is said to be in canonical
form for a basis J if :
1 AJ is, up to a permutation of its columns, the identity matrix Im .
2 For all j ∈ J, C j = 0.
max(Z) = 4x1 +5x2
2x1 +x2 +x3 =8
(P ) x1 +2x2 +x4 =7
x2 +x5 = 3
x , 1 x2 ,
x3 , x4 , x5 ≥0
1 0 0
If J = {3, 4, 5}, then A = I3 = 0 1 0
J J
and C = (0, 0, 0).
0 0 1
Hence (P ) is written in canonical form for thebasis
J.
x1 0
x2 0
Moreover, the BFS associated with J is X = x3 = 8
x 7
4
x5 3
S. Kerdjoudj Linear programming 45/62
Canonical form for a basis of a linear programming Examples
max(Z) = 8x1 −9x3
2x1 +x2 +x3 =3
(P ) x1 +2x3 +x4 =2
x3 +x5 = 3
x1 , x2 , x3 ,
x5 x4 ,
≥0
1 0 0
If J = {2, 4, 5}, then A = I3 = 0 1 0
J J
and C = (0, 0, 0).
0 0 1
Hence (P ) is written in canonical form for thebasis
J.
x1 0
x2 3
Moreover, the BFS associated with J is X = x3 = 0
x 2
4
x5 3
S. Kerdjoudj Linear programming 46/62
Canonical form for a basis of a linear programming Examples
max(Z) = 4x1 +5x2 −x4
2x1 +x2 +x3 =8
(P ) x1 +2x2 +x4 =7
x2 +x5 = 3
x1 , x2 ,
x3 , x4 , x5 ≥0
1 0 0
If J = {3, 4, 5}, then AJ = I3 =
0 1 0 and C J = (0, −1, 0) 6= 0.
0 0 1
Hence (P ) is not written in canonical form for the basis J.
max(Z) − α = C J − πAJ X
J
−1 J
J −1 b
(P C) ≡ (P ) s.c X J + AJ A X = A
J
XJ , XJ ≥ 0
Summary
The LP in canonical form for the basis J can be written as
b
max(Z) − α
= CX
(P C) s.t b =b
AX b
X≥0
where
1 Ab = AJ −1 × A. 3 b = C − C J × A.
C b
2 bb = AJ −1 × b. 4 α = C J × bb.
Example
Write the following linear program in canonical form for the bases
J1 = {1, 2} and J2 = {1, 4}.
max(Z) = 2x1 +x2 +6x3 −2x4 +5x5
x1 +x2 +3x3 −x4 +4x5 = 4
(P )
x2 +2x3 +x4 +2x5 = 3
x1 , x2 , x3 , x4 , x5 ≥0
! !
1 1 3 −1 4 4
A= b=
0 1 2
2 1 3
t
C = 2 1 6 −2 5 X = x1 x2 x3 x4 x5
t t
X = x1 x2 x3 x4 x5 = 1 3 0 0 0 is the basic solution
associated with J1 , with Z(X) = 5.
( (
x1 +x3 −2x4 +2x5 = 1 x1 = 1 − x3 + 2x4 − 2x5
⇒
+x2 +2x3 +x4 +2x5 = 3 x2 = 3 − 2x3 − x4 − 2x5
Therefore
( (
x1 +2x2 +5x3 +6x5 = 7 x1 = 7 − 2x2 − 5x3 − 6x5
⇒
+x2 +2x3 +x4 +2x5 = 3 x4 = 3 − x2 − 2x3 − 2x5
t t
X = x1 x2 x3 x4 x5 = 7 0 0 3 0 is the basic feasible
solution associated with J1 with Z(X) = 8
Example
In the previous example
max(Z) = 2x1 +x2 +6x3 −2x4 + x5
x1 +x2 +3x3 − x4 +4x5 = 4
(P )
x2 +2x3 + x4 +2x5 = 3
x1 , x2 , x3 , x4 , x5 ≥0