Package org.nlpub.watset.graph
Class MarkovClustering.Builder<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.MarkovClustering.Builder<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
- All Implemented Interfaces:
ClusteringBuilder<V,E,MarkovClustering<V,E>>
- Enclosing class:
- MarkovClustering<V,E>
public static class MarkovClustering.Builder<V,E> extends Object implements ClusteringBuilder<V,E,MarkovClustering<V,E>>
Builder forMarkovClustering.
-
-
Field Summary
Fields Modifier and Type Field Description static intEThe default value of the expansion parameter.static intITERATIONSThe default number of Markov Clustering iterations.static doubleRThe default value of the inflation parameter.
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MarkovClustering<V,E>build(org.jgrapht.Graph<V,E> graph)Construct an instance of the clustering algorithm with the parameters specified in the builder.Function<org.jgrapht.Graph<V,E>,Clustering<V>>provider()Construct a factory function that sets up the algorithm for the given graph.MarkovClustering.Builder<V,E>setE(int e)Set the expansion parameter.MarkovClustering.Builder<V,E>setIterations(int iterations)Set the maximal number of iterations.MarkovClustering.Builder<V,E>setR(double r)Set the inflation parameter.
-
-
-
Field Detail
-
E
public static final int E
The default value of the expansion parameter.- See Also:
- Constant Field Values
-
R
public static final double R
The default value of the inflation parameter.- See Also:
- Constant Field Values
-
ITERATIONS
public static final int ITERATIONS
The default number of Markov Clustering iterations.- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public MarkovClustering<V,E> build(org.jgrapht.Graph<V,E> graph)
Description copied from interface:ClusteringBuilderConstruct an instance of the clustering algorithm with the parameters specified in the builder.- Specified by:
buildin interfaceClusteringBuilder<V,E,MarkovClustering<V,E>>- Parameters:
graph- the graph- Returns:
- a fully-configured clustering algorithm
-
provider
public Function<org.jgrapht.Graph<V,E>,Clustering<V>> provider()
Description copied from interface:ClusteringBuilderConstruct a factory function that sets up the algorithm for the given graph.- Specified by:
providerin interfaceClusteringBuilder<V,E,MarkovClustering<V,E>>- Returns:
- a factory function that sets up the algorithm for the given graph
-
setE
public MarkovClustering.Builder<V,E> setE(int e)
Set the expansion parameter.- Parameters:
e- the expansion parameter- Returns:
- the builder
-
setR
public MarkovClustering.Builder<V,E> setR(double r)
Set the inflation parameter.- Parameters:
r- the inflation parameter- Returns:
- the builder
-
setIterations
public MarkovClustering.Builder<V,E> setIterations(int iterations)
Set the maximal number of iterations.- Parameters:
iterations- the maximal number of iterations- Returns:
- the builder
-
-