|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.graphalgo.impl.shortestpath.Dijkstra<CostType>
org.neo4j.graphalgo.impl.shortestpath.SingleSourceShortestPathDijkstra<CostType>
CostType - The datatype the edge weights are represented by.public class SingleSourceShortestPathDijkstra<CostType>
Dijkstra implementation to solve the single source shortest path problem for weighted networks.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.neo4j.graphalgo.impl.shortestpath.Dijkstra |
|---|
Dijkstra.DijstraIterator |
| Field Summary | |
|---|---|
protected HashMap<Node,CostType> |
distances
|
| Fields inherited from class org.neo4j.graphalgo.impl.shortestpath.Dijkstra |
|---|
calculateAllShortestPaths, costAccumulator, costComparator, costEvaluator, costRelationTypes, doneCalculation, endNode, foundPathsCost, foundPathsMiddleNodes, maxCost, maxNodesToTraverse, maxRelationShipsToTraverse, numberOfNodesTraversed, numberOfTraversedRelationShips, predecessors1, predecessors2, relationDirection, startCost, startNode |
| Constructor Summary | |
|---|---|
SingleSourceShortestPathDijkstra(CostType startCost,
Node startNode,
CostEvaluator<CostType> costEvaluator,
CostAccumulator<CostType> costAccumulator,
Comparator<CostType> costComparator,
Direction relationDirection,
RelationshipType... costRelationTypes)
|
|
| Method Summary | |
|---|---|
boolean |
calculate()
Makes the main calculation If some limit is set, the shortest path(s) that could be found within those limits will be calculated. |
boolean |
calculate(Node targetNode)
Internal calculate method that will run the calculation until either the limit is reached or a result has been generated for a given node. |
boolean |
calculateMultiple(Node targetNode)
Same as calculate(), but will set the flag to calculate all shortest paths. |
CostType |
getCost()
A call to this will run the algorithm to find the cost for the shortest paths between the start node and the end node, if not calculated before. |
CostType |
getCost(Node targetNode)
A call to this will run the algorithm, if not already done, and return the cost for the shortest paths between the start node and the target node. |
Direction |
getDirection()
This can be used to retrieve the Direction in which relationships should be in the shortest path(s). |
List<PropertyContainer> |
getPath()
A call to this will run the algorithm to find a single shortest path, if not already done, and return it as an alternating list of Node/Relationship. |
List<PropertyContainer> |
getPath(Node targetNode)
A call to this will run the algorithm to find a single shortest path, if not already done, and return it as an alternating list of Node/Relationship. |
List<Node> |
getPathAsNodes()
A call to this will run the algorithm to find a single shortest path, if not already done, and return it as a list of nodes. |
List<Node> |
getPathAsNodes(Node targetNode)
A call to this will run the algorithm, if not already done, and return the found path to the target node if found as a list of nodes. |
List<Relationship> |
getPathAsRelationships()
A call to this will run the algorithm to find a single shortest path, if not already done, and return it as a list of Relationships. |
List<Relationship> |
getPathAsRelationships(Node targetNode)
A call to this will run the algorithm to find a single shortest path, if not already done, and return it as a list of Relationships. |
List<List<PropertyContainer>> |
getPaths()
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as alternating lists of Node/Relationship. |
List<List<PropertyContainer>> |
getPaths(Node targetNode)
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as alternating lists of Node/Relationship. |
List<List<Node>> |
getPathsAsNodes()
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as lists of nodes. |
List<List<Node>> |
getPathsAsNodes(Node targetNode)
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as lists of nodes. |
List<List<Relationship>> |
getPathsAsRelationships()
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as lists of relationships. |
List<List<Relationship>> |
getPathsAsRelationships(Node targetNode)
A call to this will run the algorithm to find all shortest paths, if not already done, and return them as lists of relationships. |
List<Node> |
getPredecessorNodes(Node node)
|
Map<Node,List<Relationship>> |
getPredecessors()
This can be used to retrieve the entire data structure representing the predecessors for every node. |
RelationshipType[] |
getRelationshipTypes()
This can be used to retrieve the types of relationships that are traversed. |
void |
reset()
Resets the result data to force the computation to be run again when some result is asked for. |
void |
setEndNode(Node endNode)
Set the end node. |
| Methods inherited from class org.neo4j.graphalgo.impl.shortestpath.Dijkstra |
|---|
calculateMultiple, limitMaxCostToTraverse, limitMaxNodesToTraverse, limitMaxRelationShipsToTraverse, limitReached, limitReached, setStartNode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.neo4j.graphalgo.impl.shortestpath.SingleSourceShortestPath |
|---|
setStartNode |
| Field Detail |
|---|
protected HashMap<Node,CostType> distances
| Constructor Detail |
|---|
public SingleSourceShortestPathDijkstra(CostType startCost,
Node startNode,
CostEvaluator<CostType> costEvaluator,
CostAccumulator<CostType> costAccumulator,
Comparator<CostType> costComparator,
Direction relationDirection,
RelationshipType... costRelationTypes)
Dijkstra| Method Detail |
|---|
public void reset()
Dijkstra
reset in interface SingleSourceShortestPath<CostType>reset in interface SingleSourceSingleSinkShortestPath<CostType>reset in class Dijkstra<CostType>public boolean calculateMultiple(Node targetNode)
public boolean calculate()
Dijkstra
calculate in class Dijkstra<CostType>public boolean calculate(Node targetNode)
public void setEndNode(Node endNode)
Dijkstra
setEndNode in interface SingleSourceSingleSinkShortestPath<CostType>setEndNode in class Dijkstra<CostType>endNode - the endNode to setpublic CostType getCost(Node targetNode)
SingleSourceShortestPath
getCost in interface SingleSourceShortestPath<CostType>Dijkstrapublic List<List<PropertyContainer>> getPaths(Node targetNode)
SingleSourceShortestPath
getPaths in interface SingleSourceShortestPath<CostType>public List<List<Node>> getPathsAsNodes(Node targetNode)
SingleSourceShortestPath
getPathsAsNodes in interface SingleSourceShortestPath<CostType>public List<List<Relationship>> getPathsAsRelationships(Node targetNode)
SingleSourceShortestPath
getPathsAsRelationships in interface SingleSourceShortestPath<CostType>public List<PropertyContainer> getPath(Node targetNode)
SingleSourceShortestPath
getPath in interface SingleSourceShortestPath<CostType>public List<Node> getPathAsNodes(Node targetNode)
SingleSourceShortestPath
getPathAsNodes in interface SingleSourceShortestPath<CostType>public List<Relationship> getPathAsRelationships(Node targetNode)
SingleSourceShortestPath
getPathAsRelationships in interface SingleSourceShortestPath<CostType>public CostType getCost()
SingleSourceSingleSinkShortestPath
getCost in interface SingleSourceSingleSinkShortestPath<CostType>getCost in class Dijkstra<CostType>public List<PropertyContainer> getPath()
SingleSourceSingleSinkShortestPath
getPath in interface SingleSourceSingleSinkShortestPath<CostType>getPath in class Dijkstra<CostType>public List<Node> getPathAsNodes()
SingleSourceSingleSinkShortestPath
getPathAsNodes in interface SingleSourceSingleSinkShortestPath<CostType>getPathAsNodes in class Dijkstra<CostType>public List<Relationship> getPathAsRelationships()
SingleSourceSingleSinkShortestPath
getPathAsRelationships in interface SingleSourceSingleSinkShortestPath<CostType>getPathAsRelationships in class Dijkstra<CostType>public List<List<PropertyContainer>> getPaths()
SingleSourceSingleSinkShortestPath
getPaths in interface SingleSourceSingleSinkShortestPath<CostType>getPaths in class Dijkstra<CostType>public List<List<Node>> getPathsAsNodes()
SingleSourceSingleSinkShortestPath
getPathsAsNodes in interface SingleSourceSingleSinkShortestPath<CostType>getPathsAsNodes in class Dijkstra<CostType>public List<List<Relationship>> getPathsAsRelationships()
SingleSourceSingleSinkShortestPath
getPathsAsRelationships in interface SingleSourceSingleSinkShortestPath<CostType>getPathsAsRelationships in class Dijkstra<CostType>public List<Node> getPredecessorNodes(Node node)
getPredecessorNodes in interface SingleSourceShortestPath<CostType>SingleSourceShortestPathpublic Map<Node,List<Relationship>> getPredecessors()
SingleSourceShortestPath
getPredecessors in interface SingleSourceShortestPath<CostType>SingleSourceShortestPathpublic Direction getDirection()
SingleSourceSingleSinkShortestPath
getDirection in interface SingleSourceShortestPath<CostType>getDirection in interface SingleSourceSingleSinkShortestPath<CostType>getDirection in class Dijkstra<CostType>SingleSourceShortestPathpublic RelationshipType[] getRelationshipTypes()
SingleSourceSingleSinkShortestPath
getRelationshipTypes in interface SingleSourceShortestPath<CostType>getRelationshipTypes in interface SingleSourceSingleSinkShortestPath<CostType>getRelationshipTypes in class Dijkstra<CostType>SingleSourceShortestPath
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||