An API which allows constraint programming for java programmers. It aims at describing hard combinatorial problems in the form of Constraint Satisfaction Problems and solving them with Constraint Programming techniques
Questions tagged [choco]
120 questions
0
votes
1 answer
integrate Choco and Bloom filter
Now I am going to integrate Choco and bloom filter. The problem is I want to know which JAVA file in Choco is about search process because I want to store the decisions of each nodes into bloom filter after each searching step.
source code of choco:…

tommy
- 1
- 3
0
votes
1 answer
Choco solver shift scheduling
i m a total beginner in Choco Solver. I want to make a simple shift scheduler.
i have set integer variables like this
IntVar day1 = model.intVar("day1", new int[] {0,1,2,3,4,5});
where 0 , 1,...5 is a reference ID to an employee.
I have a total…

MrRisoni
- 43
- 4
0
votes
1 answer
Solving an assignment with many preassignments
The problem I want to solve consists of about 800 tasks that have to be assigned to about 120 workers. The workers have to be qualified to do the task and only have a certain number of hours per week available. About 80% of the assignments are…

Dora
- 47
- 1
- 8
0
votes
1 answer
Item allocation in a knapsack with Choco Solver
I try to implement a multidimensionnal knapsack problem with Choco Solver through JAVA. My idea is to assign 3 items in 2 knapsacks.
My item have a weight and knapsack a limit :
int[] itemWeight = {2, 2, 2};
int[] knapsackLimit = {4, 4};
And my…

AkrogAmes
- 45
- 9
0
votes
1 answer
Choco solver constraint/variable definition
I'm trying to port a minizinc model in choco. I know how to define variables and other basic stuff but despite having read the tutorial and some code examples I've some trouble defining some non trivial constraints.
Could someone give me some advice…

acco93
- 128
- 2
- 11
0
votes
1 answer
Choco-solver: coefficients of the variables are real numbers
I am looking for a way to encode mathematical equations on Choco Solver. I see there's a way to encode constraints like:
3x + 4y < 9
But I am trying to encode something like
3.5*x + 4.3*y < 9.3
where x and y are int vars and coefficients are real…

Quang
- 3
- 1
0
votes
1 answer
choco assign int to IntVar
For a variable array like
IntVar[][] array = VF.boolMatrix("example", 5, 10, solver);
what is the difference between
solver.post(ICF.arithm(array[i][j], "=", 0));
and
array[i][j] = VariableFactory.fixed(0, solver);
Is one superior to another in…

Dora
- 47
- 1
- 8
0
votes
2 answers
How to terminate a Java process from a different one?
I am making a CSP solver that calculates all the combinatory solutions of a specific problem like this (briefly put):
// Say we are in a Solver class
public void solve() {
// find solution...
}
// This would be in a Problem…

dabadaba
- 9,064
- 21
- 85
- 155
0
votes
0 answers
Choco squaring an IntVar
I have an IntVar array that should contain penalties. They are computed by multiplying the difference of a and b with attr[2]. But if the attr[3] is 1 I want to square the difference before multiplying with attr[2]. I can't find a View that would do…

Dora
- 47
- 1
- 8
0
votes
0 answers
Choco continue with intermediate solution
Every once in a while my building time jumps from 5s to around 200. And sometimes I don't get any solution even though I got around 17 in the same time with the same data.
Is it possible to stop the solver, check if there has been a solution and if…

Dora
- 47
- 1
- 8
0
votes
1 answer
Choco Solver ICF constraint to define the standard deviation of an IntVar array within limit
Say, I am having an IntVar array
int n = 10;
IntVar[] x = VariableFactory.boundedArray("x", n, 0, 100, solver);
I need to define a constraint that restricts the standard deviation(can be a number with decimal points) of this array less than a…

Nitu Chiring
- 13
- 1
- 3
0
votes
1 answer
Choco Solver ICF constraint to define the distance between min and max variable in an array
I am having an array of Choco solver IntVar variables, say, X1, X2,...,Xn. I need to define a constraint which enforces the rule - the distance( absolute difference) value between the min and max variable should be less than a fixed value, say, 100…

Nitu Chiring
- 13
- 1
- 3
0
votes
1 answer
How to define a product in Choco (CSP)
I am trying to model a tennis scheduling problem, as I explain in this post. I was lucky to get an answer with the equations describing the problem which allowed me to implement it in Choco, and it looks like it's working good enough.
So what I am…

dabadaba
- 9,064
- 21
- 85
- 155
0
votes
1 answer
Modeling tennis matchups with Choco (CSP)
I am trying to model a problem with Choco to get the combinations of possible matchups in a tennis event (or any sport).
The way I am trying to do it I have the following:
// Set of timeslots when the event is held (i.e. 10am-10pm)
int nTimeslots =…

dabadaba
- 9,064
- 21
- 85
- 155
0
votes
1 answer
Using choco solver for solving equations
I am looking for a way to encode mathematical equations on Choco Solver.
I see there's a way to encode constraints like:
x + y < 9
But I am trying to encode something like
3x + 4y < 9
where x and y are int vars.
Any help would be greatly…

user3630087
- 11
- 1