SOLUTIONS MANUAL
,Solutions
Solutions to Chapter 2 Excercise
1. Graph 2.9 contains:
(a) 13 vertices
(b) 17 edges
(c) 5 multiple edges
(d) 2 loops
(e) 3 vertices adjacent to vertex a
(f) 8 vertices connected to vertex a
2. The graph induced by...
(a) vertices {a, b, c, d, e} should contain vertices {a, b, c, d, e}
and edges {(a, b), (a, c), (a, d), (c, c), (b, e)}.
(b) edges {x, y, z} should contain vertices {g, j, k, l} and edges
{(g, j), (g, k), (j, l)}.
3. Graphs Y and Z are isomorphic. One possible isomorphism is
given in Table 13.2. Graphs Y and Z are not automorphic.
4. A planar clique of size...
(a) 4 can exist.
(b) 5 cannot exist.
TABLE 13.2: One possible isomorophism of graphs Y and Z.
V (A) V (B)
a d
b b
c f
d a
e e
f c
509
,510 Practical Graph Mining with R
(c) 6 cannot exist.
5. Given an undirected tree...
(a) it is possible to draw a directed tree with the same number
of vertices and edges.
(b) it is not possible to draw a new undirected tree with the
same number of vertices but a different nnumber of edges.
(c) it is not possible to add an edge to the tree without cre-
ating a cycle.
(d) it is not possible to remove an edge from the tree without
disconnecting at least one vertex.
Solutions to Chapter 3 Exercises
1. 1 > library(stats)
2 > summary(m.age)
3 Min. 1st Qu. Median Mean 3rd Qu. Max.
4 15.70 17.20 20.60 21.51 24.90 30.40
5 > sd(m.age)
6 [1] 4.83385
7 > var(m.age)
8 [1] 23.36610
2. Figure 13.20 displays the solution.
3. (a) 4+y
(b) y−x
(c) sum(y)
(d) x∗y
(e) y[1 : 5]
4. (a) seq(1, 10, by = 2)
(b) seq(2, 10, by = 2)
(c) seq(10, 1, by = −1)
(d) seq(1, 10, by = 2)ˆ3
9 11
5. (a) A + B =
10 7
23 23
(b) A + 3*B =
14 13
, Introduction to Parallel Graph Mining 511
Plot of U.S. Resident Median Age by Decade from 1790−1950
30
25
Median Age
20
1800 1850 1900 1950
Year
FIGURE 13.20: The output of the plot command plot(year,
m.age, type=“b”, col=“black”, xlab=“Year”, ylab=“Median Age”,
main=“Plot of U.S. Resident Median Age by Decade from 1790-1950”,
font.main=2, font.lab=1, pch=19)
(c) det(A) = -32
24 27
(d) A %*% B =
64 60
7 2
(e) t(B) =
6 3
6. 1 > cube = function(x){x^3}
7. 1 > randomNumbers(n=100,min=1,max=25,col=10)
2 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
3 [1,] 3 20 9 22 17 2 23 12 9 13
4 [2,] 3 4 21 8 25 15 24 10 7 4
5 [3,] 18 23 25 4 10 22 1 15 3 2
6 [4,] 9 3 22 7 12 9 15 21 14 24
7 [5,] 11 3 16 20 13 2 9 8 25 4
8 [6,] 19 3 13 9 6 20 8 14 22 1
9 [7,] 25 6 9 11 11 21 17 15 23 6