▁grouped ▁into ▁one ▁node ▁and ▁the ▁first ▁step ▁is ▁repeated . ▁The ▁method ▁is ▁similar ▁to ▁the ▁earlier ▁method ▁by ▁Cla uset , ▁New man ▁and ▁Moore ▁that ▁connect s ▁communities ▁whose ▁am alg am ation ▁produces ▁the ▁largest ▁increase ▁in ▁mod ular ity . ▁ ▁Algorithm ▁The ▁value ▁to ▁be ▁optimized ▁is ▁mod ular ity , ▁defined ▁as ▁a ▁value ▁in ▁the ▁range ▁ ▁that ▁measures ▁the ▁density ▁of ▁links ▁inside ▁communities ▁compared ▁to ▁links ▁between ▁communities . ▁For ▁a ▁weight ed ▁graph , ▁mod ular ity ▁is ▁defined ▁as : ▁ ▁where ▁▁ ▁represents ▁the ▁edge ▁weight ▁between ▁nodes ▁ ▁and ▁; ▁▁ ▁and ▁ ▁are ▁the ▁sum ▁of ▁the ▁weights ▁of ▁the ▁edges ▁attached ▁to ▁nodes ▁ ▁and ▁, ▁respectively ; ▁▁ ▁is ▁the ▁sum ▁of ▁all ▁of ▁the ▁edge ▁weights ▁in ▁the ▁graph ; ▁▁ ▁and ▁ ▁are ▁the ▁communities ▁of ▁the ▁nodes ; ▁and ▁▁▁ ▁is ▁Kr one cker ▁delta ▁function ▁( ▁if ▁, ▁ ▁otherwise ). ▁ ▁In ▁order ▁to ▁maxim ize ▁this ▁value ▁efficiently , ▁the ▁Lou v ain ▁Method ▁has ▁two ▁phases ▁that ▁are ▁repeated ▁iter atively . ▁ ▁First , ▁each ▁node ▁in ▁the ▁network ▁is ▁assigned ▁to ▁its ▁own ▁community . ▁Then ▁for ▁each ▁node ▁, ▁the ▁change ▁in ▁mod ular ity ▁is ▁calculated ▁for ▁removing ▁ ▁from ▁its ▁own ▁community ▁and ▁moving ▁it ▁into ▁the ▁community ▁of ▁each ▁neighbor ▁ ▁of ▁. ▁This ▁value ▁is ▁easily ▁calculated ▁by ▁two ▁steps : ▁( 1 ) ▁removing ▁ ▁from ▁its ▁original ▁community , ▁and