DeepHypergraph icon indicating copy to clipboard operation
DeepHypergraph copied to clipboard

BUG: hg.add_hyperedges can add edges out of vertex index

Open realxuyang opened this issue 2 years ago • 1 comments

img_v2_11a5a161-6140-42a5-92eb-fc68335b32ag

realxuyang avatar Sep 28 '22 06:09 realxuyang

Clearly, the vertex index in your hypergraph is larger than the maximum number of vertices: 31 > num_v=21. Please check your edge_list data. We will add the vertex index verification to guarantee each vertex in hyperedge is no larger than the maximum number of vertices in the next version DHG.

yifanfeng97 avatar Sep 28 '22 07:09 yifanfeng97

Could function for node type transformation, I mean ('str' -> 'int'), be added before constructing the hyperedges?

mgao97 avatar Oct 26 '22 06:10 mgao97

We provide some util functions for transforming 'str', and 'int' into an ordered and continuous range. The input can be an edge list or an adjacency list. The structure can be a simple graph or a bipartite graph. Maybe these functions can help you. https://deephypergraph.readthedocs.io/en/0.9.2/api/utils.html#dhg.utils.remap_edge_list

yifanfeng97 avatar Oct 26 '22 13:10 yifanfeng97

Looks good! I will try to use these functions.

mgao97 avatar Oct 26 '22 16:10 mgao97