Graph Theory: Week 1
Introduction to Graph Theory
Dr. John Quinn
21st August, 2007
Dr. John Quinn
Graph Theory: Week 1
The Tokyo subway
Dr. John Quinn
Graph Theory: Week 1
Week 1 overview
What are graphs? Why study graph theory? Examples of graphs in the real world Different types of graphs Example problem: finding the shortest path Example problem: three houses Example problem: allocating jobs
Dr. John Quinn
Graph Theory: Week 1
What is a graph?
C
B
D
F
A
E
Graphs have vertices and edges. An edge normally connects two vertices. There are different types of graphs, which we will look at later. . .
Dr. John Quinn Graph Theory: Week 1
Why study graph theory?
Useful set of techniques for solving real-world problems. Graph theory is useful for analysing “things that are connected to other things”, which applies almost everywhere. Some difficult problems become easy when represented using a graph. There are lots of unsolved questions in graph theory: solve one and become famous.
Dr. John Quinn
Graph Theory: Week 1
Graph example: Gnucleus peer connections
Source: cybergeography.org
Dr. John Quinn Graph Theory: Week 1
Graph example: Structure of the internet
Source: Internet Mapping Project
Dr. John Quinn Graph Theory: Week 1
Weighted graphs
C 2 1 D 2 E 1 F 2
B 1 A
4
Can extend graphs by associating a weight with each edge. Might represent e.g. the cost of travelling between two points.
Dr. John Quinn Graph Theory: Week 1
Directed graphs (digraphs)
C 2 1 D 2 E 1 F 2
B 1 A
4
Can also make edges directional. This might now represent, for example, a network of one-way streets.
Dr. John Quinn Graph Theory: Week 1
Dijkstra’s algorithm
A useful algorithm for finding the shortest path between different vertices. Details on
en.wikipedia.org/wiki/Dijkstra%27s_algorithm.
Dr. John Quinn
Graph Theory: Week 1
Class exercise: shortest path examples
Dr. John Quinn
Graph Theory: Week 1
Another shortest path problem
C 2 1 D 2 E 1 F 2
B 1 A
4
What’s the shortest path between A and F, using Dijkstra’s algorithm?
Dr. John Quinn Graph Theory: Week 1
Bipartite graphs
In this type of graph, the vertices are divided into two sets. There are no edges between vertices in the same set. This graph is also complete (all possible edges are present).
Dr. John Quinn Graph Theory: Week 1
The three houses problem
Electricity Water Telephone
House 1
House 2
House 3
Three companies need to make connections to three houses. Is it possible to do this without the pipes crossing over?
Dr. John Quinn Graph Theory: Week 1
Class exercise: matching jobs to candidates
Dr. John Quinn
Graph Theory: Week 1
New concepts this week
Graphs as sets of edges and vertices Different types of graphs: directed, undirected, bipartite Dijkstra’s algorithm to find shortest paths Incidence and adjacency Incidence matrices Neighbourhoods
Dr. John Quinn
Graph Theory: Week 1
Online course material
Lecture notes and reference material will be added to Blackboard each week: http://blackboard.mak.ac.ug. Lecture notes will also be available on the public course homepage:
http://omnipresence.org/jq/teaching/graphtheory
(this site will be moved to cit.ac.ug some time later).
Dr. John Quinn
Graph Theory: Week 1