-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equal hashes for non-isomorphic bipartite graphs with edge labels #33255
Comments
This comment has been minimized.
This comment has been minimized.
comment:4
The docstring for
So this is not a bug in the method, but I can see that this could be unexpected behavior. Perhaps a warning should be given when edge labels are put on an unweighted graph, or perhaps the documentation should be clarified. |
comment:5
Simpler examples:
|
This comment has been minimized.
This comment has been minimized.
comment:6
The manipulation of edge labels is not simple since labels might not be hashable. For instance, a label can be a |
comment:7
A related issue is the name of this option. What is called Should there be consistency in the naming of this option? |
comment:8
Documentation says:
So, the default value is not |
comment:9
I want to clarify what fix is expected for this ticket:
|
comment:10
Replying to @enjeck:
Yes, this would be great! |
comment:11
I disagree with the proposed change of behavior of parameter Parameter May be others have a different opinion ? |
Branch: u/gh-Bruno-TT/bipartite-hashes |
Commit: |
comment:14
There was never a unanimous consensus on how to handle the weight/labelling logic, so I've implemented a suggestion. My implementation adds an optional boolean parameter hash_labels to the class constructor, which if left empty will default to None and warn the user upon hash() invocation, and then include labels in the hash. Let me know what you guys think. (I'm new to the project so please feel free to give criticism, I'm assuming I've somehow misused trac). |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/gh-Bruno-TT/bipartite-hashes to public/graphs/33255 |
comment:32
I did several corrections / improvements. It currently passes tests, but I may have missed some cases. I'll check the copy method asap. It's not obvious how to endup with a clean solution. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:34
This should do the job. Roughly, if parameter In another ticket, we can change the default behavior of returning self when asking for a copy of an immutable graph without changing parameters. |
Ready for review. |
Removed branch from issue description; replaced by PR #35146. |
Removed the status label – there's no need to have it on both PR and Issue. |
The following code illustrates the problem that two bipartite graph
B1
andB2
(both canonically labeled) are claimed to be equal and have equal hashes, while they are NOT isomorphic, let alone equal, as labeled graphs.When labels are ignored, these graphs are isomorphic, and so the problem may be caused by equality testing /
hash()
function somehow ignoring edge labels.Component: graph theory
Issue created by migration from https://trac.sagemath.org/ticket/33255
The text was updated successfully, but these errors were encountered: