|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph
choco.kernel.solver.constraints.global.matching.AbstractBipartiteFlow
public abstract class AbstractBipartiteFlow
A general assignment constraint with constraints on the flow bounds
Nested Class Summary |
---|
Nested classes/interfaces inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
AbstractBipartiteGraph.IntQueue |
Field Summary | |
---|---|
protected boolean |
compatibleFlow
|
protected IStateBool |
compatibleSupport
|
protected IStateIntVector |
flow
|
protected int[] |
maxFlow
|
protected int[] |
minFlow
|
Fields inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
component, componentOrder, currentComponent, currentNode, finishDate, left2rightArc, matchingSize, maxValue, minValue, nbLeftVertices, nbRightVertices, nbVertices, queue, refMatch, right2leftArc, seen, source, time |
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
cIndices, constraintType, extensions, vars |
Fields inherited from class choco.kernel.solver.propagation.Propagator |
---|
active, constAwakeEvent, priority, propagationEngine |
Fields inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
LOGGER |
Constructor Summary | |
---|---|
AbstractBipartiteFlow(IEnvironment environment,
IntDomainVar[] vars,
int nbLeft,
int nbRight)
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 |
protected int |
getMaxFlow(int j)
|
protected int |
getMinFlow(int j)
|
void |
increaseMatchingSize(int j)
updates the matching size when one more left vertex is matched with j |
protected void |
init()
|
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 |
protected void |
removeUselessEdges()
remove arcs connecting two different strongly connected components the event generated by the flow algorithm: discovering that an edge is no longer valid, and posting this event to the constraint strategy: since we are already achieving GAC consistency in one single loop, there is no need to post a constAwake |
void |
setMatch(int i,
int j)
match the ith variable to value j |
Methods inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
addComponentEdge, addComponentVertex, augmentFlow, deleteEdgeAndPublish, firstDFSearch, firstPassDFS, getNbComponents, initSCCGraph, match, mayDiminishFlowBetween, mayGrowFlowBetween, mayGrowFlowToSink, mayInverseMatch, mayMatch, prettyPrintForDebug, propagate, refreshSCC, secondDFSearch, secondPassDFS |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, getConstraintType, isConsistent, isSatisfied, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, pretty, setConstraintIndex, setExtension, setVar, toString |
Methods inherited from class choco.kernel.solver.propagation.Propagator |
---|
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int[] minFlow
protected int[] maxFlow
protected IStateIntVector flow
protected boolean compatibleFlow
protected IStateBool compatibleSupport
Constructor Detail |
---|
public AbstractBipartiteFlow(IEnvironment environment, IntDomainVar[] vars, int nbLeft, int nbRight)
environment
- vars
- nbLeft domain variablesnbLeft
- number of domain variables to assignnbRight
- number of values for assignmentMethod Detail |
---|
protected void init()
init
in class AbstractBipartiteGraph
protected int getMinFlow(int j)
protected int getMaxFlow(int j)
public void setMatch(int i, int j)
setMatch
in class AbstractBipartiteGraph
i
- the variable to matchj
- the value to assignpublic void deleteMatch(int i, int j)
deleteMatch
in class AbstractBipartiteGraph
i
- the variable to unmatchj
- the value to removepublic void putRefMatch(int i, int j)
putRefMatch
in class AbstractBipartiteGraph
i
- the variable to assignj
- the valuepublic boolean mayDiminishFlowFromSource(int j)
mayDiminishFlowFromSource
in class AbstractBipartiteGraph
j
- the jth value
public boolean mayGrowFlowFromSource(int j)
mayGrowFlowFromSource
in class AbstractBipartiteGraph
j
- the jth value
public boolean mustGrowFlowFromSource(int j)
mustGrowFlowFromSource
in class AbstractBipartiteGraph
j
- the jth value
public void increaseMatchingSize(int j)
increaseMatchingSize
in class AbstractBipartiteGraph
j
- indice of the assigned valuepublic void decreaseMatchingSize(int j)
decreaseMatchingSize
in class AbstractBipartiteGraph
j
- indice of the removed assignementpublic int findAlternatingPath()
findAlternatingPath
in class AbstractBipartiteGraph
public void augment(int x)
augment
in class AbstractBipartiteGraph
x
- left extremity of one of the matching arcprotected void removeUselessEdges() throws ContradictionException
AbstractBipartiteGraph
removeUselessEdges
in class AbstractBipartiteGraph
ContradictionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |