All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
How to use conflict analysis Conflict analysis is a way to automatically use the information obtained from infeasible nodes in the branch-and-bound tree. Once a node is declared infeasible, SCIP automatically tries to infer a constraint that explains the reason for the infeasibility, in order to avoid similar situations later in the search. This explanation essentially consists of a constraint stating that at least one of its variables should have a bound different from the current infeasible node, because the current setting led to infeasibility. Clearly, all variables that are fixed in the current infeasible node would yield such a constraint (since this leads to infeasibility). The key point rather is to infer a "small" constraint that does the same job. SCIP handles this by several heuristics. For this, SCIP sets up a so-called (directed) conflict graph. The nodes in this graph correspond to bound changes of variables and an arc (u, v) means that the bound change corresponding to v is based on the bound change of u. In general, a node will have several ingoing arcs which represent all bound changes that have been used to infer (propagate) the bound change in question. The graph also contains source nodes for each bound that has been changed during branching and an artificial target node representing the conflict, i.e., the infeasibility. Essentially, SCIP heuristically constructs a cut in this graph that involves few "branching nodes". For details on the techniques that SCIP uses, we refer to the paper
For conflict analysis to work well, the author of a Constraint Handler or a Propagator has to implement three kinds of functionality:
If this functionality is not implemented, SCIP will still work correctly, but cannot use the information of the constraint handler or the propagator for conflict analysis. In this case, each bound reduction performed by the constraint handler/propagator will be treated as if it had been a branching decision. Initiating Conflict AnalysisIf one detects infeasibility within propagation, one should do the following:
This functionality allows SCIP to set up the conflict graph and perform a conflict analysis. PropagationWhen propagating variable domains, SCIP needs to be informed that the deduced variable bounds should be used in conflict analysis. This can be done by the functions SCIPinferVarLbCons(), SCIPinferVarUbCons(), and SCIPinferBinvarCons() for constraint handlers and SCIPinferVarLbProp(), SCIPinferVarUbProp(), and SCIPinferBinvarProp() for propagators. You can pass one integer of information that should indicate the reason of the propagation and can be used in reverse propagation, see the next section. Reverse PropagationReverse Propagation is used to build up the conflict graph. Essentially, it provides an algorithm to detect the arcs leading to a node in the conflict graph, i.e., the bound changes responsible for the new bound change deduced during propagation. Reverse Propagation needs to be implemented in the RESPROP callback functions of constraint handlers or propagators. These callbacks receive the following information: the variable which is under investigation ( One can use SCIPvarGetUbAtIndex() or SCIPvarGetLbAtIndex() to detect the bounds before or after the propagation that should be investigated. Then the bounds that were involved should be passed to SCIP via SCIPaddConflictLb() and SCIPaddConflictUb(). If there is more than one valid explanation of infeasibility, either one can be used. Typically, smaller explanations tend to be better. Details and (more) examples are given in Sections CONSRESPROP and PROPRESPROP. ExampleConsider the constraint handler When propagating the equation and Thus, variable When it propagates the triangle inequality and both SCIP_CALL( SCIPinferBinvarCons(scip, vars[k][i], FALSE, cons, n*n + i*n*n + j*n + k, &infeasible, &tightened) );
Thus, in this case, variable In reverse propagation, the two cases can be distinguished by In the first case, it has to distinguish whether |