Class GreedyG<O>

  • Type Parameters:
    O - Object type for KMedoids initialization
    All Implemented Interfaces:
    KMedoidsInitialization<O>

    @Reference(authors="M. Eug\u00e9nia Captivo",
               title="Fast primal and dual heuristics for the p-median location problem",
               booktitle="European Journal of Operational Research 52(1)",
               url="https://doi.org/10.1016/0377-2217(91)90336-T",
               bibkey="doi:10.1016/0377-2217(91)90336-T")
    public class GreedyG<O>
    extends java.lang.Object
    implements KMedoidsInitialization<O>
    Initialization method for k-medoids that combines the Greedy (PAM BUILD) with "alternate" refinement steps. After choosing a new medoid, all points are assigned to the nearest center, and the medoid of the resulting partitions is used.

    Reference:

    M. Eugénia Captivo
    Fast primal and dual heuristics for the p-median location problem
    European Journal of Operational Research 52(1)

    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Class logger.
    • Constructor Detail

      • GreedyG

        public GreedyG()
        Constructor.
    • Method Detail

      • findMedoid

        public static double findMedoid​(DBIDs ids,
                                        DistanceQuery<?> distQ,
                                        int j,
                                        DBIDArrayMIter miter,
                                        double bestm,
                                        WritableDoubleDataStore temp,
                                        WritableDoubleDataStore tempbest,
                                        WritableDoubleDataStore mindist)
        Find the best medoid of a given fixed set.
        Parameters:
        j - Cluster number
        ids - Object ids
        distQ - Distance query
        miter - Medoid iterator, pointing to the current medoid (modified)
        bestm - Prior cost, of the current assignment
        temp - Temporary storage for distances
        tempbest - Second temporary storage for distances
        mindist - Minimum distance (output)
        Returns:
        New cost