sampleapplication
Class CentralityComputer<V,E>

java.lang.Object
  extended by sampleapplication.CentralityComputer<V,E>

public class CentralityComputer<V,E>
extends java.lang.Object


Constructor Summary
CentralityComputer(org.jgrapht.Graph<V,E> myGraph)
          Class constructor.
 
Method Summary
 java.lang.Double findBetweennessOf(V vertex)
          Calculates a (normalized) betweenness centrality of a vertex.
 java.lang.Double findClosenessOf(V vertex)
          Calculates a (normalized) closeness centrality of a vertex.
 java.lang.Double findClusteringOf(V vertex)
          Calculates a clustering coefficient of a vertex.
 java.lang.Double findDegreeOf(V vertex)
          Calculates a (normalized) degree centrality of a vertex.
 java.lang.Integer getDistance(V s, V t)
          Calculates the number of edges on the shortest path between two vertices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentralityComputer

public CentralityComputer(org.jgrapht.Graph<V,E> myGraph)
Class constructor. Computes auxiliary data necessary to compute centrality characteristics.

Method Detail

findDegreeOf

public java.lang.Double findDegreeOf(V vertex)
Calculates a (normalized) degree centrality of a vertex.

Parameters:
vertex - the vertex for which degree centrality is computed.
Returns:
the degree centrality value of the vertex.

findClosenessOf

public java.lang.Double findClosenessOf(V vertex)
Calculates a (normalized) closeness centrality of a vertex.

Parameters:
vertex - the vertex for which closeness centrality is computed.
Returns:
the closeness centrality value of the vertex.

findBetweennessOf

public java.lang.Double findBetweennessOf(V vertex)
Calculates a (normalized) betweenness centrality of a vertex.

Parameters:
vertex - the vertex for which closeness centrality is computed.
Returns:
the betweenness centrality value of the vertex.

findClusteringOf

public java.lang.Double findClusteringOf(V vertex)
Calculates a clustering coefficient of a vertex.

Parameters:
vertex - the vertex for which clustering coefficient is computed.
Returns:
the clustering coefficient value of the vertex.

getDistance

public java.lang.Integer getDistance(V s,
                                     V t)
Calculates the number of edges on the shortest path between two vertices.

Parameters:
s - source vertex
t - destination vertex
Returns:
the number of edges on the shortest path between two vertices.