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
Bipartite graphs should not accept loops #23275
Comments
comment:1
I don't know which is the best place to forbid loops in |
comment:2
I did some trials and I discovered hidden issues in the Don't know what to do :( |
comment:3
Replying to @dcoudert:
A bit of reading suggests that this is intentional behavior on the For bipartite graphs, the offending code that adds loops is
because if So
But that might be overreaching. |
comment:4
I fully agree. The graph module is one of the best of sagemath for the quality of its documentation, but it's not enough. An effort was started here #19477 but not finalized.
I was thinking to implement something like that. One of my concern is the use of
|
Commit: |
comment:5
This fixes some of the issues but it's neither a smart solution nor a complete fix. Indeed, the following example should raises an error and not silently remove loops, no ?
At least, we can't add loops.
New commits:
|
Branch: u/dcoudert/23275 |
Author: David Coudert |
comment:7
anyone to review ? |
comment:8
It does what it says it does, although I should note that the module can still be fooled into accepting loops.
|
Reviewer: Zachary Gershkoff |
comment:9
To avoid that, we should make a backend
The method |
Changed branch from u/dcoudert/23275 to |
Changed commit from |
Changed reviewer from Zachary Gershkoff to Zach Gershkoff |
Loops should not be allowed in a bipartite graph, but we can currently do:
When adding edges in a different order, the behavior is more consistent.
CC: @tscrim @sagetrac-zgershkoff
Component: graph theory
Author: David Coudert
Branch:
3c0c3d4
Reviewer: Zach Gershkoff
Issue created by migration from https://trac.sagemath.org/ticket/23275
The text was updated successfully, but these errors were encountered: