Introduction To Approximation Algorithms (Dr. Shelby Funk)

advertisement
Introduction
Optimization problem Π
 Either minimization or maximization
 Each instance I of Π comes with
o Non-empty set of feasible solutions
o Each assigned a non-negative rational number called the
objective function value
o ∃ poly time algorithms for determining
 validity of instance I (is it actually an instance of Π?)
 feasibility of a proposed solution
 objective function value of a proposed solution
o OPTπ(I) denotes an objective function value of an optimal
solution to instance I (normally shortened to OPT)
Example (Vertex cover optimality problem). Given graph G with
vertex cost function c:V → Q+ (if c(v) = 1 ∀ v, this is called the
cardinality vertex cover problem)
What is this problem? (find min cost vertex cover)
What are the feasible solutions? (all possible vertex covers)
What is the objective function? (sum of costs of the vertices in the
feasible solution)
Approximation algorithm A
Produces (in poly time) a feasible solution whose objective function is
“close” to OPT – i.e., within a guaranteed factor α of OPT
We want and approximation factor α ≥ 1 such that
 We want ALG(I) ≥ 1/α OPTπ(I) on any instance I of a
maximization problem Π
 We want ALG(I) ≤ α OPTπ (I) on any instance I of a
minimization problem Π
Finding a 2-approximation for cardinality vertex cover
We want to minimize the number of vertices in the vertex cover
Our solution will find a vertex cover with at most double the
minimum number of vertices
It is not only NPH to find a minimum solution … it is also NPH to
compute the cost of a minimum solution (decision version)
DEF: Given graph H = (U,F), a subset of edges M ⊆ F is a matching if
no two edges of M share an endpoint.
A matching of maximum cardinality is called a maximum matching.
A matching that is maximal under inclusion is called a maximal
matching. (What’s the difference?)
Maximal matching can clearly be computed in poly time … pick
edges and remove endpoints of picked edges (greedy approach).
∃ poly algorithms for finding maximum matching as well.
Observation 1: If M is a maximal matching and OPT is the minimum
size of a vertex cover, then OPT ≥ |M|
Every edge in M must be covered by any vertex cover.
We cannot simply pick one endpoint … some edges might not be
covered (e.g. V = {a,b,c,d} E = {(a,b),(b,c),(c,d)} then M could be
{(b,c)}).
Algorithm 1.2
1. Find a maximal matching M for G
2. Output the endpoints of all edges in M (both endpoints).
Theorem 1.3
Algorithm 1.2 is a 2-approximation algorithm for the cardinality
vertex cover problem.
Proof:
Algorithm 1.2 outputs 2×|M| vertices. By observation above OPT ≥
|M|. Our approximation give output of size 2|M| ≤ 2OPT.
Need to argue the output is a vertex cover. No edge can be left
uncovered by the set of vertices picked … otherwise another edge
would be added to M (M would not be maximal). QED
Can approximation guarantee be improved?
We need to consider the following questions:
1. Is there a more complex analysis of Algorithm 1.2 that provides a
better approximation guarantee?
2. Can we find a different algorithm that uses the maximal matching
analysis technique to find a better approximation?
3. Is there some other lower bounding method that could give an
improved approximation guarantee for vertex cover?
1. More complex analysis will not improve approximation guarantee
Consider complete bipartite graphs Kn,n (V = V1 ∪ V2, E = {(u,v)|u ∈
V1, v∈ V2}, |V1| = |V2| = n).
Any maximal matching (or maximum matching) will contain exactly
n edges. Either V1 or V2 provide a vertex cover. Therefore, the factor
2 of our approximation is tight for Algorithm 1.2.
We call this a tight example … such examples prove valuable insight
to problems and proposed solutions … they can lead to improved
solutions.
2. Diff’t alg using max’l matching cannot improve approximation guarantee
Consider complete graphs Kn where n is odd.
What is the maximal matching? (Ans: (n-1)/2)
What is the size of the vertex cover? (Ans: (n-1))
This shows the maximal matching technique cannot provide a better
approximation guarantee.
Well-characterized problems and min-max relations
Begin by defining co-NP = {co-L | L ∈ NP}. This is also the class of
languages that have “no” verifiers. For every L ∈ co-NP ∃ poly-time
verifier M such that
∀ x \n0tin L ∃ c ∈ {0,1}p(|x|) such that M(x,c) = reject
Now revisit the cardinality vertex cover and maximum matching
decision problems.
Both are in NP – have “yes” verifiers.
We have observed that OPTMM ≤ OPTVC
Konig Egervary thm: In any bipartite graph
maxmatching M |M| = minVC U |U|
Therefore, bipartite graphs have both “yes” and “no” certificates – a
matching of size k+1 provides a “no” certificate to the VC problem and
a VC of size l -1 gives a “no” certificate to the maximum matching
prob
For bipartite graphs VC and MM are both in NP ∩ co-NP
In fact, these problems are in P for bipartite graphs
Show Venn diagram for P, NP, co-NP
(P ⊆ NP ∩ co-NP … believed to be strict)
Such problems (in NP ∩ co-NP) are called well-characterized
Min-max relations (MM/VC) prove the probs are well-characterized
Such relations provide helpful insight to algorithm development
Later this semester we’ll see a generalization of the min-max relations
… the LP-duality theorem (the 2nd section of the class is on using LPduality to find approximation algorithms)
Note if G is not bipartite, could have OPTMM < OPTVC
Examples: |V| is odd and edges form a Hamiltonian cycle (n edges)
OPTMM? (Ans: (n-1)/2)
OPTVC? (Ans: (n+1)/2)
This could even happen for graphs having a perfect matching.
A perfect matching (a.k.a. 1-factor) is a matching which matches
all vertices of the graph. That is, every vertex of the graph is
incident to exactly one edge of the matching.
Example: V = {a,b,c,d,e,f},
E = {(a,b),(a,c),(b,c),(b,d),(c,e),(d,e),(d,f)}.
Then M={(a,b),(c,e),(d,f)} is a perfect matching.
Example of graph with OPTMM + 1 = OPTVC and OPTMM is perfect.
The Petersen graph (a star surrounded by a pentagon with an edge
from each star point to each pentagon vertex … 10 vertices, 15 edges)
OPTMM? (Ans: 5 … perfect matching)
OPTVC? (Ans: 6)
We believe NP ≠ co-NP. If true, no NPC problem can be co-NP … in
particular, vertex cover is not in co-NP unless NP = co-NP.
The maximum matching problem is in P. Its “no” certificate is an odd
set cover
DEF: Given a graph G = (V,E), an odd set cover of G, is a collection of
disjoint odd cardinality subsets S0,…,Sk of V and a collection v1,…,vl of
vertices such that each edge is either
 Incident to one of the vertices vi, or
 Has both endpoints in one of the sets Si
The weight of the cover is defined to be
w(C) = l + Σ1≤i≤k (|Si| - 1)/2
a
Example:
• S0 = {b,d,f,j,l}, S1 = {g,h,k}; a, c, e, i
b
c
d
w=4+1=5
e
f
Matching (bold edges)
g
h
k
i
l
j
Observe, the matching has 1 edge for each of the vertices v1…vl with
and endpoint in S0 and ⌊ (|S1|-1)/2⌋ edges in S1.
The following min-max relation holds
Thm 1.7: In any graph the size of the maximum matching is the
minimum weight of an odd set cover.
(Work through example graphs)
Approximate VC min-max relation for gen’l graphs
Recall, the maximal matching algorithm provides a 2-approximation
for the vertex cover problem (proved in Thm 1.3).
Corollary 1.8: In any graph,
maxmatching M|M| ≤ minVC U |U| ≤ 2 maxmatching M |M|
We can use this to provide no certificates for the VC problem
instances <G,k> such that k < OPT(G)/2 … these are called
approximate “no” certificates
Download