Class Measurer<V,​E>

  • Type Parameters:
    V - the type of nodes in the graph
    E - the type of edges in the graph

    public class Measurer<V,​E>
    extends Object
    A clustering algorithm performance measurement class.

    Given a clustering algorithm provider and a graph, it measures the running time of the clustering algorithm on every input graph.

    Before recording the measurements, it warms up by running exactly the same operation to leverage the influence of JIT and other VM optimizations.

    See Also:
    Clustering
    • Constructor Detail

      • Measurer

        public Measurer​(Function<org.jgrapht.Graph<V,​E>,​Clustering<V>> provider,
                        org.jgrapht.Graph<V,​E> graph,
                        int repetitions,
                        int warmup)
        Create an instance of Measurer.
        Parameters:
        provider - the clustering algorithm provider
        graph - the graph
        repetitions - the number of repetitions
        warmup - the number of off-record repetitions
      • Measurer

        public Measurer​(Function<org.jgrapht.Graph<V,​E>,​Clustering<V>> provider,
                        org.jgrapht.Graph<V,​E> graph)
        Create an instance of Measurer.
        Parameters:
        provider - the clustering algorithm provider
        graph - the graph
    • Method Detail

      • getGraph

        public org.jgrapht.Graph<V,​E> getGraph()
        Return the input graph.
        Returns:
        the graph
      • getDurations

        public List<Long> getDurations()
        Return the list of the measured graph clustering durations in milliseconds.
        Returns:
        the list of durations
      • getClusters

        public List<Integer> getClusters()
        Return the list of the measured number of clusters.
        Returns:
        the list of cluster sizes
      • run

        public void run()
        Perform the measurement. First, warmup iterations are performed off-record. Then, the actual repetitions are performed to measure the performance of the clustering algorithm.