17
Example Question on Linear Program, Dual and NP-Complete Proof COT5405 Spring 11

Example Question on Linear Program, Dual and NP-Complete Proof

Embed Size (px)

DESCRIPTION

Example Question on Linear Program, Dual and NP-Complete Proof. COT5405 Spring 11. Question. Given an undirected connected graph G = ( V,E ) and a positive integer k ≤ | V|. T wo vertices u and v are connected if and only if there exists at least one path from u to v. - PowerPoint PPT Presentation

Citation preview

Page 1: Example Question on  Linear Program, Dual and  NP-Complete Proof

Example Question on Linear Program, Dual and

NP-Complete Proof

COT5405 Spring 11

Page 2: Example Question on  Linear Program, Dual and  NP-Complete Proof

Question

• Given an undirected connected graph G = (V,E) and a positive integer k ≤ |V|.

• Two vertices u and v are connected if and only if there exists at least one path from u to v.

• For all the possible vertex pairs, we want to remove k vertices from G, so that

• the number of connected vertex pairs in the resulting graph is minimized.

• We call it k-CNP (critical node problem)

Page 3: Example Question on  Linear Program, Dual and  NP-Complete Proof

Integer Program

• Variables:– uij = 1 if vertex i and j are connected in the

resulted graph, otherwise uij = 0. Note uii = 1.

– vi = 1 if vertex i is removed, otherwise vi = 0.

• The objective function and 2 constraints

,

1min

2 iji j V

u vi vj uij

1 1 01 0 00 1 00 0 1

( , ) , 1i j i ji j E u v v

ii V

v k

Page 4: Example Question on  Linear Program, Dual and  NP-Complete Proof

Leftover Connectivity

• Consider node pairs i and j, where (i,j) is NOT an edge.

1, ( , , )ij jh hiu u u i j h V i

j

h

i

j

hUij Ujh Uhi

1 1 1

1 0 0

0 1 0

0 0 X

Page 5: Example Question on  Linear Program, Dual and  NP-Complete Proof

Final Formulation

Page 6: Example Question on  Linear Program, Dual and  NP-Complete Proof

LP relaxation

Page 7: Example Question on  Linear Program, Dual and  NP-Complete Proof

Dual

. .

0

j jj

ij j ij

j

Min c X

s t a X b for all i

X for all j

. .

0

i ii

i ij ji

i

Max y b

s t y a c for all j

y for all i

Page 8: Example Question on  Linear Program, Dual and  NP-Complete Proof

12 13 1,

2

2

1 1 1 1 1 ( , , , )( ) '

2 2 2 2 2

. .

1 0 0 0 0 0 0 0 0 0 1 1 0

1 1 1 0 0 0 0 0 0 0 0 0 0

1 1 1 0 0 0 0 0 0 0 0 0 0

1 1 1 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 1 1 1

n n

n

n

n

Min u u u

s t

12

13

23

1,

1

1

1

1

1

1n n

n

u

u

u

u

v

v

k

|E| rows

33

nrows

1 row

Page 9: Example Question on  Linear Program, Dual and  NP-Complete Proof

Ready to write dual

• How many constraints in Primal –• How many constraints in Dual – • Dual variable– For the constraint on (i,j) belonging to E, define xij

– For the constraint on i,j,h belonging to V, define yijh

– For the constraint on the aggregate vi, define z

3 | | 13

nE

2

n

(3 | | 1)dimension in total3

nE

Page 10: Example Question on  Linear Program, Dual and  NP-Complete Proof

12 123

3 | | 13

33| |

(1,1, , 1, 1, 1 , )( ) '

. .

1 1 1 1 0

0 1 1 1 0

0 1 1 1

1 0 0 0 1

1 0 0 0 1

0 0 0 0 1

0 0 0 0 1

nE

n

E

Max k x y z

s t

12

13

123

312

132

1

21

2

1

21

21

2

0

0

0

x

x

y

y

y

z

Page 11: Example Question on  Linear Program, Dual and  NP-Complete Proof

Final Dual

Page 12: Example Question on  Linear Program, Dual and  NP-Complete Proof

NP-Complete Proof

• Decision Version– Given an undirected connected graph G and

positive integer k– a value L<n(n-1)/2– is there a set of k vertices, whose removal makes

the number of connected vertex pairs in the resulting graph is at most L?

Page 13: Example Question on  Linear Program, Dual and  NP-Complete Proof

In NP

• Given such a set of k vertices,• Remove them from the graph,• Calculate the number of connected pairs using

DFS or BFS in polynomial time,• Compare with L – Give answer: Yes or No

Page 14: Example Question on  Linear Program, Dual and  NP-Complete Proof

Is NP-hard

Reduction from Vertex Cover (VC)• Instance of VC: given a graph G = (V,E) where |

V|= n, is there a vertex cover of size at most k?• Instance of k-CNP: on the graph G, is there a

set of k vertices whose removal makes the # of connected pairs 0?

Page 15: Example Question on  Linear Program, Dual and  NP-Complete Proof

Is NP-hard

• Forward: If we can have a VC of size k ---> delete those k nodes ---> connectivity = 0

• Backward: If we can delete k nodes to make # connections 0 --> no edges left -> vertex cover of size k

Page 16: Example Question on  Linear Program, Dual and  NP-Complete Proof

NP-Completeness

• In NP• NP-hard• For an alternative proof, please refer toA. Arulselvan et al, ``Detecting Critical Nodes In Sparse Graphs’’, J. Computers and Operations Research, 2009.http://plaza.ufl.edu/clayton8/cnp.pdf

Page 17: Example Question on  Linear Program, Dual and  NP-Complete Proof

Thank You

Q & A