Package com.jgalgo.alg
Interface ShortestPathSingleSource.IResult
-
- All Superinterfaces:
ShortestPathSingleSource.Result<Integer,Integer>
- Enclosing interface:
- ShortestPathSingleSource
public static interface ShortestPathSingleSource.IResult extends ShortestPathSingleSource.Result<Integer,Integer>
A result object for theShortestPathSingleSource
problem forIntGraph
.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description double
distance(int target)
Get the distance to a target vertex.default double
distance(Integer target)
Deprecated.IPath
getNegativeCycle()
Get the negative cycle that was found.IPath
getPath(int target)
Get shortest path to a target vertex.default IPath
getPath(Integer target)
Deprecated.-
Methods inherited from interface com.jgalgo.alg.ShortestPathSingleSource.Result
foundNegativeCycle
-
-
-
-
Method Detail
-
distance
double distance(int target)
Get the distance to a target vertex.- Parameters:
target
- a target vertex in the graph- Returns:
- the sum of the shortest path edges from the source to the target, or
Double.POSITIVE_INFINITY
if no such path found. - Throws:
IllegalStateException
- if and negative cycle was found andShortestPathSingleSource.Result.foundNegativeCycle()
returntrue
.
-
distance
@Deprecated default double distance(Integer target)
Deprecated.Description copied from interface:ShortestPathSingleSource.Result
Get the distance to a target vertex.- Specified by:
distance
in interfaceShortestPathSingleSource.Result<Integer,Integer>
- Parameters:
target
- a target vertex in the graph- Returns:
- the sum of the shortest path edges from the source to the target, or
Double.POSITIVE_INFINITY
if no such path found.
-
getPath
IPath getPath(int target)
Get shortest path to a target vertex.- Parameters:
target
- a target vertex in the graph- Returns:
- the shortest path from the source to the target or
null
if no such path found. - Throws:
IllegalStateException
- if a negative cycle was found andShortestPathSingleSource.Result.foundNegativeCycle()
returntrue
.
-
getPath
@Deprecated default IPath getPath(Integer target)
Deprecated.Description copied from interface:ShortestPathSingleSource.Result
Get shortest path to a target vertex.- Specified by:
getPath
in interfaceShortestPathSingleSource.Result<Integer,Integer>
- Parameters:
target
- a target vertex in the graph- Returns:
- the shortest path from the source to the target or
null
if no such path found.
-
getNegativeCycle
IPath getNegativeCycle()
Description copied from interface:ShortestPathSingleSource.Result
Get the negative cycle that was found.- Specified by:
getNegativeCycle
in interfaceShortestPathSingleSource.Result<Integer,Integer>
- Returns:
- the negative cycle that was found.
-
-