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

added more examples on graphical degree sequence #5634

Merged
merged 9 commits into from Sep 22, 2023

Conversation

Lukong123
Copy link
Contributor

No description provided.

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.

Just a couple suggestions for more compact examples.
Thanks!

networkx/algorithms/graphical.py Outdated Show resolved Hide resolved
networkx/algorithms/graphical.py Outdated Show resolved Hide resolved
@Lukong123 Lukong123 requested a review from dschult May 16, 2022 13:27
@dschult
Copy link
Member

dschult commented May 16, 2022

Would it help to have examples where the sequences are not graphical sequences?
If that is better for another PR we can leave this as it is. I think the examples here all look good.

For example:

>>> nx.is_valid_degree_sequence_havel_hakimi([1, 2, 2])
False

@Lukong123
Copy link
Contributor Author

Would it help to have examples where the sequences are not graphical sequences? If that is better for another PR we can leave this as it is. I think the examples here all look good.

For example:

>>> nx.is_valid_degree_sequence_havel_hakimi([1, 2, 2])
False

Okay, sir.
If I am getting you correctly, apart from the examples where the sequences are graphical, another set of examples should be added where the sequences are not graphical?

@dschult
Copy link
Member

dschult commented May 16, 2022

Yes, that is what I was thinking. I'm hoping that they would be very simple and short examples.

@Lukong123
Copy link
Contributor Author

Yes, that is what I was thinking. I'm hoping that they would be very simple and short examples.

Okay sir

@MridulS
Copy link
Member

MridulS commented Jul 5, 2022

@Lukong123 just a gentle ping, let me know if you have the time to add the non graphical sequence examples in this PR. If not, no worries we can do a new PR with those examples :)

@Lukong123
Copy link
Contributor Author

@Lukong123 just a gentle ping, let me know if you have the time to add the non graphical sequence examples in this PR. If not, no worries we can do a new PR with those examples :)

Hello, please is it still open to to work on this.

@MridulS
Copy link
Member

MridulS commented Sep 20, 2023

Hello, please is it still open to to work on this.

Yes! Please feel free to add more examples here.

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.

IMO the addition of examples is an improvement - I'd vote to add/modify the examples in followup PRs!

@rossbar
Copy link
Contributor

rossbar commented Sep 21, 2023

FWIW I pushed up a few minor fixups (var-renaming, rm extra spaces) and rebased on main to get the CI updated without screwing up the diff.

@dschult
Copy link
Member

dschult commented Sep 22, 2023

Thanks for the updates.
To add the non-graphical examples, one way to proceed would be to add 1 to the last entry in the sequence.
That requires making sequence a list instead of a generator. Then adding something like this should do it.

    >>> sequence[-1] += 1
    >>> nx.is_multigraphical(sequence)
    False

@MridulS
Copy link
Member

MridulS commented Sep 22, 2023

@dschult Let's create a good first issue out of it :)

@MridulS MridulS merged commit 54fd372 into networkx:main Sep 22, 2023
38 checks passed
@MridulS
Copy link
Member

MridulS commented Sep 22, 2023

Thanks @Lukong123!

@jarrodmillman jarrodmillman added this to the 3.2 milestone Sep 22, 2023
Alex-Markham pushed a commit to Alex-Markham/networkx that referenced this pull request Oct 13, 2023
* example on is_digraphical

* reformatted

* example on psedographical

* example on is valid degree sequence erdos gallai

* example on is valid degree sequence havel hakimi

* multigraph

* adjuseted error on is_multigraph

* siplified the code

* Minor touchups.

---------

Co-authored-by: Ross Barnowski <rossbar@caltech.edu>
dschult pushed a commit to BrunoBaldissera/networkx that referenced this pull request Oct 23, 2023
* example on is_digraphical

* reformatted

* example on psedographical

* example on is valid degree sequence erdos gallai

* example on is valid degree sequence havel hakimi

* multigraph

* adjuseted error on is_multigraph

* siplified the code

* Minor touchups.

---------

Co-authored-by: Ross Barnowski <rossbar@caltech.edu>
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
* example on is_digraphical

* reformatted

* example on psedographical

* example on is valid degree sequence erdos gallai

* example on is valid degree sequence havel hakimi

* multigraph

* adjuseted error on is_multigraph

* siplified the code

* Minor touchups.

---------

Co-authored-by: Ross Barnowski <rossbar@caltech.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

5 participants