I'm a fairly new choco user (and not even a very seasoned Java programmer). I've written a small program to do graph-coloring as a CP problem (as a class assignment for the Coursera class on Discrete Optimization). It works fine on most of the input data sets, but on the largest of the homework sets I get a NPE in thread "main". There is no reporting of where within minimize() this is happening. The line being reported as the source of the exception is the actual line where I call minimize:
Note that the NPE does not come immediately. It happens after minimize() has run a while. It's possible that it runs the full amount of time I've given it (20 minutes) before throwing the NPE, so it may be originating somewhere in the construction of the solution.
I'm kind of at a loss as to how to trace this... the documentation on the built-in logging is rather sparse.
I can provide the full code and input data to anyone on the choco team who wants to run it, if it would help.
Randy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a 16Gb MacBook Pro, so I set the heap to 8G via -Xmx8g option. This will need significant heap, since it is creating 1001 variables and about 260000 constraints.
Randy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
~~~~~~~~~~
public static void main(String[] args) {
Boolean ob = Boolean.TRUE;
boolean b = ob;
System.out.println(b);
ob = Boolean.FALSE;
b = ob;
System.out.println(b);
ob = null;
b = ob;
}
~~~~~~~~~~~~
It means that the solver is not able to decide if the problem is SAT or not.
BR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, I went back and found the part of the docs that I hadn't read yet, which explained it like you did above. I'm just new-enough to Java that I hadn't thought about Boolean having effectively three possible return values instead of two :-).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-11-09
Hi,
please how can i maximize the sum of variable by choco 2.1.5
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm a fairly new choco user (and not even a very seasoned Java programmer). I've written a small program to do graph-coloring as a CP problem (as a class assignment for the Coursera class on Discrete Optimization). It works fine on most of the input data sets, but on the largest of the homework sets I get a NPE in thread "main". There is no reporting of where within minimize() this is happening. The line being reported as the source of the exception is the actual line where I call minimize:
Note that the NPE does not come immediately. It happens after minimize() has run a while. It's possible that it runs the full amount of time I've given it (20 minutes) before throwing the NPE, so it may be originating somewhere in the construction of the solution.
I'm kind of at a loss as to how to trace this... the documentation on the built-in logging is rather sparse.
I can provide the full code and input data to anyone on the choco team who wants to run it, if it would help.
Randy
Hi Randy,
Please provide us either the entire exception trace or the full code.
Charles
Unfortunately, the exception trace is not helpful:
I've put the code in a gist on github: https://gist.github.com/rjray/5980271
I've put the data-file that causes the NPE here: http://www.blackperl.com/gc_1000_5
Call it like above, after compiling:
I have a 16Gb MacBook Pro, so I set the heap to 8G via -Xmx8g option. This will need significant heap, since it is creating 1001 variables and about 260000 constraints.
Randy
Hello,
solver.minimize returns a Boolean which is null because the solver did not find any solution to your problem's instance.
BR
Are you sure? Why would it return a null rather than false? Perhaps I don't understand the auto-boxing as well as I thought...
I'll try setting the timeout to a higher length of time and see if that makes a difference...
It is consistent with the following test.
~~~~~~~~~~
public static void main(String[] args) {
Boolean ob = Boolean.TRUE;
boolean b = ob;
System.out.println(b);
ob = Boolean.FALSE;
b = ob;
System.out.println(b);
ob = null;
b = ob;
}
~~~~~~~~~~~~
It means that the solver is not able to decide if the problem is SAT or not.
BR
Thanks, I went back and found the part of the docs that I hadn't read yet, which explained it like you did above. I'm just new-enough to Java that I hadn't thought about Boolean having effectively three possible return values instead of two :-).
Hi,
please how can i maximize the sum of variable by choco 2.1.5
Best regards