Class MarkovClusteringExternal.Implementation<V,​E>

  • Type Parameters:
    V - the type of nodes in the graph
    E - the type of edges in the graph
    Enclosing class:
    MarkovClusteringExternal<V,​E>

    public static class MarkovClusteringExternal.Implementation<V,​E>
    extends Object
    Actual implementation of the Markov Clustering wrapper.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.jgrapht.Graph<V,​E> graph
      The graph.
      protected org.jgrapht.util.VertexToIntegerMapping<V> mapping
      The mapping of nodes to indices.
      protected File output
      The output file.
      protected Path path
      The path to the MCL binary.
      protected double r
      The inflation parameter.
      protected int threads
      The number of threads.
    • Constructor Summary

      Constructors 
      Constructor Description
      Implementation​(org.jgrapht.Graph<V,​E> graph, Path path, double r, int threads)
      Create an instance of the Markov Clustering algorithm wrapper implementation.
    • 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 final org.jgrapht.util.VertexToIntegerMapping<V> mapping
        The mapping of nodes to indices.
      • output

        protected File output
        The output file.
    • Constructor Detail

      • Implementation

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

      • compute

        public org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V> compute()
        Perform clustering with Markov Clustering.
        Returns:
        the clustering
      • process

        protected void process()
                        throws IOException
        Run the Markov Clustering binary and read its output.
        Throws:
        IOException - if an I/O error occurs
      • writeInputFile

        protected File writeInputFile()
                               throws IOException
        Write the input file for the Markov Clustering binary.
        Returns:
        the written input file for the Markov Clustering binary
        Throws:
        IOException - if an I/O error occurs