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:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLabeledPath
(ArrayList<V> vertices, double cost, HashSet<Integer> labels) Constructs a LabeledPath with the given inputs -
Method Summary
-
Field Details
-
vertices
the vertices in the path -
labels
the labels the path contains -
cost
public double costthe cost of the path
-
-
Constructor Details
-
LabeledPath
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 Details
-
addVertex
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
Returns the start vertex of the path- Returns:
- the start vertex of the path
-
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 classObject
- Returns:
- a shallow copy of this path.
- Throws:
RuntimeException
- in case the clone is not supported- See Also:
-