Skip to main content
. 2019 Jun 18;21(6):602. doi: 10.3390/e21060602
Algorithm 1 Competitive particle swarm optimization.
  • 1:

    input:mc,mf,v; ▹ The number of particles for each group mc,mf, the maximum number of FFCs v

  • 2:

    output:S;                              ▹ the final feature subset S

  • 3:

    [C,F]initialization(mc,mf);             ▹ initialize particles using Algorithm 2

  • 4:

    [Sc,Sf]generate subsets based on C,F;              ▹ use locations of particles

  • 5:

    [Ec,Ef]evaluate subsets Sc,Sf;           ▹ evaluate subsets using fitness function

  • 6:

    umc+mf;                      ▹ set u to the number of whole particles

  • 7:

    while u<v do

  • 8:

        update C using Equations (2) and (3);               ▹ update locations of particles

  • 9:

        [Sc,Sf] generate subsets based on C,F;

  • 10:

        [Ec,Ef] evaluate subsets Sc,Sf;

  • 11:

        uu+mc+mf;

  • 12:

        [C,F,mc,mf] competition(C,F,Ec,Ef,mc,mf);          ▹ use Algorithm 3

  • 13:

        S the best feature subset so far;

  • 14:

    end while