sol_hw3
sol_hw3
sol_hw3
Problem 1: Consider the following signed graph. Use the algorithm based on Harary’s charac-
terization of balance to determine whether or not the graph is balanced.
a e + f
−
+ − −
−
−
b
− d
− +
Your answer must clearly indicate whether or not the above graph is balanced and how the
algorithm allowed you to reach that conclusion.
Solution: The above signed graph is not balanced. This conclusion was reached using Harary’s
characterization as discussed is as discussed below.
a e + f
{e,f}
+
− −
b
d
+ −
{a,b} {c,d}
c (ii)
(i)
(a) The connected components of the subgraph containing only the edges labeled ’+’ are shown
in Figure (i) above.
(b) Figure (ii) above shows the graph obtained by collapsing each of the connected components
in Figure (i) to a single node, adding the edges labeled ’-’ and removing multi-edges.
(c) The graph in Figure (ii) contains a cycle of odd length (namely, 3). Thus, the graph is not
bipartite. Therefore, by Harary’s characterization, the graph is not balanced. (In fact, the
given graph contains the cycle b-e-f -d-c-b, which has an odd number of edges labeled ’-’.)
1
Problem 2: Consider the following undirected graph.
a
c d
e
f
h
(a) For each node in the above graph, show the values of (i) closeness centrality and (ii) eccentricity.
(b) Indicate the radius of the graph and identify all the center nodes of the above graph.
Solution:
Part (a): For the above graph, the matrix of shortest path distances between each pair of nodes
is shown below. (These distances can be computed by first constructing appropriate breadth-first-
search spanning trees.)
Nodes a b c d e f g h
a 0 1 2 2 3 2 3 3
b 1 0 1 1 2 1 2 2
c 2 1 0 2 1 1 2 2
d 2 1 2 0 1 2 3 1
e 3 2 1 1 0 1 2 2
f 2 1 1 2 1 0 1 1
g 3 2 2 3 2 1 0 2
h 3 2 2 1 2 1 2 0
Based on the above table, the farness centrality, closeness centrality and eccentricity of each
node is shown below. (Note that closeness centrality is the reciprocal of farness centrality.)
Part (b): From the last table, the lowest eccentricity value is 2. In other words, the radius of
the graph is 2. Nodes b, c and f all have their eccentricity values equal to 2. Thus, the graph has
three centers, namely b, c and f .
2
Problem 3: For any positive integer n, prove that there is an undirected graph with N ≥ n nodes
and exactly N edges such that each node has a clustering coefficient of 1. (An undirected graph G
with N nodes is sparse if the number of edges in G is O(N ). This problem points out that sparse
graphs may have large clustering coefficients.)
Your answer must clearly explain how to construct such a graph for any integer n ≥ 1 and why
the clustering coefficient of each node is 1.
Solution: We will show how such a graph can be constructed. If n = 1 or n = 2, let N = 3. Any
integer n ≥ 3 is of the form 3k, 3k + 1 or 3k + 2 for some other positive integer k. If n = 3k, let
N = n; otherwise, let N = 3k + 3. Thus, N ≥ n is a multiple of 3.
Consider a disconnected graph on N nodes, where the number of connected components is N/3
(which is an integer since N is a multiple of 3) and each connected component is a triangle (i.e., a
clique on three nodes).
For any node v of the resulting graph, the degree is 2 and the two neighbors of v have an edge
between them. Thus, for any node v, the clustering coefficient is 1.
Moreover, each connected component has exactly 3 edges and there are N/3 components. There-
fore, the total number of edges in the graph is 3 × N/3 = N .