Class Node
java.lang.Object
org.jacop.constraints.netflow.simplex.Node
A node (vertex) in the network.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionArc[]
adjacency list (recorded when degree reaches 2)connects this node to the rootint
balance of the last feasible flowint
number of connected arcsint
change in balance for the next flow computationint
final int
for debug only(package private) boolean
marks the cut (S,T) for dual pivotfinal String
a label, great for debuggingint
the potential (or dual variable) of the network simplex -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Recomputes the potential & depth values in the subtree rooted at this node.Finds the root of the smallest subtree that contains both this node and that node.void
markTree
(boolean setMark) Sets or clears a mark on a subtree rooted at this nodeFinds the predecessor of this node on the thread.Finds the last node on the thread that has a larger depth than this node.toString()
-
Field Details
-
initialBalance
public final int initialBalancefor debug only -
name
a label, great for debugging -
potential
public int potentialthe potential (or dual variable) of the network simplex -
balance
public int balancebalance of the last feasible flow -
deltaBalance
public int deltaBalancechange in balance for the next flow computation -
artificial
connects this node to the root -
toParent
-
parent
-
thread
-
depth
public int depth -
marked
boolean markedmarks the cut (S,T) for dual pivot -
degree
public int degreenumber of connected arcs -
adjacencyList
adjacency list (recorded when degree reaches 2)
-
-
Constructor Details
-
Node
-
-
Method Details
-
lca
Finds the root of the smallest subtree that contains both this node and that node.- Parameters:
that
- another node- Returns:
- the least common ancestor of this & that
-
rightMostLeaf
Finds the last node on the thread that has a larger depth than this node. Note that if this node is a leaf node then 'this' is returned.- Returns:
- the last node on the thread that is in the subtree of this node
-
predecessorOnThread
Finds the predecessor of this node on the thread. It uses the parent node as starting point of the search. (Hence, this method cannot be invoked on the root)- Returns:
- the node i with i.thread == this
-
markTree
public void markTree(boolean setMark) Sets or clears a mark on a subtree rooted at this node- Parameters:
setMark
- whether to set or clear the mark
-
computePotentials
void computePotentials()Recomputes the potential & depth values in the subtree rooted at this node. -
toString
-