set problems vertex cover, dominating set, clique, independent set

54
Set problems Vertex Cover, Dominating set, Clique, Independent set

Post on 20-Jan-2016

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems

Vertex Cover, Dominating set,

Clique, Independent set

Page 2: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems2

This lecture

• Several basic graph problems:– Finding subsets of vertices or edges with simple

property – as small or as large as possible– Relations

• Approximation Algorithms

• Special cases and a brief introduction to some important graph classes

Page 3: Set problems Vertex Cover, Dominating set, Clique, Independent set

1

Stating the problems

Page 4: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems4

Vertex cover

• Set of vertices W V with for all {x,y} E: x W or y W.

• Vertex Cover problem:– Given G, find vertex cover of minimum size

Page 5: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems5

Dominating Set

• Set of vertices W such that for all v V: v W or v has a neighbor w with w W.

• Dominating Set problem: find dominating set of minimum size

• E.g.: facility location problems

Page 6: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems6

Clique and Independent Set

• Clique: Set of vertices W with for all v, w W: {v,w} E.

• Independent set: Set of vertices W with for all v, w W: {v,w} E.

• Clique problem: find largest clique.

• Independent set problem: find largest independent set

Page 7: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems7

Relations

• The following are equivalent– G has an independent set with at least k vertices– The complement of G has a clique with at least

k vertices– G has a vertex cover with at most n-k vertices

Page 8: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems8

NP-complete

• Each of the following problems is NP-complete:– Decide if given graph G has vertex cover of size at

most a given integer K– Decide if given graph G has dominating set of size at

most a given integer K– Decide if given graph G has independent set of size at

least a given integer K– Decide if given graph G has clique of size at least a

given integer K

• Proofs omitted in this lecture

Page 9: Set problems Vertex Cover, Dominating set, Clique, Independent set

2

On approximation 1:

Clique and Independent Set

Page 10: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems10

Approximation

• Clique, IS are very hard to approximate• Ratio 2 approximation algorithm for Vertex Cover

– H = G, S =

– repeat until H is empty• Select an edge {v,w} . Put v and w in S, and remove v, w,

and all adjacent edges from H

• Proof of ratio: for each selected two vertices, at least one belongs to optimal solution

Page 11: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems11

Warning

• The vertex cover approximation does NOT give a ratio for an approximation for Clique or Independent Set– E.g., take a graph with 1000 vertices and a vertex cover

of size 498.

Page 12: Set problems Vertex Cover, Dominating set, Clique, Independent set

3

Approximating Set Cover and Dominating Set

Page 13: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems13

Approximating Dominating Seton general graphs

• Can be done with ratio O( log n)• Here: algorithm for generalization: set covering

problem• Given: set X, collection C of subsets of X• Find: smallest number of sets from C such that its

union is X.– From DS to Set Covering: For each vertex v, take a set

Sv in the collection, with Sv = {v} N(v).

Page 14: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems14

Greedy approximation of Set Covering problem

• U = X• A = • while U • do

– Select an S from C with maximum | S U|– A = A {S}– U = U – S

• Output A

Page 15: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems15

Ratio

• H(n) = i=1…n 1/i

• Theorem. Greedy algorithm gives a number of sets that is at most H( max{|S| | S C}) times the optimal number of sets.

• Corollary: Greedy algorithm has ratio O(log n).

Page 16: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems16

Proof (1)

• Assign a cost 1 to each selected set.• Spread this cost evenly over the newly

covered elements, cx.• Say A* is optimal solution, A solution by

algorithm.• |A| = x X cx S A* x S cx

• We’ll proof: x S cx H(|S|)• That proves the theorem.

Page 17: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems17

x S cx H(|S|)

• Consider some S in C.• Write ui = number of elements of S that still are in U

after i sets have been taken = |S – (S1 … Si)|. u0 = |S|.

• Suppose uk = 0; uk-1 >0.• ui-1 – ui > 0 elements from S were covered for the first

time by Si. x S cx = i=1…k (ui-1 – ui)* 1/|Si –(S1 … Si-1)|

i=1…k (ui-1 – ui)/ ui-1

Page 18: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems18

Proof continues

x S cx i=1…k (ui-1 – ui)/ ui-1 i=1…k (H(ui-1) – H(ui)) = H(u0) – H(uk) =H(|S|) – 0.

• Use H(b) – H(a) (b – a)/b

• Now we showed: x S cx H(|S|)

Page 19: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems19

Comments

