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

Add example for cycle detection #6560

Merged
merged 8 commits into from Jan 17, 2024

Conversation

PurviChaurasia
Copy link
Contributor

Added an example script to explain and highlight cycles in a graph using the find_cycle function.

Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Thanks @PurviChaurasia , I took the liberty of making some minor tweaks, but this example LGTM!

@dschult dschult reopened this Jan 15, 2024
Copy link
Member

@dschult dschult left a comment

Choose a reason for hiding this comment

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

I reopened this PR because I was about to approve it as well.
I'm thinking that it might be confusing to call nx.find_cycles twice because the cycle returned may be different. See suggestion below.

examples/algorithms/plot_cycle_detection.py Outdated Show resolved Hide resolved
@dschult dschult merged commit 40e84a4 into networkx:main Jan 17, 2024
39 checks passed
@jarrodmillman jarrodmillman added this to the 3.3 milestone Jan 17, 2024
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
* Fix negative edge cycle function raising exception for empty graph and added relevant test function

* Unresolved change

* Added example script to visualize GOT network

* Added example script to visualize cycle detection

* Deleted got.py

* Minor tweaks to example.

* Update examples/algorithms/plot_cycle_detection.py

---------

Co-authored-by: Ross Barnowski <rossbar@caltech.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
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.

None yet

4 participants