V - the graph vertex typeE - the graph edge typeKShortestSimplePaths@Deprecated public class KShortestPaths<V,E> extends Object implements KShortestPathAlgorithm<V,E>
The algorithm is a variant of the Bellman-Ford algorithm but instead of only storing the best path it stores the "k" best paths at each pass, yielding a complexity of $O(k \cdot n \cdot (m^2))$ where $m$ is the number of edges and $n$ is the number of vertices.
| Constructor and Description | 
|---|
KShortestPaths(Graph<V,E> graph,
              int k)
Deprecated.  
Constructs an object to compute ranking shortest paths in a graph. 
 | 
KShortestPaths(Graph<V,E> graph,
              int k,
              int nMaxHops)
Deprecated.  
Constructs an object to calculate ranking shortest paths in a graph. 
 | 
KShortestPaths(Graph<V,E> graph,
              int k,
              int nMaxHops,
              PathValidator<V,E> pathValidator)
Deprecated.  
Constructs an object to calculate ranking shortest paths in a graph. 
 | 
KShortestPaths(Graph<V,E> graph,
              int k,
              PathValidator<V,E> pathValidator)
Deprecated.  
Constructs an object to compute ranking shortest paths in a graph. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
List<GraphPath<V,E>> | 
getPaths(V startVertex,
        V endVertex)
Deprecated.  
Returns the $k$ shortest simple paths in increasing order of weight. 
 | 
List<GraphPath<V,E>> | 
getPaths(V source,
        V sink,
        int k)
Deprecated.  
Get a list of k-shortest paths from a source vertex to a sink vertex. 
 | 
public KShortestPaths(Graph<V,E> graph, int k)
graph - graph on which shortest paths are searchedk - number of paths to be computedpublic KShortestPaths(Graph<V,E> graph, int k, PathValidator<V,E> pathValidator)
graph - graph on which shortest paths are searched.k - number of paths to be computed.pathValidator - the path validator to useIllegalArgumentException - if k is negative or 0.public KShortestPaths(Graph<V,E> graph, int k, int nMaxHops)
graph - graph on which shortest paths are searchedk - number of ranking paths between the start vertex and an end vertexnMaxHops - maximum number of edges of the calculated pathsIllegalArgumentException - if k is negative or 0.IllegalArgumentException - if nMaxHops is negative or 0.public KShortestPaths(Graph<V,E> graph, int k, int nMaxHops, PathValidator<V,E> pathValidator)
graph - graph on which shortest paths are searchedk - number of ranking paths between the start vertex and the end vertexnMaxHops - maximum number of edges of the calculated pathspathValidator - the path validator to useIllegalArgumentException - if k is negative or 0.IllegalArgumentException - if nMaxHops is negative or 0.public List<GraphPath<V,E>> getPaths(V startVertex, V endVertex)
getPaths in interface KShortestPathAlgorithm<V,E>startVertex - source vertex of the calculated paths.endVertex - target vertex of the calculated paths.IllegalArgumentException - if the graph does not contain the startVertex or the
         endVertexIllegalArgumentException - if the startVertex and the endVertex are the same verticespublic List<GraphPath<V,E>> getPaths(V source, V sink, int k)
KShortestPathAlgorithmgetPaths in interface KShortestPathAlgorithm<V,E>source - the source vertexsink - the target vertexk - the number of shortest paths to returnCopyright © 2018. All rights reserved.