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>
Actual implementation of Markov Clustering.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intThe expansion parameter.The graph.protected final Matrices.InflateVisitorThe inflation visitor that raises each element ofmatrixto the power ofr.protected final intThe maximal number of iterations.protected final org.jgrapht.util.VertexToIntegerMapping<V>The mapping of graph nodes to the columns ofmatrix.protected org.apache.commons.math3.linear.RealMatrixThe stochastic matrix. -
Constructor Summary
ConstructorsConstructorDescriptionImplementation(org.jgrapht.Graph<V, E> graph, int e, double r, int iterations) Create an instance of the Markov Clustering algorithm implementation. -
Method Summary
-
Field Details
-
graph
The graph. -
e
protected final int eThe expansion parameter. -
iterations
protected final int iterationsThe maximal number of iterations. -
inflateVisitor
The inflation visitor that raises each element ofmatrixto the power ofr. -
mapping
The mapping of graph nodes to the columns ofmatrix. -
matrix
protected org.apache.commons.math3.linear.RealMatrix matrixThe stochastic matrix.
-
-
Constructor Details
-
Implementation
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 Details
-
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.
-