Interface ReachabilityAlgorithm<E>
- Type Parameters:
E- the edge type
- All Known Implementing Classes:
Dijkstra
public interface ReachabilityAlgorithm<E>
An algorithm which can determine which vertices on an explorable graph are reachable from a
source.
- Author:
- Lee A. Christie
-
Method Summary
Modifier and TypeMethodDescriptionreachable(Explorable<V, E> graph, V source) Returns the set of reachable vertices and the corresponding cost of each vertex's shortest path.reachable(Explorable<V, E> graph, V source, E maxCost) Returns the set of vertices reachable within a given maximum cost, and the corresponding cost of each vertex's shortest path.<V> voidreachable(Explorable<V, E> graph, V source, E maxCost, ReachabilityCallback<V, E> callback) Streams to a callback function the set of vertices reachable within a given maximum cost, and the corresponding cost of each vertex's shortest path.<V> voidreachable(Explorable<V, E> graph, V source, ReachabilityCallback<V, E> callback) Streams to a callback function the set of reachable vertices and the corresponding cost of each vertex's shortest path.
-
Method Details
-
reachable
Returns the set of reachable vertices and the corresponding cost of each vertex's shortest path.- Type Parameters:
V- the vertex type- Parameters:
graph- the graph on which to route, not nullsource- , the source vertex, in graph, not null- Returns:
- a map of reachable vertices, with associated costs
- Throws:
InterruptedException- if the thread is interrupted, and the implementation supports interruption
-
reachable
Returns the set of vertices reachable within a given maximum cost, and the corresponding cost of each vertex's shortest path.- Type Parameters:
V- the vertex type- Parameters:
graph- the graph on which to route, not nullsource- , the source vertex, in graph, not nullmaxCost- , the maximum cost, considered unlimited if null- Returns:
- a map of reachable vertices, with associated costs
- Throws:
InterruptedException- if the thread is interrupted, and the implementation supports interruption
-
reachable
<V> void reachable(Explorable<V, E> graph, V source, ReachabilityCallback<V, throws InterruptedExceptionE> callback) Streams to a callback function the set of reachable vertices and the corresponding cost of each vertex's shortest path.- Type Parameters:
V- the vertex type- Parameters:
graph- the graph on which to route, not nullsource- the source vertex, in graph, not nullcallback- a callback which acts as a consumer of reachable vertices, with associated costs, but returnsReachabilityCallback.Action.BREAKif the algorithm should abandon the search orReachabilityCallback.Action.CONTINUEotherwise, not null- Throws:
InterruptedException- if the thread is interrupted, and the implementation supports interruption
-
reachable
<V> void reachable(Explorable<V, E> graph, V source, E maxCost, ReachabilityCallback<V, throws InterruptedExceptionE> callback) Streams to a callback function the set of vertices reachable within a given maximum cost, and the corresponding cost of each vertex's shortest path.- Type Parameters:
V- the vertex type- Parameters:
graph- the graph on which to route, not nullsource- , the source vertex, in graph, not nullmaxCost- , the maximum cost, considered unlimited if nullcallback- a callback which acts as a consumer of reachable vertices, with associated costs, but returnsReachabilityCallback.Action.BREAKif the algorithm should abandon the search orReachabilityCallback.Action.CONTINUEotherwise, not null- Throws:
InterruptedException- if the thread is interrupted, and the implementation supports interruption
-