#18834: Use Sage to compute clustering coefficient
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.8
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  8c25063de223a611c202d937d828c78cf0db8bce
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/18834         |
   Dependencies:         |
  #18811                 |
-------------------------+-------------------------------------------------

Comment (by ncohen):

 A more correct fix.

 About the difference in timings:

 {{{
 sage: g=graphs.RandomBarabasiAlbert(10000,2)
 sage: %timeit _ = g.clustering_coeff()
 10 loops, best of 3: 96.8 ms per loop
 sage: from sage.graphs.base.static_sparse_graph import triangles_count
 sage: %timeit _ = triangles_count(g)
 10 loops, best of 3: 70 ms per loop
 }}}

 It seems that a nontrivial part of the difference in timing is taken by
 the construction of the.... final dictionary. Profiling the algorithm does
 not show a major cost of the actual algorithm.. So well, it seems that
 this graph is so easy to deal with that returning the result is not
 negligible `:-P`

 Nathann

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

Reply via email to