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

java.lang.Object
  extended by org.neo4j.graphalgo.impl.centrality.ShortestPathBasedCentrality<ShortestPathCostType,ShortestPathCostType>
      extended by org.neo4j.graphalgo.impl.centrality.Eccentricity<ShortestPathCostType>

public class Eccentricity<ShortestPathCostType>
extends ShortestPathBasedCentrality<ShortestPathCostType,ShortestPathCostType>

This can be used to calculate the eccentricity of nodes, which is defined as the maximum distance to any other node.

Author:
Patrik Larsson

Field Summary
 
Fields inherited from class org.neo4j.graphalgo.impl.centrality.ShortestPathBasedCentrality
centralities, centralityAccumulator, doneCalculation, nodeSet, singleSourceShortestPath, zeroValue
 
Constructor Summary
Eccentricity(SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath, ShortestPathCostType zeroValue, Set<Node> nodeSet, Comparator<ShortestPathCostType> distanceComparator)
          Default constructor.
 
Method Summary
 ShortestPathCostType getCentrality(Node node)
          This can be used to retrieve the result for every node.
 void processShortestPaths(Node node, SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath)
          This is the abstract method all centrality algorithms based on this class need to implement.
 
Methods inherited from class org.neo4j.graphalgo.impl.centrality.ShortestPathBasedCentrality
addCentralityToNode, calculate, reset, setCentralityForNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eccentricity

public Eccentricity(SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath,
                    ShortestPathCostType zeroValue,
                    Set<Node> nodeSet,
                    Comparator<ShortestPathCostType> distanceComparator)
Default constructor.

Parameters:
singleSourceShortestPath - Underlying singleSourceShortestPath.
zeroValue - Default value.
nodeSet - A set containing the nodes for which centrality values should be computed.
distanceComparator - Object being able to compare distances, in order to sort out the largest.
Method Detail

getCentrality

public ShortestPathCostType getCentrality(Node node)
Description copied from class: ShortestPathBasedCentrality
This can be used to retrieve the result for every node. Will return null if the node is not contained in the node set initially given.

Overrides:
getCentrality in class ShortestPathBasedCentrality<ShortestPathCostType,ShortestPathCostType>
Returns:

processShortestPaths

public void processShortestPaths(Node node,
                                 SingleSourceShortestPath<ShortestPathCostType> singleSourceShortestPath)
Description copied from class: ShortestPathBasedCentrality
This is the abstract method all centrality algorithms based on this class need to implement. It is called once for every node in the node set, along with a SingleSourceShortestPath starting in that node.

Specified by:
processShortestPaths in class ShortestPathBasedCentrality<ShortestPathCostType,ShortestPathCostType>


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