Skip to main content
. 2019 Mar 28;21(4):344. doi: 10.3390/e21040344
Algorithm 1 Pseudo-code of the algorithm to compute Q
Input:
  FCN, |N| (number of nodes in FCN), and A (ψ in FCN).
Output:
  Print the Q.
  •   1:

    sum_2m = 0, sum_sigma = 0;

  •   2:

    fori=1 to |N| do

  •   3:

      k[i] = 0; //ki

  •   4:

      for j=1 to |N| do

  •   5:

        sum_2m += A[i][j]; //2m

  •   6:

        if A[i][j]>0 then

  •   7:

          k[i]+=A[i][j]

  •   8:

        end if

  •   9:

      end for

  • 10:

    end for

  • 11:

    fori=1 to |N| do

  • 12:

      for j=1 to |N| do

  • 13:

        if getClass(i)==getClass(j) then

  • 14:

          sum_sigma+=A[i][j]-k[i]*k[j]/sum_2m;

  • 15:

        end if

  • 16:

      end for

  • 17:

    end for

  • 18:

    Q=sum_sigma/sum_2m;

  • 19:

    print Q;