Class MarkovClustering.Implementation<V,​E>

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

    protected static class MarkovClustering.Implementation<V,​E>
    extends Object
    Actual implementation of Markov Clustering.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int e
      The expansion parameter.
      protected org.jgrapht.Graph<V,​E> graph
      The graph.
      protected Matrices.InflateVisitor inflateVisitor
      The inflation visitor that raises each element of matrix to the power of r.
      protected int iterations
      The maximal number of iterations.
      protected org.jgrapht.util.VertexToIntegerMapping<V> mapping
      The mapping of graph nodes to the columns of matrix.
      protected org.apache.commons.math3.linear.RealMatrix matrix
      The stochastic matrix.
    • Constructor Summary

      Constructors 
      Constructor Description
      Implementation​(org.jgrapht.Graph<V,​E> graph, int e, double r, int iterations)
      Create an instance of the Markov Clustering algorithm implementation.
    • Field Detail

      • graph

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

        protected final int e
        The expansion parameter.
      • iterations

        protected final int iterations
        The maximal number of iterations.
      • inflateVisitor

        protected final Matrices.InflateVisitor inflateVisitor
        The inflation visitor that raises each element of matrix to the power of r.
      • mapping

        protected final org.jgrapht.util.VertexToIntegerMapping<V> mapping
        The mapping of graph nodes to the columns of matrix.
      • matrix

        protected org.apache.commons.math3.linear.RealMatrix matrix
        The stochastic matrix.
    • Constructor Detail

      • Implementation

        public Implementation​(org.jgrapht.Graph<V,​E> graph,
                              int e,
                              double r,
                              int iterations)
        Create an instance of the Markov Clustering algorithm implementation.
        Parameters:
        graph - the graph
        e - the expansion parameter
        r - the inflation parameter
        iterations - the maximal number of iterations
    • Method Detail

      • compute

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

        protected void normalize()
        Normalize the matrix.
      • expand

        protected void expand()
        Perform the expansion step.
      • inflate

        protected void inflate()
        Perform the inflation step.