V
- vertex typeE
- edge typeG
- graph typepublic class GirvanNewman<V,E extends UndirectedEdge<V>,G extends UnDiGraph<V,E>> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
GirvanNewman.EdgeBetweenessCtor<V>
This allows customization of the computation of edge-betweeness.
|
Constructor and Description |
---|
GirvanNewman(UnDiGraph<V,E> g,
GirvanNewman.EdgeBetweenessCtor<V> ebCtor,
GraphUtils.GraphFactory<G> gCtor)
Construct an instance of the Girvan-Newman algorithm.
|
Modifier and Type | Method and Description |
---|---|
List<G> |
clusters()
Gets all the clusters, each of which is connected.
|
int |
maxClusterSize()
Get the size of the maximal cluster.
|
UndirectedEdge<V> |
maxEdge()
Gets the edge with the maximal edge-betweeness.
|
double |
maxValue()
Get the maximum of edge-betweeness.
|
int |
numberOfClusters()
Gets the number of connected clusters.
|
double |
removeMaxEdge()
Removes the edge with the highest edge-betweeness.
|
String |
toString() |
double |
value(UndirectedEdge<V> edge)
Get the edge-betweeness of an edge.
|
public GirvanNewman(UnDiGraph<V,E> g, GirvanNewman.EdgeBetweenessCtor<V> ebCtor, GraphUtils.GraphFactory<G> gCtor)
g
- an undirected graphebCtor
- a customized constructor of edge-betweenessgCtor
- a factory to construct instances of the graph typepublic double removeMaxEdge()
Double.NaN
if there is no edge to removepublic List<G> clusters()
public int numberOfClusters()
public double value(UndirectedEdge<V> edge)
edge
- an edgepublic UndirectedEdge<V> maxEdge()
public double maxValue()
public int maxClusterSize()
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.