Chapter 5
Chapter 5
5 Network in
Graph Theory
► Network
128
Walking Through Time
Leonhard Euler
(1707 – 1783)
WORD BANK Leonhard Euler, a mathematician in the 18th
• weighted • berpemberat century, was born in Basel, Switzerland. In the
• vertex • bucu year 1735, Euler solved a mathematics and
• degree • darjah logic problem known as the Seven Bridges of
• discrete • diskret Kӧnigsberg and developed a mathematical structure
• loop • gelung called graph – a diagram consisting of dots
• graph • graf (vertices) which are linked by lines or arcs (edges).
• simple • mudah
• tree • pokok
• network • rangkaian
• subgraph • subgraf
• edge • tepi
• directed • terarah http://bt.sasbadi.com/m4129 Saiz sebenar
129
Chapter 5 Network in Graph Theory
5.1 Network
the vertices and edges having their own characteristics. The structure of network data has
CHAPTER
130
Chapter 5 Network in Graph Theory
Σd(v) = 2E ; v ∈ V ∈ : an element of
1 1 2
5
6
Based on the simple graph given, determine
CHAPTER
(a) V and n(V) 3
(b) E and n(E)
(c) sum of degrees.
5 4
Solution:
INFO ZONE
(a) V = {1, 2, 3, 4, 5, 6} Set of vertices
The edge for the vertex
n(V) = 6 Number of vertices
pair (1, 2) is also the
(b) E = {(1, 2), (1, 5), (2, 3), (2, 4), (3, 4), (4, 5), (5, 6)} Set of vertex pairs edge for the vertex pair
(2, 1).
n(E) = 7 Number of edges
G F E Saiz sebenar
7 6 5
131
Chapter 5 Network in Graph Theory
Solution:
(a) Number of vertices = 7 (b) Number of vertices = 7
Number of edges = 7 Number of edges = 9
Sum of degrees = 2 × Number of edges Sum of degrees = 2 × Number of edges
=2×7 =2×9
= 14 = 18
Let the graph given be denoted by a set of ordered pairs, G(V, E),
then
V = {A, B, C, D} e8
Multiple edges D
A loop
e7 e5
E = {(A, B), (A, B), (B, C), (B, C), (C, D), (B, D), (A, D), (D, D)} e6
E = {e1, e2, e3, e4, e5, e6, e7, e8} e1 e4
Second edge of AB A C
e2 B e3
First edge of AB
Example 3 P Q R
The diagram on the right shows a graph with a loop and
multiple edges. State
(a) V and n(V) S
(b) E and n(E) U T
(c) sum of degrees.
MY MEMORY
Solution:
(a) V = {P, Q, R, S, T, U} V = Set of vertices
E = Set of edges
n(V) = 6
(b) E = {(P, Q), (P, U), (P, U), (Q, R), (Q, U), (R, S), (R, T), (S, S), (S, T), (T, U)}
Saiz sebenar
n(E) = 10
132
Chapter 5 Network in Graph Theory
3
5 4
5
CHAPTER
T S
U
Example 5
Draw a graph with multiple edges and loops based on the given information.
(a) V = {P, Q, R, S}
E = {(P, P), (P, Q), (P, S), (Q, S), (Q, S), (Q, R), (S, R), (R, R)}
(b) V = {1, 2, 3, 4, 5, 6, 7}
E = {(1, 6), (1, 6), (2, 7), (2, 7), (5, 7), (5, 7), (3, 4), (3, 4), (1, 7), (6, 7), (3, 7), (4, 7)}
Solution: TIPS
Q 2
(a) (b) 1 3
• The vertex pair for a loop
R
P is in the form (a, a).
7 • The vertex pairs for
multiple edges are in the
S 6 4 forms (a, b), (a, b).
5
Example 6
Determine whether a graph with the following degrees of vertices can be drawn.
(a) 3, 2, 2, 1, 3 (b) 2, 1, 1, 3, 3, 2
Solution:
(a) Sum of degrees = 3 + 2 + 2 + 1 + 3 (b) Sum of degrees = 2 + 1 + 1 + 3 + 3 + 2
= 11 = 12
The graph cannot be drawn because The graph can be drawn because Saiz sebenar
the sum of degrees is odd. the sum of degrees is even.
133
Chapter 5 Network in Graph Theory
5.1a
e2 e4
e5 e6
P D
e7 F E
5 4 W V U T
For each graph, determine
(i) V and n(V) (ii) E and n(E) (iii) sum of degrees
2. Two graphs with multiple edges and loops are given below.
(a) (b) P Q
A B
U R
C O
E
5
D
T S
CHAPTER
(b) V = {P, Q, R, S, T, U}
E = {(P, U), (P, T), (Q, U), (Q, T), (Q, R), (R, S), (R, T), (S, T)}
4. Draw a graph with multiple edges and loops based on the given information.
(a) V = {P, Q, R, S}
E = {(P, S), (P, S), (Q, R), (Q, R), (P, P), (S, S), (Q, Q), (R, R), (P, Q), (R, S)}
(b) V = {1, 2, 3, 4, 5}
E = {(1, 5), (1, 5), (3, 5), (3, 5), (1, 1), (3, 3), (2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5)}
6. Draw a graph with loops and multiple edges with the given degrees of vertices.
(a) 3, 3, 4
Saiz sebenar (b) 2, 2, 4, 6, 6
134
Chapter 5 Network in Graph Theory
B
INTERACTIVE ZONE
> The blood circulation
>
system in the human
A > body is also categorised
C as a directed graph.
Diagram 1 Why?
5
(a) for edge AB, A is the initial vertex and B is the terminal vertex. For electricity networks,
CHAPTER
power stations,
(b) for edge CB, C is the initial vertex and B is the terminal vertex. transformer stations,
substations and
(c) all vertices are connected in one direction only. consumers are the
vertices, and the cables
and wires are the edges.
Is an electricity network
P
a directed graph or
e1
> an undirected graph?
e5 Q Discuss.
>
e2
>
e4 >
e3
R
Diagram 2
Diagram 2 shows a directed graph with a loop and multiple edges. Based on the directions of the
arrows, it can be seen that
(a) e4 = (P, R); P is the initial vertex and R is the terminal vertex.
(b) e5 = (R, P); R is the initial vertex and P is the terminal vertex.
(c) e2 = (Q, Q); Q is the initial vertex and the terminal vertex because e2 is a loop.
An undirected graph is a simple graph or a graph with loops and multiple edges drawn without
any direction being assigned.
Saiz sebenar
135
Chapter 5 Network in Graph Theory
Type of
Graph Set V and Set E Degrees
graph
>
>
Graph with T S
loops and
multiple Directed graph V = {P, Q, R, S, T} din (P) = 1, dout (P) = 1
edges E = {(P, Q), (Q, R), (R, Q), din (Q) = 3, dout (Q) = 1
R
(S, Q), (T, S), (T, T), din (R) = 1, dout (R) = 1
> din (S) = 1, dout (S) = 1
P Q > (T, P)}
> din (T) = 1, dout (T) = 3
}
}
Loop = 1
>
>
Loop = 1
(T, P) = 1
> (T, S) = 1
T S
Saiz sebenar Σd(V) = 14
136
Chapter 5 Network in Graph Theory
What are the differences between weighted graphs and unweighted graphs?
Weighted graph Unweighted graph
Type of
Directed graph and undirected graph Directed graph and undirected graph
graph
Edge Associated with a value or a weight Not associated with a value or a weight
The edge represents: The edge relates information like:
• distance between two cities. • job hierarchy in an organisation chart.
Example • travelling time. • flow map.
• the current in an electrical circuit. • tree map.
• cost. • bubble map.
Example 7
Draw a directed graph based on the given information. INFO ZONE
(a) V = {P, Q, R, S, T, U} (b) There is a loop at vertex Q and For Example 7(a), the
E = {(P, Q), (P, R), RS is a multiple edge such that vertex U appears in
set V but not in set E.
(R, Q), (S, R), din (P) = 1, dout (P) = 1 This means vertex U is
5
din (Q) = 3, dout (Q) = 2 not connected to any
(S, Q), (S, T)}
CHAPTER
other vertices in the
din (R) = 0, dout (R) = 3 graph and it is known
din (S) = 3, dout (S) = 1 as an isolated vertex.
Solution:
(a) Vertex pair Direction
}
(P, Q) P to Q P > R
Two edges from vertex P
(P, R) P to R
(R, Q) R to Q One edge from vertex R >
>
>
}
(S, R) S to R
S
>
(S, Q) S to Q Three edges from vertex S Q
>
(S, T) S to T U T
Vertex T only connected to vertex S
(b) Total number of vertices = 4 RS – a multiple edge, Complete the graph based on the
A loop at vertex Q. number of edges going into and
coming out from each vertex.
P Q P Q P > Q
>
>
>
>
S R S R S > R Saiz sebenar
137
Chapter 5 Network in Graph Theory
Example 8 Start
v1
500
The diagram on the right shows one-way paths that Izarul can m
choose for his running practice. Vertex v1 is the starting position v3
0m
and vertex v5 is the ending position before he goes home.
60
m
Determine 900 500 m
(a) the shortest distance from v1 to v5.
v2 800 m
(b) the longest distance from v1 to v5. v4
(c) the vertices that must be passed through if the distance of the 50
0m
m
one-way run is between 1.4 km and 2.1 km. 500
v5
Solution: End
(a) Shortest distance (b) Longest distance (c) v1, v3, v4, v5
= v1 v2 v5 = v1 v2 v3 v4 v5 and
= (600 + 500) m = (600 + 900 + 500 + 500) m v1, v2, v4, v5
= 1 100 m = 2 500 m
= 1.1 km = 2.5 km
5.1b
1. State two differences between directed graphs and undirected graphs.
5
CHAPTER
4. (a) Based on the information in Table 1 and Table 2, complete the weighted and undirected graph.
Name of place Vertex Vertex pair Weight (km)
Kuala Pilah KP (J, B) 11.6
Bahau B (KP, R) 40
J B
Rompin R (B, R) 20.7
KP
Batu Kikir BK (B, BK) 11.4
Juasseh J (BK, J ) 6.6
(KP, J ) 9.3
(b) Mr Benny and Mr Muruges drive individually from Kuala Pilah to Rompin such that:
(i) Mr Benny uses the shortest route.
(ii) Mr Muruges takes the route which passes through Juasseh and Bahau.
Calculate the difference in distance, in km, for the journeys taken by Mr Benny and Mr
Saiz sebenarMuruges from Kuala Pilah to Rompin.
138
Chapter 5 Network in Graph Theory
Example 9
Determine whether Diagram 1, Diagram 2, Diagram 3 and Diagram 4 are the subgraphs of graph G.
P e1 Q e2 P e2 P e1 Q P Q e2 P e1 Q e3
5
CHAPTER
e5 e3 e5 e5 e3 e5 e2
S e4 R S S S S e4 R
Graph G Diagram 1 Diagram 2 Diagram 3 Diagram 4
Solution:
Diagram 1 – Yes, because the vertex pair for edge e5 is the same.
{e5} ⊂ {e1, e2, e3, e4, e5} and {P, S} ⊂ {P, Q, R, S}
Diagram 2 – No, because the position of loop e2 is not on vertex Q.
Diagram 3 – No, because the edge connecting vertex P and vertex S is not e3.
Diagram 4 – No, because the loop and the edge connecting vertex Q and vertex R are wrong.
INFO ZONE
What do you understand about a tree?
The term tree was
A tree of a graph is a subgraph of the graph with the following introduced by Arthur
properties: Cayley, an English
mathematician, in the
(a) A simple graph without loops and multiple edges. year 1857.
(b) All the vertices are connected and each pair of vertices is
connected by only one edge.
(c) Number of edges = Number of vertices – 1
INFO ZONE
Number of vertices = n A family history chart is
Number of edges = n – 1 Saiz
an example of a tree. sebenar
139
Chapter 5 Network in Graph Theory
A
E Diagram 1 is a tree because
B
• all the vertices are connected.
• every pair of vertices is connected by an edge only.
C D • there are no loops or multiple edges.
Diagram 1 • 5 vertices, 4 edges.
A
E Diagram 2 is not a tree because
B
• vertex B and vertex E can be connected in two ways.
C D (i) B E
Diagram 2
(ii) B C D E
• 5 vertices, 5 edges.
Example 10
Determine whether each of the following graphs is a tree. Justify your answer.
(a) P (b) P R (c) P R (d) P
5
Q R Q Q Q R
CHAPTER
U T S U T S U T S U T S
Solution:
(a) Not a tree. 6 vertices, 7 edges. Each pair of vertices can be connected in various ways.
(b) A tree. 6 vertices, 5 edges. Each pair of vertices is connected by one edge.
(c) A tree. 6 vertices, 5 edges. Each pair of vertices is connected by one edge.
(d) Not a tree. 6 vertices, 4 edges. Vertex R and vertex T are not connected to the other vertices.
Example 11
Draw a tree for the following information given.
(a) 6 vertices (b) 8 vertices (c) 4 edges (d) 9 edges
Solution:
(a) 6 vertices (b) 8 vertices (c) 4 edges (d) 9 edges
5 edges 7 edges 5 vertices 10 vertices
Saiz sebenar
140
Chapter 5 Network in Graph Theory
Example 12
Draw two trees based on the graphs given below.
INFO ZONE
(a) (b)
Trees are used to
determine the shortest
path with the condition
that the path passes
through each vertex
once only.
Solution:
(a) 5 vertices (b) 6 vertices
7 edges (exceed by 3) 8 edges (exceed by 3)
(i) (ii) (i) (ii)
Example 13
5
The following diagram shows an undirected weighted graph. Draw a tree with a minimum
CHAPTER
total weight.
Q R
20
25 10 12 17
P 19 T 14 S
Solution:
Step 1 Langkah
Step 22
Q Q R
R
10 12 17 10 12
P T 14 S P 19 T 14 S
The graph above is not a tree because The graph obtained is a tree.
• vertex P is not connected to the other vertices. Minimum total weight of the tree
= 10 + 12 + 14 + 19
• three edges, RS, ST and RT, connect three
= 55
Saiz sebenar
vertices only.
141
Chapter 5 Network in Graph Theory
5.1c
1. Determine whether the given diagrams are the subgraphs of graph G.
e2 e2 P e2 P
P P P
e1 e3 e4
Q e4 R R Q R Q R Q
Graph G Diagram 1 Diagram 2 Diagram 3 Diagram 4 Diagram 5
e1 P e2 e2 Q e4 R e2
P P Q P
e3 e1 e2 e1 e1 e1 e3 e1 e3
P
R Q e3 R Q e4 R P e4 R e2 Q e4 R
Diagram 6 Diagram 7 Diagram 8 Diagram 9 Diagram 10 Diagram 11
e3 e2
CHAPTER
Q e2 R Q e2 R Q
Q
38
6. The diagram on the right shows an undirected 24
20 U 36 R
weighted graph. P
(a) Draw a tree with a minimum total weight. 32 18
(b) What is the minimum total weight? 34 42 S
Saiz sebenar 30
T
142
Chapter 5 Network in Graph Theory
Transportation Networks
Transportation networks can be shown as
weighted graphs and unweighted graphs.
The weights can represent the distance,
travelling time or cost of the journey. The
well known navigation system in the weighted
transportation networks is the GPS (Global
Positioning System).
5
The diagram on the right shows the train
CHAPTER
transit network in Kuala Lumpur Sentral
(KL Sentral). This undirected graph is an
example of transportation networks with the
vertices representing names of stations that are
connected and the edges representing the types
of trains.
Example 14
Mr Voon and his family plan to visit historical
places in Melaka. The map shows three
alternative routes with the distances and
estimated times needed to travel from Tangkak
to A Famosa, Melaka.
Assume P is a 46.3-kilometre route, Q is a
50.2-kilometre route and R is a 53.3-kilometre
route. In your opinion, why does route P take
the longest time compared to the other routes
even though route P is the shortest route?
Solution:
Route P takes the longest time because the route passes through crowded town areas and there are
more road users compared to the other two routes.
Saiz sebenar
143
Chapter 5 Network in Graph Theory
Social Networks
Social networks are becoming more popular among teenagers and Smart Mind
adults. Social networks are used in areas like job opportunities,
business opportunities, socialising, family relationships, education, State a social network
social media and connecting with communities around the world. that you know of.
Even though social networks are main platforms for various
activities and are useful, you should be cautious and moderate in using
social networks to avoid being distracted and being deceived easily. INTERACTIVE ZONE
Discuss the negative
effects of using social
networks.
Example 15
The table below shows the data of six pupils and the games that they like. Represent the information
in the form of a network.
Smart Mind
What are the meanings
Azwan Football, Sepak takraw of LTE and 4G which
are often used in
Rajan Chess, Football wireless Internet
networks?
Aina Chess, Netball
Netball
not repeated as the edges.
ria
Ma
Je
nn
y
144
Chapter 5 Network in Graph Theory
5.1d
5
incomplete undirected graph connecting the six places.
CHAPTER
(a) Complete Diagram 1 by drawing an undirected weighted graph.
(b) Draw a tree with a minimum total weight which shows every place being visited once only.
(c) What is the minimum distance of the tree that you have drawn?
2. The table below shows four types of favourite food of several pupils.
3. (a) Draw an organisation chart of your class using your own creativity.
(b) State the type of graph you have used. Is the class organisation chart a network? Justify
your answer. Saiz sebenar
145
Chapter 5 Network in Graph Theory
Based on the table, determine the type of transportation that should be chosen for the situation
given below. Justify your answer.
(a) A journey involving an adult without time constraint.
(b) A journey involving an adult with time constraint.
(c) A journey involving two adults and two children.
Solution:
146
Chapter 5 Network in Graph Theory
Example 17
The map above shows the domestic flight routes of a private airline in Malaysia.
(a) Mr Joshua works in Kuala Lumpur. He wants to visit his family in Kota Kinabalu. State the
best route Mr Joshua can choose.
(b) What are the advantages and disadvantages for the choice of flight made?
Solution:
5
(a) The direct flight from Kuala Lumpur to Kota Kinabalu.
CHAPTER
(b) The direct flight from Kuala Lumpur to Kota Kinabalu saves time and cost. The flight from
Kuala Lumpur to Kota Kinabalu with transit takes a longer time and most probably the cost of
the journey is also higher.
5.1e
1. Mr Maswi works in Kulai. He plans to visit his family in Miri on a certain weekend. On Friday,
Mr Maswi’s work ends at 12.30 noon. The table below shows the choices of domestic flight
routes of a private airline in Malaysia on Friday and Saturday for that week.
Friday Saturday
Route
Time Price of ticket Time Price of ticket
Johor Bahru
No flight (1705 – 1900) hrs RM259.30
- Miri
Johor Bahru (1630 – 1755) hrs RM144.30 (0605 – 0730) hrs RM174.30
- Kuching (1930 – 2055) hrs RM124.30 (1205 – 1330) hrs RM154.30
Kuching (2010 – 2115) hrs RM149.00 (0835 – 0940) hrs RM84.00
- Miri (2155 – 2300) hrs RM149.00 (1145 – 1250) hrs RM64.00
(a) Determine the most economical flight from Johor Bahru to Miri.
(b) Determine the best flight that Mr Maswi can choose if he needs to go back to Peninsular
Malaysia on Sunday. Give your reason.
Saiz sebenar
147
Chapter 5 Network in Graph Theory
T S T
P
T S Q S
(b) V = {P, Q, R, S, T}
E = {(P, Q), (P, Q), (Q, R), (Q, T), (R, S), (S, S), (S, T)}
3. (a) D
raw an undirected weighted graph to Name of town Distance (km)
represent the federal roads connecting a
few towns as shown in the table. You are Temerloh - Mentakab 9.3
advised to use an area map to determine Temerloh - Bandar Bera 30.2
the positions of the towns. Bandar Bera - Teriang 4.9
(b) I s the graph that you have drawn a tree? Mentakab - Lanchang 21.1
Justify your answer. Lanchang - Karak 21.9
Mentakab - Kuala Krau 34.6
800 m C
4. The directed graph on the right shows the D
roads connecting Lani’s house at A to the 350 m
school at E. The edge BE is a municipal road
A
and edges AB, AC, CD and DE are roads in 650 m
the housing estates. Suggest the best route
400 m
that Lani can choose to cycle to school.
Justify your answer. E B
School 1.1 km
Saiz sebenar
148
Chapter 5 Network in Graph Theory
RM
P
)
ur
65
choices of flights of a private airline. Vertex S is the RM
ho
200
(1.
RM
.8
destination of the flight from vertex P. Vertex Q and
(0
1h
(3 h
50
ours
our
vertex R are the transit airports. The transit time at )
45
(1
s)
RM
each of the airports is 45 minutes.
h
ou
S
r)
s)
(a) State Q RM115 (1.4 hour
5
x4
CHAPTER
10
10
D E
x5
7. The following undirected graph shows six houses in a village. A salesperson needs to visit all
the houses starting from house A and finishing at house F.
F
800 m
D
m 85
750 0m
m
m
450
500
A 650 m C 850 m
E
90 600 m
0m
m
780
B
(a) Draw a directed graph to represent the shortest distance from A to F with the condition that
all the paths are taken once only.
(b) Based on your graph, calculate the shortest distance in km.
Saiz sebenar
149
Chapter 5 Network in Graph Theory
K
I
A2
CHAPTER
10. The diagram on the right shows the growth of a type of cell.
It is given that on the first day, there are four cells. On the
second day, each cell produces three cells. On the following
day, each new cell produces another three new cells. The
process of producing new cells repeats at the same rate.
(a) On which day will the total number of cells exceeds 50
for the first time?
(b) Calculate the total number of cells on the fifth day.
(c) Given the life span of a cell is 5 days, calculate the total
number of cells on the eighth day.
Saiz sebenar
150
Chapter 5 Network in Graph Theory
P R O J E C T
Diagram 1
5
CHAPTER
I P Q R
X V
O N
J
H K
L M W S
D T U
E
Y Z
F G
A B C
Diagram 2
2. Divide the class into groups.
3. Obtain examples of mazes with different levels of difficulty.
4. Label the vertices with suitable letters as shown in Diagram 1.
5. Draw the corresponding networks.
6. Exhibit your project work at the Mathematics Corner.
Saiz sebenar
151
Chapter 5 Network in Graph Theory
CONCEPT MAP
Graph
Degree
e
tim
P R P R
name
Q
Q
R Unweighted graph
P P
Q Q
R R
P R
P R
Q Q
P R P R
Saiz sebenar
152
Chapter 5 Network in Graph Theory
Self Reflection
5
7. Every pair of vertices in a is connected by an edge only.
CHAPTER
Mathematics Exploration
Gather information and prepare a multimedia presentation on one of the networks given below.
Banking
Medicine
Social
Include pictures, video or interesting materials to make your presentation more creative and
informative. Saiz sebenar
153