HyperNetX icon indicating copy to clipboard operation
HyperNetX copied to clipboard

Nodes in a Hypergarph via H.nodes

Open khizer-hayat opened this issue 3 years ago • 1 comments

I tried to generate a hypergraph using node neighborhood information from a matrix K of size |N| x |N|. Using the simple graph edges list, if the length (distance) of two given nodes is less than or equal to k, then I put 1 in the K matrix, 0 otherwise. 1 denotes that the two given nodes are neighbors, and 0 denotes that nodes are not neighbors. After generating the K matrix, I used it to represent hyperedges where each row of K represents the neighborhood of a particular node. (a hyperedge).

The problem is, after generating a hypergraph, it shows the correct number of hyperedges using the H.edges method, however, it gives the wrong number of nodes using the H.nodes method. The total nodes are very less than the total nodes given by the H.nodes method,

Also, I tried the example graph given in the documentation of the library. It has 13 nodes and 8 hyperedges. H.nodes and H.edges methods show the correct number of nodes and edges for this graph.

Can't I use the defined K matrix for hypergraph generation?

khizer-hayat avatar Jul 26 '22 20:07 khizer-hayat

Thank you for raising this issue. Would you please share your code so that we can reproduce your error and provide further support?

madelynshapiro avatar Aug 29 '22 17:08 madelynshapiro

Resolved

brendapraggastis avatar Aug 08 '24 06:08 brendapraggastis