Danny King (kxrs26): Theory & Practice
Page 1 of 11
21/11/2011
Danny King (kxrs26): Theory & Practice Throughout this paper, the following notation will be used: ๐ถ๐ต (๐) denotes the betweeness centrality of a node, ๐. ๐ถ๐ถ (๐) denotes the closeness centrality of a node, ๐. AB
denotes โthe path from node ๐ด to node ๐ต.โ ๐(๐) denotes the weight of a node, ๐.
1. What is the betweenness centrality of each vertex in ๐ฎ๐ , ๐ฎ๐ and ๐ฎ๐ ?
๐ฎ๐ : AB
BC
AC
๐ถ๐ต (๐ด) = 1 + 1 + 1 = ๐ AB
BC
AC
๐ถ๐ต (๐ต) = 1 + 1 + 0 = ๐ AB
BC
AC
๐ถ๐ต (๐ถ) = 0 + 1 + 1 = ๐
๐ฎ๐ : AB
AD
AE
AC
AF
AG
DE
DF
DG
EC
EF
EG
BC
BF
BG
๐ถ๐ต ๐ด = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = ๐๐ BD
BE
BA
BC
BF
BG
DA
DC
DF
DG
CA
EC
EF
EG
DE
๐ถ๐ต (๐ต) = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = ๐๐ CF
CG
CA
CB
CD
CE
GA
GB
GD
GE
FA
FB
FD
FE
FG
๐ถ๐ต (๐ถ) = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = ๐๐ DB
DE
DA
DC
DF
DG
๐ถ๐ต (๐ท) = 1 + 1 + 1 + 1 + 1 + 1 = ๐ EB
ED
EA
EC
EF
EG
๐ถ๐ต (๐ธ) = 1 + 1 + 1 + 1 + 1 + 1 = ๐ CF
CG
CA
CB
CD
CE
๐ถ๐ต (๐น) = 1 + 1 + 1 + 1 + 1 + 1 = ๐ GC
GF
GA
GB
GD
GE
๐ถ๐ต (๐บ) = 1 + 1 + 1 + 1 + 1 + 1 = ๐
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 2 of 11
21/11/2011
๐ฎ๐ : AB
AC
AD
AE
AF
AG
AH
๐ถ๐ต ๐ด = 1 + 1 + 1 + 1 + 1 + 1 + 1 = ๐ BA
BC
BD
BE
BF
BG
BH
AF
CF
AE
CE
CF
1
1
1
1
1
1
2
3
3
5
5
๐ถ๐ต ๐ต = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + CA
CB
CD
CE
CF
CG
CH
2
+ + + + +
AG
BG
AH
1
1
1
๐๐
2
4
5
๐๐
AE
๐ถ๐ต ๐ถ = 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + = ๐ DA
DB
DC
DE
DF
DG
DH
AH
AH
= ๐๐
AG CE
BG
AH
AH
1
1
1
1
1
1
๐๐
2
2
3
4
5
5
๐๐
๐ถ๐ต ๐ท = 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + = ๐
๐ ๐๐
And by symmetry: ๐ถ๐ต ๐ธ = ๐ถ๐ต ๐ท = ๐
๐๐ ๐๐
๐ถ๐ต ๐น = ๐ถ๐ต ๐ถ = ๐๐ ๐ถ๐ต ๐บ = ๐ถ๐ต ๐ต = ๐๐
๐ ๐๐
๐ ๐๐
๐ถ๐ต ๐ป = ๐ถ๐ต ๐ด = ๐
2. Let the Simple Girvan-Newman partitioning method for finding community decompositions be the same as the Girvan-Newman method except that after edges are deleted betweenness values are not recalculated. Explain in not more than 200 words an advantage and disadvantage of this alternative approach. The main advantage is a quicker algorithm running time of ๐(๐ โ ๐) rather than ๐(๐ โ ๐2 ) where ๐ is the number of nodes and ๐ is the number of edges in the graph [Newman & Girvan, 2004]. The significant disadvantage is worsened results; the recalculation step is very important to the effectiveness of the algorithm. Removing an edge from a graph affects the betweenness values of at least some nodes and so the previously calculated betweenness values no longer apply to the modified graph. Depending on the topology this can have a significant negative impact on the algorithmโs effectiveness; communities with lower modularity than otherwise may be formed. For situations in which communities are joined by several edges with widely varying betweenness values, the edges of high betweenness will be removed early but those with low betweenness may not be removed until much later, possibly after edges from within the communities themselves. The ideal situation however would have been to remove those edges first. The recalculation avoids this because when the edges with high-betweenness between the communities are removed the betweenness of the other edges connecting them will increase, therefore taking a higher priority for future removal.
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 3 of 11
21/11/2011
3a. Calculate the closeness centrality of each vertex in ๐ฎ๐ and ๐ฎ๐ .
๐ถ๐ถ ๐ด =
1 ๐ = 2 + 3 + 1 + 2 + 3 + 4 ๐๐ AB AC
๐ถ๐ถ ๐ต =
BF
CD
CE
CF
DC
DE DF
EC
ED
EF
FC
FD
FE
GD
GE
๐ถ๐ถ ๐ถ =
๐ถ๐ถ ๐ธ =
๐ถ๐ถ ๐น =
GF
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
๐ถ๐ถ ๐บ =
BD
BE
BF
BG
CD
CE
CF
CG
DC
DE
DF
DG
EC
ED
EF
EG
1 ๐ = 2 + 3 + 2 + 2 + 1 + 1 ๐๐ FA F B
FG
AG
1 ๐ = 2 + 2 + 3 + 1 + 1 + 2 ๐๐ EA EB
EG
AF
1 ๐ = 1+1+2+1+2+2 ๐ DA DB
DG
AE
1 ๐ = 2 + 1 + 2 + 3 + 2 + 1 ๐๐ CA CB
๐ถ๐ถ ๐ท =
AD
1 ๐ = 2 + 1 + 1 + 2 + 3 + 2 ๐๐ BA BC
CG
1 ๐ = 4 + 4 + 5 + 3 + 2 + 1 ๐๐ GA GB GC
๐ถ๐ถ ๐ต =
BG
1 ๐ = 3 + 3 + 4 + 2 + 1 + 1 ๐๐ FA F B
๐ถ๐ถ ๐บ =
BE
1 ๐ = 2 + 2 + 3 + 1 + 1 + 2 ๐๐ EA EB
๐ถ๐ถ ๐น =
BD
1 ๐ = 2 + 2 + 1 + 2 + 2 + 1 ๐๐ AB AC
AG
1 ๐ = 1 + 1 + 2 + 1 + 2 + 3 ๐๐ DA DB
๐ถ๐ถ ๐ธ =
AF
1 ๐ = 3 + 1 + 2 + 3 + 4 + 5 ๐๐ CA CB
๐ถ๐ถ ๐ท =
AE
1 ๐ = 2 + 1 + 1 + 2 + 3 + 4 ๐๐ BA BC
๐ถ๐ถ ๐ถ =
AD
๐ถ๐ถ ๐ด =
FC
FD
FE
FG
1 ๐ = 1+2+1+2+2+1 ๐ GA GB GC
GD
GE
GF
Danny King (kxrs26): Theory & Practice
Page 4 of 11
21/11/2011
3b. Show that the closeness centrality (in ๐ป) of ๐ is less than the closeness centrality of ๐ if and only if ๐๐ < ๐๐ and that the centralities are equal when ๐๐ = ๐๐ . Let ๐๐ข and ๐๐ฃ be the subtrees of ๐ containing ๐ข and ๐ฃ respectively created by the edge deletion, so ๐๐ข = ๐๐ข and ๐๐ฃ = ๐๐ฃ . Also let ๐๐๐ be the distance from nodes ๐ to ๐ and ๐ถ๐ถ ๐ be the closeness centrality of node ๐. Any node ๐ in ๐๐ฃ will be a distance of 1 further from ๐ข than from ๐ฃ because ๐ข and ๐ฃ are adjacent and the path from ๐ข to ๐ must include the edge between ๐ข and ๐ฃ. Therefore if ๐๐ข < ๐๐ฃ the sum of the distances from ๐ข to all other nodes in ๐ will be greater than the sum of the distances from ๐ฃ to all other nodes in ๐ (i.e. ๐ ๐๐๐ข > ๐ ๐๐๐ฃ ) because there will be more nodes closer to ๐ฃ than to ๐ข. Since the closeness centralities of ๐ข and ๐ฃ are the reciprocals of these summations (i.e. ๐ถ๐ถ ๐ข = 1
๐ถ๐ถ ๐ฃ =
๐ ๐ ๐๐ฃ
1
and
๐ ๐ ๐๐ข
) it follows that ๐ถ๐ถ ๐ข < ๐ถ๐ถ ๐ฃ . Hence ๐๐ข < ๐๐ฃ โ ๐ถ๐ถ ๐ข < ๐ถ๐ถ ๐ฃ . Similarly, ๐ถ๐ถ ๐ข < ๐ถ๐ถ ๐ฃ โ
๐๐ข < ๐๐ฃ because for ๐ข to have a lower closeness centrality than ๐ฃ there must be fewer nodes in ๐๐ข than in ๐๐ฃ in order for
๐
๐๐๐ข >
๐
๐๐๐ฃ to be true and hence for
1
๐ ๐ ๐๐ข
โ๐2 : ๐ด๐ต, ๐ถ โ ๐ด๐ต๐ถ
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 7 of 11
21/11/2011
๐ = ๐ซ,
๐โช๐ฃ = ๐ท ,
๐ = {โ
}
๐ = {๐ด, ๐ต, ๐ถ} โ๐1 =
2 4 8 6 โ0+2โ 0โ = 11 22 22 121
๐ = {๐ธ} โ๐2 =
1 4 2 7 โ0+2โ 0โ = 11 22 22 121
๐ = {๐น} โ๐3 =
1 4 3 5 โ0+2โ 0โ = 11 22 22 121 โ๐2 > โ๐1 > โ๐3 : ๐ท, ๐ธ โ ๐ท๐ธ
๐ = ๐ฌ,
๐ โช ๐ฃ = ๐ท, ๐ธ ,
๐ = {๐ท}
๐ = {๐น} โ๐ =
1 1 2 4 3 1 โ +2โ โ = 11 11 22 22 22 121 โ๐ > 0: ๐ท๐ธ, ๐น โ ๐ท, ๐ธ๐น
๐ = ๐ญ,
๐ โช ๐ฃ = ๐ถ๐ธ, ๐น ,
๐ = {๐ธ}
๐ = {๐ท} โ๐1 =
1 1 3 2 4 3 โ +2โ โ =โ 11 11 22 22 22 121
๐ = {๐บ} โ๐2 =
1 1 3 2 3 3 โ +2โ โ =โ 11 11 22 22 22 242 Both decrease modularity: no move
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 8 of 11
21/11/2011
๐ = ๐ฎ,
๐โช๐ฃ = ๐บ ,
๐ = {โ
}
๐ = {๐ธ, ๐น} โ๐1 =
1 3 5 7 โ0+2โ 0โ = 11 22 22 242
๐ = {๐ป} โ๐2 = (same graph)
1 3 1 19 โ0+2โ 0โ = 11 22 22 242
๐ = {๐ผ} โ๐3 =
1 3 1 19 โ0+2โ 0โ = 11 22 22 242 โ๐2 = โ๐3 > โ๐1 : ๐บ, ๐ป โ ๐บ๐ป
๐ = ๐ฏ,
๐ โช ๐ฃ = ๐บ, ๐ป ,
๐ = {๐บ}
There is no neighbour of ๐ป that does not belong to the same community: no move
๐ = ๐ฐ,
๐โช๐ฃ = ๐ผ ,
๐ = {โ
}
๐ = {๐บ, ๐ป} โ๐ =
1 1 0 4 9 โ0+2โ โ = 11 22 22 22 121 โ๐ > 0: ๐บ๐ป, ๐ผ โ ๐บ๐ป๐ผ
(same graph)
๐ = ๐จ,
๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
๐ = {๐ต, ๐ถ}
There is no neighbour of ๐ด that does not belong to the same community: no move
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 9 of 11
21/11/2011
๐ = ๐ฉ,
๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
๐ = {๐ด, ๐ถ}
๐ = {๐ท} โ๐ =
1 2 3 5 4 19 โ +2โ โ =โ 11 11 22 22 22 242
(same graph)
Decreased modularity: no move
๐ = ๐ช,
๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
๐ = {๐ด, ๐ต}
๐ = {๐ท} โ๐ =
1 2 3 5 4 19 โ +2โ โ =โ 11 11 22 22 22 242
(same graph)
Decreased modularity: no move
๐ = ๐ซ,
๐โช๐ฃ = ๐ท ,
๐ = {โ
}
๐ = {๐ด, ๐ต, ๐ถ} โ๐1 =
2 4 8 6 โ0+2โ 0โ = 11 22 22 121
2 equal results (B & C)
๐ = {๐ธ, ๐น} (same graph)
โ๐2 =
2 4 5 12 โ0+2โ 0โ = 11 22 22 121
2 equal results (E & F)
โ๐2 > โ๐1 : ๐ท, ๐ธ๐น โ ๐ท๐ธ๐น
๐ = ๐ฌ,
๐ โช ๐ฃ = ๐ท, ๐ธ, ๐น ,
๐ = {๐ท, ๐น}
There is no neighbour of ๐ธ that does not belong to the same community: no move
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Danny King (kxrs26): Theory & Practice
Page 10 of 11
21/11/2011
From here on the graph does not change so it will not be redrawn at each step
๐ = ๐ญ,
๐ โช ๐ฃ = ๐ท, ๐ธ, ๐น ,
๐ = {๐ท, ๐ธ}
๐ = ๐ซ,
๐ = {๐บ, ๐ป, ๐ผ} โ๐ =
โ๐ =
Decreased modularity: no move ๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
๐ = ๐ฌ,
๐ = {๐ป, ๐ผ}
๐ = ๐ญ,
Decreased modularity: no move ๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
โ๐ =
๐ = {๐บ, ๐ผ}
๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
๐ = {๐ป, ๐ผ}
๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
โ๐ =
1 2 3 2 9 43 โ +2โ โ =โ 11 11 22 22 22 242
๐ = ๐ฏ,
๐ = {๐ป, ๐ผ}
๐ = {๐ด, ๐ถ} ๐ = ๐ฐ,
Decreased modularity: no move ๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
There is no neighbour of ๐ป that does not belong to the same community: no move ๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
๐ = {๐บ, ๐ป}
There is no neighbour of ๐ผ that does not belong to the same community: no move
1 2 3 5 9 17 โ +2โ โ =โ 11 11 22 22 22 121
๐ = ๐ช,
๐ = {๐ป. ๐ผ}
Decreased modularity: no move
๐ = {๐ต, ๐ถ}
๐ = {๐ท, ๐ธ, ๐น} โ๐ =
๐ โช ๐ฃ = ๐บ, ๐ป, ๐ผ ,
๐ = {๐ท, ๐ธ, ๐น}
There is no neighbour of ๐ด that does not belong to the same community: no move ๐ = ๐ฉ,
๐ = {๐ท, ๐ธ}
Decreased modularity: no move
There is no neighbour of ๐ผ that does not belong to the same community: no move ๐ โช ๐ฃ = ๐ด, ๐ต, ๐ถ ,
๐ โช ๐ฃ = ๐ท, ๐ธ, ๐น ,
1 2 3 6 5 19 โ +2โ โ =โ 11 11 22 22 22 242
๐ = ๐ฎ,
๐ = ๐จ,
๐ = {๐ท, ๐น}
๐ = {๐บ, ๐ป, ๐ผ}
There is no neighbour of ๐ป that does not belong to the same community: no move ๐ = ๐ฐ,
๐ โช ๐ฃ = ๐ท, ๐ธ, ๐น ,
There is no neighbour of ๐ธ that does not belong to the same community: no move
1 2 3 2 9 43 โ +2โ โ =โ 11 11 22 22 22 242
๐ = ๐ฏ,
2 2 4 5 8 6 โ +2โ โ =โ 11 11 22 22 22 121 Decreased modularity: no move
๐ = {๐ท, ๐ธ, ๐น} โ๐ =
๐ = {๐ธ, ๐น}
๐ = {๐ด, ๐ต, ๐ถ}
1 2 3 6 5 19 โ +2โ โ =โ 11 11 22 22 22 242
๐ = ๐ฎ,
๐ โช ๐ฃ = ๐ท, ๐ธ, ๐น ,
Summary of community movements
๐ = {๐ด, ๐ต}
๐ = {๐ท, ๐ธ, ๐น} 1 2 3 5 9 17 โ๐ = โ +2โ โ =โ 11 11 22 22 22 121 Decreased modularity: no move
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
๐จ, ๐ฉ ๐จ๐ฉ, ๐ช ๐ซ, ๐ฌ ๐ซ๐ฌ, ๐ญ ๐ฎ, ๐ฏ ๐ฎ๐ฏ, ๐ฐ ๐ซ, ๐ฌ๐ญ
โ ๐จ๐ฉ โ ๐จ๐ฉ๐ช โ ๐ซ๐ฌ โ ๐ซ, ๐ฌ๐ญ โ ๐ฎ๐ฏ โ ๐ฎ๐ฏ๐ฐ โ ๐ซ๐ฌ๐ญ
Final community decomposition ๐ฝ๐ = ๐จ, ๐ฉ, ๐ช ๐ฝ๐ = ๐ซ, ๐ฌ, ๐ญ ๐ฝ๐ = ๐ฎ, ๐ฏ, ๐ฐ
Danny King (kxrs26): Theory & Practice 21/11/2011
5. How long did you spend working on this assignment? Roughly 80 hours including research and typesetting.
References Newman, M. E. J. & Girvan, M. (2004). Finding and evaluating community structure in networks. Physical Review E, Vol. 69, No. 2. 026113. Easley, D. & Kleinberg, J. (2010). Networks, Crowds, and Markets: Reasoning About a Highly Connected World. Cambridge University Press: New York. (As well as the course lecture slides)
Danny King (undergraduate of Computer Science at Durham University)
[email protected] www.dannyking.eu
Page 11 of 11