Class LanceWilliamsAlgorithm

    • Method Detail

      • calculateDissimilarityMatrix

        public static double[][] calculateDissimilarityMatrix​(DissimilarityInput input,
                                                              SubProgressObserver po)
        Distance matrix calculation.
        Parameters:
        input - Input dissimilarity space
        po - Progress observer
        Returns:
        Distance matrix, with [<TARGET>][<QUERY>] indices
      • cluster

        public static IDBasedHierarchicClustering cluster​(DissimilarityInput input,
                                                          LanceWilliamsMerge merge,
                                                          ProgressObserver po)
                                                   throws CancellationException
        Invoke clustering.

        The current implementation requires O(n2) storage and O(n2) pairwise input comparison invocation. Over the stored dissimilarity values it requires O(n3) simple numerical comparison steps.

        Parameters:
        input - Input dissimilarity space
        merge - Cluster distance update function
        po - Observing progress observer. Two ProgressObserver.subTask(java.lang.String, long)} will be associate to the distance matrix calculation and to the clustering iterations
        Returns:
        Clustered hierarchy, preferred levels set as cluster distances
        Throws:
        CancellationException - Upon cancellation through the given ProgressObserver
        IllegalArgumentException - When less than 2 input specified
        IllegalStateException - When distance inconsistency found during merging: the distance of a merged cluster and any other cluster must be not less than the distance of the merging clusters
        chemaxon.license.LicenseException - when appropriate license is not available
      • cluster

        public static IDBasedHierarchicClustering cluster​(double[][] dissim,
                                                          LanceWilliamsMerge merge,
                                                          SubProgressObserver po)
                                                   throws CancellationException
        Invoke clustering.

        The current implementation requires O(n2) storage and O(n2) pairwise input comparison invocation. Over the stored dissimilarity values it requires O(n3) simple numerical comparison steps.

        Parameters:
        dissim - Distance matrix, with [<TARGET>][<QUERY>] indices
        merge - Cluster distance update function
        po - Observing to track progress. Will be closed upon finishing.
        Returns:
        Clustered hierarchy, preferred levels set as cluster distances
        Throws:
        CancellationException - Upon cancellation through the given ProgressObserver
        IllegalArgumentException - When less than 2 input specified
        IllegalStateException - When distance inconsistency found during merging: the distance of a merged cluster and any other cluster must be not less than the distance of the merging clusters
        chemaxon.license.LicenseException - when appropriate license is not available