Exercise Sheet 1

1) Use a suitable graph theoretical model to solve the following problems:

a) Show that in every city at least two of its inhabitants have the same number of neighbours!

Let \(G = (V,E)\) such that

Now, we show the (a) by proving that in any simple, undirected graph there exist two vertices which have the same degree:

– Proof by contradiction–

Assume a simple, undirected graph \(G = (V,E)\), such that \(\forall v,w \in V: v \neq w \rightarrow deg(v) \neq deg(w)\). Then, by assumption, the nodes \(\{v_1,\dots , v_n\} = V\), have degrees \(\{0, \dots, n-1\}\) (seeing as \(G\) is simple, no node has an edge to itself).

Thus, there is a node \(v_i \in V\) with \(deg(v_i) = n-1\) meaning it is connected to all other nodes, but there also exists a node \(v_j \in V\) with \(deg(v_j) = 0\) meaning it is connected to no other nodes, including \(v_i\). Contradiction!

b) 11 friends want to send postcards according to the following rules:

Let \(G=(V,E)\) a graph such that the nodes \(V = \{v_1, \dots, v_{11}\}\) represent the 11 friends and there is an edge \(v,w \in E\) if \(v\) sends a card to \(w\) and vice versa.

–Proof that this is impossible–

By the Handshaking Lemma, \(\sum_{v \in V} deg(v) = 2*|E|\) holds for any finite, undirected graph. By (i), for each vertice \(v \in V\), \(deg(v) = 3\) and by assumption \(|V| = 11\). If we apply this to the handshaking lemma: \(\sum_{v \in V} deg(v) = 33 = 2* k\), where \(k = |E|\). But this holds for no integer amount of edges. Contradiction!

c) Determine all graphs in which all vertices have degree 1.

In order for all vertices in a graph to have degree 1, each edge in the graph has to be connected to exactly two vertices, which themselves may not be connected to any other vertices. Therefore we can construct the set of all graphs with only vertices of degree 1, based on their number of edges. For \(G = (V,E)\), with \(|E| = k, k \in \mathbb{N}\):

\[\begin{gather*} E = \{e_1, \dots , e_k\},\\ V = \{v_{i1}, v_{i2} | e_i \in E\} \end{gather*}\]

2) Compute the number of walks of length \(l\) from \(i\) to \(j\) in the following graph:

The number of walks of length \(l\) from \(i\) to \(j\) is defined by the sum of all values in \(A(G)^l\), where

\[A(G) = \begin{pmatrix} 0 & 1 & 0\\ 1 & 0 & 1\\ 0 & 1 & 0 \end{pmatrix}\]

The element \((i,j)\) in \(A(G)^l\) represents the walks of length \(l\) from vertex \(i\) to vertex \(j\).

How could you use the adjacency matrix to compute the number of triangles (cycles of length 3) in a (loopless) graph? The number of triangles is defined by the trace (the sum of elements on the main diagonal) of \(A(G)^3\) divided by 6 for undirected, and 3 for directed graphs.

Perform the computation for two graphs of your choice on four vertices.

3) Show that each of the following four statements is equivalent to the statement “T is a tree”:

Let (0) := “T is a tree”, i.e. A graph is a tree iff it is connected, acyclic, and undirected.

Since we showed, (2) -> (0) -> (1) -> (3) -> (4) -> (2), we have shown equivalence of all statements by transitivity of implication.

4) Prove that the edge set of an undirected, simple graph can be partitioned into cycles iff every vertex set has even degree.

Hint: To prove the existence of a cycle, consider a maximal path and use the even degree condition.

5) Let \(G = (V,E)\) be an undirected graph with \(n\) vertices which does not have any cycle of length 3. Prove:

1. If \(xy \in E\) then \(d(x) + d(y) \leq n\).

Let \(G = (V,E)\) be an undirected graph such that \(|V| = n\) which contains no cycles of length 3.

–Proof by contradiction–

Assume two nodes \(x,y \in V\) such that \(d(x) + d(y) > n\), then the nodes \(x\) and \(y\) are connected to at least \(n-1\) other nodes (since they are also connected by an edge themselves). Now, \(|V \backslash \{x,y\}| = n-2\) by assumption. Thus, there exists at least one node \(z \in V\) such that \(xz \in E\) and \(yz \in E\) which means \(G\) contains a cycle of length 3. Contradiction!

2. The previous inequality \(d(x) + d(y) \leq n\) implies that \(\sum_{v \in V} d(v)^2 \leq n|E|\).

Since forall edges \(xy \in E\), \(d(x) + d(y) \leq n\), we know \(n*|E| \geq \sum_{vw \in E} d(v) + d(w)\). Now:

