Class MarkovClusteringExternal<V,​E>

  • Type Parameters:
    V - the type of nodes in the graph
    E - the type of edges in the graph
    All Implemented Interfaces:
    Clustering<V>

    public class MarkovClusteringExternal<V,​E>
    extends Object
    implements Clustering<V>
    A wrapper for the official implementation of the Markov Clustering (MCL) algorithm in C.

    This is a weird thing. The official implementation of MCL is very fast, but we need to run the separate process and speak to it over standard input/output redirection.

    See Also:
    van Dongen (2000), van Dongen (2008), MCL - a cluster algorithm for graphs
    • Field Detail

      • graph

        protected final org.jgrapht.Graph<V,​E> graph
        The graph.
      • path

        protected final Path path
        The path to the MCL binary.
      • r

        protected final double r
        The inflation parameter.
      • threads

        protected final int threads
        The number of threads.
      • mapping

        protected Map<V,​Integer> mapping
        The mapping of nodes to indices.
      • output

        protected File output
        The output file.
    • Constructor Detail

      • MarkovClusteringExternal

        public MarkovClusteringExternal​(org.jgrapht.Graph<V,​E> graph,
                                        Path path,
                                        double r,
                                        int threads)
        Create an instance of the Markov Clustering algorithm wrapper.
        Parameters:
        graph - the graph
        path - the path to the MCL binary
        r - the inflation parameter
        threads - the number of threads
      • MarkovClusteringExternal

        @Deprecated
        public MarkovClusteringExternal​(org.jgrapht.Graph<V,​E> graph,
                                        Path path,
                                        double r)
        Create an instance of the Markov Clustering algorithm wrapper.
        Parameters:
        graph - the graph
        path - the path to the MCL binary
        r - the inflation parameter
    • Method Detail

      • provider

        public static <V,​E> Function<org.jgrapht.Graph<V,​E>,​Clustering<V>> provider​(Path mcl,
                                                                                                      double r,
                                                                                                      int threads)
        A factory function that sets up the algorithm for the given graph.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Parameters:
        mcl - the path to the MCL binary
        r - the inflation parameter
        threads - the number of threads
        Returns:
        a factory function that sets up the algorithm for the given graph
      • provider

        @Deprecated
        public static <V,​E> Function<org.jgrapht.Graph<V,​E>,​Clustering<V>> provider​(Path mcl,
                                                                                                      double r)
        Deprecated.
        A factory function that sets up the algorithm for the given graph.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Parameters:
        mcl - the path to the MCL binary
        r - the inflation parameter
        Returns:
        a factory function that sets up the algorithm for the given graph
      • fit

        public void fit()
        Description copied from interface: Clustering
        Run the algorithm to induce the parameters of the clusters.
        Specified by:
        fit in interface Clustering<V>