Package org.nlpub.watset.graph
Class MarkovClusteringExternal.Implementation<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.MarkovClusteringExternal.Implementation<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- 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>graphThe graph.protected org.jgrapht.util.VertexToIntegerMapping<V>mappingThe mapping of nodes to indices.protected FileoutputThe output file.protected PathpathThe path to the MCL binary.protected doublerThe inflation parameter.protected intthreadsThe 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.
-
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 voidprocess()Run the Markov Clustering binary and read its output.protected FilewriteInputFile()Write the input file for the Markov Clustering binary.
-
-
-
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.
-
mapping
protected 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 graphpath- the path to the MCL binaryr- the inflation parameterthreads- 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 IOExceptionRun 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
-
-