Title: Networks
1Lecture 10
2This lecture
- Introduction.
- Graph theory.
- Types of Networks.
- Path analysis.
- Flow analysis.
- Kevin Bacon and the spread of diseases.
3Introduction
- Types of networks
- Vehicle / Distribution
- Motorways, rail, electricity grid, water, nerves,
circuits. - Socio-economic
- Trade, politics, friendship.
- Spatial-temporal
- Timetables, zonal maps, chemical structures.
- Almost any set of complex relationships between
variables can be represented as a network in
variable space.
4Graph Theory
- The study of networks as graphs.
- How do we efficiently move around networks?
- How do networks break down?
- Can we add links to improve networks?
- How do things spread around networks?
5What is a graph?
- Combination of (potentially disconnected)
Vertices and Edges. - Can be Directional (sometimes called digraphs)
6Representing networks
- Vertices are the points on a network, edges are
the relationships. The degree of a vertex is the
number of edges it has connected to it. - Note that it is only the connections that matter,
not how theyre draw. - E.g. contiguousness in maps.
7Types of graph
Complete each vertex is connected to all the
others. Regular each vertex has the same
number of edges. Simple no loops or multiple
paths.
8Walks, Trails and Paths
- A Walk any sequence of adjacent edges.
- A Trail any sequence of unrepeated adjacent
edges. - A Path any sequence of adjacent edges that dont
visit the same vertex more than once.
A path that ends where it begins is called a
Cycle.
A trail, but not a path.
9Eulerian networks
- A graph is Eulerian is there is a trail
containing every edge in a graph. - Euler solved the Königsberg Bridges problem can
you cross all the bridges and return to your
starting point, crossing each once and once only
A
D
B
C
10Eulerian networks
- A graph will contain a cycle if each vertex has a
degree of 2. - A connected graph is Eulerian if, and only if,
the degree of each vertex is even. - A semi-Eulerian network is the same but doesnt
end up at its start. - A connected graph is semi-Eulerian when only two
of its vertices are odd. - Uses
- Designing one-way systems.
- Designing diversions / flow alterations.
11Fleurys Algorithm
- How to construct a Eulerian trail in a Eulerian
graph. - Start with any vertex, and travel through the
edges, following these rules - As you go through each edge, mark it as taboo.
- If you create isolated vertices, mark them as
taboo. - Only use a bridge as a last resort.
- A bridge is an edge connecting two otherwise
disconnected graphs
12Hamiltonian networks
- A graph is Hamiltonian if theres a path taking
in every vertex once only, that ends where it
began. - A graph is semi-Hamiltonian if theres a trail
taking in every vertex once only that doesnt end
where it began. - Diracs Theorem
- A simple graph with n vertices (more than two) is
Hamiltonian if the degree of each vertex is
greater than n/2. - Note that there may be more Hamiltonian
situations.
13Weighted graphs
- So far weve only been interested in connections,
but we can add strength, capacity, or length of
connections. - This gives much more realistic networks, and
allows us to study real path optimisation
problems.
3
4
1
1
3
Path length 5
2
3
14Path optimisation problems
- Three major problems
- Shortest Path Problem
- What is the shortest path between two points?
- Chinese Postman Problem
- What is the shortest way around a network back to
the start taking in each edge (imagining the
edges to be roads of houses)? - Travelling Salesman Problem
- What is the shortest way around a network back to
the start taking in each vertex (imagining each
to be a city)?
15Shortest Path Problem
- Find the shortest path across a weighted graph.
16Shortest Path Problem algorithm
- Move from A to B, treating all the vertices at
each distance from the start in turn. - Attribute the value of the shortest path to each
vertex to that vertex, then reassess each of its
neighbours to see if the path is now shorter to
them. - Continue until at the destination and follow back
shortest path.
9
8
9
5
9
5
3
3
14
3
A
0
A
0
2
2
1
1
2
2
17Chinese Postman Problem
- Suggested by Mei-Ku Kwan
- Find the shortest walk taking in all the weighted
edges and coming back to the start. - If the graph is Eulerian we can use Fleurys
method. - If not we find a semi-Eulerian trail using
Fleurys to take in all the edges. - We then use the Shortest Path algorithm to find
our way back to the start.
18Travelling Salesman Problem
- Find the shortest weighted path needed to visit a
number of cities once (i.e. the shortest
Hamiltonian path). - No efficient accurate algorithm.
- Could calculate all the possible Hamiltonians and
pick the shortest. - However, for 20 cities on a Hamiltonian graph,
there are about 6 x 1016 such possible paths. - One solution is to use a Minimum Connector.
19The Minimum Connector Problem
- Work out the smallest sub-network to connect a
set of vertices on a weighted network a
spanning tree. - Choose the smallest weighted edge.
- Continue picking the next smallest connected
edges but not using edges that form cycles with
the ones already picked.
3
3
3
2
2
2
1
6
1
6
1
6
5
5
5
20The Travelling Salesman revisited
- If we remove a vertex from a Hamiltonian path, we
end up with a spanning tree. - To get an good approximation for the Travelling
Salesman path, we - Remove a vertex from the graph, and its
associated edges. - Form the minimum connector for the rest of the
graph. - Add in the vertex and the two of its edges with
the minimum weights. - This will give us a semi-Hamiltonian which the
solution cant be better than, and which the
solution will be close to. - Alternatively use AI to search the solution space.
21Network flows strong connection
- Strongly connected graphs are those digraphs
where every vertex can be reach from every other. - A graph can be made into a strongly connected one
if each edge is in a cycle. - I.e. you cant make a purely one-way system in a
town split by a single bridge.
Strongly connected
Not strongly connected
22Maximum Flow Minimum Cut
- Given each part of a network has a capacity, what
is the maximum capacity of the network? - It equals the minimum capacity cut of the
graph. - A cut is a set of edges which a flow must pass
through one of.
Maximum flow 6
1
5
1
9
2
7
B
A
1
3
4
Cut 3
Cut 1
Cut 2
23Other things Graph Theory can help with
- Finding the distribution of flow in
interconnected networks with resistances and
inputs/outputs. - Calculating whether graph lines, e.g. railways,
need to cross. - Calculating the number of rearrangements possible
between vertices on a graph. - The maximum number of different paths between two
places. - Timetabling (using rooms and people as
components). - How many colours it takes to colour a zonal map.
- How long it takes to do a number of parallel
tasks. - Magic squares.
- Arranged marriages.
24Summary
- Graph theory encapsulates the mathematics of
networks. - Eulerian graphs are those where you can visit all
the edges one and end up at the start. - Hamiltonian graphs are those where you can visit
all the vertices once and end up at the start. - The rules for these graphs help us design network
systems.
25Summary
- By giving weights to edges we can model real
dynamic systems. - We can find out optimal paths.
- We can work out transport loads.
26?? Its a small world afterall ??
- How is it we often meet complete strangers with
whom we have a mutual acquaintance? - Its said that youre only six mutual associates
away from anyone in the world (Six Degrees of
Separation). - Stanley Milgram (1967) sent packages to people in
Nebraska and Kansas, with instructions to pass
them to people they thought might be closer to
targets in Massachusetts. Took an average of 5
steps to arrive. - How can this be possible given the following..?
- Every person knows only around a thousand people.
- There are six billion people on the globe.
27The Kevin Bacon Game
- Can you link any actor to Bacon via co-stars in
films? - Anyone whose co-starred in a film with Kevin
Bacon has a Bacon Number of one. - Anyone whos been in a film with a co-star of
Bacon has a Bacon Number of two, etc.
28Six Degrees of Kevin Bacon
- Peggy Mitchell has a Bacon number of three.
- Barbara Windsor was in Comrades (1987) with
Robert Stephens - Robert Stephens was in Chaplin (1992) with Diane
Lane - Diane Lane was in My Dog Skip (2000) with Kevin
Bacon
- Frank Butcher has a Bacon number of two.
- Mike Reid was in Snatch (2000) with Brad Pitt.
- Brad Pitt was in Sleepers (1996) with Kevin
Bacon.
29Is Kevin Bacon the centre of the Universe?
- The Internet Movie Database has 225226 connected
films. Each film has an average number of actors
of 61. - Yet the maximum Bacon Number found so far is only
11. - The average number of films between any actor and
Bacon is only 2.878 films. - So why is this so?
- Because social groups are a form of network known
as Small World graphs.
30Small World graphs
- A mix of strongly Clustered groups with a few
individuals who know many groups (cause the
social groups to overlap). - Fall between extremes in the level of local
clustering and Global Path Length the average
edges between two vertices.
Kevin
31Characteristics of Small World graphs
- Small World graphs have high clustering and low
global path lengths because of the lynchpin /
shortcut individuals. - Small Worlds are like Random Graphs with each
vertex being a cluster.
Random graph connected to near and far randomly
Caveman graphs
Trees
Low clustering, Short global path
High clustering, No global path length
Low clustering, Long global path length
32More characteristics
- In Random and Small World graphs
- Global Path Length is proportional to
ln(vertices). - Global Path Length is inversely proportional to
ln(associates). - The Global path length decreases extremely
rapidly as lynchpins / shortcuts increase
slightly from nothing. - Shortcuts cross vast areas of variable space to
link with unexpected groups.
33Spatial graphs
- Graphs where the distance over which connections
occur are much more limited because of resources. - Shortcuts are rare (its easier to link to nearby
nodes than stretch to the other side of a net) so
they rarely show Small World characteristics. - In such networks the Global Path Length scales
more linearly with the number of vertices.
34Uses of Small World theory
- The spread of disease (Watts, 1999).
- Spreading is controlled by
- The length of time that someone is infectious.
- The length of time someone is removed (sick but
not infectious, or if infinite immune or dead). - The infection probability / rate between 0 and 1.
- People are either Susceptible, Infectious or
Removed. - Watts mapped the proportions of these groups in
Small World societies and physically limited
networks for different disease parameters.
35Violent deadly diseasesSmall World
- Such diseases reach equilibrium when people are
removed faster than the disease spreads. - Theres a massive difference in deaths dependent
on shortcuts. - Hence cutting off diseased population is vital.
1
Equilibrium fraction of Susceptible people
0
0
1
Probability of infection
Tipping point Disease takes off
Everyone dies
36Other characteristics of disease spread
- If the disease infects the whole population, the
time to do so is also strongly dependent on the
fraction of shortcuts. - In physically limited graphs, however, the spread
is about the same whatever the range over which
vertices can connect. - Diseases are worse in Small World situations, but
more easily controlled.
37Foot and Mouth daily cases
- Cutting movements improved on 1967.
- Cases decreased when probability of inflection
lowered.
Source BBC / MAFF 4 May 2001
1967
24hr cull policy
50
Healthy cull policy
Initial May 5th predictions 400d-1
40
30
20
10
0
24 Feb
10 Mar
24 Mar
7 Apr
29 Apr
38Other uses of Small World theory
- Spread of information / fashion / memes.
- The resilience of networks to attack.
- The efficiency of distribution systems.
39Software
- Masses of software
- E.g. Inflow
- Network Centrality
- Small-World Networks
- Cluster Analysis
- Network Density
- Prestige / Influence
- Structural Equivalence
- Network Neighborhood
- External / Internal Ratio
- Weighted Average Path Length
- Shortest Paths Path Distribution
40Summary
- Graph theory encapsulates the mathematics of
networks. - Eulerian graphs are those where you can visit all
the edges one and end up at the start. - Hamiltonian graphs are those where you can visit
all the vertices once and end up at the start. - The rules for these graphs help us design network
systems.
41Summary
- By giving weights to edges we can model real
dynamic systems. - We can find out optimal paths.
- We can work out transport loads.
- The dynamics of networks can be strongly
determined by the difference in local clustering
and interconnections. - Small world graphs are useful for many situations
that are partly physically controlled but also
have shortcuts over long distances.
42Next lecture
- Pulling it together and doing it.