#13698: Access to graph routines of the GLPK
------------------------------------------------------------------------+---
Reporter: christiankuper |
Owner: jason, jkantor
Type: enhancement |
Status: needs_info
Priority: major |
Milestone: sage-5.8
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:
------------------------------------------------------------------------+---
Comment (by christiankuper):
Hello Nathann,
> * `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".
Thanks for all the good changes!
> * `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.
You're absolutely right
> * 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.
You are absolutely correct, I hadn't thought of that. I removed the
"guessing".
> * 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.
I agree, the API is not perfect. I had thought about the "vertices must be
strings" issue and do have some ideas for a workaround to leave it aside
for now.
Thanks again!!!!
Christian
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13698#comment:26>
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.