Commit
2 years ago
gh-35245: GenericGraph.adjacency_matrix: using sort=True when getting 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: https://github.com/sagemath/sage/pull/35245 Reported by: cyrilbouvier Reviewer(s): cyrilbouvier, David Coudert
Author
Release Manager
Loading