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:
    org.jgrapht.alg.interfaces.ClusteringAlgorithm<V>

    public class MarkovClusteringExternal<V,​E>
    extends Object
    implements org.jgrapht.alg.interfaces.ClusteringAlgorithm<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.
      • clustering

        protected org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V> clustering
        The cached clustering result.
    • 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
    • Method Detail

      • builder

        public static <V,​E> MarkovClusteringExternal.Builder<V,​E> builder()
        Create a builder.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Returns:
        a builder
      • getClustering

        public org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V> getClustering()
        Specified by:
        getClustering in interface org.jgrapht.alg.interfaces.ClusteringAlgorithm<V>