Package com.jgalgo.alg
Interface ShortestPathAllPairs.IResult
-
- All Superinterfaces:
ShortestPathAllPairs.Result<Integer,Integer>
- Enclosing interface:
- ShortestPathAllPairs
public static interface ShortestPathAllPairs.IResult extends ShortestPathAllPairs.Result<Integer,Integer>
A result object for anShortestPathAllPairsalgorithm forIntGraph.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description doubledistance(int source, int target)Get the distance of the shortest path between two vertices.default doubledistance(Integer source, Integer target)Deprecated.Please usedistance(int, int)instead to avoid un/boxing.IPathgetPath(int source, int target)Get the shortest path between vertices.default IPathgetPath(Integer source, Integer target)Deprecated.Please usegetPath(int, int)instead to avoid un/boxing.
-
-
-
Method Detail
-
distance
double distance(int source, int target)Get the distance of the shortest path between two vertices.- Parameters:
source- the source vertextarget- the target vertex- Returns:
- the sum of weights of edges in the shortest path from the source to target,
or
Double.POSITIVE_INFINITYif no such path exists - Throws:
NoSuchVertexException- ifsourceortargetare not vertices in the graphIllegalArgumentException- if the shortest paths were computed on pairs of vertices from a subset of the vertices of the graph (rather than all pairs), andsourceortargetare not in the subset
-
distance
@Deprecated default double distance(Integer source, Integer target)
Deprecated.Please usedistance(int, int)instead to avoid un/boxing.Get the distance of the shortest path between two vertices.- Specified by:
distancein interfaceShortestPathAllPairs.Result<Integer,Integer>- Parameters:
source- the source vertextarget- the target vertex- Returns:
- the sum of weights of edges in the shortest path from the source to target,
or
Double.POSITIVE_INFINITYif no such path exists
-
getPath
IPath getPath(int source, int target)
Get the shortest path between vertices.- Parameters:
source- the source vertextarget- the target vertex- Returns:
- the shortest path from the source to target, or
nullif no such path exists - Throws:
NoSuchVertexException- ifsourceortargetare not vertices in the graphIllegalArgumentException- if the shortest paths were computed on pairs of vertices from a subset of the vertices of the graph (rather than all pairs), andsourceortargetare not in the subset
-
getPath
@Deprecated default IPath getPath(Integer source, Integer target)
Deprecated.Please usegetPath(int, int)instead to avoid un/boxing.Get the shortest path between vertices.- Specified by:
getPathin interfaceShortestPathAllPairs.Result<Integer,Integer>- Parameters:
source- the source vertextarget- the target vertex- Returns:
- the shortest path from the source to target, or
nullif no such path exists
-
-