Package ons.util
Class YenKSP
java.lang.Object
ons.util.YenKSP
public class YenKSP
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description YenKSP()
-
Method Summary
Modifier and Type Method Description static java.util.ArrayList<java.lang.Integer>[]
kShortestPaths(WeightedGraph graph, int source, int destination, int K)
static java.util.ArrayList<java.lang.Integer>[]
kShortestPaths(WeightedMultiGraph graph, int source, int destination, int K)
static java.util.ArrayList<java.lang.Integer>[]
kShortestPathsByHops(WeightedGraph graph, int source, int destination, int K)
static java.util.ArrayList<java.lang.Integer>[]
kShortestPathsByHops(WeightedMultiGraph graph, int source, int destination, int K)
static int[]
kShortestPathsIndex(WeightedGraph graph, int source, int destination, int index)
Retrieves the specific k-shortest path from source and destination (in path nodes)static int[]
kShortestPathsIndex(WeightedMultiGraph graph, int source, int destination, int index)
Retrieves the specific k-shortest path from source and destination (in path nodes)static java.util.ArrayList<java.lang.Integer>
subList(java.util.ArrayList<java.lang.Integer> array, int fromIndex, int toIndex)
-
Constructor Details
-
YenKSP
public YenKSP()
-
-
Method Details
-
kShortestPathsIndex
public static int[] kShortestPathsIndex(WeightedGraph graph, int source, int destination, int index)Retrieves the specific k-shortest path from source and destination (in path nodes)- Parameters:
graph
- the WeightedGraph objectsource
- the source nodedestination
- the destination nodeindex
- the k index path- Returns:
- the path nodes of specific k-shortest path index
-
kShortestPathsByHops
public static java.util.ArrayList<java.lang.Integer>[] kShortestPathsByHops(WeightedGraph graph, int source, int destination, int K) -
kShortestPaths
public static java.util.ArrayList<java.lang.Integer>[] kShortestPaths(WeightedGraph graph, int source, int destination, int K) -
subList
public static java.util.ArrayList<java.lang.Integer> subList(java.util.ArrayList<java.lang.Integer> array, int fromIndex, int toIndex) -
kShortestPaths
public static java.util.ArrayList<java.lang.Integer>[] kShortestPaths(WeightedMultiGraph graph, int source, int destination, int K) -
kShortestPathsIndex
public static int[] kShortestPathsIndex(WeightedMultiGraph graph, int source, int destination, int index)Retrieves the specific k-shortest path from source and destination (in path nodes)- Parameters:
graph
- the WeightedGraph objectsource
- the source nodedestination
- the destination nodeindex
- the k index path- Returns:
- the path nodes of specific k-shortest path index
-
kShortestPathsByHops
public static java.util.ArrayList<java.lang.Integer>[] kShortestPathsByHops(WeightedMultiGraph graph, int source, int destination, int K)
-