0% found this document useful (0 votes)
28 views

Problem Session Sols

The document discusses several graph theory problems and provides solutions or proofs: 1) It proves that a graph is bipartite if and only if it does not contain any odd cycles. It also proves that for a bipartite k-regular graph, the partitions must be the same size. 2) It provides a randomized algorithm for 3-coloring a graph that satisfies at least 2/3 of the optimal number of edges in expectation. 3) It calculates the expected number of Hamiltonian paths in a random tournament and uses this to show there exists a tournament with at least that many paths. 4) It provides a 2-approximation algorithm for the Steiner tree problem by returning the minimum spanning

Uploaded by

Nada Nadifah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Problem Session Sols

The document discusses several graph theory problems and provides solutions or proofs: 1) It proves that a graph is bipartite if and only if it does not contain any odd cycles. It also proves that for a bipartite k-regular graph, the partitions must be the same size. 2) It provides a randomized algorithm for 3-coloring a graph that satisfies at least 2/3 of the optimal number of edges in expectation. 3) It calculates the expected number of Hamiltonian paths in a random tournament and uses this to show there exists a tournament with at least that many paths. 4) It provides a 2-approximation algorithm for the Steiner tree problem by returning the minimum spanning

Uploaded by

Nada Nadifah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CME 305 Problem Session 1 2/10/2014

1. Recall the definition of a bipartite graph. Let G(V, E) be a graph and (A, B) be a partition of V . We
say that G is bipartite if all edges in E have one end-point in A and the other in B. More precisely,
for all (u, v) ∈ E either u ∈ A, v ∈ B or u ∈ B, v ∈ A.

(a) Prove that a graph is bipartite if and only if it doesn’t have an odd cycle.
Solution:
⇒: Suppose that G(V = A ∪ B, E) is bipartite. Assume for contradiction that there exists a
cycle v1 , v2 , ..., vk , v1 in G with k odd. Without loss of generality we may additionally assume
that v1 ∈ A. Using the fact that G is bipartite, a simple induction argument suffices to show that
vi ∈ A for i odd and vi ∈ B for i even. But then {vk , v1 } ∈ E is an edge with both endpoints
in A, which contradicts the fact that G is bipartite. Therefore a bipartite graph G has no odd
cycles.
⇒: Let G be a graph with no odd cycles. We will consider the case that G is connected; this is
sufficient since if we can show that each connected component of a graph is bipartite, then it follows
that the graph as a whole is bipartite. Let d(u, v) denote the length of the shortest path between
two vertices in G. Pick an arbitary vertex u ∈ V and define A = {u} ∪ {w | d(u, w) is even}.
Define B = V \ A. We claim that the partition V = A ∪ B demonstrates that G is bipartite.
Assume for contradiction that there exists an edge {w, v} ∈ E with w, v ∈ A (or B). Then by
construction d(u, w) and d(u, v) are both even (or odd). Let Puw and Pvu be the shortest paths
connecting u to w, and v to u respectively. Then the cycle given by Puw , {w, v}, Pv,u has length
1 + d(u, w) + d(u, v), which is odd, a contradiction. Therefore no such edge {w, v} may exist and
G is bipartite.
(b) A graph is called k-regular if all vertices have degree k. Prove that if a bipartite G is also k-regular
with k ≥ 1 then |A| = |B|.
Solution:
Since each vertex of G has degree k, we have that |A| = k1 a∈A deg(a) and |B| = k1 b∈B deg(b).
P P
Now, every edge in G has exactly one endpoint in A and exactly one endpoint in B. Thus
X X
deg(a) = deg(b) = |E|
a∈A b∈B

and thus |A| = |B| = |E|/k.

2. (Kleinberg & Tardos 13.1) 3-Coloring is a yes/no question, but we can phrase it as an optimization
problem as follows.
Suppose we are given a graph G(V, E), and we want to color each node with one of three colors, even
if we aren’t necessarily able to give different colors to every pair of adjacent node. Rather, we say that
an edge (u, v) is satisfied if the colors assigned to u and v are different.
Consider a 3-coloring that maximizes the number of satisfied edges, and let c∗ denote this number.
Give a polynomial-time algorithm that produces a 3-coloring that satisfies at least 23 c∗ edges. If you
want, your algorithm can be randomized; in this case, the expected number of edges it satisfies should
be at least 23 c∗ .
Solution:
Consider the algorithm that picks a color for each vertex uniformly and independently at random.
Then for each edge e ∈ E, the probability that e is satisfied is 2/3. Define the indicator random
variables Xe = 1{e is satisfied} for e ∈ E; then we compute using linearity of expectation:
" #
X
E[number of satisfied edges] = E Xe
e∈E
X
= E [Xe ]
e∈E
X 2
= P[e is satisfied] = |E|.
3
e∈E

1
CME 305 Problem Session 1 2/10/2014

Now, noting that the optimal number of satisfied edges can be no more than the total number of edges,
i.e. c∗ ≤ |E|, we have for our algorithm: E[number of satisfied edges] = 23 |E| ≥ 23 c∗ .
3. A tournament is a complete directed graph i.e. a directed graph which has exactly one edge between
each pair of vertices. A Hamiltonian path is a path that traverses each vertex exactly once. A random
tournament, is a tournament in which the direction of all edges is selected independently and uniformly
at random.
(a) What is the expected value of the number of Hamiltonian paths in a random tournament?
Solution:
Consider a random tournament G(V = {1, 2, ..., n}, E) on n vertices. Let Sn denote the set of all
permutations of 1, 2, ..., n. For each permutation σ ∈ Sn , we may consider the event Aσ that σ
gives a path in G, i.e. that the directed edge (σ(i), σ(i + 1)) ∈ E for each 1 ≤ i ≤ n − 1. We note
that P(An ) = (1/2)n−1 , the probability that all of the aforementioned edges P are directed in the
desired direction. Then the number of Hamiltonian paths in G is given by σ∈Sn 1{Aσ } , and by
linearity of expectation:
" #
1{Aσ } = E[1{Aσ } ]
X X
E
σ∈Sn σ∈Sn

= n!P(Aσ )
n!
= n−1
2

(b) Use part (a) to show that for every n, there is a tournament with n players and at least

n!
2n−1
Hamiltonian paths.
Solution:
Since the expected number of Hamiltonian paths is equal to n!/2n−1 , there must exist a tour-
nament on n players with ≥ n!/2n−1 Hamiltonian paths. If this were not the case, i.e. every
tournament had strictly < n!/2n−1 Hamiltonian paths, then the expectation (which, in the ab-
sence of a formal probability class can be thought of as an “average”) would be strictly < n!/2n−1 .
4. Given an undirected graph G = (V, E) with nonnegative edge costs satisfying the metric inequality and
whose vertices are partitioned into two sets V = R ∪ S, Required and Steiner, find a minimum cost tree
in G that contains all the vertices in R and any subset of the vertices in S. Finding an optimal solution
to this problem is NP-hard. Find and prove a factor 2 approximation algorithm for this problem.
Solution:
Consider the algorithm that returns the minimum cost spanning tree, e.g. through Kruskal’s algorithm,
connecting the vertices of R and completely ignoring the optional nodes in S. That is, we compute
the minimum cost spanning tree T on the subgraph of G induced by R.
To prove the approximation factor, let T ∗ denote the optimal solution to the Steiner Tree problem.
Consider doubling every edge of T ∗ to produce a graph where every vertex has even degree; thus there
exists an Eulerian cycle CE on this graph. The cost of this cycle is c(CE ) = 2c(T ∗ ). Start at an
arbitrary point on CE and follow the cycle around, keeping track of the order in which you first see
each vertex in R. Since T ∗ contains every vertex of R, this ordering will look like r1 , r2 , ..., r|R| where
every vertex of R shows up exactly once in the list. Now consider the path P = r1 , r2 , ..., r|R| in G.
Using a shortcutting argument similar to the proofs of our TSP approximation algorithms, we note
that c(P ) ≤ c(CE ) = 2c(T ∗ ) (as a reminder, the argument boils down to the fact that skipping from
ri to ri+1 in CE , omitting any intermediate vertices, can only decrease the length of P compared to
CE by the metric inequality). Now, P is a specific example of a spanning tree connecting the vertices
of R. Our algorithm returns the minimum cost spanning tree, so c(T ) ≤ c(P ) ≤ 2c(T ∗ ) as desired.

2
CME 305 Problem Session 1 2/10/2014

5. Show that the Steiner Tree problem (see above) is NP-hard by reducing minimum vertex cover to the
Steiner Tree problem.
(Not Actually a) Solution:
Consider an instance G(V, E) of the (unweighted, undirected, but still NP-complete!) minimum vertex
cover problem. We define a new graph H(W, F ) in which to find a Steiner tree. Let W = V ∪ E and

F = {{u, v} | u, v ∈ V } ∪ {{v, e} | v ∈ e ∈ E}.

That is, to form H we take the complete graph on V , add a vertex for every edge e ∈ E, and connect
each such e to its two endpoints in V . Let c(e) = 1 for all e ∈ E and take R = E ⊂ W and S = V ⊂ W .
(In order to more properly frame this in the context of Problem 4’s formulation, we may also imagine
adding all unspecified edges {u, v} to the graph with cost equal to d(u, v); this is called the graph
metric on H.)
I leave it as an exercise to the reader to prove why a Steiner tree corresponds to a vertex cover in this
construction, and thus a minimum Steiner tree corresponds to a minimum vertex cover.

You might also like