org.neo4j.graphalgo.impl.centrality
Class ParallellCentralityCalculation<ShortestPathCostType>

java.lang.Object
  extended by org.neo4j.graphalgo.impl.centrality.ParallellCentralityCalculation<ShortestPathCostType>
Type Parameters:
ShortestPathCostType - The datatype used by the underlying SingleSourceShortestPath algorithm, i.e. the type the edge weights are represented by.

public class ParallellCentralityCalculation<ShortestPathCostType>
extends Object

This is a utility class used to group together a number of centrality measure calculations to run them all at the same time. Doing this enables us to reuse the results of the underlying SingleSourceShortestPath algorithm, instead of re-running it for each centrality measure. We do it by collecting a number of ShortestPathBasedCentrality and then running the SingleSourceShortestPath for every node.

Author:
Patrik Larsson

Field Summary
protected  boolean doneCalculation
           
protected  Set<Node> nodeSet
           
protected  SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath
           
 
Constructor Summary
ParallellCentralityCalculation(SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath, Set<Node> nodeSet)
          Default constructor.
 
Method Summary
 void addCalculation(ShortestPathBasedCentrality<?,ShortestPathCostType> shortestPathBasedCentrality)
          This adds a centrality measure to be included in the calculation.
 void calculate()
          Method that will perform the calculation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleSourceShortestPath

protected SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath

nodeSet

protected Set<Node> nodeSet

doneCalculation

protected boolean doneCalculation
Constructor Detail

ParallellCentralityCalculation

public ParallellCentralityCalculation(SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath,
                                      Set<Node> nodeSet)
Default constructor.

Parameters:
singleSourceShortestPath - Underlying singleSourceShortestPath.
nodeSet - A set containing the nodes for which centrality values should be computed.
Method Detail

addCalculation

public void addCalculation(ShortestPathBasedCentrality<?,ShortestPathCostType> shortestPathBasedCentrality)
This adds a centrality measure to be included in the calculation.

Parameters:
shortestPathBasedCentrality - The centrality algorithm.

calculate

public void calculate()
Method that will perform the calculation. After this we are of course unable to add more measures to this object.



Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.