#13698: Access to graph routines of the GLPK
------------------------------------------------------------------------+---
Reporter: christiankuper |
Owner: jason, jkantor
Type: enhancement |
Status: needs_info
Priority: major |
Milestone: sage-5.7
Component: numerical |
Resolution:
Keywords: out-of-kilter, minflow, maxflow, critical path, GLPK |
Work issues:
Report Upstream: N/A |
Reviewers:
Authors: Christian Kuper |
Merged in:
Dependencies: |
Stopgaps:
------------------------------------------------------------------------+---
Changes (by ncohen):
* status: needs_review => needs_info
Comment:
Hellooooooooooooooo Christian.
Well, I think I spent my whole saturday on your patch. Here is a patch to
apply on topof yours, which changes many things among which the following
:
* `set_vertex/set_vertices` were renamed to `set_vertex_demand` and
`set_vertices_demand` as they define "rhs", and as the help of
`get_vertex` says that `"rhs"` represents the demand in mincost flow
algorithms. As a result, they do not take a dictionary as an argument
anymore but only a numerical value, as it is only meant to define a
numerical value and nothing else.
* some unimportant reformatting of the index of method at the tp of the
document. It goes beyond 80 characters, but it is easier to read this way.
* `fname` is not `fname` but "data". data can be a filename, None, or a
Sage graph.
* You can use "::" wherever you like, not only after "EXAMPLES".
* `import_generic_graph` looks like trouble if you call it after having
defined edges and vertices in the graph. And its use did not seem very
sensible at this step. Hence I removed the function, which is now part of
the class constructor.
* In this `import_generic_graph` function you were trying to guess the
value of `rhs` from the vertex name, by casting it to a float. Are you
aware that most of our graph's vertices are integers ? And that no two
vertices can have the same name ? This would let rhs be defined to 0, 2,
3, 4, 5 ... in a graph without anybody noticing, wouldn't it ? I removed
that part of the code. Honestly I do not like the fact that rhs is guessed
from the result of `Graph.get_vertex` (if it happens to be a numerical
value or a dictionary) as it seems to be that users could have stuff
defined in `rhs` without knowing it. Looks dangerous. If you agree I would
be glad to see it removed, otherwise I will not complain anymore.
* I hate the fact that vertices are necessarily represented by strings.
But that's not your fault of course, the API is written like that.
* I hate the fact that there is no function in the API to look for an
edge, and that you have to do it yourself.
And many, many other small details in the code. A bugfix in `add_vertices`
random stuff everywhere.
Well. Tell me what you think about it. I don't know if all this will be
heavily used for itself, but we will a least have to expose the flow
algorithms inside of the Graph.connectivity methods later on. Thank you
for your work for I know it has taken a lifetime, and I think this patch
will be ready very soon.
See youuuuuuuuuuuuuuuuuuuuuuuuuuuu !!!
Nathann
P.S. : Pleaaaaaaaaaaase. No other "patch bombs". These things are too big
to review at once `:-P`
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13698#comment:23>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.