Interface Clustering

All Known Implementing Classes:
KMeansPlusPlusClustering, SingleLinkageClustering

public interface Clustering
Interface for a clustering algorithm.

Please note that this interface expects the clustering algorithm to construct a fixed number of clusters. Consider using one of Apache Commons Math's Clusterer implementations directly if this is too restrictive.

  • Method Details

    • cluster

      List<Cluster> cluster(int size, Iterable<ClusterableSolution> solutions)
      Construct clusters using the points defined by the clusterable solutions.
      Parameters:
      size - the number of clusters to construct
      solutions - the clusterable solutions
      Returns:
      the clusters
    • cluster

      default List<Cluster> cluster(int size, ClusterableSolution[] solutions)
      Construct clusters using the points defined by the clusterable solutions.
      Parameters:
      size - the number of clusters to construct
      solutions - the clusterable solutions
      Returns:
      the clusters
    • clusterObjectives

      default List<Cluster> clusterObjectives(int size, Solution[] solutions)
      Construct clusters based on the objective values of the solutions.
      Parameters:
      size - the number of clusters to construct
      solutions - the solutions
      Returns:
      the clusters
    • clusterObjectives

      default List<Cluster> clusterObjectives(int size, Iterable<Solution> solutions)
      Construct clusters based on the objective values of the solutions.
      Parameters:
      size - the number of clusters to construct
      solutions - the solutions
      Returns:
      the clusters
    • clusterVariables

      default List<Cluster> clusterVariables(int size, Solution[] solutions)
      Construct clusters based on the decision variables of the solutions. See ClusterableSolution.withVariables(Solution) for limitations of this method.
      Parameters:
      size - the number of clusters to construct
      solutions - the solutions
      Returns:
      the clusters
    • clusterVariables

      default List<Cluster> clusterVariables(int size, Iterable<Solution> solutions)
      Construct clusters based on the decision variables of the solutions. See ClusterableSolution.withVariables(Solution) for limitations of this method.
      Parameters:
      size - the number of clusters to construct
      solutions - the solutions
      Returns:
      the clusters
    • truncate

      default void truncate(int size, Population population)
      Truncates a population to the given size by forming clusters based on the objective values and selecting the representative member from each cluster.
      Parameters:
      size - the resulting size of the population
      population - the population to truncate
    • singleLinkage

      static Clustering singleLinkage()
      Constructs the single-linkage clustering algorithm using Euclidean distances.
      Returns:
      the clustering algorithm
    • kMeansPlusPlus

      static Clustering kMeansPlusPlus()
      Constructs the k-means++ clustering algorithm using Euclidean distances.
      Returns:
      the clustering algorithm