Class DefaultManyToManyShortestPaths.DefaultManyToManyShortestPathsImpl<V,​E>

    • Field Detail

      • pathsMap

        private final java.util.Map<V,​java.util.Map<V,​GraphPath<V,​E>>> pathsMap
        Map with paths between sources and targets.
    • Constructor Detail

      • DefaultManyToManyShortestPathsImpl

        DefaultManyToManyShortestPathsImpl​(java.util.Set<V> sources,
                                           java.util.Set<V> targets,
                                           java.util.Map<V,​java.util.Map<V,​GraphPath<V,​E>>> pathsMap)
        Constructs an instance of the algorithm for the given sources, targets and pathsMap.
        Parameters:
        sources - source vertices
        targets - target vertices
        pathsMap - map with paths between sources and targets
    • Method Detail

      • getPath

        public GraphPath<V,​E> getPath​(V source,
                                            V target)
        Return the path from the source vertex to the target vertex. If no such path exists, null is returned.
        Parameters:
        source - source vertex
        target - target vertex
        Returns:
        path between source and target or null if no such path exists
      • getWeight

        public double getWeight​(V source,
                                V target)
        Return the weight of the path from the source vertex to the targetvertex or Double.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 vertex
        target - target vertex
        Returns:
        the weight of the path between source and sink vertices or Double.POSITIVE_INFINITY in case no such path exists