Closed michaeldorner closed 2 years ago
Thanks for bringing up the issue, @michaeldorner. Our first goal was to get a static version out to speed up construction, but the need for elements/memberships in constant time remains. That is on the workbench now and we have a couple of possible solutions and hope to push a more performant version within the next 6 weeks. For now I am afraid the original (dynamic) hypergraph is faster for look up of incident edges. If you have ideas or code snippets you would like to suggest, please send them. We will be watching.
@michaeldorner We have solved this in v1.1 by adding a .memberships attribute to the nodes of a static hypergraph. Note that for dynamic hypergraphs the information is stored with each entity. For static hypergraphs the information is stored by the StaticEntitySet: Use: H.nodes.memberships[node_uid]
Hi, Maybe I am just blind (and/or stupid), but how can I identify (easily) all hyperedges of a given node
n
in a (static) hypergraphH
in HyperNetX?The solution I came up is:
[edge for edge, nodes in H.incidence_dict.items() if n in nodes]
But probably you had another, more performant solution in mind? Thank you!