|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.solver.constraints.global.tree.filtering.structuralFiltering.globalCardConstraint.AbstractBipartGraph
public abstract class AbstractBipartGraph
Nested Class Summary | |
---|---|
protected static class |
AbstractBipartGraph.IntQueue
|
Field Summary | |
---|---|
protected int[] |
component
|
protected boolean[][] |
componentOrder
|
protected int |
currentComponent
|
protected int |
currentNode
|
protected int[] |
finishDate
|
protected BitSet[] |
graph
|
protected int[] |
index
|
protected boolean |
isFeasible
|
protected int[] |
left2rightArc
|
protected static Logger |
LOGGER
|
protected int |
matchingSize
|
protected int |
maxValue
|
protected int |
minValue
|
protected int |
nbLeftVertices
|
protected int |
nbRightVertices
|
protected int |
nbVertices
|
protected IntDomainVar |
nTree
|
protected AbstractBipartGraph.IntQueue |
queue
|
protected int[] |
refMatch
|
protected int[] |
right2leftArc
|
protected boolean[] |
seen
|
protected Solver |
solver
|
protected int |
source
|
protected StructuresAdvisor |
struct
|
protected int |
time
|
protected TreeParameters |
tree
|
Constructor Summary | |
---|---|
protected |
AbstractBipartGraph(Solver solver,
Object[] pack)
Constructor |
Method Summary | |
---|---|
void |
addComponentEdge(int compi,
int compj)
add an edge in the component graph between compi and compj: componentOrder stores the transitive closure of that graph |
void |
addComponentVertex()
adds a new vertex to the component graph (= a component = a set of s. connected vertices in the original graph) |
void |
augment(int x)
augment the matching along one alternating path note: throughout the following code, we assume (1 <= x <= c.nbLeftVertices), (1 <= y <= c.nbRightVertices) |
void |
augmentFlow()
keeps augmenting the flow until a maximal flow is reached |
abstract void |
decreaseMatchingSize(int j)
updates the matching size when one more left vertex is de-matched with j |
abstract void |
deleteEdgeAndPublish(int i,
int j,
RemovalsAdvisor rem)
implement one of the two main events: when an edge is definitely removed from the bipartite assignment graph |
abstract void |
deleteMatch(int i,
int j)
removing the arc i-j from the reference matching & update matchingSize |
int |
findAlternatingPath()
First pass: use Ford & Fulkerson algorithm to compute a reference flow (assignment) finds an augmenting path using a fifo queue |
void |
firstDFSearch(int i)
the first search explores (DFS) the reduced graph |
void |
firstPassDFS()
|
int |
getPriority()
|
abstract void |
increaseMatchingSize(int j)
updates the matching size when one more left vertex is matched with j |
protected void |
init(Object[] pack)
|
void |
initSCCGraph()
initialize the graph data structure storing the SCC decomposition |
int |
match(int i)
|
boolean |
mayDiminishFlowBetween(int j,
int i)
whether the flow from j (a right vertex) to i (a left vertex) may be increased |
abstract boolean |
mayDiminishFlowFromSource(int j)
whether the flow from the source to j (a right vertex) may be decreased |
boolean |
mayGrowFlowBetween(int j,
int i)
whether the flow from j (a right vertex) to i (a left vertex) may be increased (the additional flow is able to arrive to j, we don't care yet whether it will be able to leave i) |
abstract boolean |
mayGrowFlowFromSource(int j)
whether the flow from the source to j (a right vertex) may be increased |
boolean |
mayGrowFlowToSink(int i)
whether the flow from i (a left vertex) to the sink may be increased |
int[] |
mayInverseMatch(int j)
reverse, access from the right vertex set: iterating over the variables (left vertex set) and reading their domains |
int[] |
mayMatch(int i)
Accessing the edges of the bipartite graph access from the left vertex set |
abstract boolean |
mustGrowFlowFromSource(int j)
whether the flow from the source to j (a right vertex) must be increased in order to get a maximal (sink/left vertex set saturating) flow |
void |
propagate(RemovalsAdvisor rem)
|
abstract void |
putRefMatch(int i,
int j)
adding the arc i-j in the reference matching without any updates |
void |
removeUselessEdges(RemovalsAdvisor rem)
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 solver: since we are already achieving GAC consistency in one single loop, there is no need to post a constAwake |
void |
secondDFSearch(int i)
the second search explores (DFS) the inverse of the reduced graph |
void |
secondPassDFS()
|
abstract void |
setMatch(int i,
int j)
adding the arc i-j in the reference matching & update matchingSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
protected int nbLeftVertices
protected int nbRightVertices
protected int nbVertices
protected int minValue
protected int maxValue
protected int source
protected int[] refMatch
protected int matchingSize
protected int[] left2rightArc
protected int[] right2leftArc
protected AbstractBipartGraph.IntQueue queue
protected Solver solver
protected IntDomainVar nTree
protected BitSet[] graph
protected boolean isFeasible
protected TreeParameters tree
protected int[] index
protected StructuresAdvisor struct
protected int time
protected int[] finishDate
protected boolean[] seen
protected int currentNode
protected int currentComponent
protected int[] component
protected boolean[][] componentOrder
Constructor Detail |
---|
protected AbstractBipartGraph(Solver solver, Object[] pack)
solver
- the choco solver involving the constraintpack
- a set of parameters such as the original set of variables fvars, the contracted graph
structure associated and the table of indicesMethod Detail |
---|
protected void init(Object[] pack)
public int[] mayMatch(int i)
i
-
public int[] mayInverseMatch(int j)
j
-
public int match(int i)
i
- left vextex index
public boolean mayGrowFlowToSink(int i)
i
-
public boolean mayGrowFlowBetween(int j, int i)
j
- i
-
public boolean mayDiminishFlowBetween(int j, int i)
j
- i
-
public abstract void increaseMatchingSize(int j)
j
- public abstract void decreaseMatchingSize(int j)
j
- public abstract void deleteMatch(int i, int j)
i
- j
- public abstract void putRefMatch(int i, int j)
i
- left node indexj
- right node indexpublic abstract void setMatch(int i, int j)
i
- j
- public abstract boolean mayDiminishFlowFromSource(int j)
j
-
public abstract boolean mayGrowFlowFromSource(int j)
j
-
public abstract boolean mustGrowFlowFromSource(int j)
j
-
public int findAlternatingPath()
public void augment(int x)
x
- public void augmentFlow()
public void initSCCGraph()
public void addComponentVertex()
public void addComponentEdge(int compi, int compj)
compi
- compj
- public void firstPassDFS()
public void firstDFSearch(int i)
i
- public void secondPassDFS()
public void secondDFSearch(int i)
i
- public abstract void deleteEdgeAndPublish(int i, int j, RemovalsAdvisor rem)
i
- the variable to unmatchj
- the value to removepublic void removeUselessEdges(RemovalsAdvisor rem) throws ContradictionException
ContradictionException
public void propagate(RemovalsAdvisor rem) throws ContradictionException
ContradictionException
public int getPriority()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |