xgi icon indicating copy to clipboard operation
xgi copied to clipboard

no order argument in neighbors()

Open maximelucas opened this issue 2 years ago • 2 comments

It would be useful to get the nodes that share an edge of size d with a given node.

maximelucas avatar Jan 31 '23 15:01 maximelucas

What if a node x is a neighbor of y via two edges of different orders? As a first approximation, we could ofc return y when requesting two different orders. But do we also want an option to get the neighbors of x that ONLY share edges of a certain order?

leotrs avatar Mar 29 '23 07:03 leotrs

By default I would just return y for each order. Say they share an edge of order 1 and one of order 2.

H.nodes.neighbors(x, order=1)
# --> {y}
H.nodes.neighbors(x, order=2)
# --> {y}
H.nodes.neighbors(x, order=3)
# --> {}

When do you think your last suggestion could be useful? We could implement it with a only_order=False argument?

H.nodes.neighbors(x, order=1, only_order=False)
# --> {}
H.nodes.neighbors(x, order=2, only_order=False)
# --> {}
H.nodes.neighbors(x, order=3, only_order=False)
# --> {}

maximelucas avatar Mar 29 '23 09:03 maximelucas