|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.algorithms.shortestpath.UnweightedShortestPath<V,E>
public class UnweightedShortestPath<V,E>
Computes the shortest path distances for graphs whose edges are not weighted (using BFS).
Constructor Summary | |
---|---|
UnweightedShortestPath(Hypergraph<V,E> g)
Constructs and initializes algorithm |
Method Summary | |
---|---|
Number |
getDistance(V source,
V target)
Returns the distance from the source vertex
to the target vertex. |
Map<V,Number> |
getDistanceMap(V source)
Returns a Map which maps each vertex
in the graph (including the source vertex)
to its distance (represented as a Number)
from source . |
Map<V,E> |
getIncomingEdgeMap(V source)
Returns a Map which maps each vertex
in the graph (including the source vertex)
to the last edge on the shortest path from the
source vertex. |
void |
reset()
Clears all stored distances for this instance. |
void |
reset(V v)
Clears all stored distances for the specified source vertex source . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnweightedShortestPath(Hypergraph<V,E> g)
g
- the graphMethod Detail |
---|
public Number getDistance(V source, V target)
Distance
source
vertex
to the target
vertex. If target
is not reachable from source
, returns null.
getDistance
in interface Distance<V>
Distance.getDistance(Object, Object)
public Map<V,Number> getDistanceMap(V 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<V>
Distance.getDistanceMap(Object)
public Map<V,E> getIncomingEdgeMap(V source)
ShortestPath
Returns a Map
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 interface ShortestPath<V,E>
ShortestPath.getIncomingEdgeMap(Object)
public void reset()
reset(V)
may be appropriate instead.
reset(Object)
public void reset(V v)
source
. Should be called whenever the stored distances
from this vertex are invalidated by changes to the graph.
reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |