#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 | c774057bf07b2da8539f2395555b2062428874f4
Dependencies: #12601 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Replying to [comment:11 ncohen]:
> * About not requiring `allows_multiple_edges` and `allows_loops` to be
equal :
It will probably be fine to keep them in `__eq__`, as they simply ask for
the backend's opinion, and the static backend hopefully has no changeable
mind.
> * About `.weighted()` : looks like the meaning of "weighted" is only
used in
> `spanning_tree.pyx`. And I'd say that this can easily be replaced by
an
> additional argument to the methods (as it is already the case in many
others,
> like `flow` of `traveling_salesman_problem`)
OK, but removing ".weighted()" from `__eq__` could be done later, I
believe.
> * I don't see any problem with using #12601. Do you see one ?
Nope.
> * Why didn't you use the decorators from your first immutable graph
patch to
> deal with immutability in `.weighted()` ?
With the decorator, an error would be raised whenever `.weighted()` is
called on a mutable graph. However, `.weighted` only mutates the graph if
it has an argument. `G.weighted()` will not change `G`, but will only tell
whether `G` is weighted or not. I am not using the decorator in order to
preserve this behaviour.
Best regards,
Simon
--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:15>
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.