public final class Arc extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
capacity
The unused (i.e.
|
ArcCompanion |
companion
The arc companion for constraint API.
|
int |
cost
The cost of the Arc cost
|
boolean |
forward
whether this arc is a forward arc or a residual arc
|
Node |
head
The head of the arc (where the arc points to).
|
int |
index
Index in lower arcs array
|
Arc |
sister
The flow of an arc is the residual capacity of its sister arc.
|
| Constructor and Description |
|---|
Arc(Node tail,
Node head)
Special constructor to create artificial arcs.
|
Arc(Node tail,
Node head,
int cost,
int lowerCapacity,
int upperCapacity)
General constructor to create arcs.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFlow(int delta) |
void |
clear()
Clears an artificial arc
|
ArcCompanion |
getCompanion() |
boolean |
hasCompanion() |
boolean |
isInCut(boolean forward) |
long |
longCost() |
String |
name() |
int |
reducedCost()
Computes the cost of this arc considering node potentials.
|
void |
set(int newCost,
int newCapacity)
Initializes an artificial arc
|
Node |
tail() |
String |
toFlow() |
String |
toString() |
public final Node head
public int cost
public int capacity
public final Arc sister
public int index
public ArcCompanion companion
public boolean forward
public Arc(Node tail, Node head)
tail - tail of the archead - head of the arcpublic Arc(Node tail, Node head, int cost, int lowerCapacity, int upperCapacity)
tail - tail of the archead - head of the arccost - cost-per-unit of the arclowerCapacity - lower capacity of the arcupperCapacity - upper capacity of the arcpublic int reducedCost()
public void addFlow(int delta)
public Node tail()
public boolean isInCut(boolean forward)
public void set(int newCost,
int newCapacity)
newCost - newCapacity - public void clear()
public long longCost()
public String toFlow()
public boolean hasCompanion()
public ArcCompanion getCompanion()
public String name()
Copyright © 2016. All rights reserved.