|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.graphalgo.impl.shortestpath.FloydWarshall<CostType>
CostType - The datatype the edge weights are represented by.public class FloydWarshall<CostType>
This provides an implementation of the Floyd Warshall algorithm solving the all pair shortest path problem.
| Field Summary | |
|---|---|
protected CostAccumulator<CostType> |
costAccumulator
|
protected Comparator<CostType> |
costComparator
|
protected CostEvaluator<CostType> |
costEvaluator
|
protected boolean |
doneCalculation
|
protected CostType |
infinitelyBad
|
protected Set<Node> |
nodeSet
|
protected Direction |
relationDirection
|
protected Set<Relationship> |
relationshipSet
|
protected CostType |
startCost
|
| Constructor Summary | |
|---|---|
FloydWarshall(CostType startCost,
CostType infinitelyBad,
Direction relationDirection,
CostEvaluator<CostType> costEvaluator,
CostAccumulator<CostType> costAccumulator,
Comparator<CostType> costComparator,
Set<Node> nodeSet,
Set<Relationship> relationshipSet)
|
|
| Method Summary | |
|---|---|
void |
calculate()
Internal calculate method that will do the calculation. |
CostType |
getCost(Node node1,
Node node2)
This returns the cost for the shortest path between two nodes. |
List<Node> |
getPath(Node startNode,
Node targetNode)
This returns the shortest path between two nodes as list of nodes. |
void |
reset()
This resets the calculation if we for some reason would like to redo it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CostType startCost
protected CostType infinitelyBad
protected Direction relationDirection
protected CostEvaluator<CostType> costEvaluator
protected CostAccumulator<CostType> costAccumulator
protected Comparator<CostType> costComparator
protected Set<Node> nodeSet
protected Set<Relationship> relationshipSet
protected boolean doneCalculation
| Constructor Detail |
|---|
public FloydWarshall(CostType startCost,
CostType infinitelyBad,
Direction relationDirection,
CostEvaluator<CostType> costEvaluator,
CostAccumulator<CostType> costAccumulator,
Comparator<CostType> costComparator,
Set<Node> nodeSet,
Set<Relationship> relationshipSet)
startCost - The cost for just starting (or ending) a path in a node.infinitelyBad - A cost worse than all others. This is used to initialize the
distance matrix.costRelationType - The relationship type to traverse.relationDirection - The direction in which the paths should follow the
relationships.costEvaluator - costAccumulator - costComparator - nodeSet - The set of nodes the calculation should be run on.relationshipSet - The set of relationships that should be processed.CostEvaluator},
CostAccumulator},
CostAccumulator} or {@link CostEvaluator}| Method Detail |
|---|
public void reset()
public void calculate()
public CostType getCost(Node node1,
Node node2)
node1 - The start node.node2 - The end node.
public List<Node> getPath(Node startNode,
Node targetNode)
startNode - The start node.targetNode - The end node.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||