Class ListSingleSourcePathsImpl<V,​E>

java.lang.Object
org.jgrapht.alg.shortestpath.ListSingleSourcePathsImpl<V,​E>
Type Parameters:
V - the graph vertex type
E - the graph edge type
All Implemented Interfaces:
java.io.Serializable, ShortestPathAlgorithm.SingleSourcePaths<V,​E>

public class ListSingleSourcePathsImpl<V,​E>
extends java.lang.Object
implements ShortestPathAlgorithm.SingleSourcePaths<V,​E>, java.io.Serializable
An implementation of ShortestPathAlgorithm.SingleSourcePaths which stores one path per vertex.

This is an explicit representation which stores all paths. For a more compact representation see TreeSingleSourcePathsImpl.

Author:
Dimitrios Michail
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected Graph<V,​E> graph
    The graph
    protected java.util.Map<V,​GraphPath<V,​E>> paths
    One path per vertex
    protected V source
    The source vertex of all paths
  • Constructor Summary

    Constructors 
    Constructor Description
    ListSingleSourcePathsImpl​(Graph<V,​E> graph, V source, java.util.Map<V,​GraphPath<V,​E>> paths)
    Construct a new instance.
  • Method Summary

    Modifier and Type Method Description
    Graph<V,​E> getGraph()
    Returns the graph over which this set of paths is defined.
    GraphPath<V,​E> getPath​(V targetVertex)
    Return the path from the source vertex to the sink vertex.
    V getSourceVertex()
    Returns the single source vertex.
    double getWeight​(V targetVertex)
    Return the weight of the path from the source vertex to the sink vertex.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • graph

      protected Graph<V,​E> graph
      The graph
    • source

      protected V source
      The source vertex of all paths
    • paths

      protected java.util.Map<V,​GraphPath<V,​E>> paths
      One path per vertex
  • Constructor Details

    • ListSingleSourcePathsImpl

      public ListSingleSourcePathsImpl​(Graph<V,​E> graph, V source, java.util.Map<V,​GraphPath<V,​E>> paths)
      Construct a new instance.
      Parameters:
      graph - the graph
      source - the source vertex
      paths - one path per target vertex
  • Method Details