Package org.jgrapht.alg.interfaces
Interface ManyToManyShortestPathsAlgorithm.ManyToManyShortestPaths<V,E>
-
- Type Parameters:
V
- the graph vertices typeE
- the graph edge type
- All Known Implementing Classes:
ManyToManyShortestPathsAlgorithm.BaseManyToManyShortestPathsImpl
- Enclosing interface:
- ManyToManyShortestPathsAlgorithm<V,E>
public static interface ManyToManyShortestPathsAlgorithm.ManyToManyShortestPaths<V,E>
A set of paths from all sources vertices to all target vertices.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GraphPath<V,E>
getPath(V source, V target)
Return the path from thesource
vertex to thetarget
vertex.java.util.Set<V>
getSources()
Returns the set of source vertices for which this many-to-many shortest paths were computed.java.util.Set<V>
getTargets()
Returns the set of target vertices for which this many-to-many shortest paths were computed.double
getWeight(V source, V target)
Return the weight of the path from thesource
vertex to thetarget
vertex orDouble.POSITIVE_INFINITY
if there is no such path in the graph.
-
-
-
Method Detail
-
getSources
java.util.Set<V> getSources()
Returns the set of source vertices for which this many-to-many shortest paths were computed.- Returns:
- the set of source vertices
-
getTargets
java.util.Set<V> getTargets()
Returns the set of target vertices for which this many-to-many shortest paths were computed.- Returns:
- the set of target vertices
-
getPath
GraphPath<V,E> getPath(V source, V target)
Return the path from thesource
vertex to thetarget
vertex. If no such path exists, null is returned.- Parameters:
source
- source vertextarget
- target vertex- Returns:
- path between
source
andtarget
or null if no such path exists
-
getWeight
double getWeight(V source, V target)
Return the weight of the path from thesource
vertex to thetarget
vertex orDouble.POSITIVE_INFINITY
if there is no such path in the graph. The weight of the path between a vertex and itself is always zero.- Parameters:
source
- source vertextarget
- target vertex- Returns:
- the weight of the path between source and sink vertices or
Double.POSITIVE_INFINITY
in case no such path exists
-
-