Package com.jgalgo.alg
Interface ShortestPathAllPairs.Result<V,E>
-
- Type Parameters:
V- the vertices typeE- the edges type
- All Known Subinterfaces:
ShortestPathAllPairs.IResult
- Enclosing interface:
- ShortestPathAllPairs
public static interface ShortestPathAllPairs.Result<V,E>A result object for anShortestPathAllPairsalgorithm.- Author:
- Barak Ugav
-
-
Method Detail
-
distance
double distance(V source, V 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
-
getPath
Path<V,E> getPath(V source, V 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
-
-