Research Article

An Efficient Hierarchy Algorithm for Community Detection in Complex Networks

Algorithm 1

CN agglomerative algorithm.
Input  Adjacency matrix of the graph model
Output  Communities, community structures, hierarchy clustering tree
(1)  
(2)  while  
(3)  perform a BFS traversal over the graph to compute for each vertex (1) , (2)
     , (3) , defined as , (4) , defined as the minimum
     value of elements in
(4)  find an such that for some
(5)  if  such does not exist  then
(6)    break;
(7)  else
(8)    find to maximize
(9)    merge into
(10)  let the resulting set of communities be
(11)  
(12)  endif
(13)  endwhile
(14)   //the first level community structure
(15)  while  
(16)  perform a BFS traversal over the graph to compute for
  each vertex (1) , (2) , (3) , defined
  as , (4) , defined as the
  minimum value of elements in
(17)  find an such that for some
(18)   if  such does not exist  then
(19)    break;
(20)  else
(21)   find to maximize
(22)   merge into
(23)   let the resulting set of communities be
(24)   
(25)  endif
(26)  endwhile
(27)   //the second level community structure
(28)  while  
(29)   select two communities of and merge them
(30)   let the resulting set of communities be
(31)   
(32)  endwhile
 //now consist of the hierarchy clustering tree