#14535: Mutability of Graphs
------------------------------------+---------------------------------------
Reporter: SimonKing | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
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 ncohen):
> It would be nice to have a better solution, but, as for matrices, I do
think it would be good to be able to use graphs as keys in dictionaries
''without'' a hack.
And you would trade `10%` of speed for that ? `O_o`
Really, the only way I see to do this properly is to write an immutable
backend...
> Then we may have different notions of "backend". By "backend", I
understood the stuff that is assigned to `G._backend` and is defined in
sage.graphs.base.graph_backends`.
Oh. Sorry, then. I call backend whatever is in the `base/` folder, but
perhaps that isn't right. In any case :
{{{
sage: type(Graph()._backend)
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
}}}
> You think it might be better to move all mutability checks into the
backend? I thought so as well, initially.
Yep. Looks much cleaner !
> But then I found that a couple of add_* methods first change some data
''outside'' of the backend, and call the backend method only later.
Oh ? Like which ones ? `O_o`
> So, I thought it is safer to check mutability not in the backend, but in
the graph.
>
> I would prefer to deal with it in the backends.
+1.
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14535#comment:10>
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.