Difference in pulp classes and native solvers.

196 views
Skip to first unread message

Joel Cofield

unread,
Dec 4, 2014, 3:25:44 AM12/4/14
to pulp-or...@googlegroups.com
I have one binary program with thousands of rows/variables.
I see drastic difference if I run the PuLP solver classes or the respective solver via command line.
It solves in under a second via command line,
but runs for hours if I call PuLP classes.

I generate the .lp (and .mps) model with PuLP then try solving it in 4 ways:

(i) PULP_CBC_CMD class
But it runs forever and has yet to exhaust the search tree
(ii)pulp's GLPK class
Also runs too long
(iii) CBC command line interface import and solve
Instantly says the linear relaxation is infeasible
(once I got "optimal solution found" instead . Could it be the seed? )
(iv) glpsol command line
Instantly says an optimal integer solution is found

My output is below.
Why is there such a drastic difference if I call the pulp classes or run the models directly through the solvers?

CBC Output

Result - Linear relaxation infeasible

Objective value:                -50398.00000000
Enumerated nodes:               0
Total iterations:               0
Time (CPU seconds):             1.88
Time (Wallclock seconds):       2.05

glpsol output

INTEGER OPTIMAL SOLUTION FOUND
Time used:   0.2 secs
Memory used: 42.0 Mb (44053862 bytes)

glpk via pulp output

Integer optimization begins...
+   596: mip =     not found yet <=              +inf        (1; 0)
+   938: mip =     not found yet <=   5.080000000e+02        (9; 0)
+   968: mip =     not found yet <=   5.080000000e+02        (19; 0)
+  1020: mip =     not found yet <=   5.080000000e+02        (35; 0)
+  1066: mip =     not found yet <=   5.080000000e+02        (49; 0)

Keyboard Interrupt

cbc via pulp output
...
Cbc0010I After 2800 nodes, 617 on tree, -106 best solution, best possible -307 (68.53 seconds)
Result - Stopped on node limit

Objective value:                106.00000000
Lower bound:                    307.000
Gap:                            -0.65
Enumerated nodes:               2866
Total iterations:               6911
Time (CPU seconds):             69.53
Time (Wallclock seconds):       72.77

Stuart Mitchell

unread,
Dec 4, 2014, 4:56:23 PM12/4/14
to pulp-or...@googlegroups.com
Hmm interesting are you able to send me (privately if you like) the example?

Note pulps version of cbc hasn't been updated for a while, but I will release new solvers in the next version.

Stu

--
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 post to this group, send email to pulp-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.



--
Stuart Mitchell
PhD Engineering Science
Extraordinary Freelance Programmer and Optimisation Guru

r. geo.s

unread,
Nov 12, 2017, 3:38:14 PM11/12/17
to pulp-or-discuss
This is a rather old thread but I was googling for the same thing too.
In my case I see differences of solving times using the same solver with the same input. (from a couple of seconds to a couple of minutes)

Since I haven't checked the internals of the solver on how it gets to the solution, I only speculated that it must be some sort of heuristics and that's why the solving time differs so much.
So I was wondering  if I can seed the model?!?

Any insights on this?

Thank you.
Reply all
Reply to author
Forward
0 new messages