▁( 2 ) ▁inserting ▁ ▁to ▁the ▁community ▁of ▁. ▁The ▁two ▁equations ▁are ▁quite ▁similar , ▁and ▁the ▁equation ▁for ▁step ▁( 2 ) ▁is : ▁ ▁Where ▁ ▁is ▁sum ▁of ▁all ▁the ▁weights ▁of ▁the ▁links ▁inside ▁the ▁community ▁ ▁is ▁moving ▁into , ▁ ▁is ▁the ▁sum ▁of ▁all ▁the ▁weights ▁of ▁the ▁links ▁to ▁nodes ▁in ▁the ▁community ▁ ▁is ▁moving ▁into , ▁ ▁is ▁the ▁weight ed ▁degree ▁of ▁, ▁ ▁is ▁the ▁sum ▁of ▁the ▁weights ▁of ▁the ▁links ▁between ▁ ▁and ▁other ▁nodes ▁in ▁the ▁community ▁that ▁ ▁is ▁moving ▁into , ▁and ▁ ▁is ▁the ▁sum ▁of ▁the ▁weights ▁of ▁all ▁links ▁in ▁the ▁network . ▁Then , ▁once ▁this ▁value ▁is ▁calculated ▁for ▁all ▁communities ▁ ▁is ▁connected ▁to , ▁ ▁is ▁placed ▁into ▁the ▁community ▁that ▁resulted ▁in ▁the ▁greatest ▁mod ular ity ▁increase . ▁If ▁no ▁increase ▁is ▁possible , ▁ ▁remains ▁in ▁its ▁original ▁community . ▁This ▁process ▁is ▁applied ▁repeatedly ▁and ▁sequ entially ▁to ▁all ▁nodes ▁until ▁no ▁mod ular ity ▁increase ▁can ▁occur . ▁Once ▁this ▁local ▁maximum ▁of ▁mod ular ity ▁is ▁hit , ▁the ▁first ▁phase ▁has ▁ended . ▁ ▁In ▁the ▁second ▁phase ▁of ▁the ▁algorithm , ▁it ▁groups ▁all ▁of ▁the ▁nodes ▁in ▁the ▁same ▁community ▁and ▁builds ▁a ▁new ▁network ▁where ▁nodes ▁are ▁the ▁communities ▁from ▁the ▁previous ▁phase . ▁Any ▁links ▁between ▁nodes ▁of ▁the ▁same ▁community ▁are ▁now ▁represented ▁by ▁self - lo ops ▁on ▁the ▁new ▁community ▁node ▁and ▁links