New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow constants for objective function & deletion of rows in MixedIntegerLinearProgram #12823
Comments
comment:1
I've uploaded a patch for Coin & GLPK. Do we want to take care of deleting constraints in this patch, too? I haven't done that yet; if so, I'll modify the ticket correspondingly. |
comment:2
I knew I'd forgotten something in the ticket properties: its type. Sorry. :-( |
Author: john_perry, ncohen |
This comment has been minimized.
This comment has been minimized.
comment:3
I'm about to upload a new patch that takes into account our offline discussion and enables deletion of rows. The doctests and some warning blocks are only in the backends, though; should those be moved to |
comment:4
I also corrected the output of |
comment:5
Hellooooooooooo John !! Well, there is no need to test functions 10 times in the same way, so the best is to write real hard tests in the backends, and some tests just meant as examples for the users in the documentation of numerical/mip.pyx. The point is that GLPK is the only solver whose documentation appears in Sage's online reference manual, so we can not easily write important documentation in the backends of CBC, Cplex and Gurobi for the user has almost no way to see it. Nathann |
comment:6
Replying to @nathanncohen:
Okay. I added a relatively simplex doctest for I guess it's time for you to referee this one, and to submit a patch for the other solvers. |
Attachment: trac_12823_const_for_obj_funs.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:8
Hellooooooooo !!! Simple. Your meant Simple. Not Simplex Well... This patch took me... quite some time ! It all began with #12833, which this patch depends upon. Some problems with Gurobi's interface. Which I noticed because my gurobi license was not valid anymore. Once I got this license again (and reinstalled Gurobi), I had a problem when installing cbc with Some important things I should mention. Please tell me what you think of them :
Anyway, everything is tested, and....
(And I rarely have all solvers installed at the same time) Soo... Well, if you agree with my patch (I can send you my cplex/gurobi license if necessary), .... Thank you very much for your work on that one ! It's good to see this class move a bit Nathann |
This comment has been minimized.
This comment has been minimized.
Dependencies: 12833 |
comment:9
I'm okay with offsetting the constraint according to the solver. However, line 401 of coin_backend should have
instead of
shouldn't it? |
comment:10
Ahahaah. Totally right. Updated I had also totally forgotten to do the same for GLPK Nathann |
comment:11
Why do you enumerate the constraints in coin_backend, maybe others? Why not simply loop i from 0 to len(constraints)? More: I don't understand this:
Seems to me the test should be
shouldn't it? and then you could have
|
comment:12
Oh. Because I have been told that "enumerate" had been "optimised", and that as "for i in range(n)" it was translated into "good C code". Actually, here is what it gives :
So it is more or less the same... In particular, when you have a "for i in range(len(something))" I guess the "len(something)" is evaluated many times.
Oh. No, it is not. Ok well.. It looks like it is indeed better as an range(len(thing)) Updated !
Yeah totally.... Stupid me. Nathann |
comment:54
Nathann Replying to @nathanncohen:
Hope you're having fun :-)
I'm not surprised. I forgot to test it w/#12833 first. I can't get #12833 to apply at all on 5.0.beta9, so I'll have to try this at home, later tonight or tomorrow. Bummer. Stay tuned... |
comment:55
Okay. I downloaded & build beta 13 on a second computer (the first is a nearly 15 year-old, 32-bit machine, bogged down in testing some other tickets), applied the requisite patches for all dependencies listed, and after a lot of tinkering, got it to work. I then went back & figured out why beta 8 didn't like #12833 --- some sort of whitespace error --- and tested it there, since I have coin installed there. That works, too. So Coin & GLPK work on my machines. Someone please test gurobi & cplex again! An aside: most of the problems seem to have been caused by whitespace!!! Apparently #12833 fixes some whitespace problems in gurobi and mip that I had also tried to fix in the latest patch for this one. I hadn't tried to fix them before; hence the unpleasant surprise. I hope this one works... |
Changed reviewer from David Coudert to David Coudert, Nathann Cohen |
comment:56
Hellooooooooooooo !!! Well, this one seems well oiled
And all tests pass in mip.pyx, graph, dgraph, generic_graph. Sooooo... I guess the patch is now positively reviewed Nathann |
comment:57
Yessss! :-) It only took... uhm, how many tries? X-D |
comment:58
Ahahah.. Well, it is still funnier like that compared with times when it takes several months before a ticket gets reviewed Nathann |
comment:59
(This being said, the ticket still depends on #12833 |
comment:60
Hello, I don't need patch #12833 to apply this patch and all tests are OK (sage -t sage/numerical, and sage -t -optional sage/numerical/backends/glpk_backend.pyx and same for cplex). D. |
Changed work issues from failing doctests to none |
Changed author from john_perry, ncohen to John Perry, Nathann Cohen |
comment:63
The patch needs a proper commit message. |
comment:65
This needs to be rebased to sage-5.0.rc0:
|
Attachment: trac_12823_rolls_all_into_one.patch.gz |
comment:66
Patch updated ! Nathann |
Merged: sage-5.1.beta1 |
Currently, MixedIntegerLinearProgram does not allow deleting rows. We would like to enable this for all backends that allow it.
Also, this is a bug.
The correct value ought to be 9, not 2. The problem is this line in the
set_objective()
method ofmip.pyx
:John Perry will create a patch for GLPK and CBC; Nathann Cohen will create a patch for Gurobi and CPLEX.
Apply:
Depends on #12220
Depends on #12736
Depends on #12833
CC: @nathanncohen
Component: linear programming
Keywords: solver objective
Author: John Perry, Nathann Cohen
Reviewer: David Coudert, Nathann Cohen
Merged: sage-5.1.beta1
Issue created by migration from https://trac.sagemath.org/ticket/12823
The text was updated successfully, but these errors were encountered: