-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior with simple arithmetical constraint (+Java) #435
Comments
Strange, indeed.Thanks for reporting. It will be fixed by tomorrow. |
Ok, I see. |
Hello, I'm interested in this issue because I've found the error on choco-solver. Could you explain how ibex developers work around this problem, I mean, no one deal with such interval reductions that not achieve 1% of significance? This is a common issue, if not, why not? Thanks in advance, |
Hello, |
Hi, I suppose that NOT_SIGNIFICANT will be a good answer, and that Choco can manage it. Best |
We are starting a important project using the choco-solver in the company. Would be nice if such feature could be released until the end next month. Thanks, |
Sure, I can make the update quickly; it's a minor thing. I let you know. |
Thinking again about this topic, I am not sure that we really need two different status for contraction: NOTHING and NOT_SIGNIFICANT. Would you distinguish both? If, say, a contraction only removes a single float in a domain, what difference would that make comparing to nothing removed at all? |
Indeed, NOT_SIGNIFICANT is currently not used. NOTHING triggers no specific action, as expected. So I suppose the best option is to set the threshold programmatically. |
Ok, it's done in the 'develop' branch and it will be integrated in the next release. You can test meanwhile with 'develop'. |
Is this published in 2.8.7 or still under development ? |
It is still under "develop" and ready for the next release. |
Ok, well I encounter another issue, related to this, I bet. I have the following model: Ibex ibex = new Ibex(new double[]{0.001});
ibex.add_ctr("{0}=2.");
ibex.add_ctr("{0}=2.");
ibex.build();
double[] domains = new double[]{1.0, 3.0};
Assert.assertEquals(Ibex.CONTRACT, ibex.contract(0, domains));
Assert.assertEquals(Ibex.ENTAILED, ibex.contract(1, domains, Ibex.FALSE_OR_TRUE)); The first assert is satisfied, but not the second. |
This is not related to this issue. The "problem" is that ibex only proves entailment for inequality constraints. This is because, in the realm of continuous constraints, entailment does not make much sense for equations ... except on very special situations like the one you're testing, i.e., equations x=some_constant or x*y=0, etc. Note that with equations, however, we can prove the existence of a solution and this is what the return code SOLUTION of It's possible to make a hack in the java plugin for some constraints like x=some_constant, but I'm not enthusiast. This kind of constraint could be directly handled by Choco. Tell me what you think. |
I would like to give an opinion about this situation. @cprudhom I've made a question on gitter some time ago asking the possibility about a more performant way to define equality constraints over real numbers. The related problem to this question was: In the following code, increasing the numVars from 10 to 1000 linearly (in increments of 10) causes the propagation time increasing exponentially. Differently from IntVar that executes [very] more efficiently. Model model = new Model();
RealVar[] vars = model.realVarArray(numVars, lb, ub, precision);
for (int i = 0; i < numVars; i++) {
vars[i].eq(100.0).ibex(precision).post();
}
model.getSolver().propagate(); In a problem with thousands of RealVars, where many of then will be constrained with equality, how it can be made more efficiently? What about the possibility of create a Java propagator to define direct constraints as =, !=, >, <, >= and <=? |
I've made some tests with a custom propagator, if it's interest you, I could share my implementation. Then choco-team can analyse this possibility. |
I profiled the execution, and most of the time is spent in double lb = 1.0;
double ub = 200.;
double precision = 0.001;
Model model = new Model();
RealVar[] vars = model.realVarArray(numVars, lb, ub, precision);
for (int i = 0; i < numVars; i++) {
vars[i].eq(100.0).ibex(precision).post();
}
model.getSolver().propagate(); numVars = 50
execution time: 0.782s,
Ibex build: 0,510s
numVars = 100
execution time: 2.745s,
Ibex build: 2,438s
numVars = 200
execution time: 18.88s,
Ibex build: 17,78s @gchabert any ideas where this comes from ? |
I am not surprised that building a constraint is slow. The building process first goes through JNI, the syntax is then parsed and a bunch of objects are built on C++ side. This may takes time and this part of Ibex has not been optimized at all, simply because models are usually fairly small to be exhaustively solvable. |
Dear developers,
I encounter a strange result while calling
ibex.contract(...)
on the following example (in Java):This prints
[1.0, 85.0]
whendomains = new double[]{0.15, 85.0};
But, when upper bound is greater or equal to
86.0
it prints[0.15, 86.0]
(f-ex,domains = new double[]{0.15, 86.0};
).Any ideas how to fix this ?
Best,
CP
The text was updated successfully, but these errors were encountered: