#15035: removing redundant set/iter conversions in graph backend
------------------------------+-----------------------------
Reporter: slani | Owner:
Type: PLEASE CHANGE | Status: new
Priority: minor | Milestone: sage-5.12
Component: graph theory | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Dependencies: | Stopgaps:
------------------------------+-----------------------------
Hello,
this patch speeds up neighbor iterator method when the original graph is
not directed. The speed up is achieved by removing unnecessary set
conversions in the graph backend.
(as seen on a figure in ticket [http://trac.sagemath.org/ticket/13730].)
Before:
{{{
sage: G = graphs.RandomBarabasiAlbert(1000,2)
sage: %timeit E = [(u,v) for u in G for v in G.neighbor_iterator(u)]
100 loops, best of 3: 7.8 ms per loop
}}}
After:
{{{
sage: G = graphs.RandomBarabasiAlbert(10**6,2)
sage: %timeit E = [(u,v) for u in G for v in G.neighbor_iterator(u)]
100 loops, best of 3: 3.58 ms per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15035>
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.
For more options, visit https://groups.google.com/groups/opt_out.