Package edu.claflin.finder.algo.clustering.struct.girvan_newman_struct

# Class BetweennessCentrality

java.lang.Object
edu.claflin.finder.algo.clustering.struct.girvan_newman_struct.BetweennessCentrality

public class BetweennessCentrality extends Object
Computes betweenness centrality for each vertex and edge in the graph.

See Also:
  - "Ulrik Brandes: A Faster Algorithm for Betweenness Centrality. Journal of Mathematical Sociology 25(2):163-177, 2001."

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `private class`
  `BetweennessCentrality.BetweennessComparator`
  `private class`
  `BetweennessCentrality.BetweennessData`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<Edge,Double>`
  `edge_scores`
  `protected Graph`
  `graph`
  `protected Map<Node,BetweennessCentrality.BetweennessData>`
  `vertex_data`
  `protected Map<Node,Double>`
  `vertex_scores`
  `protected boolean`
  `weighted`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BetweennessCentrality(Graph graph, boolean weighted)`
  Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `computeBetweenness(Queue<Node> queue)`
  `Double`
  `getEdgeScore(Edge e)`
  `Double`
  `getVertexScore(Node v)`
  `protected void`
  `initialize()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### graph

    protected Graph graph

  - ### weighted

    protected boolean weighted

  - ### vertex_scores

    protected Map<Node,Double> vertex_scores

  - ### edge_scores

    protected Map<Edge,Double> edge_scores

  - ### vertex_data

    protected Map<Node,BetweennessCentrality.BetweennessData> vertex_data

- ## Constructor Details

  - ### BetweennessCentrality

    public BetweennessCentrality(Graph graph, boolean weighted)
    Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.
    Parameters:
      `graph` - the the graph to calculate betweenness centrality
      `weighted` - whether to consider edge weights

- ## Method Details

  - ### initialize

    protected void initialize()

  - ### computeBetweenness

    protected void computeBetweenness(Queue<Node> queue)

  - ### getVertexScore

    public Double getVertexScore(Node v)

  - ### getEdgeScore

    public Double getEdgeScore(Edge e)