Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal...

19
Primal and Dual Example (1) Primal: min x 1 + 2x 2 s.t. 2x 1 + x 2 7 -x 1 + 3x 2 1 x 1 + 4x 2 5 x 1 , x 2 0 Dual: 136 p , . P2 p , Max 7- p , t pz t 5ps Zp , - Pz t Ps E I p , t 3Pa t 4ps E 2 Pj a O Hj

Transcript of Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal...

Page 1: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Example (1)Primal:

min x1 + 2x2s.t. 2x1 + x2 � 7

�x1 + 3x2 � 1

x1 + 4x2 � 5

x1, x2 � 0

Dual:

136

← p , .

← P2

← p ,

Max 7-p ,t pz t 5ps

Zp ,- Pz t Ps E I

p ,t 3Pa t 4ps E 2

Pj a O Hj

Page 2: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Example (2)Primal:

min �x1 + 4x2s.t. 3x1 + 2x2 � 9

x1 � 3x2 3

x1, x2 � 0

Dual:

137

← Pi

⇒ - x.

+3×22-3← Pi

pz := - pz'

ma×9p ,- 3pz

'

⇒ Max 9p , -13psSt

. 3ps ,- pi E - I Set 3ps , -cpzE - I

2ps , -13ps'

E 4 2ps , -3pct c

p ,ZO p ,

so

pi ZO past

Page 3: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Example (3)Primal:

min �x1 + 4x2s.t. 3x1 + 2x2 � 9

x1 � 3x2 = 3

x1, x2 � 0

Dual:

138

←Pi

{ × . -3×223 ← pi- x -13×27-3 2- pic

pi . - pi -pi'

max 9p,t3( poi - pi ) ⇐ Max Gp,a 3ps

Setspit ( pi - pz

" ) E - I sit. 3p,tpzE - I

2. p , -31ps'- pi

' ) -24 2p , -3ps E 4

p , 20 p , so

pi ZOpz free

Pz" ZO

Page 4: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Linear ProgramConsider the general linear program:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Obtain a lower bound:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

The linear program on the right hand side is the dual linear program of the primal linear

program on the left hand side.

139

pi 20for ie M,

pi EO for ie Mzpi free for ie My

Page 5: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Linear ProgramConsider the general linear program:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Obtain a lower bound:

max pT · bs.t.

pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

The linear program on the right hand side is the dual linear program of the primal linear

program on the left hand side.

139

Aj .

p E Cj for j E N,

Aj . pZ

Cj for je Nz

Aj . p = Cj for je Nz

Page 6: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Linear ProgramConsider the general linear program:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Obtain a lower bound:

max pT · bs.t.

pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

The linear program on the right hand side is the dual linear program of the primal linear

program on the left hand side.

139

Max ptbs

. t .

Page 7: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Linear ProgramConsider the general linear program:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Obtain a lower bound:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

The linear program on the right hand side is the dual linear program of the primal linear

program on the left hand side.

139

Page 8: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Linear ProgramConsider the general linear program:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Obtain a lower bound:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

The linear program on the right hand side is the dual linear program of the primal linear

program on the left hand side.

139

This is a definition I

Page 9: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Primal and Dual Variables and Constraints

primal LP (minimize) dual LP (maximize)

� bi � 0

constraints bi 0 variables

= bi free

� 0 ci

variables 0 � ci constraints

free = ci

140

Page 10: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Examples

primal LP dual LP

min cT · xs.t. A · x � b

max pT · bs.t. AT · p = c

p � 0

min cT · xs.t. A · x = b

x � 0

max pT · bs.t. AT · p c

141

X free

p free

Page 11: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Basic Properties of the Dual Linear Program

Theorem 4.1.

The dual of the dual LP is the primal LP.

Proof:

Primal in general form:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Dual:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

142

Max ptbS.t. pi

so i c- M,

pi E 0 ie Mzpi free ie Mz

Afp E Cj JEN ,

Aj p 2 Cj je Nz

Aj p = Cj j E Ng

Page 12: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Basic Properties of the Dual Linear Program

Theorem 4.1.

The dual of the dual LP is the primal LP.

Proof:

Primal in general form:

min cT · xs.t. ai

T · x � bi for i 2 M1

aiT · x bi for i 2 M2

aiT · x = bi for i 2 M3

xj � 0 for j 2 N1

xj 0 for j 2 N2

xj free for j 2 N3

Dual:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

142

Page 13: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Basic Properties of the Dual Linear ProgramProof (cont.):

Dual:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

Dual (in primal form):

min �pT · bs.t. � AT

j · p � �cj for j 2 N1

� ATj · p �cj for j 2 N2

� ATj · p = �cj for j 2 N3

pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

143

min - PT b

S .t

.

11

Page 14: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Basic Properties of the Dual Linear ProgramProof (cont.):

Dual:

max pT · bs.t. pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

ATj · p cj for j 2 N1

ATj · p � cj for j 2 N2

ATj · p = cj for j 2 N3

Dual (in primal form):

min �pT · bs.t. � AT

j · p � �cj for j 2 N1

� ATj · p �cj for j 2 N2

� ATj · p = �cj for j 2 N3

pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

143

. C - I )

. ( - I )

. C - l )

