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

[joss] Bad result from degree() method with self loops #517

Closed
szhorvat opened this issue Dec 4, 2021 · 0 comments · Fixed by #518
Closed

[joss] Bad result from degree() method with self loops #517

szhorvat opened this issue Dec 4, 2021 · 0 comments · Fixed by #518
Labels
bug Something isn't working

Comments

@szhorvat
Copy link

szhorvat commented Dec 4, 2021

The .degree() method returns incorrect (or at least very unusual) results for undirected graphs with self-loops.

Example:

g3 = rx.PyGraph()
g3.extend_from_edge_list([(0,1), (0,0)])

g3.degree(0)
2

The correct result is 3. Note that the degree is not the same as the number of incident edges. It is the number of edge endpoints.

Certainly, one may reinterpret the meaning of "degree", but diverging from the de-facto standard textbook definition is not a good idea. It is going to be extremely confusing for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants