-
Notifications
You must be signed in to change notification settings - Fork 4
Connecting choco with PuLP #15
Comments
Hi Franco, We do have a I let you know, Best |
I just pushed the code. You can have a look at the readme file. I did not plan any release yet. Best, |
Nice, thanks Charles! So what would be the steps to build and test it via command line? I'm not at all versed in the arts of java. (by the way I think the MPS.md has an error in the example command)
should be:
? Things I've already done, watching the instructions in the READMEs:
thanks again! Franco |
Hi, Thank you, you are right about the readme. Here are the required steps to work with master branch (no need to download choco first):
Note that Best, |
Salut Charles! Thank you for the help. I think I got it working now, although I had to still do some weird things: Even with the new version I was getting the same error about choco-solver not being available. From what I got from the error and what I could search for, maven does not have that version I tried changing the version in the Finally, what I did was to copy the Then apparently it built ok and now works with at least one example. I'll keep you updated with what I do. thanks, Franco |
That is strange because the snapshot directory is declared in the pom.xml and version 4.0.7-SNAPSHOT is release on that directory. But, downloading the last version of choco from github is ok too. Best, |
Hello once again! I've been playing with pulp calling choco and apparently the normal solving works correctly. That's good! There are a couple of things that are yet to work / I have doubts about:
For number 2, here's the response I get from choco. Taking out the -p 3 option makes it work. I've tried with different examples and got the same error. I even tried forcing all variables of my problem to be integer but still got the error. what I run:
what I get in response:
PC details: I'm using Ubuntu 16.04 LTS 64 bits with an i7 processor and 16GB RAM. Thanks for your help! F. |
Hi Franco,
Thank you for your contribution. Best, |
Hi, Just a remark on point 3) it should be fair compared to building exactly the same model using choco api, but it is possible that a cp user would build a different formulation of the problem (more adapted to cp). At least, it is very common for us to specify a search heuristic (telling which variables to branch on) and this usually helps a lot the solver. |
thanks to both: I'll create the issues as proposed. I'm not really sure about (2) though because I at, some point, forced all my variables to be Integer, and even then I got the same error about real variables. And @jgFages, I'm guessing it's not possible to assign branching priorities via the command line right now. Not sure if this would be hard to implement. thanks! F. |
Well the connection has been working for some time in a branch in my fork of pulp: https://github.com/pchtsp/pulp-or/tree/CHOCO As you can see here, I've embedded the choco parser jar file inside the repo to be able to distribute it together with the pulp library. I recently received a response from the pulp project manager that has make me wonder: does the choco license permit this kind of distribution? from what I've read in the license file, it does. But I just wanted to confirm this with you. Besides this question, I guess we could close this ticket because I do not think there is much else to do. regards, Franco |
Yes, BSD is unrestrictive. Expect if we change the license, I can see no limitation to embed choco in PuLP. |
FO = Fonction objectif ? pulp is built to formulate MIP problems since it, until now, only connected to mixed linear programming solvers such as gurobi, cplex, etc. I have not tried to build any weird non-linear constraints to see if they're correctly passed to CHOCO but I'd expect it to be possible. I'm using the Finally, pulp has no support for CP constraints such as "all different" or "cardinality constraint" so everything would have to go via "algebraic equations". As a summary, what I've tested is:
F. |
Good day!
I'm interested on integrating choco with python's PuLP library to test it with the models that I've modeled so far.
This library (PuLP) lets the user build one single model and then communicates with several linear programming solvers: CBC, GUROBI, CPLEX, XPRESS, glpk.
I guess there are multiple ways of doing the integration. One very simple way pulp communicates with some of these solvers is the following:
I'm wondering if this could be done with choco. That is:
.mps
or.lp
files?I'm aware that much of the functionality of the CP solver is lost sometimes doing these kinds of translations, specially if the models come from the LP / MIP world. Still I think it's useful to be able to at least test the solver for lazy people like me.
Of course, I'd be more than glad to edit the necessary parts in PuLP if needed (although I'm not the maintainer of the repo).
thanks!
Franco
The text was updated successfully, but these errors were encountered: