Package org.nlpub.watset.graph
Class MarkovClusteringExternal<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.MarkovClusteringExternal<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMarkovClusteringExternal.Builder<V,E>Builder forMarkovClusteringExternal.static classMarkovClusteringExternal.Implementation<V,E>Actual implementation of the Markov Clustering wrapper.
-
Field Summary
Fields Modifier and Type Field Description protected org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V>clusteringThe cached clustering result.protected org.jgrapht.Graph<V,E>graphThe graph.protected PathpathThe path to the MCL binary.protected doublerThe inflation parameter.protected intthreadsThe number of threads.
-
Constructor Summary
Constructors Constructor Description MarkovClusteringExternal(org.jgrapht.Graph<V,E> graph, Path path, double r, int threads)Create an instance of the Markov Clustering algorithm wrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V,E>
MarkovClusteringExternal.Builder<V,E>builder()Create a builder.org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V>getClustering()
-
-
-
Field Detail
-
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 graphpath- the path to the MCL binaryr- the inflation parameterthreads- 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 graphE- the type of edges in the graph- Returns:
- a builder
-
-