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

Make chordal_graph_cliques a generator #5758

Merged

Conversation

juanis2112
Copy link
Contributor

No description provided.

@MridulS MridulS added this to the networkx-3.0 milestone Jun 15, 2022
Comment on lines +205 to +207
>>> cliques = [c for c in chordal_graph_cliques(G)]
>>> cliques[0]
frozenset({1, 2, 3})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay because, though the ordering of the cliques is arbitrary, it should be consistent between function calls. If we wanted to be extra sure though, we could use sorted to guarantee the ordering, e.g.

Suggested change
>>> cliques = [c for c in chordal_graph_cliques(G)]
>>> cliques[0]
frozenset({1, 2, 3})
>>> cliques = sorted(chordal_graph_cliques(G))
[frozenset({1, 2, 3}),
frozenset({2, 3, 4}),
frozenset({3, 4, 5, 6}),
frozenset({7, 8}),
frozenset({9})]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't a blocker though, we can always fix this up in a follow-up PR!

@rossbar rossbar force-pushed the make-chordal-graph-cliques-generator branch from e4e2928 to f20c854 Compare June 16, 2022 09:39
@rossbar rossbar merged commit 4a64bab into networkx:main Jun 16, 2022
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Make chordal_graph_cliques a generator

Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
Make chordal_graph_cliques a generator

Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants