#14535: Mutability of Graphs
------------------------------------+---------------------------------------
       Reporter:  SimonKing         |         Owner:  jason, ncohen, rlm
           Type:  enhancement       |        Status:  needs_info        
       Priority:  major             |     Milestone:  sage-5.10         
      Component:  graph theory      |    Resolution:                    
       Keywords:  mutability graph  |   Work issues:                    
Report Upstream:  N/A               |     Reviewers:                    
        Authors:  Simon King        |     Merged in:                    
   Dependencies:  #14524            |      Stopgaps:                    
------------------------------------+---------------------------------------

Comment (by SimonKing):

 Here is a little timing.

 Without patch:
 {{{
 sage: K12 = graphs.CompleteGraph(12)
 sage: K4 = graphs.CompleteGraph(4)
 sage: def test(g,h):
 ....:     g.delete_edges(h.edge_iterator())
 ....:     g.add_edges(h.edge_iterator())
 ....:
 sage: %timeit test(K12,K4)
 10000 loops, best of 3: 118 us per loop
 }}}

 With patch:
 {{{
 sage: K12 = graphs.CompleteGraph(12)
 sage: K4 = graphs.CompleteGraph(4)
 sage: def test(g,h):
 ....:     g.delete_edges(h.edge_iterator())
 ....:     g.add_edges(h.edge_iterator())
 ....:
 sage: %timeit test(K12,K4)
 10000 loops, best of 3: 131 us per loop
 sage: (131-118)/118.*100
 11.0169491525424
 }}}

 So, there is a slow-down of 11% in this example. I don't know if in "real"
 examples, the backend would be used (without slow-down) internally.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14535#comment:5>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to