#10135: eulerian_circuit() of Graph can't handle multiple edges
----------------------------+-----------------------------------------------
Reporter: mvngu | Owner: jason, ncohen, rlm
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.8
Component: graph theory | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
----------------------------+-----------------------------------------------
Changes (by brunellus):
* status: new => needs_review
Comment:
The patch I just sent strives for three advancements in
eulerian_circuit():
* It should close this ticket. :-)
* It should run in O(|E|) time.
* It should find eulerian circualiton in disconnected cases like
{{{
Graph({0: [], 1: [2], 2: [3], 3: [1], 4: []})
}}}
where previous one failed. This is similar to the trac #12108. Notice,
that you need to apply the patch I sent to that ticket before testing this
code -- if you don't, one of the tests fails because is_eulerian() doesn't
work correctly.
During testing I was surprised by way Sage handles multiple loops:
{{{
sage: g=Graph({0: [0, 0]})
sage: g.degree(0)
4
sage: g.delete_edge(g.edge_iterator(0).next())
sage: g.degree(0)
0
}}}
I think that Sage should either reject multiple loops at the beginning
(merge them to one, for example), or handle them as separate. This is
surprising behavior. What do you think?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10135#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.