choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint
Class AbstractBipartFlow

java.lang.Object
  extended by choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartGraph
      extended by choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartFlow
Direct Known Subclasses:
GlobalCardinalityNoLoop

public abstract class AbstractBipartFlow
extends AbstractBipartGraph

A general assignment constraint with constraints on the flow bounds


Nested Class Summary
 
Nested classes/interfaces inherited from class choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartGraph
AbstractBipartGraph.IntQueue
 
Field Summary
protected  boolean compatibleFlow
           
protected  int[] flow
           
protected  int[] maxFlow
           
protected  int[] minFlow
           
 
Fields inherited from class choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartGraph
component, componentOrder, currentComponent, currentNode, finishDate, graph, index, isFeasible, left2rightArc, LOGGER, matchingSize, maxValue, minValue, nbLeftVertices, nbRightVertices, nbVertices, nTree, queue, refMatch, right2leftArc, seen, solver, source, struct, time, tree
 
Constructor Summary
protected AbstractBipartFlow(Solver solver, Object[] pack)
          Constructor for AbstractBipartiteFlow
 
Method Summary
 void augment(int x)
          Augment flow on the current matching
 void decreaseMatchingSize(int j)
          updates the matching size when the matching is rebuilt
 void deleteMatch(int i, int j)
          remove the assignment of j to the ith variable
 int findAlternatingPath()
          Search for an augmenting path
 void increaseMatchingSize(int j)
          updates the matching size when one more left vertex is matched with j
protected  void initAbstractBipartFlow()
           
 boolean mayDiminishFlowFromSource(int j)
          check unassignement
 boolean mayGrowFlowFromSource(int j)
          check assignement
 boolean mustGrowFlowFromSource(int j)
          check if j should be assigned to other variables
 void putRefMatch(int i, int j)
          Assignment of j to the ith variable
 void setMatch(int i, int j)
          match the ith variable to value j
 
Methods inherited from class choco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartGraph
addComponentEdge, addComponentVertex, augmentFlow, deleteEdgeAndPublish, firstDFSearch, firstPassDFS, getPriority, init, initSCCGraph, match, mayDiminishFlowBetween, mayGrowFlowBetween, mayGrowFlowToSink, mayInverseMatch, mayMatch, propagate, removeUselessEdges, secondDFSearch, secondPassDFS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minFlow

protected int[] minFlow

maxFlow

protected int[] maxFlow

flow

protected int[] flow

compatibleFlow

protected boolean compatibleFlow
Constructor Detail

AbstractBipartFlow

protected AbstractBipartFlow(Solver solver,
                             Object[] pack)
Constructor for AbstractBipartiteFlow

Parameters:
solver - the solver
pack - a set of parameters such as the original set of variables fvars, the contracted graph structure associated and the table of indices
Method Detail

initAbstractBipartFlow

protected void initAbstractBipartFlow()

setMatch

public void setMatch(int i,
                     int j)
match the ith variable to value j

Specified by:
setMatch in class AbstractBipartGraph
Parameters:
i - the variable to match
j - the value to assign

deleteMatch

public void deleteMatch(int i,
                        int j)
remove the assignment of j to the ith variable

Specified by:
deleteMatch in class AbstractBipartGraph
Parameters:
i - the variable to unmatch
j - the value to remove

putRefMatch

public void putRefMatch(int i,
                        int j)
Assignment of j to the ith variable

Specified by:
putRefMatch in class AbstractBipartGraph
Parameters:
i - the variable to assign
j - the value

mayDiminishFlowFromSource

public boolean mayDiminishFlowFromSource(int j)
check unassignement

Specified by:
mayDiminishFlowFromSource in class AbstractBipartGraph
Parameters:
j - the jth value
Returns:
true if a variable assigned to j could be unassigned

mayGrowFlowFromSource

public boolean mayGrowFlowFromSource(int j)
check assignement

Specified by:
mayGrowFlowFromSource in class AbstractBipartGraph
Parameters:
j - the jth value
Returns:
true if a variable could be assigned to j

mustGrowFlowFromSource

public boolean mustGrowFlowFromSource(int j)
check if j should be assigned to other variables

Specified by:
mustGrowFlowFromSource in class AbstractBipartGraph
Parameters:
j - the jth value
Returns:
true if j has not been assigned to enough variables

increaseMatchingSize

public void increaseMatchingSize(int j)
updates the matching size when one more left vertex is matched with j

Specified by:
increaseMatchingSize in class AbstractBipartGraph
Parameters:
j - indice of the assigned value

decreaseMatchingSize

public void decreaseMatchingSize(int j)
updates the matching size when the matching is rebuilt

Specified by:
decreaseMatchingSize in class AbstractBipartGraph
Parameters:
j - indice of the removed assignement

findAlternatingPath

public int findAlternatingPath()
Search for an augmenting path

Overrides:
findAlternatingPath in class AbstractBipartGraph
Returns:
eopath

augment

public void augment(int x)
Augment flow on the current matching

Overrides:
augment in class AbstractBipartGraph
Parameters:
x - left extremity of one of the matching arc


Copyright © 2012. All Rights Reserved.