small cleanup in graphic_matroid#41649
Conversation
|
Documentation preview for this PR (built with commit 2fd30a1; changes) is ready! 🎉 |
There was a problem hiding this comment.
variable vertex_list is no longer used in this method.
dcoudert
left a comment
There was a problem hiding this comment.
LGTM.
other proposed changes can be done in a separate PR.
| leaf_edges = [e for e in edge_set | ||
| if degree[e[0]] == 1 or degree[e[1]] == 1] | ||
| while leaf_edges: | ||
| for leaf in leaf_edges: |
| degree[leaf[0]] -= 1 | ||
| degree[leaf[1]] -= 1 | ||
| leaf_edges = [e for e in edge_set | ||
| if degree[e[0]] == 1 or degree[e[1]] == 1] |
There was a problem hiding this comment.
Just a note: this seems suboptimal.
There was a problem hiding this comment.
This problem can be solved in
The current implementation has time complexity in leaf_edges is repeated only a few times.
just a very small-scale cleanup in the modified file ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#41649 Reported by: Frédéric Chapoton Reviewer(s): David Coudert, Frédéric Chapoton, gmou3
This follows the change in `graphic_matroid.pyx`: sagemath#41649
sagemathgh-41649: small cleanup in graphic_matroid just a very small-scale cleanup in the modified file ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#41649 Reported by: Frédéric Chapoton Reviewer(s): David Coudert, Frédéric Chapoton, gmou3
sagemathgh-41651: refactor: collapse `M = <def>; return M` to `return <def>` This follows the change in `graphic_matroid.pyx`: sagemath#41649. URL: sagemath#41651 Reported by: gmou3 Reviewer(s): David Coudert, Frédéric Chapoton
sagemathgh-41651: refactor: collapse `M = <def>; return M` to `return <def>` This follows the change in `graphic_matroid.pyx`: sagemath#41649. URL: sagemath#41651 Reported by: gmou3 Reviewer(s): David Coudert, Frédéric Chapoton
just a very small-scale cleanup in the modified file
📝 Checklist