Research Article

Performance Evaluation of Modularity Based Community Detection Algorithms in Large Scale Networks

Algorithm 2

Kernighan-Lin method adapted to community detection.
       Input: Network ;
       Two communities and ;
       A division vector   (7)
       Output: Two communities e ;
       A division vector (after post-processing)
(1)     ;
(2)   ;
(3)   ;
(4)   while    do
(5)    ;
(6)    ;
(7)    element of vector   if  element   not  moved  yet   then
(8)     Evaluates gain when moving from to (or from to );
(9)     if    then
(10)    ;
(11)      ;
(12)   end
(13)  end
(14)  Update vector moving from to or from to ;
(15)  ;
(16)  Assign element as moved;
(17)  if    then
(18)   ;
(19)   ;
(20)  end
(21)  end