Package ons.util
Class KSPOffline
java.lang.Object
ons.util.KSPOffline
public class KSPOffline
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
Throws an exception to stop a cloned MyStatistics object from being created.java.util.ArrayList<java.lang.Integer>[]
getKShortestPaths(int source, int destination)
Retrieves the K-Shortest Paths from the source and destinationjava.util.ArrayList<java.lang.Integer>
getKShortestPaths(int source, int destination, int k)
Retrieves the K-Path of the K-Shortest Pathsstatic KSPOffline
getKSPOfflineObject(WeightedGraph g, int k)
Creates a new KSPOffline object, in case it does'n exist yet.
-
Method Details
-
getKSPOfflineObject
Creates a new KSPOffline object, in case it does'n exist yet.- Parameters:
g
- the weighted graph- Returns:
- the MyStatistics singletonObject
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionThrows an exception to stop a cloned MyStatistics object from being created.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
getKShortestPaths
public java.util.ArrayList<java.lang.Integer>[] getKShortestPaths(int source, int destination)Retrieves the K-Shortest Paths from the source and destination- Parameters:
source
- the source nodedestination
- the destination node- Returns:
- the K-Shortest Paths
-
getKShortestPaths
public java.util.ArrayList<java.lang.Integer> getKShortestPaths(int source, int destination, int k)Retrieves the K-Path of the K-Shortest Paths- Parameters:
source
- the source nodedestination
- the destination nodek
- the k-path, starts from = 0- Returns:
- the K-Path, starts from = 0
-