#7304: Contract edge in graph
--------------------------------+-------------------------------------------
       Reporter:  AJonsson      |         Owner:  rlm         
           Type:  enhancement   |        Status:  needs_review
       Priority:  major         |     Milestone:  sage-5.0    
      Component:  graph theory  |    Resolution:              
       Keywords:                |   Work issues:              
Report Upstream:  N/A           |     Reviewers:              
        Authors:                |     Merged in:              
   Dependencies:  #9362         |      Stopgaps:              
--------------------------------+-------------------------------------------

Comment (by boothby):

 Brunellus,

 This isn't quite there, and you haven't tested everything.

 Graphs have a copy method -- {{{g = g.copy()}}} is faster than
 {{{g=copy(g)}}}.  There are two problems with the block

 {{{
         if vertices and vertices[0] is None:
             vertices[0] = g.add_vertex()
 }}}

 first off, this assumes that {{{g.add_vertex()}}} returns the label of the
 added vertex.  It does not.  Second, it modifies {{{vertices}}} for no
 good reason (what if the users passes in a tuple, set, or generator?)

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