#14806: Immutable graph backend
---------------------------------+------------------------------------------
       Reporter:  ncohen         |         Owner:  tbd      
           Type:  enhancement    |        Status:  new      
       Priority:  major          |     Milestone:  sage-5.12
      Component:  PLEASE CHANGE  |    Resolution:           
       Keywords:                 |   Work issues:           
Report Upstream:  N/A            |     Reviewers:           
        Authors:  Nathann Cohen  |     Merged in:           
   Dependencies:  #14805         |      Stopgaps:           
---------------------------------+------------------------------------------
Changes (by ncohen):

  * dependencies:  #14806 => #14805


Old description:

> As the title says, this patch implements a data structure atop of the
> current "static sparse graphs" which can be used as a backend for a Sage
> Graph. Smaller in memory, and faster.
>
> {{{
> sage: g = graphs.CompleteGraph(400)
> sage: gi = Graph(g,data_structure="static_sparse")
> sage: %timeit g.edges()
> 1 loops, best of 3: 512 ms per loop
> sage: %timeit gi.edges()
> 10 loops, best of 3: 30.3 ms per loop
> }}}
>
> Nathann
>
> (not ready for a review yet)

New description:

 As the title says, this patch implements a data structure atop of the
 current "static sparse graphs" which can be used as a backend for a Sage
 Graph. Smaller in memory, and faster.

 {{{
 sage: g = graphs.CompleteGraph(400)
 sage: gi = Graph(g,data_structure="static_sparse")
 sage: %timeit g.edges()
 1 loops, best of 3: 512 ms per loop
 sage: %timeit gi.edges()
 10 loops, best of 3: 30.3 ms per loop
 }}}

 Content of [attachment:trac_14806.patch] :
 * Creates a new sage.graphs.base.static_sparse_backend modules containing
 two classes, StaticSparseCGraph and StaticSparseBackend, as it is done for
 the current sparse/dense backends.
 * Updates the static_sparse_graph data structure to handle labels
 * Updates the constructors of Graph and DiGraph by renaming the ``sparse``
 keyword to ``data_structure`` which can now be set to ``sparse,dense`` or
 ``static_sparse`` (and others later)

 Content of [attachment:trac_14806-keyword.patch] :
 * Deals with the consequences of renaming the keyword, i.e. changes
 doctests everywhere in the graph/ files, and into some other files of Sage
 too.

 Nathann

 Apply:
 * [attachment:trac_14806.patch]
 * [attachment:trac_14806-keyword.patch]

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14806#comment:4>
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/groups/opt_out.


Reply via email to