Class Tree
- java.lang.Object
-
- org.processmining.earthmoversstochasticconformancechecking.reallocationmatrix.epsa.Tree
-
public class Tree extends java.lang.ObjectTree representation of a basic solution according to M.S. Bazaraa, J.J. Jarvis, and H.D. Sherali. Linear Programming and Network Flows. Wiley, 2010, 482-488.- Author:
- brockhoff
-
-
Field Summary
Fields Modifier and Type Field Description booleanbranchOfLeavingEdgeTrue if source is cut off, false elseintcSrcCount sourcesintcTarCount targets;
-
Constructor Summary
Constructors Constructor Description Tree(InitTreeArrayStruct inst)Build a tree from the given instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)intgetCommonPredecessor(int left, int right)intgetcSrc()intgetcTar()doublegetCurDual()Current dual objective function valuedoublegetFlow(int node)TreeIteratorgetFreshTreeIterator()intgetLeavingChild()booleangetOrientation(int node)intgetParent(int node)doublegetPrimalObj()booleangetRootOrientation(int node)Returns the orientation of the root "over" the given nodedoublegetSurplusFlow()voididentifyCycleAndFlow(int left, int right)Identifies the cycle and the minimum flow around that cycle Edges of the cycle are stored.doubleredCost(int from, int to)Calculates reducing costsvoidresetMinFlow()Resets min FlowvoidsetCurBackward(int curBackward)voidsetCurDual(double curDual)voidsetCurForward(int curForward)voidsetDual(double[] dual)
-
-
-
Constructor Detail
-
Tree
public Tree(InitTreeArrayStruct inst)
Build a tree from the given instance- Parameters:
inst-
-
-
Method Detail
-
enterEdgeNUpdate
public 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).- Parameters:
entering- Entering edge (from, to)minRedC- Reducing costs of the edge- Returns:
- leaving edge (parent, child)
-
identifyCycleAndFlow
public void identifyCycleAndFlow(int left, int right)Identifies the cycle and the minimum flow around that cycle Edges of the cycle are stored.- Parameters:
left- left entering noderight- right entering node
-
redCost
public double redCost(int from, int to)Calculates reducing costs- Parameters:
from- edge fromto- edge to- Returns:
- Reducing costs of edge (from, to)
-
getFreshTreeIterator
public TreeIterator getFreshTreeIterator()
- Returns:
- A fresh tree iterator
-
getCurDual
public double getCurDual()
Current dual objective function value- Returns:
-
getSurplusFlow
public double getSurplusFlow()
- Returns:
- the surplusFlow
-
getPrimalObj
public double getPrimalObj()
-
getChildren
public int[] getChildren(int root)
-
getFlow
public double getFlow(int node)
-
getParent
public int getParent(int node)
-
getcSrc
public int getcSrc()
- Returns:
- the cSrc
-
getcTar
public int getcTar()
- Returns:
- the cTar
-
getCommonPredecessor
public int getCommonPredecessor(int left, int right)
-
getLeavingChild
public int getLeavingChild()
- Returns:
- the leavingChild
-
setCurForward
public void setCurForward(int curForward)
- Parameters:
curForward- the curForward to set
-
setCurBackward
public void setCurBackward(int curBackward)
- Parameters:
curBackward- the curBackward to set
-
resetMinFlow
public void resetMinFlow()
Resets min Flow
-
getOrientation
public boolean getOrientation(int node)
- Parameters:
node-- Returns:
- true if upwards, false if downwards
-
getRootOrientation
public boolean getRootOrientation(int node)
Returns the orientation of the root "over" the given node- Parameters:
node-- Returns:
- true if upwards, false if downwards
-
setDual
public void setDual(double[] dual)
- Parameters:
dual- the dual to set
-
setCurDual
public void setCurDual(double curDual)
- Parameters:
curDual- the curDual to set
-
-