Package net.automatalib.util.graph.sssp
Interface SSSPResult<N,E>
-
- Type Parameters:
N- node classE- edge class
- All Known Implementing Classes:
DijkstraSSSP
public interface SSSPResult<N,E>Result interface for the single-source shortest path (SSSP) problem.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NgetInitialNode()Retrieves the node the source was started from.@Nullable List<E>getShortestPath(N target)Retrieves the shortest path from the initial node to the given one (as a sequence of edges), ornullif there exists no such path.floatgetShortestPathDistance(N target)Retrieves the length of the shortest path from the initial node to the given one.@Nullable EgetShortestPathEdge(N target)Retrieves the incoming edge via which the given node is reached on the shortest path.
-
-
-
Method Detail
-
getInitialNode
N getInitialNode()
Retrieves the node the source was started from.- Returns:
- the source node
-
getShortestPathDistance
float getShortestPathDistance(N target)
Retrieves the length of the shortest path from the initial node to the given one.- Parameters:
target- the target node- Returns:
- the length of the shortest path from the initial node to the given target node, or
Graphs.INVALID_DISTANCEif there exists no such path.
-
getShortestPath
@Nullable List<E> getShortestPath(N target)
Retrieves the shortest path from the initial node to the given one (as a sequence of edges), ornullif there exists no such path.Note that implementations might construct these paths on-the-fly.
- Parameters:
target- the target node- Returns:
- the path from the initial node to the given target node, or
nullif there exists no such path.
-
getShortestPathEdge
@Nullable E getShortestPathEdge(N target)
Retrieves the incoming edge via which the given node is reached on the shortest path. If the node is not reachable, or it is the initial node,nullis returned.- Parameters:
target- the target node- Returns:
- the reaching edge on the shortest path, or
null.
-
-