org.graphstream.algorithm.measure
Class ClosenessCentrality
java.lang.Object
org.graphstream.algorithm.measure.AbstractCentrality
org.graphstream.algorithm.measure.ClosenessCentrality
- All Implemented Interfaces:
- Algorithm
public class ClosenessCentrality
- extends AbstractCentrality
Compute closeness centrality.
Method Summary |
void |
init(org.graphstream.graph.Graph graph)
Initialization of the algorithm. |
DEFAULT_ATTRIBUTE_KEY
public static final String DEFAULT_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
ClosenessCentrality
public ClosenessCentrality()
- Default construtor. Same as calling `ClosenessCentrality("closeness")`.
ClosenessCentrality
public ClosenessCentrality(String attribute)
- Construtor allowing to configure centrality attribute. Same as calling
`ClosenessCentrality(attribute, false)`.
- Parameters:
attribute
- attribute where centrality will be stored
ClosenessCentrality
public ClosenessCentrality(String attribute,
AbstractCentrality.NormalizationMode normalize)
- Constructor allowing to configure attribute and normalize flag. Same as
calling `ClosenessCentrality(attribute, normalize, true, false)`.
- Parameters:
attribute
- attribute where centrality will be storednormalize
- defines the normalization mode
ClosenessCentrality
public ClosenessCentrality(String centralityAttribute,
AbstractCentrality.NormalizationMode normalize,
boolean computeAPSP,
boolean useDangalchevMethod)
- Fully configurable construtor.
- Parameters:
centralityAttribute
- attribute where centrality will be storednormalize
- defines the normalization modecomputeAPSP
- if true, apsp will be computed in this algorithmuseDangalchevMethod
- if true, Dangelchev method will be used in this algorithm
init
public void init(org.graphstream.graph.Graph graph)
- Description copied from interface:
Algorithm
- Initialization of the algorithm. This method has to be called before the
Algorithm.compute()
method to initialize or reset the algorithm according
to the new given graph.
- Specified by:
init
in interface Algorithm
- Overrides:
init
in class AbstractCentrality
- Parameters:
graph
- The graph this algorithm is using.
Copyright © 2013. All Rights Reserved.