#13730: Speed up some graph iterations
--------------------------------+-------------------------------------------
       Reporter:  dcoudert      |         Owner:  jason, ncohen, rlm
           Type:  enhancement   |        Status:  new               
       Priority:  major         |     Milestone:  sage-5.6          
      Component:  graph theory  |    Resolution:                    
       Keywords:                |   Work issues:                    
Report Upstream:  N/A           |     Reviewers:                    
        Authors:                |     Merged in:                    
   Dependencies:                |      Stopgaps:                    
--------------------------------+-------------------------------------------

Comment (by azi):

 Hello, dcoudert!!

 First thing that I am wondering is why is sage constructing a set from the
 iterator and then returns the iterator of the set. Does anyone happen to
 know that? It does not seem to affect computational speed but I do not see
 why it is necessary. Anyone happens to know why is set() required in this
 case?

 {{{
     def neighbor_iterator(self, vertex):

         if self._directed:
             return iter(set(self.neighbor_out_iterator(vertex)) \
                     | set(self.neighbor_in_iterator(vertex)))
         else:
             return iter(set(self._backend.iterator_nbrs(vertex))))
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13730#comment:1>
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.

Reply via email to