Bridges of Konisberg

This is essentially the origins of graph theory. The map is decomposed to the following graph:

"\\begin{document}\n\\begin{tikzpicture}\n % Define coordinates for the land masses\n \\coordinate (A) at (0,1);\n \\coordinate (B) at (0,0);\n \\coordinate (C) at (0,-1);\n \\coordinate (D) at (4,0);\n\n % Draw the land masses as filled circles\n \\node[draw, circle] at (A) (L1) {A};\n \\node[draw, circle] at (B) (L2) {B};\n \\node[draw, circle] at (C) (L3) {C};\n \\node[draw, circle] at (D) (L4) {D};\n\n % Draw the bridges\n % Bridge 1: A to B\n \\draw[line width=1pt, bend right=20] (L1) to (L2);\n % Bridge 2: A to B (another one)\n \\draw[line width=1pt, bend left=20] (L1) to (L2);\n\t\n\t% Bridge 3: A to D\n\t\\draw[line width=1pt] (L1) to (L4);\n\n % Bridge 4: B to C (two bridges)\n \\draw[line width=1pt, bend left=20] (L2) to (L3);\n \\draw[line width=1pt, bend right=20] (L2) to (L3);\n\n % Bridge 5: B to D\n \\draw[line width=1pt] (L2) -- (L4);\n\n % Bridge 6: C to D\n \\draw[line width=1pt] (L3) -- (L4);\n\\end{tikzpicture}\n\\end{document}"ABCD
source code

Is there a trail that visits each edge once?

Definition (Eulerian Graph)

