xgi
xgi copied to clipboard
no order argument in neighbors()
It would be useful to get the nodes that share an edge of size d with a given node.
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?
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)
# --> {}