Skip to content
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

py3: avoid sorting vertices and edges in method treewidth #27009

Closed
dcoudert opened this issue Jan 3, 2019 · 10 comments
Closed

py3: avoid sorting vertices and edges in method treewidth #27009

dcoudert opened this issue Jan 3, 2019 · 10 comments

Comments

@dcoudert
Copy link
Contributor

dcoudert commented Jan 3, 2019

We avoid sorting vertices, edges and connected components. The code is better this way, and this fixes a doctest error with py3.

CC: @tscrim @fchapoton

Component: graph theory

Author: David Coudert

Branch/Commit: f830eb9

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/27009

@dcoudert dcoudert added this to the sage-8.6 milestone Jan 3, 2019
@dcoudert
Copy link
Contributor Author

dcoudert commented Jan 3, 2019

Commit: f830eb9

@dcoudert
Copy link
Contributor Author

dcoudert commented Jan 3, 2019

New commits:

f830eb9trac #27009: avoid sorting in method treewidth

@dcoudert
Copy link
Contributor Author

dcoudert commented Jan 3, 2019

Branch: public/27009_treewidth

@tscrim
Copy link
Collaborator

tscrim commented Jan 3, 2019

comment:2

Why do you use for v in G.vertices(sort=False): instead of one of the iterators?

Other than that LGTM.

@dcoudert
Copy link
Contributor Author

dcoudert commented Jan 3, 2019

comment:3

The graph is modified inside the loop over all vertices, so I cannot use an iterator here (at least it's safer this way).
So we can use either G.vertices(sort=False) or list(G).

@tscrim
Copy link
Collaborator

tscrim commented Jan 3, 2019

comment:4

Okay, thanks for the explanation. LGTM.

@tscrim
Copy link
Collaborator

tscrim commented Jan 3, 2019

Reviewer: Travis Scrimshaw

@dcoudert
Copy link
Contributor Author

dcoudert commented Jan 3, 2019

comment:5

Thank you for the reviews and happy new year !

@embray
Copy link
Contributor

embray commented Jan 15, 2019

comment:6

Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.

@embray embray modified the milestones: sage-8.6, sage-8.7 Jan 15, 2019
@vbraun
Copy link
Member

vbraun commented Jan 22, 2019

Changed branch from public/27009_treewidth to f830eb9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants