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 destination
    java.util.ArrayList<java.lang.Integer> getKShortestPaths​(int source, int destination, int k)
    Retrieves the K-Path of the K-Shortest Paths
    static KSPOffline getKSPOfflineObject​(WeightedGraph g, int k)
    Creates a new KSPOffline object, in case it does'n exist yet.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getKSPOfflineObject

      public static KSPOffline getKSPOfflineObject​(WeightedGraph g, int k)
      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.CloneNotSupportedException
      Throws an exception to stop a cloned MyStatistics object from being created.
      Overrides:
      clone in class java.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 node
      destination - 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 node
      destination - the destination node
      k - the k-path, starts from = 0
      Returns:
      the K-Path, starts from = 0