#15278: Hash and equality for graphs
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-5.13
Component: graph theory | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/SimonKing/ticket/15278 | 07bad466ab9a3e2ffe82c142cc6d0c515f1ae452
Dependencies: #12601, #15491 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
> Shouldn't named graphs be immutable?
Please no !
> I would expect that in order to modify something "named", one should
create a mutable copy first.
Yep. So when you add a vertex, the graph's name should change or be
removed ? Or would you remove the name attribute itself for mutable graphs
? Or would you drop the name of a graph when it is converted to a mutable
copy ?
If this is to be done someday (all named graphs made immutable), it will
be after a very simple task : I want to be sure *first* that all current
methods will work fine on immutable graphs. And I am 100% sure that it is
*not* the case at the moment.
Because many graph methods can take a copy of self and modify it. But if
self is immutable the copy will be immutable too, and no edge/vertices can
be touched on the copy either. And these methods have not been written
while taking this into account. And all these functions *will* break on
immutable graphs.
We already had the experience of "bipartite graphs", a new class of graph
that made sure all graphs stayed bipartite. Sometimes, adding an edge
would raise an exception because such an edge couldn't be added while
keeping the graph bipartite. This class was hell. Making it the default
class of `graphs.CompleteBipartiteGraph` would have been hell too.
So please, the named graphs stay mutable for the moment, unless this job
is done responsibly.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:27>
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.