-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
Graph.is_eulerian fails when the graph contains a connected component with non-comparable vertices #35168
Closed
2 tasks done
Labels
Comments
Thanks for reporting this bug. The fix is rather simple. |
4 tasks
2 tasks
vbraun
pushed a commit
that referenced
this issue
Mar 26, 2023
### 📚 Description Fixes #35168. We set parameter `sort` to `False` when calling `connected_components`. This fixes the bug as we avoid sorting vertices with different types. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies None URL: #35170 Reported by: David Coudert Reviewer(s): Marc Mezzarobba
vbraun
pushed a commit
that referenced
this issue
Jun 3, 2023
… vertices ### 📚 Description As illustrated by the following code, the method `adjacency_matrix` of the GenericGraph class failed when vertices where not sortable. ```python G = Graph() G.add_vertices ([14, 'test']) G.adjacency_matrix() ``` I fixed the problem by using `sort=False` instead of `sort=True` in the line that get the list of vertices. I did not open an issue for this bug, but it is similar to #35168 (fixed by PR #35170) **NOTE** I started to write a test to cover the changes but all others test are broken by this small commit. Indeed the adjacency matrix obtained with the new code can have a different row/column order. I am not sure what is the correct way to handle this situation ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies URL: #35245 Reported by: cyrilbouvier Reviewer(s): cyrilbouvier, David Coudert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Did you read the documentation and troubleshoot guide?
Environment
Steps To Reproduce
Expected Behavior
Actual Behavior
Additional Information
When a graph contains vertices that are non comparable (like integers and strings) in the same connected components, calling
is_eulerian
on this graph raises aTypeError
.The text was updated successfully, but these errors were encountered: