-
Notifications
You must be signed in to change notification settings - Fork 33
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
wrong degree count with singleton #190
Comments
I think the rationale is that 4 belongs to one (singleton) edge. So in a
way, it is correct. The fix would be to add a parameter "ignore_singletons"
as is done elsewhere in the codebase.
…On Wed, Oct 5, 2022, 4:55 PM Maxime Lucas ***@***.***> wrote:
Running
HH = xgi.Hypergraph([{1, 2, 3}, {4}, {5, 6}, {6, 7, 8}])xgi.degree_counts(HH)
outputs [0, 7, 1].
It is even our test:
https://github.com/ComplexGroupInteractions/xgi/blob/c262f406cf13e3d51e7b40e5534fbfcca223caff/tests/classes/test_function.py#L58
).
But node 4 does not have any neighbour, so degree 0 should have count 1:
the output should be [1, 6, 1].
—
Reply to this email directly, view it on GitHub
<#190>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILYAARUKLWDY4CWW5UUK3WBWJGXANCNFSM6AAAAAAQ5U76IA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sure I agree that 4 is a singleton edge here. I would say 0 because node 4 has no neighbour (not connected by any node by an edge). |
It comes down to a matter of semantics/perspective. Is the degree the number of neighboring nodes? If so, do you count repetitions (when a neighbor appears in many different edges)? Or is the degree defined as the number of edges a node belongs to? Since we are using the bipartite representation, I'd say the degree of a node in the hypergraph should just be the degree of the node in the bipartite representation, and in this case it is 1 because it belongs to exactly one hyperedge, which just happens to be a singleton. But that's just my opinion and I'm happy to be convinced otherwise :) |
Ok I see where this is coming from now, thanks. |
Agreed, let's put it in the agenda. |
I can totally share Max's doubts, but I also completely agree with the "clean" definition by Leo of degree as given by the bipartite. I would say that the only thing really needed at this point is to stress this example as much as possible in the documentation ;) |
Agreed, at this point we should just pick one and stick with it. (Though, if I may add one more data point: in graphs with self-loops, usually a node's degree is increased by 2 if it has a self-loop...) |
If I remember correctly, we decided to simply add an explanation in the docstring for this, right? |
Yes! |
Running
outputs
[0, 7, 1]
.It is even our test: https://github.com/ComplexGroupInteractions/xgi/blob/c262f406cf13e3d51e7b40e5534fbfcca223caff/tests/classes/test_function.py#L58).
But node 4 does not have any neighbour, so degree 0 should have count 1: the output should be
[1, 6, 1]
.The text was updated successfully, but these errors were encountered: