Assignment 1
Assignment 1
Bodo Manthey
Discrete Optimization
Homework Assignment 1
Due: September 29, 2014
(1) Are the following statements true or false? Give a short reason or a counterexample.
(a) (1 point) The following holds for all functions f, g : N R
+
:
f = (g) if and only if lim
n
f(n)
g(n)
exists.
(b) (1 point) The following holds for all monotonically increasing, unbounded functions
f, g, h : N N:
If f = O(g), then f h = O(g h).
(The symbol denotes the concatenation of functions, i.e., (f h)(n) = f(h(n)).)
(c) (1 point) The following holds for all monotonically increasing, unbounded functions
f, g, h : N N:
If f = O(g), then h f = O(h g).
(d) (1 point) log(n!) = (n log n).
(e) (1 point) The following holds for all monotonically increasing, unbounded functions
f, g : N R
+
:
Either f (g) or f O(g) or both.
(2) (5 points) Consider an undirected graph G = (V, E) with an injective edge cost function
c : E R.
Prove that G has a unique minimum spanning tree.
(3) (5 points) Consider the following rather stupid algorithm for computing a minimum span-
ning tree of a graph G = (V, E) if the edge costs c : E R
+
are injective:
input: undirected graph G = (V, E), injective edge cost function c : E R
output: minimum spanning tree T of G
1: for all non-empty X V do
2: e argmin
e
(X)
c(e
)
3: T T {e}
4: end for
Prove that the algorithm indeed computes a minimum spanning tree. (Note that T is a
set, not a multi-set.)
page 1 of 2
(4) (10 points) Consider the following algorithm for computing minimum spanning trees:
input: undirected graph G = (V, E), injective edge cost function c : E R
output: minimum spanning tree T of G
1: T
2: while T is not connected do
3: A
4: for each connected component C of T do
5: let e be the cheapest edge in (C)
6: add e to A
7: end for
8: T T A
9: end while
(a) (4 points) Prove that T is a minimum spanning tree if the algorithm terminates.
(b) (1 point) How many iterations of the while loop does the algorithm need?
page 2 of 2