Wagner's Wonder

An introduction to graph theory

Main contents 1

Recommendation: you can either first go over the glossary to comprehend the terminologies, or directly go through the results and refer to the glossary along the way. Also, you can take some scratch paper to visualize some of the contents yourself.

Let's first tackle the classic Königsberg's bridges problem.

    Theorem 1
A connected graph G has a closed Eulerian trail if and only if() all vertices of G have even degrees.

Proof First we prove the "only if"() part. That is, the presence of a closed Eulerian trail implies that all vertices have even degrees.

In fact, take a closed Eulerian trail(call it W) and let A be a vertex that's not the starting(also ending) point of W. Assume that A is visited a times by W. Because each time the trail enters A, it has to exit, there are 2a edges in connection with A. Since the Eulerian trail uses every edge in a graph, A has a degree of 2a, which is even. Now, say B is the start and the end of W. If B is visited exactly b times between the start and the end, the degree of B would be 2b+2 where the +2 comes from the start and end. So indeed every vertex has an even degree.

Then, we prove the "if"() part. Assume every vertex has an even degree. Take any vertex S, and start walking along on edge e1 to A1, and walk along any new edge e2 from A1. Repeat this process, until a closed trail C1 is formed. Note that since G is finite(universal assumption unless specified otherwise), such a C1 always exists. If C1=G, we are done; else, choose a vertex v0 in C1 such that C1 doesn't contain all edges incident at v0.

Remark: such a vertex always exists. Suppose C1 has all edges connecting to all vertices in it. As C1G, C1 has fewer edges than G, so there is some vertex A that's not in it. However, because G is connected, there is a path from A to a vertex of C1. So start walking on this path, and the moment you reach C1's vertex(say V), the most recent edge is connected to V but not in C1. Contradiction.

So let's remove all edges of C1 from G, and we obtain a graph with all even degrees again(because at the beginning all degrees are even, and by removing a closed trail, we have removed an even number of edges on each vertex). Now, start at v0, take another closed trail in what's left(call it C2). Thereafter, we can unite C1 and C2 by first walking by C1, stopping at v0, and then completing C2, coming back to v0, and finishing the rest of C1. If C1C2=G, we are done. Else, repeat the process above and it will eventually stop(again, because G is finite), meaning a closed Eulerian(using every edge) trail has been formed on G.

So what can we say about the bridges now...





Now we will look at a pertinent result.

    Theorem 2
A connected graph G has an Eulerian trail starting at vertex S and ending at a different vertex T S and T have odd degrees and all other vertices have even degrees.

Proof Add a new edge joining S and T and call the new graph H.

Claim: H has a closed Eulerian trail G has an Eulerian trail starting at S and ending at T.

Proof of the claim: left as an exercise for the readers(hint: fairly trivial--just follow the structure of the proof above).

The theorem then follows from Theorem 1(as now in H deg(S) and deg(T) are even).



The following theorem illustrates a fundamental result that's cohesively utilized in many other scenarios.

    Theorem 3
A graph G without loops has an even number of vertices whose degrees are odd.

Proof Take such a graph with e edges. Let d1,d2,...,dn be the degrees of the n vertices of G. Now it's time to introduce a lemma.

Lemma i=1ndi=2e.

Proof of the lemma: on the left hand side, each edge is counted twice(each time by one of its two endpoints).

So if G has an odd number of vertices with odd degrees, the sum of degrees would also be odd but it's equal to 2e. Contradiction.




Imagine the following scenario: your year group is holding an end-of-year party and there will be a round-table dinner. Everyone will sit somewhere around the table. Is it possible that all participants have their friends sitting next to them? Well, the following result could assist you in determining that.

    Theorem 4
Let n3 and G be a simple graph on n vertices. Assume that all vertices in G are of degree at least n/2. Then, G is Hamiltonian(i.e., has a Hamiltonian cycle).

Proof First note that G must be connected since otherwise, it would have a component of less than n/2 vertices(but why is that?), meaning the vertices in that component have degrees smaller than n/2.

