edu.uci.ics.jung.algorithms.scoring
Class BetweennessCentrality<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality<V,E>
All Implemented Interfaces:
EdgeScorer<E,Double>, VertexScorer<V,Double>

public class BetweennessCentrality<V,E>
extends Object
implements VertexScorer<V,Double>, EdgeScorer<E,Double>

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."

Field Summary
protected  Map<E,Double> edge_scores
           
protected  Graph<V,E> graph
           
protected  Map<V,edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> vertex_data
           
protected  Map<V,Double> vertex_scores
           
 
Constructor Summary
BetweennessCentrality(Graph<V,E> graph)
          Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.
BetweennessCentrality(Graph<V,E> graph, org.apache.commons.collections15.Transformer<E,? extends Number> edge_weights)
          Calculates betweenness scores based on the all-pairs weighted shortest paths in the graph.
 
Method Summary
protected  void computeBetweenness(Queue<V> queue, org.apache.commons.collections15.Transformer<E,? extends Number> edge_weights)
           
 Double getEdgeScore(E e)
          Returns the algorithm's score for this edge.
 Double getVertexScore(V v)
          Returns the algorithm's score for this vertex.
protected  void initialize(Graph<V,E> graph)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected Graph<V,E> graph

vertex_scores

protected Map<V,Double> vertex_scores

edge_scores

protected Map<E,Double> edge_scores

vertex_data

protected Map<V,edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> vertex_data
Constructor Detail

BetweennessCentrality

public BetweennessCentrality(Graph<V,E> graph)
Calculates betweenness scores based on the all-pairs unweighted shortest paths in the graph.

Parameters:
graph - the graph for which the scores are to be calculated

BetweennessCentrality

public BetweennessCentrality(Graph<V,E> graph,
                             org.apache.commons.collections15.Transformer<E,? extends Number> edge_weights)
Calculates betweenness scores based on the all-pairs weighted shortest paths in the graph.

NOTE: This version of the algorithm may not work correctly on all graphs; we're still working out the bugs. Use at your own risk.

Parameters:
graph - the graph for which the scores are to be calculated
edge_weights - the edge weights to be used in the path length calculations
Method Detail

initialize

protected void initialize(Graph<V,E> graph)

computeBetweenness

protected void computeBetweenness(Queue<V> queue,
                                  org.apache.commons.collections15.Transformer<E,? extends Number> edge_weights)

getVertexScore

public Double getVertexScore(V v)
Description copied from interface: VertexScorer
Returns the algorithm's score for this vertex.

Specified by:
getVertexScore in interface VertexScorer<V,Double>
Returns:
the algorithm's score for this vertex

getEdgeScore

public Double getEdgeScore(E e)
Description copied from interface: EdgeScorer
Returns the algorithm's score for this edge.

Specified by:
getEdgeScore in interface EdgeScorer<E,Double>
Returns:
the algorithm's score for this edge


Copyright © 2009. All Rights Reserved.