M Clements Formal Network Theory
Introduction Practical problem – The Seven Bridges of Königsberg Network graphs Nodes & edges Degrees Rules/ axioms Practical uses 31/01/ EISCN
Once upon a time long long ago… Old fairytale pic of konigsberg 31/01/ EISCN
31/01/ EISCN The city of Königsberg in Prussia
The Seven Bridges Problem (see handout) Is there a walk through the city that crosses each bridge once and only once. The islands cannot be reached by any route other than the bridges, and every bridge must be crossed completely every time; you cannot walk halfway onto a bridge and then turn around and later cross the other half from the other side. The walk need not start nor end at the same spot. 31/01/ EISCN
Have you heard the one about the two princes and the bishop? 31/01/ EISCN
31/01/ EISCN
Activity We need to work out the locations of: 1. The Blue Prince’s new bridge. 2. The Red Prince’s new bridge. 3. The Bishop’s new bridge. How easy will it be to work out heuristically where the new bridges should go? A better method follows…… 31/01/ EISCN
31/01/ EISCN Start with the problem statement Add meaningful labels
31/01/ EISCN Remove the pictorial elements
31/01/ EISCN Reduce the diagram to a set of nodes that represent the land masses, keeping the labels. Represent the bridges as edges (lines) between the nodes.
31/01/ EISCN You now have a connected graph with nodes and edges. Summary 4 nodes and 7 edges exist as in the starting statement
31/01/2016EISCN 13 Count the number of edges attached to each of the nodes in the graph
31/01/2016EISCN 14 Note whether the degree of each node is even or odd
Now analyse a simple graph For the graph shown there is a complete circuit. Where can you start from? What degree do the nodes have (odd or even)? What rule(s) could we begin to formulate? 31/01/2016EISCN 15
Further analysis – more complexity Where does the path shown begin and end? Are there other paths? What are the degrees (odd or even) of the start and end points? What rule(s) could we begin to formulate? 31/01/2016EISCN 16
Even more complexity….. Can a path be drawn now? There are now more than 2 nodes of odd degree. What rule(s) could we begin to formulate? Leonhard Euler followed our thinking process….. 31/01/2016EISCN 17
Formal network analysis In 1735, the mathematician Leonhard Euler solved the Seven Bridges of Königsberg problem using the techniques we have just used. In his honour, a path through a graph that starts at any node, traverses every edge, and ends at the start node is called an Eulerian Circuit. And, a path through a graph that starts at one node, traverses every edge, and ends at a different node is called an Eulerian Path. Such analysis led Euler to his theorems….. 31/01/2016EISCN 18
Euler’s Theorems 1. If a graph has any nodes of odd-degree, then it CANNOT have an Eulerian Circuit. AND If a graph is connected and every node has even-degree, then it has AT LEAST ONE Eulerian Circuit (usually more). 2. If a graph has more than 2 nodes of odd-degree, then it CANNOT have an Eulerian Path. AND If a graph is connected and has exactly 2 nodes of odd-degree, then it has AT LEAST ONE Eulerian Path (usually more). Any such path must start at one of the odd-degree nodes and end at the other. 3. The sum of the degrees of all the nodes of a graph is an even number (exactly twice the number of edges). In every graph, the number of nodes of odd-degree must be even. 31/01/ EISCN
So.. how do we draw an Eulerian circuit? First, use Euler’s theorems to prove that an Eulerian circuit actually exists. Second, use Hierholzer’s algorithm. 1. Draw any circuit that arrives back at the starting node, noting the START node. 2. Choose another node that has a pending edge and draw any circuit that arrives back at the same chosen node. 3. If necessary, repeat step 2 until all edges have been traversed. 31/01/2016EISCN 20
31/01/2016EISCN 21 Draw an Eulerian Circuit using Hierholzer’s algorithm
Practical uses of graphs Checking for redundant paths in a network. Routing algorithm development. Shortest path problem. Finding minimum spanning tree, etc., etc. Other uses exist in other engineering fields e.g. Kirchhoff's junction rule. 31/01/2016EISCN 22
Summary Complex networks can be analysed using graph theory. Graphs have nodes and edges. Nodes have degrees. Eulerian circuits and paths may exist. Euler’s theorems solve path and circuit problems. Algorithms e.g. Hierholzer’s exist to navigate graphs. 31/01/2016EISCN 23
Finding an Eulerian Circuit 31/01/2016EISCN 24
Draw any circuit, noting the start 31/01/2016EISCN 25
Colour added to help differentiate 31/01/2016EISCN 26
Draw another circuit 31/01/2016EISCN 27
Draw the last circuit 31/01/2016EISCN 28
31/01/2016EISCN 29
One way to number the circuit… From the start node, begin numbering edges until you encounter another circuit. Join that circuit and number the edges until you meet another circuit. Join that circuit and circumnavigate it. Rejoin the previous circuit again until you reach the original circuit, continue to the start node. 31/01/2016EISCN 30
Finished! 31/01/2016EISCN 31