#11181: edge labels should be unique
-------------------------------+--------------------------------------------
   Reporter:  rlm              |       Owner:  jason, ncohen, rlm
       Type:  defect           |      Status:  needs_review      
   Priority:  major            |   Milestone:  sage-4.7          
  Component:  graph theory     |    Keywords:                    
     Author:  Robert Miller    |    Upstream:  N/A               
   Reviewer:  Christian Stump  |      Merged:                    
Work_issues:                   |  
-------------------------------+--------------------------------------------

Comment(by ncohen):

 Hello again !

 > http://docs.python.org/release/1.5/tut/node23.html

 Okokokok ! Got it ! Tricky python `:-)`

 I rephrase this paragraph so that it now tests whether the label is None
 before... As -- if I make no mistake -- the id 0 never appears in the
 dictionary, being always identified with None, and so it's useless to read
 the whole list of labels.

 > Since those iterators construct a list anyway, there is no real reason
 for them to be written that way, but I didn't want to touch more code than
 necessary.

 Well, in the end I edited them. I tried to pay attention, and the doctests
 still pass, which is also a good sign ! If you can summon the energy to
 re-check it... `:-)`

 > It should be in `del_edge` if anywhere. Probably I just forgot to delete
 the edge label from the translation dictionary.

 I added them !

 > Your referee patch looks good to me, although you may post another one
 after reading these comments....

 And here it is... I also tried the following on the Sage without uour
 patches applied :

 {{{
 sage: def test():
 ....:     for u,v in g.edges(labels = False):
 ....:         g.delete_edge(u,v)
 ....:         g.add_edge(u,v)
 sage: g = graphs.CompleteGraph(200)
 sage: %timeit test()
 5 loops, best of 3: 538 ms per loop
 }}}

 With the patches applied

 {{{
 5 loops, best of 3: 495 ms per loop
 }}}

 Well.. Not much, but better this way `:-)`

 Nathann

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