Professional Documents
Culture Documents
Part 1 – Networks
1
Networks.
Degree of a vertex
The degree of a vertex is the number of edges attached to the vertex.
2
Network elements: definitions
A network is a diagram that consists of a set of points called vertices that are joined by a set
of lines called edges. Each edge joins two vertices.
A loop is an edge in a network that joins a vertex in a network to itself.
Two or more edges that connect the same vertices are called multiple edges.
The degree of a vertex is the number of edges attached to the vertex. The degree of a
vertex is denoted deg(V). For example, in the network
below, deg(A)=4, deg(B)=2, deg(C)=4 and deg(D)=2.
Note: A loop contributes two degrees to a vertex because a loop is attached to its vertex at
both ends.
In any network, the sum of degrees of the vertices is equal to twice the number of edges.
Note: A loop contributes one edge to the network.
Describing graphs
Graphs that represent connections between objects can take different forms and have
different features. This means that there is a variety of ways to describe these graphs.
Simple graphs
Isolated vertex
3
A graph has an isolated vertex if there is a vertex
that is not connected to another vertex by an edge.
The isolated vertex in this graph is E, because it is not
connected to any other vertex by an edge.
Complete graphs
Subgraphs
4
Exercise 1.1
1. For each network shown, complete the associated statements by filling in the boxes.
a)
b)
c)
5
1. The network has ___________
vertices.
2. The network has ___________
edges.
3. The network has ___________
loops.
4. deg(A)= ___________
5. deg(C)= ___________
6. The network has ___________ odd
vertices.
7. The network has ___________
even vertices.
d)
2. What is the sum of the degrees of the vertices of a network with: (In each case draw an
example of the network and check your answer.)
a) five edges?
b) three edges?
c) one edge?
6
4. This section of a road map can be considered
as a graph, with towns as vertices and the
roads connecting the towns as edges.
Trees
Spanning trees
Every connected graph will have at least one subgraph that is a tree. A subgraph is a tree,
and if that tree connects all of the vertices in the graph, then it is called a spanning tree.
Trees
A tree has no loops, multiple edges or cycles.
If a tree has n vertices, it will have n−1 edges.
A spanning tree is a tree that connects all of the vertices of a graph.
There can be more than one spanning tree for any connected graph. The total weight of a
spanning tree is the total of all the weights on the edges that make up the tree.
7
Minimum spanning trees
One of the spanning trees from a particular connected graph will have the smallest total
weight. This tree is called the minimum spanning tree. Minimum spanning trees can be
found using an algorithm called Prim’s algorithm.
Prim’s algorithm for finding a minimum spanning tree
Choose a starting vertex (any will do).
Inspect the edges starting from the starting vertex and choose the one with the lowest
weight. (If there are two edges that have the same weight, it does not matter which one you
choose). The starting vertex, the edge and the vertex it connects to form the beginning of
the minimum spanning tree.
Now inspect all of the edges starting from both of the vertices you have in the tree so far.
Choose the edge with the lowest weight, ignoring edges that would connect the tree back to
itself. The vertices and edges you already have, plus the extra edge and vertex it connects
form the minimum spanning tree so far.
Keep repeating this process until all of the vertices are connected.
8
Exercise 1.2
2. Find a minimum spanning tree for each of the following graphs and give the total
weight.
a)
b)
c)
9
d)
3. In the network opposite, the vertices represent water tanks on a large property and
the edges represent pipes used to move water between these tanks. The numbers
on each edge indicate the lengths of pipes (in m) connecting different tanks.
Determine the shortest length of pipe needed to connect all water storages.
10
Planar graphs
Some graphs do not initially appear to be planar; for example, Graph 1 shown below left.
However, Graph 2 (below right) is equivalent (isomorphic) to Graph 1. Graph 2 is clearly
planar.
Non-planar graph
11
Not all graphs are planar.
For example, the graph opposite cannot be redrawn in an equivalent planar form, no matter
how hard you try.
Faces of a graph
The graph opposite can be regarded as dividing the paper it is drawn on into two regions.
In the language of graphs, these regions are called the faces of the graph.
One face, f1, is bounded by the graph.
The other face, f2, is the region surrounding the graph. This ‘outside’ face is infinite.
The graph opposite divides the paper into four regions, so we say that it has four
faces: f1, f2, f3 and f4. Here f4 is an infinite face.
12
Euler’s formula
Euler discovered that, for connected planar graphs, there is a relationship between
the number of vertices, v, the number of edges, e, and the number of faces, f. This relationship
can be expressed in words as:
Euler’s formula
For a connected planar graph:
Exercise 1.3
1. Which of the following graphs are drawn in planar form?
a)
b)
13
c)
d)
e)
f)
2. Redraw each graph in an equivalent planar form.
a)
b)
14
c)
d)
e)
f)
a)
15
b)
c)
d)
a) f given v=4 and e=4
b) v given e=3and f=2
c) e given v=3 and f=3
d) v given e=6 and f=4
e) f given v=4 and e=6
f) f given v=6 and e=11
g) e given v=10 and f=11
16
17
3. The five graphs shown below are known as the platonic (after Plato) solids.
For each graph, write down the values of v, e and f and show that they satisfy Euler’s
formula.
18
Eulerian and semi-Eulerian graphs
Eulerian graphs
A graph is described as Eulerian if it has a circuit that includes every edge once only. The
circuit in an Eulerian graph is called an Eulerian circuit.
To be Eulerian, a graph must:
be connected
have all vertices of an even degree.
An Eulerian circuit can start at any vertex and will also finish at that vertex.
Semi-Eulerian graphs
A graph is described as semi-Eulerian if it includes every edge once only. The trail in an
Eulerian graph is called an Eulerian trail.
To be semi-Eulerian, a graph must:
be connected.
have exactly two vertices of an odd degree.
An Eulerian trail must start at one of the odd degree vertices and will finish at the other odd
degree vertex.
Hint: Remember that Eulerian graphs are concerned with following edges and both begin
with “e”.
A Hamiltonian graph is a graph that contains a Hamiltonian cycle. A connected graph that
contains an open Hamiltonian path, but not a Hamiltonian cycle, is said to be semi-
Hamiltonian.
19
Unfortunately, unlike Eulerian trails and circuits, there are no simple rules for determining
whether a network contains a Hamiltonian path or cycle. It is just a matter of ‘trial and error’.
20
Exercise 1.4
Eulerian Graph
Eulerian Cycle
Eulerian Circuit
Eulerian Trail
Hamiltonian Path
Hamiltonian Cycle
b)
21
c)
d)
e)
f)
g)
22
h)
i)
2. A road inspector lives in Town A and is required to inspect all roads connecting the
neighbouring towns B, C, D and E. The network of roads is shown on the right.
a) Is it possible for the inspector to set out from Town A, carry out his inspection by
travelling over every road linking the five towns only once, and return to Town A?
Explain.
3. A postman has to deliver letters to the houses located on the network of streets shown
on the right.
23
a) Is it possible for the postman to start and finish his deliveries at the same point in
the network without retracing his steps at some stage? If not, why not?
b) It is possible for the postman to start and finish his deliveries at different points in
the network without retracing his steps at some stage. Identify one such route.
b) It is not possible to plan a walking route that passes over each bridge once only.
Why not?
24
c) Show where another bridge could be added to make such a walk possible.
d) Draw a graph to represent this situation.
e) Explain why it is now possible to find a walking route that passes over each bridge
once only. Mark one such route on your graph.
5. The graph below models the pathways linking five animal enclosures in a zoo to the
kiosk and to each other.
a) Is it possible for the zoo’s street sweeper to follow a route that enables its
operator to start and finish at the kiosk without travelling down any one
pathway more than once? If so, explain why.
b) If so, write down one such route.
7. Identify a Hamiltonian cycle in each of the following graphs (if possible), starting
at A each time.
25
a)
b)
c)
d)
e)
26
f)
10. The graph below models the pathways linking seven animal enclosures in a zoo to the
kiosk and to each other.
a) Is it possible for a visitor to the zoo to start their visit at the kiosk and see all of the
animals without visiting any one animal enclosure more than once? If so, identify a
possible route and give this route its mathematical name.
27
b) Is it possible for a visitor to the zoo to start their visit at the deer enclosure and
finish at the kiosk without visiting the kiosk or any enclosure more than once? If
so, identify a possible route and give this route its mathematical name.
28
Eulerian and Hamiltonian Cycles and Paths Summary.
Name Characteristics
Traversable Graph Connected graph
All vertices have even degrees OR have 2
odd vertex degrees
No REPEAT EDGES
No REPEAT VERTICES
29
Critical Paths – Project Planning.
Activit Immediate
y predecessors
A −−
B −−
C A
D B
E B
F C,D
G E,F
In the organisation of a wedding, invitations would be sent out to guests, but a plan for
seating people at the tables during the reception can’t be completed until the invitations are
accepted. When building a house, the plastering of the walls can’t begin until the house is
sealed from the weather.
For any project, if activity AA must be completed before activity BB can begin then
activity AA is said to be an immediate predecessor of activity BB. The activities within a
project can have multiple immediate predecessors and these are usually recorded in a table
called a precedence table.
This precedence table shows some of the activities involved in a project and their immediate
predecessors.
The information in the precedence table can be used to draw a network diagram called
an activity network.
Activity networks do not have labelled vertices, other than the start and finish of the project.
The activities in the project are represented by the edges of the diagram and so it is the
edges that must be labelled, not the vertices.
Activities A and B have no immediate predecessors.
These activities can start immediately and can be completed at the
same time.
30
Activity A is an immediate predecessor of activity C, so activity C
must follow immediately after activity A.
Activity C is an immediate predecessor of activity F, so activity F
must follow immediately after activity C.
Activity G is not an immediate predecessor for any activity and so the project is finished
after this activity is complete.
Activity networks
When activity A must be completed before activity B can begin, activity A is called
an immediate predecessor of activity B.
A table containing the activities of a project, and their immediate predecessors, is called
a precedence table.
An activity network can be drawn from a precedence table. Activity networks have edges
representing activities. The vertices are not labelled, other than the start and finish vertices.
Exercise 1.5
1.
2.
31
3. Draw an activity network for each of the precedence tables below.
a)
Immediate
Activit predecesso
y rs
A −−
B A
C A
D B
E C
b)
Immediate
Activit predecesso
y rs
P −−
Q −−
R P
S Q
T R, S
c)
Immediate
Activit predecesso
y rs
T −−
U −−
32
V T
W U
X V, W
Y X
Z Y
d)
Immediate
Activit predecesso
y rs
F −−
G −−
H −−
I F
J G, I
K H, J
L K
33
Exercise 1.6
1. When a personal computer is being assembled the following processes must be performed:
34
Construct a network diagram and determine the minimum time in which all tasks could be
completed (forward scan)
b) Identify any tasks that may be delayed without increasing the earliest completion
time.
3. In the network below complete a forward scan and hence, find the earliest completion
time for the project.
35
Example:
36
37
Exercise 1.7
1.
2.
38
3.
4.
5.
39
6.
40