Professional Documents
Culture Documents
The distance between two vertices is the length of a shortest walk(path) between them
Notation:
dist(x): distance from vertex s to x,
w(e) : edge-weight
P(e): P-value, (for each frontier edge e)
P( e ) dist ( x ) w( e )
This is an example of a
Chinese postman problem.
college.
College B
(C)
D
Think about
Is it possible to deliver
leaflets to the houses in
E
these streets without
travelling along the same
street twice?
F
G
The college map is an example of a graph.
Here are some others.
A graph is made up of a
collection of vertices
called nodes, joined by
edges called arcs.
A traversable graph is
one that can be drawn
without taking a pen
from the paper and
without retracing the
same edge Think about
Which of the graphs above can be traced without taking your pen from the paper?
A Swiss mathematician, Leonhard Euler (1707 to 1783),
published the first paper on graph theory in 1736.
Residents of Konigsberg
wanted to know if it was
possible to find a route
which passed across each
of the bridges only once.
Euler found that the order of the vertices determines
whether or not a graph is traversable.
order 1
order 2
order 3
order 4
order 6
order 5
Vertices:
A
A order 4
B order 4
C order 5
College B
D order 2 D
E order 4
F order 4
E
G order 3
The only odd
vertices are C F
G
and G
An Eulerian trail is only possible if all vertices are even.
Think about Can you explain why?
A semi-Eulerian trail
is possible:
130m
This started at C but A
100m
ended at G. 80m
H order 2
Odd vertices: A, C, E, G
Possible pairings: AC + EG = 9 + 8 = 17 mins
AG + EC = 13
+ 7 = 20 mins
AE + CG = 5
+ 11 = 16 mins
Easter Parade G
10 min H
The smallest 11 min 6 min
total is:
8 min F
AE + CG = 16 min 9 min
Add these edges to E 4 min
the network 9 min
7 min 8 min
C D
The total time in 5 min
the original
network = 97 min 9 min 5 min
6 min B
A
c d
The level of a vertex is the number of edges along the unique
path between it and the root.
The height of a rooted tree is the maximum level to any vertex of
the tree.
The children of a vertex v are those vertices that are adjacent to
v and one level farther away from the root than v.
When every vertex in a rooted tree has at most two children, the
tree is called a binary tree.
Binary trees and traversals 6