public class BetweennessCentrality<V,E> extends java.lang.Object implements VertexScorer<V,java.lang.Double>, EdgeScorer<E,java.lang.Double>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<E,java.lang.Double> |
edge_scores |
protected edu.uci.ics.jung.graph.Graph<V,E> |
graph |
protected java.util.Map<V,edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> |
vertex_data |
protected java.util.Map<V,java.lang.Double> |
vertex_scores |
Constructor and Description |
---|
BetweennessCentrality(edu.uci.ics.jung.graph.Graph<V,E> graph)
Calculates betweenness scores based on the all-pairs unweighted shortest paths
in the graph.
|
BetweennessCentrality(edu.uci.ics.jung.graph.Graph<V,E> graph,
org.apache.commons.collections4.Transformer<E,? extends java.lang.Number> edge_weights)
Calculates betweenness scores based on the all-pairs weighted shortest paths in the
graph.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeBetweenness(java.util.Queue<V> queue,
org.apache.commons.collections4.Transformer<E,? extends java.lang.Number> edge_weights) |
java.lang.Double |
getEdgeScore(E e)
Returns the algorithm's score for this edge.
|
java.lang.Double |
getVertexScore(V v)
Returns the algorithm's score for this vertex.
|
protected void |
initialize(edu.uci.ics.jung.graph.Graph<V,E> graph) |
protected java.util.Map<V,java.lang.Double> vertex_scores
protected java.util.Map<E,java.lang.Double> edge_scores
protected java.util.Map<V,edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality.BetweennessData> vertex_data
public BetweennessCentrality(edu.uci.ics.jung.graph.Graph<V,E> graph)
graph
- the graph for which the scores are to be calculatedpublic BetweennessCentrality(edu.uci.ics.jung.graph.Graph<V,E> graph, org.apache.commons.collections4.Transformer<E,? extends java.lang.Number> edge_weights)
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.
graph
- the graph for which the scores are to be calculatededge_weights
- the edge weights to be used in the path length calculationsprotected void computeBetweenness(java.util.Queue<V> queue, org.apache.commons.collections4.Transformer<E,? extends java.lang.Number> edge_weights)
public java.lang.Double getVertexScore(V v)
VertexScorer
getVertexScore
in interface VertexScorer<V,java.lang.Double>
public java.lang.Double getEdgeScore(E e)
EdgeScorer
getEdgeScore
in interface EdgeScorer<E,java.lang.Double>