Skip to content

k-means speciation is not handling empty clusters/species. #52

@colgreen

Description

@colgreen

The standard k-means algorithm may result in empty species, e.g. consider this example in 1D space:

Initial clusters

      {2, 3, 3, 3}
      {3, 7, 7, 7}
      {7, 8, 8, 8}.

For k=3, the first update will empty the middle cluster.

Once the cluster is empty it has no centroid, and therefore will not gain any genomes in later iterations, i.e. it will remain empty at completion of the k-means iterations.

This is currently somewhat/partly handled by NeatEvolutionAlgorithm.IntegrateOffspringIntoSpecies(), which 're-speciates' the full population if one or more species are empty, but that re-speciation uses k-means clustering, so it can still produce empty species.

Other code may then assume that all species obtain at least one genome, and thus other problems may result from this.

Also see https://stackoverflow.com/questions/11075272/k-means-empty-cluster

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions