public class Tree
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
branchOfLeavingEdge
True if source is cut off, false else
|
int |
cSrc
Count sources
|
int |
cTar
Count targets;
|
Constructor and Description |
---|
Tree(InitTreeArrayStruct inst)
Build a tree from the given instance
|
Modifier and Type | Method and Description |
---|---|
int[] |
enterEdgeNUpdate(int[] entering,
double minRedC)
Add the given edge with the given reducing costs to the tree and restore
the the tree by choosing the appropriate edge (minimum flow in the
cycle).
|
int[] |
getChildren(int root) |
int |
getCommonPredecessor(int left,
int right) |
int |
getcSrc() |
int |
getcTar() |
double |
getCurDual()
Current dual objective function value
|
double |
getFlow(int node) |
TreeIterator |
getFreshTreeIterator() |
int |
getLeavingChild() |
boolean |
getOrientation(int node) |
int |
getParent(int node) |
double |
getPrimalObj() |
boolean |
getRootOrientation(int node)
Returns the orientation of the root "over" the given node
|
double |
getSurplusFlow() |
void |
identifyCycleAndFlow(int left,
int right)
Identifies the cycle and the minimum flow around that cycle Edges of the
cycle are stored.
|
double |
redCost(int from,
int to)
Calculates reducing costs
|
void |
resetMinFlow()
Resets min Flow
|
void |
setCurBackward(int curBackward) |
void |
setCurDual(double curDual) |
void |
setCurForward(int curForward) |
void |
setDual(double[] dual) |
public int cSrc
public int cTar
public boolean branchOfLeavingEdge
public Tree(InitTreeArrayStruct inst)
inst
- public int[] enterEdgeNUpdate(int[] entering, double minRedC)
entering
- Entering edge (from, to)minRedC
- Reducing costs of the edgepublic void identifyCycleAndFlow(int left, int right)
left
- left entering noderight
- right entering nodepublic double redCost(int from, int to)
from
- edge fromto
- edge topublic TreeIterator getFreshTreeIterator()
public double getCurDual()
public double getSurplusFlow()
public double getPrimalObj()
public int[] getChildren(int root)
public double getFlow(int node)
public int getParent(int node)
public int getcSrc()
public int getcTar()
public int getCommonPredecessor(int left, int right)
public int getLeavingChild()
public void setCurForward(int curForward)
curForward
- the curForward to setpublic void setCurBackward(int curBackward)
curBackward
- the curBackward to setpublic void resetMinFlow()
public boolean getOrientation(int node)
node
- public boolean getRootOrientation(int node)
node
- public void setDual(double[] dual)
dual
- the dual to setpublic void setCurDual(double curDual)
curDual
- the curDual to set