Graph Theory: Problem Set 1 (Solutions)
Graph Theory: Problem Set 1 (Solutions)
1. a) What is the maximum number of edges a (simple) graph on n vertices can have ?
This number corresponds to the number of ways, in which we can choose 2 elements
from an n element set, if we do not care about the order of the elements, i.e. n2 .
b) What is the maximum number of edges a bipartite graph on n vertices can have ?
If we fix a partition of our vertex set into two sets one of them having n1 elements
and the other n − n1 elements, we can have n1 ∗ (n − n1 ) edges. By maximizing the
above expression we get 41 n2 , if n is even, and 41 (n2 − 1), if n is odd.
c) Show that every tree is bipartite.
In the trivial case, when our tree consists of one vertex the claim is true.
For the inductive step we can assume that a tree on n−1 vertices is bipartite (inductive
hypothesis), and that each tree on n vertices can be constructed by adding a leaf to
a tree on n − 1 vertices. Moreover, given a partition of the vertex set of the smaller
tree on n − 1 vertices into two parts V1 and V2 witnessing its bipartiteness, we can
extend one part, w.l.o.g. V1 , by adding a leaf v to V1 , such that the only neighbor of
v does not belong to V1 .
2. Prove that a tree on n vertices contains n − 1 edges.
In the trivial case, when our tree consists of one vertex the claim is true. For the inductive
case we can assume that any tree T ′ on n − 1 vertices contains n − 2 edges, and that each
tree T on n vertices can be constructed by adding a leaf to a tree on n − 1 vertices. Let
T ′ be such a tree. Thus, the number of edges in T is n − 2 + 1 = n − 1.
3. Show that the number of leaves in a tree T can be bounded from below by the maximum
degree of T .
Let u denote a maximum degree vertex in T . For each neighbor v of u a maximal path
uvP wz starting with the edge uv ends in a leaf. Note that it might happen that z = v
and w = u, in this case P = wz, or that v = w, and in this case P = uwz.
1
Indeed, otherwise z has a neighbor t, which is not the previous vertex on P . However,
t has to belong to P , because otherwise we can extend P , and that is impossible by the
maximality of P . Thus, t gives rise to a cycle, and that is impossible too.
Moreover, for two different neighbors v1 and v2 of u these leaves must differ, since other-
wise we would have a cycle.
Indeed, if we have uv1 P1 w and uv2 P2 w, we also have a walk uv1 . . . w . . . v2 u, that contains
a cycle.
Thus, we have at least as many leaves in T , as deg(u).
4. Prove that a graph is bipartite if and only if it does not contain an odd cycle.
1
extra credit
2
Let M ′ be a matching containing more edges than M. Consider the graph G′ on the same
vertex set as G whose edges are precisely M1 ▽M2 = (M1 ∪M2 )\(M1 ∩M2 ). Observe that
every vertex of G′ has degree either 0, 1 or 2. Thus, G′ consists of connected components
each of which is either cycle or path. Moreover, on each such path or cycle edges alternate
between M and M ′ . Since M ′ > M, there must be an odd path P whose first and last
edge belongs to M ′ . P is an augmenting path.