Assume that G doesn't have a Hamiltonian cycle. Let's add new edges to G(anywhere) as long as we can without creating a Hamiltonian cycle. When we stop adding, we have a new graph, call it G'. All vertices in G' have similarly degrees at least n/2 and there's no Hamiltonian cycle. Again, at this stage, adding any new edge would induce a Hamiltonian cycle.

Let P be a path of maximum length in G'. It's true that P contains all vertices of G'. Indeed, let x and y be vertices in G' such that xy is not an edge of G'. As adding the edge xy would induce a Hamiltonian cycle, it follows that G' has a Hamiltonian path(encompassing all vertices) from x to y.

By our condition, deg(x)+deg(y)n. Claim: there exists some i where 2in1, and both xzi and zi1y are edges of G'.

Proof of the claim: Assume otherwise. Then, if y has k neighbors, x has at most n(k+21) neighbors(but why is that?). Thus, deg(x)+deg(y)n1. Contradiction with our condition.

Now, the sequence xz2...zi1yzn1...zix is a Hamiltonian cycle. Contradiction.

The following image illustrates the main idea of the proof, although the labels have some disparities.



You can interact with the following embedment: attempt to create a Hamiltonian cycle by clicking on the vertices one by one. Note: this animation isn't a visualization of Theorem 4, but rather highlights the logic that if G is Hamiltonian, it's not necessarily true that all vertices of G are of degree at least the order of G over 2. That is, the lower-bound condition is sufficient for a Hamiltonian cycle to exist, but not necessary.

v1-v2v1-v3v1-v5v2-v3v2-v4v3-v4v3-v5v4-v5v4-v6v5-v6v13v23v34v44v54v62



Notice that everything we have covered so far is related to graphs in which edges have no directions. Every edge is analogous to a two-way street. Now, we are going to add directions to(orientate) graphs.

    Theorem 5
A directed graph G has a closed Eulerian trail it's balanced and strongly connected.

Proof First let's prove the conditions are necessary(): as a closed Eulerian trail leaves and enters each vertex the same amount of times, G must be balanced(by definition). Meanwhile, such a trail provides a trail(path) from any vertex to any other vertex, so G must be strongly connected.

Then let's prove the conditions are sufficient(). This would resemble the proof of Theorem 1. In fact, all we need to do is to supersede "edges" by "directed edges"(left as an exercise for the readers).



Now we will prove something similar to Theorem 4, but in the spirit of directed graphs as well.

    Theorem 6
A tournament T has a Hamiltonian cycle it's strongly connected.

Proof First we prove the "" part(the trivial one). Indeed, if there's a Hamiltonian cycle, that cycle would provide a directed path from any vertex to any other vertex(by omitting the last edge in a cycle, we have a path). So T is strongly connected.

Then we prove the "" part(the non-trivial one).

Claim: T contains a cycle(not necessarily Hamiltonian)

Proof of the claim: Assume T doesn't. Then, for xy,yzE(T), we must have xzE(T) because otherwise there would be a cycle of length 3. So T is transitive, in which the vertices can be listed from left to right such that ijE(T) if and only if j is on the right of i. But such a T isn't strongly connected as no path goes from right to left. Contradiction.

Now let C=y1y2...yky1 be a cycle of maximal length in T, and assume C isn't Hamiltonian. As T is strongly connected and C doesn't contain all of V(T), there exists an edge from C to some vertex xC. Say this edge is y1x. Note that if xy2 were an edge, y1xy2...yky1 would be a cycle longer than C, contradicting C's maximality. Therefore, y2x,y3x,...,ykxE(T).

Let Z be the set of vertices zV(T) such that y1zE(T). By the observation above, zZ,i=1,...,k, we must have yizE(T) for the sake of not contradicting C's maximality. Let zt be an edge with (z \in Z\) and tZ(such an edge exists because of the strong connectivity. More specifically, if there is no such edge, then the outdegree of z would be 0, meaning z can't get to any other vertex(you may think it has a negative divergence), contradicting the strong connectivity). Again, by the same observation, tC.

Conclusively, tC,tZ, which implies that because of strong connectivity, ty1E(T)(if y1t is instead an edge, t would be in Z).

However, we now have a new cycle: zty1y2...ykz, which is longer than C. Contradiction.

Thus, C is Hamiltonian.

Copyright © Wagner's Wonder 2023