On 5/14/10 12:48 PM, Ryan Hinton wrote:
I am running some Monte Carlo simulations where I construct and pull
apart graphs. If I can get them to run faster, I can get my results
faster or with higher precision/confidence.
I can give details if desired, but most of the processor time is spent
in adding/deleting edges and vertices and iterating over edges. Are
there any shortcuts or low-level methods for doing this faster? For
example, the top line of my runtime profile is
ncalls tottime percall cumtime percall
filename:lineno(function)
37348 5.701 0.000 5.701 0.000 {del_vertex}
(out of a total of 24.627 CPU seconds) which I assume is the CGraph
vertex delete method.
Again, are there any shortcuts or low-level methods I can use? Should
I try NetworkX instead? Any help is appreciated. Thanks!
- Ryan
Are you adding/deleting things using the python functions, or are you
using the Cython interface to the underlying CGraph structure? If you
are using python, you can probably speed up these operations by 100x or so.
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org