org.neo4j.graphalgo.impl.centrality
Class Eccentricity<ShortestPathCostType>
java.lang.Object
org.neo4j.graphalgo.impl.centrality.ShortestPathBasedCentrality<ShortestPathCostType,ShortestPathCostType>
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.