Skip to content

Add benchmarks for is_regular. - #8173

Merged
dschult merged 1 commit into
networkx:mainfrom
rossbar:is-regular-bench-complete-graph
Aug 4, 2025
Merged

dschult merged 1 commit into
networkx:mainfrom
rossbar:is-regular-bench-complete-graph

Conversation

@rossbar

@rossbar rossbar commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Benchmark cases included directed and undirected complete graphs (regular) as well as graphs with one edge removed (not regular) to test early termination.

Relevant for #8138

Benchmark cases included directed and undirected complete graphs (regular)
as well as graphs with one edge removed (not regular) to test early
termination.

@Peiffap Peiffap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks Ross!

Comment on lines +39 to +41
G = nx.complete_graph(n)
if directed:
G = G.to_directed()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit

Suggested change
G = nx.complete_graph(n)
if directed:
G = G.to_directed()
G = nx.complete_graph(n, create_using=nx.DiGraph if directed else nx.Graph)

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me!
Thanks!

@dschult
dschult merged commit e9ecdff into networkx:main Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants