|
|||||||||||
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 graphMethod Detail |
public java.lang.Number getDistance(Vertex source, Vertex target)
Distance
source
vertex
to the target
vertex. If target
is not reachable from source
, returns null.
getDistance
in interface Distance
Distance.getDistance(edu.uci.ics.jung.graph.Vertex, edu.uci.ics.jung.graph.Vertex)
public java.util.Map getDistanceMap(Vertex source)
Distance
Returns 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 Distance
Distance.getDistanceMap(edu.uci.ics.jung.graph.Vertex)
public java.util.Map getIncomingEdgeMap(Vertex source)
ShortestPath
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.
getIncomingEdgeMap
in class ShortestPath
ShortestPath.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 |