Sunteți pe pagina 1din 48

Graph Theory: Using

networks to solve problems


Dr Rosie Cameron
Department of Mathematics, MUN
What do these problems have in common?

How do rumours spread?

Setting up a computer network.

Predict the spread of disease in a population.


How to efficiently compare products?

How to design efficient road systems?


What do these problems have in common?

How do rumours spread?

Setting up a computer network.

Networks! Predict the spread of disease in a population.


How to efficiently compare products?

How to design efficient road systems?


Seven bridges of Königsberg

Can we cross each bridge exactly once?


Seven bridges of Königsberg

Can we cross each bridge exactly once?


Seven bridges of Königsberg

Can we cross each bridge exactly once?

What if we build extra bridges?


Seven bridges of Königsberg

Can we visit each district exactly once?


Graph theory
A “graph” is a set of nodes (vertices) and links (edges) between them.

Graph:
vertex

edge

Graph theory: The study of graphs, their properties and applications.


What do these problems have in common?

How do rumours spread?

Setting up a computer network.

Graph theory! Predict the spread of disease in a population.


How to efficiently compare products?

How to design efficient road systems?


Graph theory
• A cycle that goes through each vertex exactly once: Hamilton cycle
Graph theory
• A cycle that goes through each vertex exactly once: Hamilton cycle

• A set of edges that meets each vertex exactly once: 1-factor


The complete graph

K6 K5
Hamilton cycles
The complete graph always has a Hamilton cycle.
1-Factors
There is a 1-factor only when the complete graph is on an even number
of vertices.
1-Factors
There is a 1-factor only when the complete graph is on an even number
of vertices.
1-Factors
There is a 1-factor only when the complete graph is on an even number
of vertices.

A 1-factorisation: every edge in the graph is assigned to a 1-factor.


Hamilton cycles and 1-factorisations
A Hamilton cycle on an even number of vertices yields a pair of 1-
factors.
Hamilton cycles and 1-factorisations
A Hamilton cycle on an even number of vertices yields a pair of 1-
factors.
Hamilton cycles and 1-factorisations
A Hamilton cycle on an even number of vertices yields a pair of 1-
factors.

A pair of 1-factors doesn't always yield a Hamilton cycle.


Perfect 1-factorisations

When do the 1-factors from a 1-factorisation form Hamilton cycles?

Perfect 1-factorisation: Every pair of 1-factors is a Hamilton cycle.


Perfect 1-factorisations
A perfect 1-factorisation: any pair of 1-factors forms a Hamilton cycle.
Perfect 1-factorisations
A perfect 1-factorisation: any pair of 1-factors forms a Hamilton cycle.
Perfect 1-factorisations
A perfect 1-factorisation: any pair of 1-factors forms a Hamilton cycle.
This is not a perfect 1-factorisation!
Perfect 1-factorisations

• When does the complete graph have a perfect 1-factorisation?


• How can we construct them?

• Why are they useful???


Problem: Storing data efficiently

• We want to store data on a set of discs.


A B C D E F G H I J
Problem: Storing data efficiently

• We want to store data on a set of discs.


A B C D E F G H I J

• If two discs get destroyed, can we recover the information?

A B C D E F G H I J
Storing data efficiently
A B C D E F G H I J

Ideas:
• Repeat data: store everything on two discs
• Have one "check disc" with A+B+C...
Storing data efficiently
A B C D E F G H I J

Ideas:
• Repeat data: store everything on two discs
• Have one "check disc" with A+B+C...

• We can use perfect 1-factorisations!


Binary addition

• Data is often stored as a binary string: 00111010


• We use bitwise addition of binary strings: 1+1=0, 1+0=1, 0+0=0
Binary addition

• Data is often stored as a binary string: 00111010


• We use bitwise addition of binary strings: 1+1=0, 1+0=1, 0+0=0
00111010
+ 10110010
10001000
Binary addition

• Data is often stored as a binary string: 00111010


• We use bitwise addition of binary strings: 1+1=0, 1+0=1, 0+0=0
00111010
+ 10110010
10001000
• "Minus" is the same as "plus": 1+1=0 and 1-1=0.
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.

• Edges represent pieces of data


(like labels)
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
A
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
A

Data to store on ‘red’ disc


• data{3,9}
• data{4,8}
• data{5,7}
• data{6,10}
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.

Data to store on ‘blue’ disc


• data{2,3}
• data{1,4}
• data{6,8}
• data{7,9}
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
A

Data to store on ‘red’ disc


• data{3,9}
• data{4,8}
• data{5,7}
• data{6,10}
• data{1,12}=data{1,2}+data{1,3}
+data{1,4}+data{1,5}+data{1,6}
+data{1,7}+data{1,8}+data{1,9}
An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.
A

Data to store on ‘red’ disc


• data{3,9}
• data{4,8}
• data{5,7}
• data{6,10}
• data{1,12}=data{1,2}+data{1,3}
+data{1,4}+data{1,5}+data{1,6}
+data{1,7}+data{1,8}+data{1,9}

Using “bitwise binary addition”


An array code on 10 discs
• A perfect 1-factorisation of K12 tells us where to store the data.

Data to store on ‘blue’ disc


• data{2,3}
• data{1,4}
• data{6,8}
• data{7,9}

• data{5,12}=data{1,5}+data{2,5}
+data{3,5}+data{4,5}+data{7,5}
+data{5,8}+data{5,9}+data{5,10}
Restoring lost data
A B C D E F G H I J
Restoring lost data
Restoring lost data
data{10,12}=data{4,10}+data{5,10}+data{8,10}+data{9,10}+data{2,10}+
data{3,10}+data{6,10} +data{7,10}
Restoring lost data
data{10,12}=data{4,10}+data{5,10}+data{8,10}+data{9,10}+data{2,10}+
data{3,10}+data{6,10} +data{7,10}

data{6,10}=data{10,12}-(data{4,10}+data{5,10}+data{8,10}+data{9,10}+
data{2,10}+ data{3,10}+data{7,10})
Restoring lost data
data{10,12}=data{4,10}+data{5,10}+data{8,10}+data{9,10}+data{2,10}+
data{3,10}+data{6,10} +data{7,10}

data{6,10}=data{10,12}-(data{4,10}+data{5,10}+data{8,10}+data{9,10}+
data{2,10}+ data{3,10}+data{7,10})

data{6,8}=data{6,12}-(data{4,6}+ data{3,6} data{2,6}+ data{1,6}+


data{6,10}+ data{6,9}+ data{6,7)

etc…
Restoring lost data

• Perfect 1-factorisation on K12


• Array code:
• 10 discs
• 40 pieces of data
• 10 ‘check’ data
• If two discs fail then we can restore all of the data

Reference: N. Deo and S. Nanda, One-factors and Hamiltonian paths in modeling


data and parity placement disk arrays, Congressus Numerantium (2005).
Efficiently storing data.

Setting up a computer network.

How do rumours spread?

Graph theory! Predict the spread of disease in a population.

How to efficiently compare products?


How to design efficient road systems?

S-ar putea să vă placă și