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*}\]
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.
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.
Hint: To prove the existence of a cycle, consider a maximal path and use the even degree condition.
=> Let \(G = (V,E)\) be a graph such that \(E\) can be partitioned into cycles \(C = \{C_1, \dots, C_k\}\). Then for an arbitrary vertex \(v\), the degree is defined as follows: Let \(d(v)_G = 0\), then for every cycle \(C_i \in C\), - if \(v \in C_i\), \(d(v)_{G \cup C_i} = d(v)_{G \cup C_{i-1}} + 2\) - else \(d(v)_{G \cup C_i} = d(v)_{G \cup C_{i-1}}\). Since we start with even degree and in each step the degree either remains unchanged or is increased by 2, the degree of all nodes is even.
<= Let \(G = (V,E)\) be a graph, such that every vertex \(v \in V\) has even degree.
–Proof by induction–
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}\)
–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\).
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.
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.
–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!
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\).