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 N
getInitialNode()
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), ornull
if there exists no such path.float
getShortestPathDistance(N target)
Retrieves the length of the shortest path from the initial node to the given one.@Nullable E
getShortestPathEdge(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_DISTANCE
if 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), ornull
if 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
null
if 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,null
is returned.- Parameters:
target
- the target node- Returns:
- the reaching edge on the shortest path, or
null
.
-
-