• (I)LP methods work also: log n ratio

• O(log n) is the best one can hope for unless P=NP

Page 20: Set problems Vertex Cover, Dominating set, Clique, Independent set

4

Bipartite graphs

Page 21: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems21

Vertex cover in bipartite graphs

• In a bipartite graph: the minimum size of a vertex cover equals the maximum size of a matching– If we have a matching: each edge must have an

endpoint in the vertex cover

– In the other direction:

• Let X be a vertex cover. Take flow model. Look at the edges from s to vertices in X, and from vertices in X to t. These form a cut. Now use the min-cut max-flow theorem.

Page 22: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems22

Bipartite graphs

• We saw: min vertex cover in bipartite graph equals maximum matching

• Corollary: Independent Set in bipartite graphs is polynomial time computable

Page 23: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems23

Special cases for Independent Set

• For many types of graphs (e.g., planar) IS stays NP-complete when restricted to these graphs.

• Some special cases are polynomial– Trees, bounded treewidth– Bipartite graphs– Interval graphs, circular arc graphs

Page 24: Set problems Vertex Cover, Dominating set, Clique, Independent set

5

Interval graphs and generalizations

Page 25: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems25

Interval graphs

• Each vertex represents an interval• Edge between two vertices when their intervals

have non-empty intersection• Independent set on interval graphs models room-

booking problem

Page 26: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems26

Greedy algorithmson interval graphs

• Greedy algorithm for IS on interval graphs is optimal:– Repeat:

• Select vertex v with leftmost right-endpoint of interval

• Remove v and its neighbors

• Clique is trivial on interval graphs

Page 27: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems27

Circular arc graphs

• Like interval graphs, but now `intervals on a circle’ (model of repeating time…)

• If we remove a vertex and its neighbors from an circular arc graph, then we get an interval graph

• Algorithm, e.g.:– for all vertices v do

• Compute the maximum independent set of G minus v and its neighbors

– If the largest i.s. is found for v*, output that set with v* added.

Page 28: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems28

Perfect graphs• A graph G is perfect if for each induced subgraph

H of G: the size of the maximum clique in H equals the chromatic number of H (nb. of colors needed to `vertex color H’).

• Strong perfect graph theorem (conjectured Berge 1966, proven Chudnowsky et al., 2002).– G is perfect, if and only if G does not contain an

