Sei sulla pagina 1di 2

Algorithms: CSE 202 — Additional problems on approximation

algorithms

Problem 1: Cardinality vertex cover


Consider the following factor 2 approximation algorithm for the cardinality vertex cover problem.
Find a depth-first search tree in the given graph, G, and output the set, say S, of all the nonleaf
vertices of this tree. Show that S is indeed a vertex cover for G and |S| ≤ 2.OP T .

Solution. Hint: Show that G has a matching of size d|S|/2e.

Problem 2: Minimum cardinality maximal matching


Design a factor 2 approximation algorithm for the problem of finding a minimum cardinality
maximal matching in an undirected graph.

Solution. Hint: Use the fact that any maximal matching is at least half the maximum matching.

Problem 3: Directed acyclic graph


Given a directed graph G = (V, E), pick a maximum cardinality set of edges from E so that the
resulting subgraph is acyclic. Give a factor 1/2 algorithm.

Solution. Hint: Arbitrarily number the vertices and pick the bigger of the two sets, the forward-
going edges and the backward-going edges. What scheme are you using to upper bound the optimal
value?

Problem 4: Maximum directed cut


Given a directed graph G = (V, E) with nonnegative P edge weights, find a subset S ⊆ V so as
to maximize the total weight of edges out of S, i.e., uv∈E: u∈S and v∈V −S wuv , where wuv is the
weight of the directed edge uv. Give a greedy algorithm to achieve an approximation guaranteee of
factor 1/4.

Solution.

Problem 5: Vertex coloring


Given an undirected graph G = (V, E), color its vertices with the minimum number of colors so
that the two end points of each edge receive distinct colors.

1
1. Give a greedy algorithm for coloring G with ∆ + 1 colors, where ∆ is the maximum degree of
a vertex in G.

2. Give an algorithm for coloring a 3-colorable graph with O( n) colors.

Solution. Hint: For any vertex v, the induced subgraph on its neighbors, N (v), is bipartite, and

hence optimally colorable. If v has degree > n, color v ∪ N (v) using 3 distinct colors. Continue

until every vertex has degree ≤ n. Then use the algorithm in the first part.

Problem 6: Cardinality maximum cut


Given an undirected graph G = (V, E), the cardinality maximum cut problem asks for a partition
of V into sets S and S̄ = V − S so that the number of edges running between these sets is maximized.
Consider the following greedy algorithm for this problem. Here v1 and v2 are arbitrary vertices in
G, and for A ⊆ V , d(v, A) denotes the number of edges between vertex v and the set of vertices A.

1 Initialization:
2 A ← {v1 }
3 B ← {v2 }
4 for v ∈ V − {v1 , v2 } do:
5 if d(v, A) ≥ d(v, B) then B ← B ∪ {v}
6 else A ← A ∪ {v}
7 Output A and B

Show that this is a factor 1/2 approximation algorithm and give a tight example. What upper
bound did you use for the optimal value? Give examples of graphs for which this upper bound is as
bad as twice the optimal value. Generalize the problem and the algorithm to weighted graphs.

Solution.

Problem 7: Maximum coverage


Given a universal set U of n elements, with nonnegative weights specified, a collection of subsets
of U , S1 , . . . , Sl and an integer k, pick k sets so as to maximize the wight of elements covered.
Show that the obvious algorithm, of greedily picking the best set in each iteration until k sets
are picked, achieve an approximation factor of 1 − (1 − 1/k)k > 1 − 1/e.

Solution.

Potrebbero piacerti anche