Skip to main content
. 2025 May 14;27(5):524. doi: 10.3390/e27050524
Algorithm 3: Calculate the Entropy
Input:
     N: The population size
     N uniformly distributed weight vectors: λ1,…λN
     rho: the count of solutions associated with each reference point
Association:
    1: Measure the distance between each solution and each reference vector: Cosine
    2: Match each solution with its closest reference point: pi
    3: Compute the count of solutions associated with each reference point: rho
Calculate the Entropy:
    4: entropy = 0
    5: i = 1
    6: while i≤N do
    7: if Numi≠0, then p=Numi/N, entropy = entropy +p∗logp
    8: end
    9: if the loop ends
    10:  entropy = −entropy
    11: end if
    12: i = i + 1
    13: end
Output:
     entropy