graphs edge(arc) vertices can be even or odd or undirected (two-way) edges can be directed (one-way)...
TRANSCRIPT
Graphs
Edge(arc)
Vertices can be even or odd
or undirected (two-way)
Edges can be directed (one-way)
This graph is connected.
Degree(order) = 3Odd vertex
The degree(order) of a vertex is the number of edges meeting at a vertex
vertex (node)
Degree(Order) = 2Even vertex
This is a graph.
The stations are the nodes and the tracks are the arcs.
The London Tube map is an example.
The arcs only indicate which nodes are joined not the distance between them.
It should be called the London Tube Graph
Graph
Map
Before Harry Beck redesigned the tube map 1931 (Beck was responsible for the iconic, more user-friendly version we use today), Londoners used this map to navigate the underground network. It has many lost stations on it as well as different names for some existing ones.
49 mins
39 mins
28 mins
22 mins
24 mins
29 mins
34 mins
15 miles
17 miles
15 miles
12 miles
17 miles
21 miles
20 miles
Networks
Colchester
Stowmarket
IpswichSudbury
Bury St Edmunds
Harwich
In a Network the arcs have values such as distances or journey times or traffic flow
Degree 3
Degree 2
loop
Multiple arc
arc
The Degree ( Order) of a node
An arc that starts and finishes at the same vertex is a LOOP.A graph with no loops or multiple edges is called a simple graph.
is the number of arcs that meet at that node.
A connected graph has all nodes linked in.
A graph that ‘falls apart’ is disconnected.
disconnected simple connected graph
A little history: the Bridges of Koenigsberg
• “Graph Theory” began in 1736• Leonhard Eüler
– Visited Koenigsberg– People wondered whether it is possible to take a walk, end up where you started from, and cross each bridge in Koenigsberg exactly once
The Bridges of Koenigsberg
A
D
C
B
1 2
4
3
7
65
Is it possible to start in A, cross over each bridge exactly once,
and end up back in A?
The Bridges of Koenigsberg
A
D
C
1 2
4
3
7
65
Translation into a graph problem: Land masses are “nodes”.
B
The Bridges of Koenigsberg
1 2
4
3
7
65
Translation into a graph problem : Bridges are “arcs.”
A
C
D
B
The Bridges of Koenigsberg
1 2
4
3
7
65
Is there a “walk” starting at A and ending at A and passing through each arc exactly once?
Such a walk is called an eulerian cycle.
A
C
D
B
If every node is linked to every other node by a single edge it is complete.
Everything meets when its complete
If a graph is complete it is given the name Kn where n is the number of nodes.
K5K3
If every node is linked to every other node by a single edge it is complete.
K5K3
How many arcs(edges)? Find a rule!Make a tableK3, K4, K5, K6 etc
If a graph contains a closed trail then that section is called a cycle.
A,B,D is a cycle in the graph below.
B
A
D
C
A Cycle:
A connected graph in which there are no cycles (not closed) is called a Tree.
The number of arcs of a tree is one less than the number of nodes.
No. Arcs = No. Nodes =
Tree
7 8
No. arcs = No. nodes -1
PathsRoutes that do not visit any vertex more than onceand do not go along any edge more than once except the start.
A cycle forms a loop by returning to its starting point
Colchester
Stowmarket
IpswichSudbury
Bury St Edmunds
Harwich
adjacency matrix
010001
100110
000100
011010
010101
100010B Su C H I St
B
Su
C
H
I
St
An Adjacency Matrix shows which vertices are joined
Colchester
Stowmarket
IpswichSudbury
Bury St Edmunds
Harwich
distance matrix
B Su C H I St B
Su
C
H
I
St
15 miles
17 miles
15 miles
12 miles
17 miles
21 miles
20 miles
01200015
120017200
0002100
017210150
020015017
15000170
An Distance Matrix shows the distance between vertices.
As it is undirected the matrix is symmetricalHarwich to Colchester = Colchester to Harwich
Directed Graphs (Digraph)If it is only possible to travel along the arcs in one direction then the graph is called a digraph.
If a graph represents a street plan then some of the streets may be one way.
Arrows are used to indicate the allowable direction.
Arcs without arrows can be travelled in either direction
B
A D
C3
2 14
5
If the network is a directed graph then the direction matters and the matrix is not symmetrical as can be seen below.It is not possible to go From A To B as the route is directed. A To C is 4 whereas C To A is 5
A B C D
From
A 4
B 2 3
C 5 3 1
D 1
To
DCBA
1
134
32
42
D
C
B
AB
A D
C3
2 14
Networks
A network is graph where each arc has a weight.
This could be a distance if it represents a map or the number of cars that can travel down a roadin a specified time without becoming congested.
Representing a network using a matrix
Graphs in our daily livesGraphs in our daily lives
• Transportation• Telephone • Computer• Electrical (power)• Pipelines• Molecular structures in biochemistry
Telephone network
Molecular chain of atoms in protein
Review of Graphs• A graph (or network) consists of
– a set of points– a set of lines connecting certain pairs of the points.
The points are called.
The lines are called• Example:
nodes (or vertices)
arcs (or edges or links).
Terminology of Graphs: Paths
• A path between two nodes is a sequence of distinct nodes and edges connecting these nodes.
Example:
• Walks are paths that can repeat nodes and arcs.
a
b
Adding two bridges creates such a walk
1 2
4
3
7
65
A
C
D
B
8
9
Here is the walk.
Note: the number of arcs incident to B is twice the number of times that B appears on the walk.
Existence of Eulerian Cycle
1 2
4
3
7
65
A
C
D
B
8
9
The degree of a node is the number of arcs that meet at the node
6
4
4
4
Theorem. An undirected graph has an eulerian cycle if and only if (1) every node degree is even and (2) the graph is connected (that is, there is a path from each node to each other node).