Page 15: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Basic Properties of the Dual Linear ProgramProof (cont.):

Dual (in primal form):

min �pT · bs.t. � AT

j · p � �cj for j 2 N1

� ATj · p �cj for j 2 N2

� ATj · p = �cj for j 2 N3

pi � 0 for i 2 M1

pi 0 for i 2 M2

pi free for i 2 M3

Dual of Dual:

144

mat - CtxSrt

. xjso jeNiXj Ed jerkXj free JENS

- air E - bijEM

,

- air 2 - bi i E M2

- air = - bi ie Mg

Page 16: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Equavalence of the Dual LP

Theorem 4.2.

Let ⇧1 and ⇧2 be two LPs where ⇧2 has been obtained from ⇧1 by (several)

transformations of the following type:

i replace a free variable by the difference of two non-negative variables;

ii introduce a slack variable in order to replace an inequality constraint by an

equation;

iii if some row of a feasible equality system is a linear combination of the other rows,

eliminate this row.

Then the dual of ⇧1 is equivalent to the dual of ⇧2.

145

Page 17: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Weak Duality Theorem

Theorem 4.3.

If x is a feasible solution to the primal LP (minimization problem) and p a feasible

solution to the dual LP (maximization problem), then

cT · x � pT · b .

Corollary 4.4.

Consider a primal-dual pair of linear programs as above.

a If the primal LP is unbounded (i. e., optimal cost = �1), then the dual LP is

infeasible.

b If the dual LP is unbounded (i. e., optimal cost = 1), then the primal LP is

infeasible.

c If x and p are feasible solutions to the primal and dual LP, resp., and if

cT · x = pT · b, then x and p are optimal solutions.

146

Page 18: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

Weak Duality Theorem

Theorem 4.3.

If x is a feasible solution to the primal LP (minimization problem) and p a feasible

solution to the dual LP (maximization problem), then

cT · x � pT · b .

Corollary 4.4.

Consider a primal-dual pair of linear programs as above.

a If the primal LP is unbounded (i. e., optimal cost = �1), then the dual LP is

infeasible.

b If the dual LP is unbounded (i. e., optimal cost = 1), then the primal LP is

infeasible.

c If x and p are feasible solutions to the primal and dual LP, resp., and if

cT · x = pT · b, then x and p are optimal solutions.

146

Page 19: Primal and Dual Example (1) - University of Liverpoolgairing/COMP557/board/20181030.pdf · Primal and Dual Linear Program Consider the general linear program: min cT ·x s.t. ai T

146 - 1

Proof of Them 4.2 :

-By Them 4.2 we way assume that primal CP ) and

dual CD ) are of the form :

m

C P ) min Ctx = IE.

cjxj (D) maxptb = ?,

bi piset Atsb n St

. Atp EC m

× so ? .aijxjsbi

,-Vi

p so⑨

¥,aijpi Ecj

Xiao Ki Kjpj 20

Kj