Commit 655f625e authored by Simon de Givry's avatar Simon de Givry Committed by Thomas Schiex
Browse files

[code] diseable clique cut propagation with binaries

parent db778361
......@@ -532,6 +532,10 @@ AllDifferentDecomposedIntoBinaryConstraints 4 4 6 1
\item = {\itshape cst} {\itshape delta} to express soft binary constraint $x = y + cst$ with associated cost function $(|y + cst - x| \leq delta)?|y + cst - x|:UB$
\item disj {\itshape cstx} {\itshape csty} {\itshape penalty} to express soft binary disjunctive constraint $x \geq y + csty \vee y \geq x + cstx$ with associated cost function $(x \geq y + csty \vee y \geq x + cstx)?0:penalty$
\item sdisj {\itshape cstx} {\itshape csty} {\itshape xinfty} {\itshape yinfty} {\itshape costx} {\itshape costy} to express a special disjunctive constraint with three implicit hard constraints $x \leq xinfty$ and $y \leq yinfty$ and $x < xinfty \wedge y < yinfty \Rightarrow (x \geq y + csty \vee y \geq x + cstx)$ and an additional cost function $((x = xinfty)?costx:0) + ((y= yinfty)?costy:0)$
\item Global cost functions using a dedicated propagator\-:
\begin{DoxyItemize}
\item clique {\itshape 1} ({\itshape nb\-\_\-values} ({\itshape value})$\ast$)$\ast$ to express a hard clique cut to restrict the number of variables taking their value into a given set of values (per variable) to at most {\itshape 1} occurrence for all the variables (warning! it assumes also a clique of binary constraints already exists to forbid any two variables using both the restricted values)
\end{DoxyItemize}
\item Global cost functions using a flow-\/based propagator\-:
\begin{DoxyItemize}
\item salldiff var$\vert$dec$\vert$decbi {\itshape cost} to express a soft alldifferent constraint with either variable-\/based ({\itshape var} keyword) or decomposition-\/based ({\itshape dec} and {\itshape decbi} keywords) cost semantic with a given {\itshape cost} per violation ({\itshape decbi} decomposes into a binary cost function complete network)
......@@ -599,6 +603,11 @@ Examples\-:
2 1 2 -1 disj 1 2 UB
\end{DoxyCode}
\item clique cut (\{x0,x1,x2,x3\}) on Boolean variables such that value 1 is used at most once\-:
\begin{DoxyCode}
4 0 1 2 3 -1 clique 1 1 1 1 1 1 1 1 1
\end{DoxyCode}
\item soft\-\_\-alldifferent(\{x0,x1,x2,x3\})\-:
\begin{DoxyCode}
4 0 1 2 3 -1 salldiff var 1
......
No preview for this file type
// Cmake generated version
#define Toulbar_VERSION "1.0.1-master-tainted (1544738028)"
#define Toulbar_VERSION "1.0.1-master-tainted (1544823438)"
......@@ -10,6 +10,8 @@
#include "tb2clqcover.hpp"
#include "search/tb2clusters.hpp"
//#define PROPAGATE_CLIQUE_WITH_BINARIES
int CliqueConstraint::nextid{ 0 };
CliqueConstraint::CliqueConstraint(WCSP* wcsp, EnumeratedVariable** scope_in,
......@@ -125,9 +127,11 @@ void CliqueConstraint::propagate_incremental()
wcsp->revise(this);
gather_unary_0s();
#ifdef PROPAGATE_CLIQUE_WITH_BINARIES
TreeDecomposition* td = wcsp->getTreeDec();
if (!td)
gather_binary(); // Warning! does not work with tree decomposition-based methods
#endif
gather_unary_1s();
if (debug) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment