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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.algorithm.measure.AbstractCentrality
AbstractCentrality.NormalizationMode
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ATTRIBUTE_KEY
-
Constructor Summary
Constructors Constructor Description ClosenessCentrality()
Default construtor.ClosenessCentrality(String attribute)
Construtor allowing to configure centrality attribute.ClosenessCentrality(String attribute, AbstractCentrality.NormalizationMode normalize)
Constructor allowing to configure attribute and normalize flag.ClosenessCentrality(String centralityAttribute, AbstractCentrality.NormalizationMode normalize, boolean computeAPSP, boolean useDangalchevMethod)
Fully configurable construtor. -
Method Summary
Modifier and Type Method Description void
computeAPSP(boolean compute)
void
init(org.graphstream.graph.Graph graph)
Initialization of the algorithm.Methods inherited from class org.graphstream.algorithm.measure.AbstractCentrality
compute, copyValuesTo, copyValuesTo, defaultMessage, getCentralityAttribute, getNormalizationMode, setCentralityAttribute, setNormalizationMode
-
Field Details
-
DEFAULT_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ClosenessCentrality
public ClosenessCentrality()Default construtor. Same as calling `ClosenessCentrality("closeness")`. -
ClosenessCentrality
Construtor allowing to configure centrality attribute. Same as calling `ClosenessCentrality(attribute, false)`.- Parameters:
attribute
- attribute where centrality will be stored
-
ClosenessCentrality
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
-
-
Method Details
-
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 theAlgorithm.compute()
method to initialize or reset the algorithm according to the new given graph.- Specified by:
init
in interfaceAlgorithm
- Overrides:
init
in classAbstractCentrality
- Parameters:
graph
- The graph this algorithm is using.
-
computeAPSP
public void computeAPSP(boolean compute)
-