#16005: Waste of time in iterator_edges 2
-----------------------------+---------------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: PLEASE CHANGE | Keywords:
Merged in: | Authors: Nathann Cohen
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies: #15978
Stopgaps: |
-----------------------------+---------------------------------
As reported by Marc in #15978, `iterator_edges` wastes a lot of time.
Computationally, returning all edges of a graph currently works this way:
{{{
for each edge E of the graph: # Okay, linear time
<Something equivalent to checking that E is an edge> # Totally useless
return E
}}}
This can be solved by creating a function that is somehow between
- Returning all neighbors of a vertex (which is not sufficient to find the
edges incident to this vertex)
- Work directly with the data structure, i.e. a binary tree
This function is named `out_neighbors_BTNode_unsafe` and does what some
part of the code already did, before throwing the information away. It
builds the list of `BTNodes` describing the [neighbors of/edges incident
to] a vertex, from which all that we need can be deduced.
As a result, the useless computations reported above can be removed.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/16005>
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/d/optout.