#13440: Adding reverse_edge() function to DiGraph
---------------------------------+------------------------------------------
Reporter: egunawan | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_work
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:
---------------------------------+------------------------------------------
Changes (by dcoudert):
* status: needs_review => needs_work
Comment:
Not working for digraphs with labels on edges
{{{
sage: d = digraphs.Circuit(6)
sage: d.reverse_edges(d.edges()).edges()
[(0, 5, None),
(1, 0, None),
(2, 1, None),
(3, 2, None),
(4, 3, None),
(5, 4, None)]
sage: d = digraphs.Kautz(2,3)
sage: d.reverse_edges(d.edges()).edges()
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
<ipython-input-15-99c7e6f964ef> in <module>()
----> 1 d.reverse_edges(d.edges()).edges()
/home/dcoudert/Soft/sage-5.7.beta2/local/lib/python2.7/site-
packages/sage/graphs/digraph.pyc in reverse_edges(self, edges, inplace)
1997 tempG = self if inplace else self.copy()
1998 for e in edges:
-> 1999 tempG.reverse_edge(e,inplace=True)
2000 if not inplace:
2001 return tempG
/home/dcoudert/Soft/sage-5.7.beta2/local/lib/python2.7/site-
packages/sage/graphs/digraph.pyc in reverse_edge(self, u, v, label,
inplace)
1943
1944 if not self.has_edge(u,v,label):
-> 1945 raise ValueError, "Input edge must exist in the
digraph."
1946
1947 tempG = self if inplace else self.copy()
ValueError: Input edge must exist in the digraph.
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13440#comment:20>
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.