org.javanetworkanalyzer.analyzers
Class GraphAnalyzer<V extends VCent,E extends EdgeCent,S extends PathLengthData>

java.lang.Object
  extended by org.javanetworkanalyzer.analyzers.GeneralizedGraphAnalyzer<V,E>
      extended by org.javanetworkanalyzer.analyzers.GraphAnalyzer<V,E,S>
Direct Known Subclasses:
UnweightedGraphAnalyzer, WeightedGraphAnalyzer

public abstract class GraphAnalyzer<V extends VCent,E extends EdgeCent,S extends PathLengthData>
extends GeneralizedGraphAnalyzer<V,E>

Calculates various centrality measures on the given graph, assumed to be connected.

Author:
Adam Gouge

Field Summary
protected  ProgressMonitor pm
          Progress monitor.
protected  Stack<V> stack
           
 
Fields inherited from class org.javanetworkanalyzer.analyzers.GeneralizedGraphAnalyzer
graph, nodeCount, nodeSet
 
Constructor Summary
GraphAnalyzer(org.jgrapht.Graph<V,E> graph, Class<? extends S> pathClass)
          Initializes a new instance of a graph analyzer that doesn't keep track of progress.
GraphAnalyzer(org.jgrapht.Graph<V,E> graph, ProgressMonitor pm)
          Initializes a new instance of a graph analyzer with the given ProgressMonitor.
 
Method Summary
protected  void calculateClosenessForNode(V node, S paths)
          Given a node and its path length data calculated in #calculateCentralityMeasures(int), this method calculates its closeness centrality (or "out" closeness centrality for digraphs).
protected abstract  CentralityAlg<V,E,S> calculateShortestPathsFromNode(V startNode)
          Stores number of shortest paths and the length of these paths from startNode to every other node in the V of every other node; also updates the predecessor sets.
 void computeAll()
          Performs graph analysis and stores the results in a hash map, mapping each node to a data structure holding the results of the analysis.
 
Methods inherited from class org.javanetworkanalyzer.analyzers.GeneralizedGraphAnalyzer
getGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pm

protected ProgressMonitor pm
Progress monitor.


stack

protected final Stack<V extends VCent> stack
Constructor Detail

GraphAnalyzer

public GraphAnalyzer(org.jgrapht.Graph<V,E> graph,
                     ProgressMonitor pm)
              throws NoSuchMethodException,
                     InstantiationException,
                     IllegalAccessException,
                     IllegalArgumentException,
                     InvocationTargetException
Initializes a new instance of a graph analyzer with the given ProgressMonitor.

Parameters:
graph - The graph to be analyzed.
pm - The ProgressMonitor to be used.
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException

GraphAnalyzer

public GraphAnalyzer(org.jgrapht.Graph<V,E> graph,
                     Class<? extends S> pathClass)
              throws NoSuchMethodException,
                     InstantiationException,
                     IllegalAccessException,
                     IllegalArgumentException,
                     InvocationTargetException
Initializes a new instance of a graph analyzer that doesn't keep track of progress.

Parameters:
graph - The graph to be analyzed.
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
Method Detail

computeAll

public void computeAll()
                throws InstantiationException,
                       IllegalAccessException,
                       IllegalArgumentException,
                       InvocationTargetException
Performs graph analysis and stores the results in a hash map, mapping each node to a data structure holding the results of the analysis.

Throws:
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException

calculateShortestPathsFromNode

protected abstract CentralityAlg<V,E,S> calculateShortestPathsFromNode(V startNode)
Stores number of shortest paths and the length of these paths from startNode to every other node in the V of every other node; also updates the predecessor sets.

Parameters:
startNode - Start node
Returns:
The GraphSearchAlgorithm used to find the shortest paths.

calculateClosenessForNode

protected void calculateClosenessForNode(V node,
                                         S paths)
Given a node and its path length data calculated in #calculateCentralityMeasures(int), this method calculates its closeness centrality (or "out" closeness centrality for digraphs).

Parameters:
node - The given node.
paths - Its path length data.


Copyright © 2014. All Rights Reserved.