Module org.jgrapht.core
Package org.jgrapht.alg.cycle
Class AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V>
- java.lang.Object
-
- org.jgrapht.alg.cycle.AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V>
-
- Type Parameters:
V- the vertex type
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- AhujaOrlinSharmaCyclicExchangeLocalAugmentation<V,E>
private class AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V> extends java.lang.Object implements java.lang.CloneableImplementation of a labeled path. It is used in AhujaOrlinSharmaCyclicExchangeLocalAugmentation to efficiently maintain the paths in the calculation.- Since:
- June 7, 2018
-
-
Constructor Summary
Constructors Constructor Description LabeledPath(java.util.ArrayList<V> vertices, double cost, java.util.HashSet<java.lang.Integer> labels)Constructs a LabeledPath with the given inputs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVertex(V v, double edgeCost, int label)Adds a vertex to the pathAhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V>clone()Returns a shallow copy of this labeled path instance.VgetHead()Returns the start vertex of the pathVgetTail()Returns the end vertex of the pathbooleanisEmpty()Returns whether the path is empty, i.e.
-
-
-
Field Detail
-
vertices
public java.util.ArrayList<V> vertices
the vertices in the path
-
labels
public java.util.HashSet<java.lang.Integer> labels
the labels the path contains
-
cost
public double cost
the cost of the path
-
-
Constructor Detail
-
LabeledPath
public LabeledPath(java.util.ArrayList<V> vertices, double cost, java.util.HashSet<java.lang.Integer> labels)
Constructs a LabeledPath with the given inputs- Parameters:
vertices- the vertices of the path in order of the pathcost- the cost of the edges connecting the verticeslabels- the mapping of the vertices to labels (subsets)
-
-
Method Detail
-
addVertex
public void addVertex(V v, double edgeCost, int label)
Adds a vertex to the path- Parameters:
v- the vertexedgeCost- the cost of the edge connecting the last vertex of the path and the new vertexlabel- 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
public AhujaOrlinSharmaCyclicExchangeLocalAugmentation.LabeledPath<V> clone()
Returns a shallow copy of this labeled path instance. Vertices are not cloned.- Overrides:
clonein classjava.lang.Object- Returns:
- a shallow copy of this path.
- Throws:
java.lang.RuntimeException- in case the clone is not supported- See Also:
Object.clone()
-
-