Skip to main content
. 2019 Jan 20;21(1):95. doi: 10.3390/e21010095
Algorithm 1 The weighted co-association matrix based community fusion algorithm, WCMFA, which detects community structure in attributed networks based on the two-layer representation
  • Input: 

    G=(G(V,E),A): an attributed network; {f}i=1N: a set of base community detector; N: the number of candidate community partitions; M: the total number of node in the attributed network G; simt(·,·): the node pair similarity measure for topological structure; sima(·,·): the node pair similarity measure for attribute set; M(·): a similarity matrix based clustering algorithm.

  • Output: 

    P: the consensus community partition.

  • 1:

    RlowGG(V,E),A;

  • 2:

    //calculate the candidate community partitions P;

  • 3:

    for i=1,2,,N do

  • 4:

        if fi is an instance of ft for G(V,E) then

  • 5:

            P[i]fit(G);

  • 6:

        else

  • 7:

            P[i]fia(G);

  • 8:

            calculate the matrix Ψi associated with P[i];

  • 9:

        end if

  • 10:

    end for

  • 11:

    Rhigh{fi}i=1N,P,{Ψi}i=1N;

  • 12:

    //community fusion;

  • 13:

    for i=1,2,,N do

  • 14:

        if Pi is generated by ft(G) then

  • 15:

            wi(·,·)simt(·,·);

  • 16:

        else

  • 17:

            wi(·,·)sima(·,·);

  • 18:

        end if

  • 19:

    end for

  • 20:

    for u=1,2,,n do

  • 21:

        for v=1,2,,n do

  • 22:

            if uv then

  • 23:

               continue;

  • 24:

            end if

  • 25:

            Cuv0;

  • 26:

            for k=1,2,,N do

  • 27:

               CuvCuv+wk(u,v)·δ(Pk(u),Pk(v));

  • 28:

            end for

  • 29:

            Cuv1N·Cuv;

  • 30:

        end for

  • 31:

    end for

  • 32:

    CC+CT;

  • 33:

    PM(C);

  • 34:

    return the consensus community partition P.