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 theShortestPathSingleSourceproblem forIntGraph.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description doubledistance(int target)Get the distance to a target vertex.default doubledistance(Integer target)Deprecated.IPathgetNegativeCycle()Get the negative cycle that was found.IPathgetPath(int target)Get shortest path to a target vertex.default IPathgetPath(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_INFINITYif 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.ResultGet the distance to a target vertex.- Specified by:
distancein 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_INFINITYif 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
nullif 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.ResultGet shortest path to a target vertex.- Specified by:
getPathin interfaceShortestPathSingleSource.Result<Integer,Integer>- Parameters:
target- a target vertex in the graph- Returns:
- the shortest path from the source to the target or
nullif no such path found.
-
getNegativeCycle
IPath getNegativeCycle()
Description copied from interface:ShortestPathSingleSource.ResultGet the negative cycle that was found.- Specified by:
getNegativeCyclein interfaceShortestPathSingleSource.Result<Integer,Integer>- Returns:
- the negative cycle that was found.
-
-