- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

- 08:49Travis chocoteam/choco-solver (master) passed (1738)
- 08:39Travis chocoteam/choco-solver (master) passed (1737)
- 08:29
cprudhom on master

Update docker-image.yml: there … (compare)

- 08:17
cprudhom on mzn2020.0

- 08:16
cprudhom on mzn2020.0

- 08:15
cprudhom on master

Update docker-image.yml to only… (compare)

- Jul 09 17:23Travis chocoteam/choco-solver (master) fixed (1736)
- Jul 09 17:01
cprudhom on master

I give up on .travis.yml (compare)

- Jul 09 17:00
cprudhom on master

Last try on .travis.yml (compare)

- Jul 09 16:57
cprudhom on master

Rollback .travis.yml (compare)

- Jul 09 16:54
cprudhom on master

Update .travis.yml (compare)

- Jul 09 09:07
cprudhom on master

Update .travis.yml to only rele… (compare)

- Jul 09 08:23Travis chocoteam/choco-solver (master) broken (1735)
- Jul 09 08:19
cprudhom on mzn2020.0

- Jul 09 08:13Travis chocoteam/choco-solver (master) passed (1734)
- Jul 09 08:02
cprudhom on master

Update docker-image.yml (compare)

- Jul 09 07:49
cprudhom on master

Remove tokens files (compare)

- Jul 09 07:46
cprudhom on mzn2020.0

- Jul 09 07:37
cprudhom on mzn2020.0

- Jul 08 21:07Travis chocoteam/choco-solver (master) passed (1733)

A geometrical cutoff strategy. It is based on two parameters: g for geometricalFactor and s for scaleFactor. At step n, the next cutoff is computed with the following function : s*g^n Example with s=1 and g=1.3: 1, 2, 2, 3, 3, 4, 5, 7, 9, 11, 14, 18, 24, 31, 40, ...

Hello. I have been using CHOCO for task planning and scheduling and constructed a scenario with inconsistent constrains between time points. It operates in Integer intervals for variables with very large domains.

The following code sample reproduces the problem (MAX_INT is (int) Integer.MAX_VALUE / 2).

Is there a better way to post such constraints to propagate them in aggregate rather than incrementally. For example, in other solvers I have used simple temporal networks which would efficiently detect such a problem.

@Ignore("Does not converge in reasonable time") public void testCycle(){

Model model = new Model("Cycle");

```
IntVar a = model.intVar("a", 0, EngineUtil.MAX_INT);
IntVar b = model.intVar("b", 0, EngineUtil.MAX_INT);
IntVar c = model.intVar("c", 0, EngineUtil.MAX_INT);
// This is inconsistent but incremental propagation is very bad at converging quickly on a fixed point.
b.gt(a).post();
b.eq(c).post();
a.eq(c).post();
try {
model.getSolver().propagate();
}
catch(ContradictionException e){
e.printStackTrace();
}
```

}

@mcgannc Hi, I’m afraid there is no automatic way to tackle this problem. Indeed, your example is stressing the propagation engine: it will need to empty a domain to detect failure. This is achieved at root node (ie, no decision needed) but requires (at least) MAX_INT*3 events. There is no detection of such cases, here you would except choco-solver to induce a = b which is not consistent with b>a (and even if you posted a = b, the failure detection will be very long too). I have no turnkey solution.

@cprudhom I figured. A solution would be to use a Simple Temporal Network. For example: https://github.com/nasa/europa/tree/master/src/PLASMA/TemporalNetwork/base.

Hi, I am considering choco-solver to optimize a resource optimization problem. In my current implementation, I limit the search space by enforcing the zero-sum game in my "decisions". This means my solver must considers several variables at once and update their values such as their sum remain constant.

I know I can enforce the zero-sum game with a constraint, but I found this search method to be most efficient. How would I implement this in choco-solver ?

In the javadoc, AbstractStrategy seems to consider decisions based on single variables. What am I missing ?

I know I can enforce the zero-sum game with a constraint, but I found this search method to be most efficient. How would I implement this in choco-solver ?

In the javadoc, AbstractStrategy seems to consider decisions based on single variables. What am I missing ?

@rohel01 that will not be easy to achieve this based on a search strategy. Indeed, a search strategy provides a decision (ie, one variable, one operator and one value) on a call to getDecision. This method is called once at a time. In other words, you cannot restrict more than one variable at a time with a search strategy. On the other hand a constraint would be able to filter impossible values.

What's the difference between https://github.com/chocoteam/choco-parsers and https://github.com/chocoteam/choco-solver/tree/master/parsers?

Hi. I'm new to choco solver. I have a model with the following statistics:

