|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.algorithms.shortestpath.ShortestPath
edu.uci.ics.jung.algorithms.shortestpath.UnweightedShortestPath
Computes the shortest path distances for graphs whose edges are not weighted (using BFS).
| Constructor Summary | |
UnweightedShortestPath(Graph g)
Constructs and initializes algorithm |
|
| Method Summary | |
java.lang.Number |
getDistance(Vertex source,
Vertex target)
Returns the distance from the source vertex
to the target vertex. |
java.util.Map |
getDistanceMap(Vertex source)
Returns a Map which maps each vertex
in the graph (including the source vertex)
to its distance (represented as a Number)
from source. |
java.util.Map |
getIncomingEdgeMap(Vertex source)
Returns a LinkedHashMap which maps each vertex
in the graph (including the source vertex)
to the last edge on the shortest path from the
source vertex. |
int |
getShortestPath(Vertex source,
Vertex target)
Deprecated. use getDistance |
| Methods inherited from class edu.uci.ics.jung.algorithms.shortestpath.ShortestPath |
getPath |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UnweightedShortestPath(Graph g)
g - the graph| Method Detail |
public java.lang.Number getDistance(Vertex source,
Vertex target)
Distancesource vertex
to the target vertex. If target
is not reachable from source, returns null.
getDistance in interface DistanceDistance.getDistance(edu.uci.ics.jung.graph.Vertex, edu.uci.ics.jung.graph.Vertex)public java.util.Map getDistanceMap(Vertex source)
DistanceReturns a Map which maps each vertex
in the graph (including the source vertex)
to its distance (represented as a Number)
from source. If any vertex
is not reachable from source, no
distance is stored for that vertex.
getDistanceMap in interface DistanceDistance.getDistanceMap(edu.uci.ics.jung.graph.Vertex)public java.util.Map getIncomingEdgeMap(Vertex source)
ShortestPathReturns a LinkedHashMap which maps each vertex
in the graph (including the source vertex)
to the last edge on the shortest path from the
source vertex.
getIncomingEdgeMap in class ShortestPathShortestPath.getIncomingEdgeMap(edu.uci.ics.jung.graph.Vertex)
public int getShortestPath(Vertex source,
Vertex target)
source - the source nodetarget - the target node
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||