#13730: Speed up some graph iterations
--------------------------------+-------------------------------------------
Reporter: dcoudert | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: graph theory | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by vdelecroix):
Hi,
I just upload [attachment:trac_13730-vd.patch] to show how you could do
this. There is no reason to add extra attributes to graphs (it will only
slow down everything). Right now, all graph data structures in Sage are
implemented to be fast at Cython level (ie compiled code). In order to
have reasonable timings at Python level you need to work a bit.
In [attachment:trac_13730-vd.patch], there is a working iterator for the
out neighbors in a dense graph (in `sage.graphs.base.dense_graph`). You
might implement similar classes `InIteratorXXX`, `OutIteratorXXX` and
`InAndOutIteratorXXX` for each graph backend `XXX` and then make some
small wrapper in order to make it works for Sage graphs (ie translating
ints to vertex labels).
I may help further if you need.
Best,
Vincent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13730#comment:19>
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.