#13440: Adding reverse_edge() function to DiGraph
---------------------------------+------------------------------------------
Reporter: egunawan | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.7
Component: graph theory | Resolution:
Keywords: digraph | Work issues:
Report Upstream: N/A | Reviewers: Gregg Musiker
Authors: Emily Gunawan | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by dcoudert):
The reverse edge function should raise an error if one tries to reverse an
edge that is not in the graph. The tempG line should be moved after the
if.
Also, it would be convenient to accept {{{
G.reverse_edge(u,v,some_label,inplace=True) }}}.
See the {{{G.add_edge}}} function for more details on how to do this.
Then the {{{reverse_edges}}} should be like:
{{{
tempG = self if inplace else self.copy()
for e in edges:
tempG.reverse_edge(e,inplace=True)
if not inplace:
return tempG
}}}
I think these methods are useful, although the behavior is not perfect.
But as long as the documentation is clear...
I let Nathann answered other comments.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13440#comment:16>
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.