induced subgraph that is a cycle without additional edges of odd length at least four, and the complement of G also does not contain such a cycle. (`No odd hole or antihole’)

Page 29: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems29

Coloring and independent set in perfect graphs

• Polynomial time algorithm for finding the maximum independent set and the coloring number of a perfect graph– Grötschel, Lovasz, Schrijver (1981)– Uses Linear Programming methods

Page 30: Set problems Vertex Cover, Dominating set, Clique, Independent set

6

Approximating facility location

Page 31: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems31

Facility location

• In a town, we want to place a number of facilities (e.g., fire stations, hospitals, …), such that the maximum distance to a facility is small

• Models as a graph problem

Page 32: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems32

Facility location problem

• Given: complete graph G, distances d between vertices fulfilling triangle inequality, integer k

• Question: find a set S of k vertices, such that the maximum over all vertices v ofminw S d(v,w)

is as small as possible

Page 33: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems33

Restating the problem

• Find the smallest r and a set S such that S is a dominating set of size at most k for the graph Gr formed by the edges of length at most r.

• OPT is smallest r.

• G2 is square of a graph: edge in G2 when there is a path of length 2

Page 34: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems34

A Lemma

• Let I be an independent set in H2. Then |I| is at most the minimum size of a dominating set in H.

• Proof: Let D be a minimum dominating set of H. For each v D, N(v) {v} contains at most one vertex from I.

Page 35: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems35

Approximation algorithm for facility location

• Sort the values of the lengths of the edges in G, say d1 … dm

• for i = 1 to m do– Compute Gx with x = di

– Compute Gx2

– Find a maximal independent set I in Gx2

– If it has size at most k, then return I; stop.

Page 36: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems36

Analysis

• The optimal solution has cost at least x=di

– For y<x: the minimum size of a dominating set in Gy is k+1 or more (use lemma)

• Ratio of algorithm is 2– Each maximal independent set is a domination

set, so I is a dominating set in Gx2.

– Each vertex has a path of length at most 2 to a vertex in I in Gx: so, I is a k-center with `cost’ at most 2x.

Page 37: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems37

Graphs that are not complete

• Given: graph G, distance for each edge d(e), integer k.

• Question: find a set S of k vertices, such that the maximum over all vertices of the length of the shortest path to a vertex in S is as small as possible.

Can be translated to previous problem: make complete graph with d(v,w) the length of the shortest path from v to w

Page 38: Set problems Vertex Cover, Dominating set, Clique, Independent set

7

Conclusions

Page 39: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems39

Conclusions

• Several techniques for approximation problems like vertex cover, dominating set, independent set

• Work often for other problems too (with modifications)

Page 40: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems40

Omitted parts

• After this some omitted parts in 2010– NP-completeness – Unit disk graphs

Page 41: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems44

Unit disk graphs

• Vertices are disks on plane with radius 1

• Edge when disks intersect

• Model radio transmitters and inferences or connections

Page 42: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems45

More on unit disk graphs

• Finding the intersection model is hard (NP-hard; not yet known to be in NP).

• Approximation algorithms for Independent Set, Dominating Set, …– Greedy algorithm is a 5-approximation– Simple modification gives 3 approximation

(next)

Page 43: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems46

3-approximation for Independent set on Unit Disk graphs

• W = V• S = • repeat until W =

– Choose a vertex v from W whose center is as much as possible to the left

– S = S {v}– W = W – N(v) – {v}

• Return S

Leftmost GreedyAlgorithm

Leftmost GreedyAlgorithm

Page 44: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems47

Ratio 3

• The maximum independent set is never larger than 3 times the set, given by the leftmost greedy algorithm.– If we choose v, then

N(v) has an independent set of size at most 3

Between successivenonintersecting

neighbors, there is an angle that is larger than

/3

Page 45: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems48

A PTAS

• For every , there is a polynomial time algorithm for Independent set that gives an independent set of size at least (1-)*OPT.– Uses geometric separation technique

PTAS =Polynomial TimeApproximation

Scheme

PTAS =Polynomial TimeApproximation

Scheme

Page 46: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems49

Bounded regions

• Suppose all disks are in a region of size r by r. Then the maximum size of an independent set in this graph is at most 4r2/– Each disk takes space /4.

– The disks in the solution do not overlap.

• Then, the maximum independent set problem can be solved in O(nO(r*r)) time.– Check each subset of size at most 4r2/ Take the

largest independent one of these.

Page 47: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems50

Removing strips and getting small area subgraphs

• Remove, at steps of r+1, for a 1-wide horizontal strip all disks intersecting the strip.

• Remove, at steps of r+1, for a 1-wide vertical strip all disks intersecting the strip.

• On the remaining graph, each connected component fits in an r by r area

Page 48: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems51

All disks intersecting a green strip are removed. We end up with the graph, formed by the disks fitting in the white area

For fixed r, we can solve the IS problem on the remaining graph in polynomial time

Each connected componentfits in one white area

Page 49: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems52

Page 50: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems53

Graphs Gi,j

• Remove horizontal strips at spaces i, i+(r+1), i + 2*(r+1), … (I.e., start at i.)

• Remove vertical strips at spaces j, j+(r+1), j + 2*(r+1), … (I.e., start at j.)

• Let Gi,j = (Vi,j,Ei,j) be the resulting graph• Algorithm: try all (r+1)2 choices for (i,j),

for each solve IS optimally for Gi,j and output the largest IS from these.

Page 51: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems54

Quality of heuristic (1)

• Let X be an independent set of maximum size.

• Let v X. There are at most 4(r+1) graphs Gi,j that do not contain v.

– v can be removed by a horizontal strip (upside, downside intersects) or a vertical strip (left side, right side intersects) .

Page 52: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems55

Quality of heuristic (2)

• Total size over all m.i.s.’s over all Gi,j is at least the sum over all |Vi,j X| (r+1)2 *|X| - 4(r+1)*|X|

• There must be at least one Gi,j that contains an independent set of size at least ((r+1)2 – 4)/(r+1)2 * |X|– Maximum is at least average

Page 53: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems56

Setting r

• Let r be the smallest integer such that

• For fixed , this is a constant – gives a polynomial time algorithm: PTAS

1

1

3

)1(

)1(4)1(2

2

r

r

r

rr

Page 54: Set problems Vertex Cover, Dominating set, Clique, Independent set

Set problems57

Variants

• Other type of intersecting objects• Other type of surfaces• Other problems• Example: Dominating set.

– Instead of removing strips, we duplicate vertices in strips giving them to the left, and right area

– Leads also to PTAS