Skip to main content
. 2020 Apr 9;22(4):425. doi: 10.3390/e22040425
Algorithm 2 CDID
Input:Gt=(Vt,Et)
Output:Ct
 1: //Initialization of information
 2: for each node vVt do
 3:  for each node uN(v) do
 4:   compute the JSvu, CSuv using Equation (1)–(2)
 5:  end for
 6:  compute the Iv using Equation (3)
 7: end for
 8: //Information dynamic interaction.
 9: while true do
 10:  Imax=0
 11:  for each node vVt do
 12:   for each node uN(v) do
 13:    compute Iuv using Equation (4)–(5)
 14:    compute I(uv)_cost using Equation (6)
 15:    end for
 16:   compute Iv(t+1) using Equation (7)
 17:   Iin=IuvI(uv)_cost
 18:   if Iin>Imax then
 19:    Imax=Iin
 20:    end if
 21:  end for
 22:  // the balanced state
 23:  if Imax<Threshold then
 24:   Break
 25:  end if
 26: end while
 27: // Find communities Ct
 28: for each node vVt do
 29:  if vCt then
 30:   for each node uN(v) do
 31:    if |IvIu|<Threshold then
 32:     u>Cv
 33:     else
 34:     u>Cu
 35:     end if
 36:    end for
 37:   end if
 38: end for