```
Choco 4.10.2 (2019-10) : Constraint Programming Solver, Copyright (c) 2010-2019
- Model[Model-0] features:
Variables : 87275
Constraints : 19585
Building time : 9.097s
User-defined search strategy : yes
Complementary search strategy : no
```

I'd like to know if the number of Variables and Constraints is problematic. I use

```
while(solver.solve()){
solver.showShortStatistics();
chocoCallback.OnChocoCallback(....); // print stuff here
}
```

to print out the results of the solution in my custom callback handler.

Addition 1: Also, I have a minimize objective in my code. I consolidate a large number of variables into a single cost variable and try to minimize. I feel like this is the problem, as without it I get solutions in a reasonable amount of time (Start coming in after a few minutes).

you can post temporary a constraint based on a monitor

so the constraint will be removed on backtrack

Do you think that using a propagator to do so is more hacky ? Using the propagator, I am notified only when the variables I am interested in are instantiated. Then I can post/unpost accordingly ?

or using a Variable monitor

a propogator is a good trade-off

Except if you declare a kind of implication propagator, that sets a boolean variables to True when all are instantiated ?

or a counter variable?

In fact, I will generate the constraints

In practice, once a placement decided, some extra scheduling constraint (precedences or cumulatove) to post depending on the resulting placement

so unused but not GCeable ?

the root node may be very big

but since no new modifi ation occurs, it's only at root node

Hello, I've a question related to tuple constraints:

The following source code:

```
Model model = new Model();
IntVar x = model.intVar(new int[]{1, 2, 3, 4});
IntVar y = model.intVar(new int[]{1, 2, 3, 4});
Tuples tuples = new Tuples();
tuples.add(1, 1);
tuples.add(1, 2);
tuples.add(1, 3);
tuples.add(1, 4);
model.table(x, y, tuples).reify().eq(0).post();
model.getSolver().propagate();
System.out.println(x);
System.out.println(y);
```

It shouldn't remove the value 1 from X domain due to the reification to false?

No, it can’t. By default a reification constraint only check for a constraint to be satisfied or not, calling the

`isEntailed`

of each of its propagators. In some specific cases, we were able to provide the opposite of a constraint. That is not the case of Table constraint. But, since you are using extension constraints, you can programmatically reified them by declaring a new dimension to the tuple, and a new variable as scope like:```
Model model = new Model();
IntVar x = model.intVar(new int[]{1, 2, 3, 4});
IntVar y = model.intVar(new int[]{1, 2, 3, 4});
BoolVar b = model.boolVar();
int STAR = 99;
Tuples tuples = new Tuples();
tuples.setUniversalValue(STAR);
tuples.add(1, 1, 1);
tuples.add(1, 2, 1);
tuples.add(1, 3, 1);
tuples.add(1, 4, 1);
tuples.add(2, STAR, 0);
tuples.add(3, STAR, 0);
tuples.add(4, STAR, 0);
model.table(new IntVar[]{x, y, b}, tuples).post();
b.eq(0).post();
model.getSolver().propagate();
System.out.println(x);
System.out.println(y);
```

I was confusing about it because of this paper "Efficient Reification of Table Constraints" (10.1109/ICTAI.2017.00029), where the authors present a reification algorithm for table constraints (Algorithm 1). In that algorithm, given `c`

as a table constraint and `b`

as a reification variable of `c`

, they mention the enforcement of GAC on contraint `c`

if `b = 1`

or `not (c)`

if `b = 0`

.

I'm researching about it because I'm considering integrate the choco-solver with SQL (RDMS) to maintain positive table contraints, the reference is this paper "CSP Techniques for Solving Combinatorial Queries within Relational Databases" (https://doi.org/10.1007/978-3-642-04170-9_6 ), and I was struggling with the implementation of reification.

Based on my research and in choco source code, because my `SqlTablePropagator`

will work the same way as`Tuples`

, I decided to implement the same `isEntailed`

logic of `Tuples.java`

. However, instead of checking the tuples in memory for validation, I query the database to get this information.

```
@Override
public ESat isEntailed() {
ESat entailed;
if (nbTuples == 0) {
entailed = ESat.FALSE;
} else if (!areAllVariablesInstantiated()) {
entailed = ESat.UNDEFINED;
} else if (getNumberValidTuples() == 1) {
entailed = ESat.TRUE;
} else {
entailed = ESat.FALSE;
}
return entailed;
}
```

In the first article you pointed, the authors give an algorithm to enforce GAC on a reified table constraint. This algorithm is not part of Choco-solver. If you feel like code it and pushing it, it will be welcome. I believe the most difficult part is to get the tuples, since most of the time, in Choco, we encode them in a more convenient structure...

In addition, you still have to provide the opposite of c