I'm solving a slightly modified version of the same problem several
times and I found out that warm start was really suitable for me.
AFAIK, Warm starting is possible in at least two solvers, cplex and
Clp, and as it also available in the OSI library, I think this is a
must have feature in PuLP.
I did not find references about this, but I'm new to PuLP and python
so I'm still discovering the pyhon way to browse documentations. Is it
possible? If not, is it possible to add it?
Cheers!
Christophe-Marie
PhD student in OR
Tell me exactly what you want to change in the problem and the solver
you want to use and I will tell
you if it is already in there or if I can add it easily.
Stu
What I would like exactly is to do the same as I do with OSI: be able
to get a generic warm start object once my problem is solved, so that
I can provide it to the solver next time I solve the problem.
I typically use the following methods:
http://www.coin-or.org/Doxygen/Osi/class_osi_solver_interface.html#243a73c2c4741788382cc5675c574214
http://www.coin-or.org/Doxygen/Osi/class_osi_solver_interface.html#f7dba660a92526fd4de6507bae3c6d2a
Christophe-Marie
Saying that I would like to write an OSI interface for pulp. I have
thought that the best way to do that would be either to write a python
binding to OSI and submit that to the project, or write an c- interface
to OSI and then call it using c-types like I do for CoinMP and CPLEX.
Any volunteers for either of those jobs.
Vinaka
Stu
I just recalled that I had already seen something about python and OSI
before. Here it is: http://code.google.com/p/pyosi/. It does not seem
like there is a lot of features, I have to admit I prefer the PuLP way
to say things.
--
Christophe-Marie Duquesne
06 84 14 26 82 - mobile
04 76 57 48 06 - g-scop
04 97 04 27 33 - amadeus
Ok I'll bottom post,
Looks good, I can easily wrap that in pulp and support it as a solver. I
hope it has the capabilities you are looking for.
I also would want to wrap pyglpk might have a look at that this weekend.
Stu
Nice!
Btw I just tried to build their package. I spotted errors in OSI
headers inclusion (OSI headers are usually installed in
/usr/include/coin/, but they #include "OsiSolverInterface.hpp". It
must be replaced with #include <coin/OsiSolverinterface.hpp>, and same
applies for other includes. I generated a patch (see attached). The
bad news is I know fail with a link error:
/usr/bin/ld: cannot find -lboost_python-gcc41-mt
boost python is installed on my system. Let me know if you are more
lucky than me.
Cheers!
--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pulp-or-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/17d8ceef-a53a-4c13-9f98-4e7063274f2e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/CAOuNk4ZNVJVVBtUU1y6vQrN5eL_%3D-6vErEqxw7Yh636F5vvgiw%40mail.gmail.com.
Thanks for the tip. I will give it a try.
Le mar. 27 août 2019 à 23:43, 'Stuart Mitchell' via pulp-or-discuss <pulp-or...@googlegroups.com> a écrit :
Maybe tryStuart MitchellPhD Engineering ScienceExtraordinary Freelance Programmer and Optimisation Guru
On Wed, Aug 28, 2019 at 9:41 AM Tomasz Gorecki <tomh....@gmail.com> wrote:
Hi--I suppose the previous comment still applies: no warm-starting with CBC through PULP. If i understand correctly it is a functionality of CBC though. Could you recommend the fastest way to try a warm start. rewriting the problem will already be intensive, but ok.. Suing something else than Python is not an option for me at the moment.Should I try pyomo or another CBC python interfaceThxBr
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/17d8ceef-a53a-4c13-9f98-4e7063274f2e%40googlegroups.com.
--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/b0e710f7-c9d5-474a-87aa-fe80125e13cc%40googlegroups.com.
Hey Tomasz,
Yeah, relevant changes are just a few lines, actually.
First of all, just like all other files that are created in pulp, if you use keepFiles=True
as argument, you will keep the initial solution file that we pass to the solver (and it will not have a weird name).
For CBC, the actual file is created here and then given as argument to the solver:
if self.mip_start:
self.writesol(tmpSol_init, lp, vs, variablesNames, constraintsNames)
cmds += 'mips {} '.format(tmpSol_init)
The variable that stores the name of the file tmpSol_init
is assigned here and depends on the argument keepFiles
, as I said:
if not self.keepFiles:
uuid = uuid4().hex
tmpLp = os.path.join(self.tmpDir, "%s-pulp.lp" % uuid)
tmpMps = os.path.join(self.tmpDir, "%s-pulp.mps" % uuid)
tmpSol = os.path.join(self.tmpDir, "%s-pulp.sol" % uuid)
tmpSol_init = os.path.join(self.tmpDir, "%s-pulp_init.sol" % uuid)
else:
tmpLp = lp.name+"-pulp.lp"
tmpMps = lp.name+"-pulp.mps"
tmpSol = lp.name+"-pulp.sol"
tmpSol_init = lp.name + "-pulp_init.sol"
Afterwards, we just delete it at the end with the rest of files we create.
For GUROBI_CMD
and CPLEX_CMD
the idea is very similar but the writesol
method is different and the command line arguments to pass the file are different too.
Franco
You received this message because you are subscribed to a topic in the Google Groups "pulp-or-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pulp-or-discuss/nkEZHLmSt-s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pulp-or-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/CAG%3DLVEBrz3sqp%2B-5YLY1ZQZnsSo4BJ8JNH1J5XX2MEmM%3DXo5nw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/CAPEBFCa%2BsHJAJo_E-ZMpg71C1FyUwYjr_Q9MmnJD6CBLZgLcVg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/58eec517-f32a-45b9-8ae6-51ddc16a16b2n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/CAOuNk4YOtt0rfjEZq9zoHKWMPXyY2yEQ4Xp_g2%3DmHoxcpCn82w%40mail.gmail.com.