#12220: Updated CBC spkg
----------------------------------+-----------------------------------------
Reporter: ncohen | Owner: ncohen
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.0
Component: linear programming | Keywords: sd35.5, Cernay2012
Work_issues: | Upstream: N/A
Reviewer: | Author: John Perry
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Comment(by ncohen):
Helloooooo !!!
> Can you tell me which one?
Oh sorry, it is in the one-line patch I just attached to this ticket.
> Since Cbc becomes the default solver when you install coin, I recently
noticed that after copying and trying to change the objective function,
Sage would crash, hard. In fact, I was thinking of that this morning
before I came down to the computer.
Hmmm... Did you update Sage to some 5.0 beta in between ? Odd thing `O_o`
> I am not sure what is going on. I know it '''used''' to work some time
ago, since as you know I had been very interested in making Cbc work at
one point. I'm planning to look at it again, though since GLPK is now
working I was busy working on my research instead.
Well, I'm applying for a permanent position myself and it is taking most
of my life `^^;`
> Just this week I've arrived at a point on the problem I was studying
that I think I can look at this again, so I will try to fix it.
Same thing here. I may have one week and perhaps a bit more to do my job
*mathematics*. And some time for Sage too `:-)`
> > Oh, and also : why do you want to cache all the values of the
variables in a dictionnary attached to the CoinBackend object ?
>
> If I want to add a constraint after solving once, the Cbc model crashes,
hard. I don't remember if it crashes when I add to the model, or when I
try to solve.
If I remember correctly it is when you try to solve it.
> The solution I had found, and which worked at ''one'' point, was to
delete the model, but since OsiClp stores the solution in the model (no
joke) you lose the solutions.
Yeah I know, that's the reason why you can not add constraint, then solve,
then add constraints, then solve again. Because if the first "solve"
operation said that some variable had a value of 1.7, this variable has an
upper bound and a lower bound of 1.7 after the first call to solve. That's
awful.
> My solution was to store the values of the variables; I don't remember
how, but a dictionary doesn't sound too wrong...
>
> Do you think I should store them in C floats? Do you have a better
suggestion?
Well, then that is a problem when the user wants to 1) solve a LP 2) add
a constraint 3) read the value given to the variables by the *former* call
to solve. Actually I mostly wondered about whether we should cache them
ourselves at all. In the user backends (that's not necessarily relevant of
course, given Coin's "own constraints") the solutions are just "stored by
the LP", as it is done by Coin. As it is more expensive to store them in a
dictionary that through Coin's internal storage system, I would rather
stand for an exception raised in the situation where the user goes through
the 3 steps I listed before. "If Coin has no variable in memory for some
reason, raise an exception saying so". And in this situation the user is
free to build his own dictionary before adding constraints so as to
remember them while adding new constraints.
All in all, if we are decided to cache it a dictionary is probably the
best -quick and easy- solution. But this really is not something Sage
should do, that's the solver's job...
> I know. I'll try to work on it, but I have no guarantees that I'll have
a patch soon.
I will be thinking about this patch too, but it really is tricky. I
mean..... Considering the solver's behaviour, I have to admit that I hate
to have to do dirty work above to patch their mistakes `:-/`
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12220#comment:70>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.