\(\sum_{vw \in E} d(v) + d(w) = \sum_{v \in V} \sum_{1}^{d(v)} d(v)\)

since for each vertice, its degree is contained in the left sum as many times as it occurs in an edge (i.e. as many times as its degree). Additionally,

\(\sum_{v \in V} \sum_{1}^{d(v)} d(v) = \sum_{v \in V} d(v)^2\)

seeing as the left side simply sums up \(d(v)\) times \(d(v)\). Now we can apply transitivity of equality and get

\(n* |E| \geq \sum_{v \in V} d(v)^2\)

3. The graph has at most \(n^2/4\) edges. Hint: Use the Handshaking-Lemma, the Cauchy-Schwarz inequality \((\sum_{i=1}^r a_i b_i)^2 \leq (\sum_{i=1}^r a_i^2) (\sum_{i=1}^r b_i^2)\), and what you have proved so far.

Assume \(\sum_{v \in V} d(v)^2 \leq |E| * n\), we apply the Cauchy-Schwarz inequality with \(a = d(v)\) and \(b=1\) to get

\((\sum_{v \in V} d(v) * 1)^2 \leq (\sum_{v \in V} d(v)^2) * (\sum_1^n 1),\)

i.e.

\((\sum_{v \in V} d(v))^2 \leq \sum_{v \in V} d(v)^2 * n\)

Now, this can be inserted into the Handshaking Lemma,

\(4*|E|^2 = (\sum_{v \in V} d(v))^2 \leq n * \sum_{v \in V} d(v)^2\)

And in turn, from exercise 5.2):

\(4*|E|^2 = (\sum_{v \in V} d(v))^2 \leq n * \sum_{v \in V} d(v)^2 \leq n^2 * |E|\)

we divide by \(n\) and remove the sandwiched inequalities:

\(\frac{4*|E|^2}{n} \leq n * |E|\)

now only simple arithmetic transformations:

\(\frac{4*|E|^2}{n} \leq n * |E| \Leftrightarrow \frac{4m}{n} \leq n \Leftrightarrow 4m \leq n^2 \Leftrightarrow m \leq \frac{n^2}{4}\)

6) Let \(G = (V,E)\) and \(G' = (V',E')\) be two undirected graphs. A graph isomorphism is a bijective mapping \(\phi : V \rightarrow V'\) such that two vertices \(x,y \in V\) are adjacent iff \(\phi(x)\) and \(\phi(y)\) are adjacent. The two graphs \(G\) and \(G'\) are called isomorphic, if there exists an isomorphism \(\phi: V \rightarrow V'\). Prove the following statements:

  1. If \(G\) and \(G'\) are isomorphic graphs and \(\phi : V \rightarrow V'\) is an isomorphism, then \(d_G(x) = d_G'(\phi(x))\) forall \(x \in V\).

–Proof by contradiction–

Let \(x \in V\) be a vertice such that \(d_G(x) \neq d_G(\phi(x))\).

Since we arrive at a contradiction in both cases, \(d_G(x) = d_G(\phi(x))\) has to hold forall \(x \in V\).

  1. If \(\phi : V \rightarrow V'\) is a bijective mapping satisfying \(d_G(x) = d_G(\phi(x))\) forall \(x \in V\), then \(G\) and \(G'\) are not necessarily isomorphic. We provide \(G\), \(G'\) and \(\phi\) such that \(d_G(x) = d_G(\phi(x))\), but \(G\) and \(G'\) are not isomorphic.

    G:

    G’:

    and \(\phi(v_i) = v'_i\) for each \(v_i \in V\).

    This means, forall \(v_i \in V\), \(d_G(x) = d_G(\phi(x))\) as all vertices in both graphs have degree 2.

    But \(G\) and \(G'\) are not isomorphic, since \(v_5\) and \(v_4\) are adjacent but \(v_4'\) and \(v_5'\) are not.

7) Are the following two graphs isomorphic?

G1 4 4 3 3 4--3 b b 4--b 1 1 4--1 c c 3--c 2 2 3--2 b--c a a b--a d d c--d a--d a--1 d--2 1--2 G2 A A β β A--β γ γ A--γ δ δ A--δ B B B--γ B--δ α α B--α C C C--β C--δ C--α D D D--β D--γ D--α

Yes, we provide the following isomorphism: \(f(1) = A\), \(f(3) = B\), \(f(b) = C\), \(f(d) = D\), \(f(c) = \alpha\), \(f(a) = \beta\), \(f(2) = \gamma\), \(f(4) = \delta\), which is edge preserving and bijective.

8) Let \(G = (V,E)\) be a simple graph. Moreover let \(G_R\) be its reduction. Prove that \(G_R\) is acyclic.

–Proof by contradiction–

Let \(G_R\) be a graph reduction which contains a cycle \(C\), then \(C\) is a walk \(V_1^R \rightarrow V_2^R \leadsto V_1^R\). Thus, there exist strongly connected components \(V_1, V_2\) in \(G\) such that there is a walk from some \(v_1 \in V_1\) to some \(v_2 \in V_2\) and from \(v_2\) to \(v_1\). By construction of \(G_R\) this means that \(v_1\) and \(v_2\) have to be in the same component in \(G_R\). Contradiction!

9) Find the strongly connected components and the reduction \(G_R\) of the graph \(G\) below. Furthermore, determine all vertex bases of \(G\).

