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.
  • Field Details

  • Constructor Details

    • 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 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 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.
    • computeAPSP

      public void computeAPSP​(boolean compute)