Closed goznalo-git closed 1 year ago
@goznalo-git HNX 2.0 will be released this coming Saturday on May 13. The return on >>H.nodes is now just the default class message. The return on list(H.nodes) should provide the only ordering you need. Please let us know if the new version does not solve the issue.
Hi there,
I am experiencing a weird behaviour when retrieving the nodelist from the Hypergraph. It is so basic that I do wonder if, rather than being an issue, I am doing something wrong or if I am missing some option, but I can't figure it out.
Take, for instance, the first tutorial notebook. When one runs
H.nodes
, one is returnedEntitySet(:Nodes,['BM', 'JU', 'MP', 'CN', 'TH', 'FN', 'JA', 'BR', 'GP', 'MA', 'JV', 'CH', 'CC'],{'weight': 1.0})
. Notice the ordering of the nodes: that is the same order of, for instance, theH.adjacency_matrix()
matrix.On the other hand, if one runs
list(H.nodes)
orH.nodes.elements
or even prints the nodes in afor node in H.nodes:
loop, one gets a completely different ordering:['FN', 'TH', 'JV', 'BM', 'JA', 'JU', 'CH', 'BR', 'CN', 'CC', 'GP', 'MP', 'MA']
.What am I missing? I think this is confusing, to say the least.
Thanks in advance, G