G 1 1 2 2 1->2 5 5 2->5 6 6 7 7 7->6 11 11 12 12 7->12 8 8 8->7 3 3 3->8 9 9 4 4 4->3 10 10 4->10 5->1 6->2 6->5 11->7 11->6 13 13 12->8 12->11 14 14 9->3 9->4 9->12 9->10 13->11 14->12 14->13 G 3 3 4 4 K2 K2 3->K2 9 9 10 10 4->3 4->10 K1 K1 6 6 6->K1 K2->6 13 13 14 14 9->3 9->4 9->K2 9->10 13->K2 14->K2 14->13

10) Use the matrix tree theorem to compute the number of spanning forests of the graph below!

G 1 1 3 3 1--3 2 2 3--2 2--1 4 4 8 8 4--8 6 6 8--6 5 5 8--5 7 7 7--4 7--8 7--6

Kirchoff’s Matrix-Tree Theorem: If \(G=(V,E)\) is an undirected graph and \(L\) is its graph Laplacian, then the number \(N_T\) of spanning trees contained in \(G\) is given by: 1.) Choose a vertex \(v_j\) and eliminate the \(j\)-th row and column from \(L\) to get a new matrix \(\hat L_j\),

To get all spanning forests of \(G = G_1 \dot \cup G_2\), we simply calculate \(N_T(G1) * N_T (G_2)\): The adjacency matrix of \(G_1\):

\[\begin{gather*} A(G_1) = \begin{pmatrix} 0 & 1 & 1\\ 1 & 0 & 1\\ 1 & 1 & 0 \end{pmatrix} \end{gather*}\]

The corresponding degree matrix:

\[\begin{gather*} D(G_1) = \begin{pmatrix} 2 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & 2 \end{pmatrix} \end{gather*}\]

The laplacian:

\[\begin{gather*} L(G_1) = \begin{pmatrix} 2 & -1 & -1\\ -1 & 2 & -1\\ -1 & -1 & 2 \end{pmatrix} \end{gather*}\]

after deleting the first row and column:

\[\begin{gather*} \hat L(G_1) = \begin{pmatrix} 2 & -1\\ -1 & 2 \end{pmatrix} \end{gather*}\]

calculating the determinant:

\[\begin{gather*} det(\hat L_1(G_1)) = 4 - 1 = 3 \end{gather*}\]

The adjacency matrix of \(G_2\):

\[\begin{gather*} A(G_2) = \begin{pmatrix} 0 & 0 & 0 & 1 & 1\\ 0 & 0 & 0 & 0 & 1\\ 0 & 0 & 0 & 1 & 1\\ 1 & 0 & 1 & 0 & 1\\ 1 & 1 & 1 & 1 & 0 \end{pmatrix} \end{gather*}\]

The laplacian matrix:

\[\begin{gather*} L(G_2) = \begin{pmatrix} 2 & 0 & 0 & -1 & -1 \\ 0 & 1 & 0 & 0 & -1 \\ 0 & 0 & 2 & -1 & -1 \\ -1 & 0 & -1 & 3 & -1 \\ -1 & -1 & -1 & -1 & 4 \end{pmatrix} \end{gather*}\]

after deleting the fourth row and column:

\[\begin{gather*} \hat L_4(G_2) = \begin{pmatrix} 2 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & -1 \\ -1 & 0 & -1 & 3 \end{pmatrix} \end{gather*}\]

calculating the determinant:

\[\begin{gather*} det(\hat L_4(G_2)) = -1 \times \begin{pmatrix} 2 & 0 & -1 \\ 0 & 2 & -1 \\ -1 & -1 & 3 \end{pmatrix} = -1 \times (12 + 0 + 0 - 2 - 0 - 2) = -8 \end{gather*}\]

we take \(8\) as the sign only depends on which row and column you eliminate. Thus the number of \(G = 3 \times 8\).