Class Arc
java.lang.Object
org.jacop.constraints.netflow.simplex.Arc
A directed, residual arc in the graph.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe unused (i.e.The arc companion for constraint API.intThe cost of the Arc costbooleanwhether this arc is a forward arc or a residual arcfinal NodeThe head of the arc (where the arc points to).intIndex in lower arcs arrayfinal ArcThe flow of an arc is the residual capacity of its sister arc. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFlow(int delta) voidclear()Clears an artificial arcbooleanbooleanisInCut(boolean forward) longlongCost()name()intComputes the cost of this arc considering node potentials.voidset(int newCost, int newCapacity) Initializes an artificial arctail()toFlow()toString()
-
Field Details
-
head
The head of the arc (where the arc points to). The head of an arc is the tail of its sister arc. -
cost
public int costThe cost of the Arc cost -
capacity
public int capacityThe unused (i.e. residual) capacity of the arc -
sister
The flow of an arc is the residual capacity of its sister arc. -
index
public int indexIndex in lower arcs array -
companion
The arc companion for constraint API. Only forward arcs have a companion, residual arcs do not. -
forward
public boolean forwardwhether this arc is a forward arc or a residual arc
-
-
Constructor Details
-
Arc
Special constructor to create artificial arcs. Should NOT be used in a model. Models should use (or subclass) a NetworkBuilder instead. A NetworkBuilder provides various addArc methods to create arcs more conveniently.- Parameters:
tail- tail of the archead- head of the arc
-
Arc
General constructor to create arcs. Models should consider to use (or subclass) a NetworkBuilder instead. A NetworkBuilder provides various addArc methods to create arcs more conveniently.- Parameters:
tail- tail of the archead- head of the arccost- cost-per-unit of the arclowerCapacity- lower capacity of the arcupperCapacity- upper capacity of the arc
-
Arc
-
-
Method Details
-
reducedCost
public int reducedCost()Computes the cost of this arc considering node potentials.- Returns:
- the reduced cost
-
addFlow
public void addFlow(int delta) -
tail
-
isInCut
public boolean isInCut(boolean forward) -
set
public void set(int newCost, int newCapacity) Initializes an artificial arc- Parameters:
newCost- new cost for the arcnewCapacity- new capacity for the arc
-
clear
public void clear()Clears an artificial arc -
longCost
public long longCost()- Returns:
- cost associated with an arc.
-
toString
-
toFlow
-
hasCompanion
public boolean hasCompanion() -
getCompanion
-
name
-