Skip navigation links
com.aliasi.cluster

Class SingleLinkClusterer<E>

    • Constructor Detail

      • SingleLinkClusterer

        public SingleLinkClusterer(double maxDistance,
                                   Distance<? super E> distance)
        Construct a single-link clusterer with the specified distance bound.
        Parameters:
        maxDistance - Maximum distance for clusters.
        distance - Distance measure between objects to cluster.
        Throws:
        IllegalArgumentException - If the specified bound is not a non-negative number.
      • SingleLinkClusterer

        public SingleLinkClusterer(Distance<? super E> distance)
        Construct a single-link clusterer with no distance bound. The distance bound is set to Double.POSITIVE_INFINITY, which effectively removes the distance bound.
        Parameters:
        distance - Distance measure between objects to cluster.
    • Method Detail

      • hierarchicalCluster

        public Dendrogram<E> hierarchicalCluster(Set<? extends E> elementSet)
        Return the array of clusters derived from the specified distance matrix by performing single-link clustering up to the specified maximum distance bound. Every pair of elements in the matrix that are within the distance bound will fall in the same dendrogram in the result. Setting the maximum distance to Double.POSITIVE_INFINITY results in a complete clustering.
        Specified by:
        hierarchicalCluster in interface HierarchicalClusterer<E>
        Specified by:
        hierarchicalCluster in class AbstractHierarchicalClusterer<E>
        Parameters:
        elementSet - Set of elements to cluster.
        Returns:
        Clustering in the form of a set of sets of elements.
        Throws:
        IllegalArgumentException - If the set of elements is empty.