Class AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V>

java.lang.Object
org.jgrapht.alg.cycle.AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V>
Type Parameters:
V - the vertex type
All Implemented Interfaces:
Cloneable
Enclosing class:
AhujaOrlinSharmaCyclicExchangeLocalAugmentation<V,E>

private class AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V> extends Object implements Cloneable
Implementation of a labeled path. It is used in AhujaOrlinSharmaCyclicExchangeLocalAugmentation to efficiently maintain the paths in the calculation.
Since:
June 7, 2018
  • Field Details

    • vertices

      public ArrayList<V> vertices
      the vertices in the path
    • labels

      public HashSet<Integer> labels
      the labels the path contains
    • cost

      public double cost
      the cost of the path
  • Constructor Details

    • LabeledPath

      public LabeledPath(ArrayList<V> vertices, double cost, HashSet<Integer> labels)
      Constructs a LabeledPath with the given inputs
      Parameters:
      vertices - the vertices of the path in order of the path
      cost - the cost of the edges connecting the vertices
      labels - the mapping of the vertices to labels (subsets)
  • Method Details

    • addVertex

      public void addVertex(V v, double edgeCost, int label)
      Adds a vertex to the path
      Parameters:
      v - the vertex
      edgeCost - the cost of the edge connecting the last vertex of the path and the new vertex
      label - the label of the new vertex
    • getHead

      public V getHead()
      Returns the start vertex of the path
      Returns:
      the start vertex of the path
    • getTail

      public V getTail()
      Returns the end vertex of the path
      Returns:
      the end vertex of the path
    • isEmpty

      public boolean isEmpty()
      Returns whether the path is empty, i.e. has no vertices
      Returns:
      whether the path is empty
    • clone

      Returns a shallow copy of this labeled path instance. Vertices are not cloned.
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of this path.
      Throws:
      RuntimeException - in case the clone is not supported
      See Also: