Package org.nlpub.watset.graph
Class MarkovClustering.Implementation<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.MarkovClustering.Implementation<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- 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 inteThe expansion parameter.protected org.jgrapht.Graph<V,E>graphThe graph.protected Matrices.InflateVisitorinflateVisitorThe inflation visitor that raises each element ofmatrixto the power ofr.protected intiterationsThe maximal number of iterations.protected org.jgrapht.util.VertexToIntegerMapping<V>mappingThe mapping of graph nodes to the columns ofmatrix.protected org.apache.commons.math3.linear.RealMatrixmatrixThe 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V>compute()Perform clustering with Markov Clustering.protected voidexpand()Perform the expansion step.protected voidinflate()Perform the inflation step.protected voidnormalize()Normalize the matrix.
-
-
-
Field Detail
-
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 ofmatrixto the power ofr.
-
mapping
protected final org.jgrapht.util.VertexToIntegerMapping<V> mapping
The mapping of graph nodes to the columns ofmatrix.
-
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 graphe- the expansion parameterr- the inflation parameteriterations- 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.
-
-