A Graph is called Eulerian if it contains a circuit that visits each edge of once (and has the same start and end. That circuit is called an Eulerian Circuit.

If we are talking about a trail, then the graph is called Semi-Eulerian and the trail is called an Eulerian Trail.

Since a circuit is a trail, then

Observations On Eulerian Graphs

  • We note that if is Eulerian/Semi-Eulerian, it must be connected since there is no way to move between two connected components.
  • In any circuit, if you enter a vertex, you must also leave it. For some vertex , and edge that visits must have some edge that exits. In particular, each edge must come in pairs. Thus, if is Eulerian, then must be even .

Theorem (Eulerian Graphs have Even Degree)

A finite graph is Eulerian iff

  1. is connected except for its isolated vertices and
  2. all vertices of have even degree.

Proof: Let be Eulerian.

This is trivial. is immediate by definition of Eulerian, and two is from Observations On Eulerian Graphs.

We can ignore the isolated vertices, and only pay attention the singular connected component.

Claim A: has a circuit, or it is empty. This is obvious.

Claim B: The edges of can be partitioned into circuits.

We prove by strong induction. We only need to assume , in that all vertices of have even degree. If , then we are done (base case). Otherwise, we have some Cycle .

If we repeatedly remove from , then the degrees of the vertices are even. Indeed, each vertex in the cycle only has degrees, so we are only removing an even number of edges. Thus, satisfies . The vertices have or edges of .

By the inductive hypothesis, we can partition the edges into cycles, and we have proven B.

The reason we use strong induction here is because when we remove the first cycle , we want to be able to reason that , of some edges also satisfies the inductive hypothesis (as opposed to weak induction only allowing us to reason the next number/iteration).

Claim C: We can merge cycles together to form a circuit. Given two cycles, , have no common edges, but they have a common vertex.

"\\usepackage{tikz-cd}\n\\begin{document}\n% https://q.uiver.app/#q=WzAsNixbMCwyLCJcXGJ1bGxldCJdLFsyLDIsIlxcYnVsbGV0Il0sWzMsMSwiXFxidWxsZXQiXSxbMSwxLCJcXGJ1bGxldCJdLFsyLDAsIlxcYnVsbGV0Il0sWzQsMiwiXFxidWxsZXQiXSxbMCwxLCIiLDAseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFsxLDIsIiIsMCx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzAsMywiQ18xICIsMix7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fSxbMCw2MCw2MCwxXV0sWzMsMiwiIiwyLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMyw0LCJDXzIgIiwwLHsiY29sb3VyIjpbMjQwLDYwLDYwXSwic3R5bGUiOnsiYm9keSI6eyJuYW1lIjoiZGFzaGVkIn0sImhlYWQiOnsibmFtZSI6Im5vbmUifX19LFsyNDAsNjAsNjAsMV1dLFs0LDIsIiIsMCx7ImNvbG91ciI6WzI0MCw2MCw2MF0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9LCJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzMsMSwiIiwwLHsiY29sb3VyIjpbMjQwLDYwLDYwXSwic3R5bGUiOnsiYm9keSI6eyJuYW1lIjoiZGFzaGVkIn0sImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMSw1LCIiLDAseyJjb2xvdXIiOlsyNDAsNjAsNjBdLCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifSwiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFsyLDUsIiIsMCx7ImNvbG91ciI6WzI0MCw2MCw2MF0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9LCJoZWFkIjp7Im5hbWUiOiJub25lIn19fV1d\n\\begin{tikzcd}\n\t&& \\bullet \\\\\n\t& v && \\bullet \\\\\n\t\\bullet && \\bullet && \\bullet\n\t\\arrow[color={rgb,255:red,92;green,92;blue,214}, dashed, no head, from=1-3, to=2-4]\n\t\\arrow[\"{C_2 }\", color={rgb,255:red,92;green,92;blue,214}, dashed, no head, from=2-2, to=1-3]\n\t\\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=2-2, to=2-4]\n\t\\arrow[color={rgb,255:red,92;green,92;blue,214}, dashed, no head, from=2-2, to=3-3]\n\t\\arrow[color={rgb,255:red,92;green,92;blue,214}, dashed, no head, from=2-4, to=3-5]\n\t\\arrow[\"{C_1 }\"', color={rgb,255:red,214;green,92;blue,92}, no head, from=3-1, to=2-2]\n\t\\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=3-1, to=3-3]\n\t\\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=3-3, to=2-4]\n\t\\arrow[color={rgb,255:red,92;green,92;blue,214}, dashed, no head, from=3-3, to=3-5]\n\\end{tikzcd}\n\\end{document}"²v²²²²C2C1
source code

where is a circuit, and is another (ignore that the colors don’t match). You can think of the circuits at loop that

  • We have created a single circuit that uses all of their edges. Thus, C is proven.

Claim D: If is connected and its edges are partitions into some circuits , then is Eulerian. We prove this by induction on .

If , then we are done.

Note that should share some vertex with with . If not, would be disconnected, a contradiction. Let be this circuit using the edges of and . So our path

with our partition as our set of edges. Essentially, at each step we apply C and keep merging to a larger circuit until is just . By our inductive hypothesis, is Eulerian since we now have a Eulerian trail over the entire graph.

Theorem (Semi-Eulerian Can Have Odd Degrees)

A finite is Semi-Eulerian iff

  1. is connected except for isolated vertices
  2. has at most vertices of odd degree.

Proof:

Suppose had an Eulerian trail that starts at and ends at . If this is true, then if we add an edge , our trail is now a circuit since the start and end are the same.

If has a Eulerian trail (and thus Semi-Eulerian), then is Eulerian. By Theorem (Eulerian Graphs have Even Degree), is connected except for isolated vertices, proving . If we call this graph , then has even degrees. Upon removal of edge , every vertex of except has an even degree, proving .

We have cases on the number of odd degree vertices.

  • If there are zero, then is Eulerian, and thus Semi-Eulerian by definition of a circuit.
  • If there is one odd degree vertex, then this is impossible by the Handshake Lemma, since we would have an odd sum of edges.
  • If we have two odd degree vertices, , let where . has all even degree and is connected. By Theorem (Equivalent Eulerian), is Eulerian. Then has a circuit that ends at with edge , then removing it gives us an Eulerian trail, and so is Semi-Eulerian.

Alternative, Constructive Proof of Theorem

We can try to build a trail as we go. has an Eulerian trail that starting at some vertex iff

  • all the edges of connect to the vertex ,
  • at most one vertex other than has an odd degree.

Say we took some edge as the start of our trail for some graph . Obviously, the next edge must be incident with . In particular, we want to prove graph ( without ) should have an Eulerian trail starting at .

So, is true if

  1. at most one vertex other than has an odd degree in .
  2. is connected to all edges in .

This should look similar to what we were proving initially.

Here, is automatic if the removal of caused to have degree decreased, and thus are now even (with the degrees of the other vertices are invariant. Otherwise, has odd degrees in and some other vertex . After removal of , then has odd degree at and some other vertex . Unless of course, and holds.

For , we cannot choose a bridge (unless ). However, if and there are at most one other odd degree vertex, then has a a non-bridge edge.

Suppose by contradiction has only bridges,

"\\usepackage{tikz-cd}\n\\begin{document}\n\\begin{tikzcd}\n\t& {C_1} \\\\\n\t{C_2} & u & {C_3}\n\t\\arrow[no head, from=2-2, to=1-2]\n\t\\arrow[no head, from=2-2, to=2-1]\n\t\\arrow[no head, from=2-2, to=2-3]\n\\end{tikzcd}\n\\end{document}"C1C2uC3
source code

where are other connected parts of the graph. Then picking any edge will disconnect the graph. Suppose is the subgraph with and its edge to it. Then has an even number of odd degree vertices by the Handshake Lemma. In particular, an even number of odd degree vertices ensures has an even and thus an even . But then is an odd degree.

But then this implies has some other odd degree vertex. But then has exactly one (an odd number!) vertex of odd degree, contradicting the Handshake Lemma.

Thus there must exist at least one edge that is not a bridge. By always choosing this edge, the graph of the remaining edges stays connected, allowing us to traverse every edge and complete the Eulerian trail.