Sol 1
Sol 1
Sol 1
X
l−2
w({v1 , vl−1 }) ≤ w({vλ , vλ+1 })
λ=1
1
2
in the rst step of Algorithm 1.2 be the rst and third edges of every path.
Thus #C = c = 4 · 4 , but the optimal vertex cover is the set of second
n
Also, a minimum vertex cover consists of both the endpoints of the edges
of the matching.
Solution to Exercise 1.9
We show that C is indeed a vertex cover. If not, there is an edge e = {u, v}
not covered by C. It is clear that both u and v are leaves of T since otherwise
one of them will belong to C and hence e is covered. But, since T is obtained
by a depth rst seach, this means that e should have appeared in T . So, C
is a vertex cover.
Next, we show that there is a matching M in G of size at least |C|
l m
2 .
P
of all of which matches i |Ci | = |C| − 2. Alongwith the edge (u, v) we then
have a matching of size |C|.
Solution to Exercise 1.10
Fix an order v1 , v2 , · · · , vn of the vertices of G. Pick edges one by one,
and add an edge e = (vi , vj ) to the set E1 if i < j and to the set E2 if i > j.
After exhausting all the edges in E, select the bigger of E1 and E2 . It is easy
to see that both E1 and E2 are acyclic, as the presence of a cycle needs an
edge in the opposite direction. Since OPT ≤ |E| and the bigger of E1 and E2
is of size at least |E|/2, the above algorithm nds an acyclic subgraph with
at least half the number of edges of an optimum acyclic subgraph.