Skip to main content
. 2018 Sep 7;20(9):684. doi: 10.3390/e20090684
Algorithm 4 Crowding_distance function.
Require:P {Population}
Require: P {Population}
Require: I {Individual}
Require: l {Number of objectives}
  •  1:

    forj=1 to l do

  •  2:

    fjmaxmaxIP{fjI}

  •  3:

    fjminminIP{fjI}

  •  4:

    fjsupjI value of the jth objective for the individual higher adjacent in the jth objective to the individual I

  •  5:

    fjinfjI value of the jth objective for the individual lower adjacent in the jth objective to the individual I

  •  6:

    end for

  •  7:

    forj=1 to l do

  •  8:

    if fjI=fjmax or fjI=fjmin then

  •  9:

      return

  • 10:

    end if

  • 11:

    end for

  • 12:

    CD0.0

  • 13:

    forj=1 to l do

  • 14:

    CDCD+fjsupjIfjinfjIfjmaxfjmin

  • 15:

    end for

  • 16:

    returnCD