org.graphstream.algorithm.measure
Class ClosenessCentrality

java.lang.Object
  extended by org.graphstream.algorithm.measure.AbstractCentrality
      extended by 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
static String DEFAULT_ATTRIBUTE_KEY
           
 
Constructor Summary
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
 void init(org.graphstream.graph.Graph graph)
          Initialization of the algorithm.
 
Methods inherited from class org.graphstream.algorithm.measure.AbstractCentrality
compute, copyValuesTo, copyValuesTo, getCentralityAttribute, getNormalizationMode, setCentralityAttribute, setNormalizationMode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ATTRIBUTE_KEY

public static final String DEFAULT_ATTRIBUTE_KEY
See Also:
Constant Field Values
Constructor Detail

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 stored
normalize - 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 stored
normalize - defines the normalization mode
computeAPSP - if true, apsp will be computed in this algorithm
useDangalchevMethod - if true, Dangelchev method will be used in this algorithm
Method Detail

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.