CSCI 4260MATH 4150 - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

CSCI 4260MATH 4150

Description:

CSCI 4260-MATH 4150. Lecture 20. Approximation Algorithms for NP-Complete Problems ... This means that, in general, we can not solve these problems in polynomial time. ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 29
Provided by: Hil665
Category:
Tags: 4260math | csci | math | problems

less

Transcript and Presenter's Notes

Title: CSCI 4260MATH 4150


1
CSCI 4260-MATH 4150
  • Lecture 20
  • Approximation Algorithms for NP-Complete Problems

2
Why approximation?
  • Many optimization problems on graphs are
    NP-Complete.
  • This means that, in general, we can not solve
    these problems in polynomial time.
  • Approximation algorithms provide one way of to
    deal with such problems without sacrificing too
    much from optimality

3
Definition
  • Algorithm A is said to be a c-approximation
    algorithm for a minimization problem
  • A runs in polynomial time
  • And
  • For all possible inputs ??

4
Problem 1 Vertex Cover
  • Input G (V,E)
  • Find a minimum cardinality S ?V such that every
    edge in E is adjacent to a vertex in S.
  • Vertex Cover is NP-Complete

5
2-approximation algorithm for vertex cover
  • S ? empty set
  • Repeat
  • Pick an edge (u,v)
  • Add u and v to S
  • Remove every edge adjacent to either u or v from
    G
  • Until no more edges remain

6
Why is this a 2-approximation algorithm?
  • Clearly it runs in polynomial time
  • Note that we output a maximal matching
  • We know that the size of any matching M is less
    than or equal to the size of any vertex cover.
  • Let OPT be the cardinality of the optimal
    vertex-cover for our input.
  • What is the number of vertices in S?

7
Is this analysis tight?
  • That is, is there an instance where our algorithm
    outputs as many as 2xOPT vertices
  • K(n,n)

8
Problem 2 Dominating Set
  • Input G (V,E)
  • Find a minimum cardinality S ?V such that every
    vertex in V is adjacent to a vertex in S.
  • Dominating Set is NP-Complete

9
Recall the Set-cover problem
  • Given a set X a,b,c,d,e,f,g
  • And a collection of subsets of X
  • S S1,S2,S3,S4, S5, S6
  • S1 a, b, c
  • S2 c, d, e
  • S3 c, e, f, g
  • S4 a, f, g
  • S5 f
  • S6 g
  • Cover a collection of subsets from S whose union
    gives X
  • Example S1, S2, S5, S6 is a cover of S
  • Minimum Set Cover Problem Find a cover of
    minimum cardinality (with minimum number of
    subsets)

10
From Dominating Set to Set Cover
  • We can reduce the dominating set problem to a set
    cover problem as follows
  • Base set X ? Vertex Set V
  • Subsets ? For each vertex v, add v ?? N(v) as
    a subset in the set system S
  • Every set cover of (X,R) is a dominating set of G
    and vice versa

11
Greedy Set Cover Algorithm
  • Repeat
  • Pick a subset that covers most number of
    uncovered elements and add it to the solution.
  • Until all elements of X are covered

12
Analysis
  • Let SOL be our solution and OPT be the optimal
    solution
  • The number of subsets in SOL is equal to the
    number of iterations

13
Analysis
  • At every state we pick the element that covers
    most uncovered elements.
  • The optimal algorithm covers all elements using
    OPT elements
  • Therefore at every stage there must be a subset
    that covers at least
  • (total number of uncovered elements)/OPT
  • Uncovered elements

14
Analysis (cont)
  • Let r(i) denote the number of uncovered elements
    after ith iteration

15
Analysis
  • The last inequality comes from (1-x) ? e-x

16
Analysis
  • Therefore, no more uncovered elements remain
    after OPT ln(n) iterations.
  • Hence, greedy gives a ln(n) approximation for the
    set-cover problem

17
Is this analysis tight?
  • Is there an instance where greedy is log(n) times
    worse than OPT?

18
Problem 3 Metric k-center
  • Input G(V,E) complete undirected graph with
    edge costs satisfying the triangle inequality
  • For any set S ? V and a vertex v, define
    connect(v,S) cost of the cheapest edge from v to
    a vertex in S
  • Output S ? V with S k that minimizes
  • max_v connect(v,S)

19
A 2-approximation algorithm
  • Suppose that we knew the cost achieved by the
    optimal solution.
  • This is no big deal because we know that it will
    be equal to the weight of some edge and we can
    try all possibilities.
  • Sort the edges in nondecreasing coste1, e2, ,
    em
  • Let Gi be the unweighted graph obtained by
    deleting all edges that are costlier than ei from
    G

20
Crucial observation
  • If OPT cost(ei) for some i
  • Then
  • Gi must have a dominating set of size k
  • Of course, we dont know how to compute
    dominating sets optimally
  • But we can compute a lower bound on OPT and
    utilize this lower bound to test Gi

21
Lemma
  • Given a graph H, let H2 denote a graph
    containing an edge (u,v) whenever H has a path of
    length 2 between u and v
  • Given a graph H, let I be an independent set in
    H2. Then
  • I ? dom(H) size of the minimum dominating set
    in H

22
Proof
  • Let D be the dominating set in H
  • H contains D stars
  • Each of these stars will be a clique in H2
  • Any independent set can pick at most one vertex
    from each clique

23
K-center algorithm
  • Construct G12, G22, , Gm2
  • Compute a maximal independent set Mi for each
    Gi2
  • Find the smallest index i such thatMi ? k
  • Call this index j
  • Return Mj

24
Analysis
  • cost(ej) ? OPT
  • ej index chosen by the algorithm
  • OPT Cost incurred by the optimum k-center
    solution
  • Proof
  • For all i lt j, we have Mi gt k
  • But then dom(Gi) ? Mi gt k
  • So OPT is more than cost(ei)

25
2 approximation proof
  • First observe that every maximal independent set
    is also a dominating set
  • Suppose not. Then there must be a non-dominated
    vertex. This vertex can be added to the
    independent set contradicting maximality
  • So, our independent set in Gi2 is also a
    dominating set in Gi2
  • But not necessarily in Gi. However,

26
But what is the cost?
  • Suppose u is a vertex in Mj and v is adjacent to
    u
  • distance(u,v) lt 2cost(ej)
  • by triangle inequality

27
What have we achieved
  • OPT achieves cost(ej) using k centers
  • We achieve 2cost(ej) using k centers

28
Is the analysis tight?
  • red edges have cost 1, black edges cost 2
  • Optimal solution for k 1 is (cost) 1
Write a Comment
User Comments (0)
About PowerShow.com