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?
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 tok
, then I put1
in the K matrix,0
otherwise.1
denotes that the two given nodes are neighbors, and0
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 theH.nodes
method. The total nodes are very less than the total nodes given by theH.nodes
method,Also, I tried the example graph given in the documentation of the library. It has 13 nodes and 8 hyperedges.
H.nodes
andH.edges
methods show the correct number of nodes and edges for this graph.Can't I use the defined K matrix for hypergraph generation?