pnnl / HyperNetX

Python package for hypergraph analysis and visualization.
https://hypernetx.readthedocs.io
Other
501 stars 86 forks source link

Same edge name ? #106

Closed vsraptor closed 1 year ago

vsraptor commented 1 year ago

Is it possible for edges with the same name but different nodes to coexist. Something like this :

{
  "is" : ["red","apple","rotten"],
  "is" : ["black","pen"]
}

How do you achieve this ?

brendapraggastis commented 1 year ago

@vsraptor You cannot create a hypergraph where two edges have the same unique identifier. You can draw a hypergraph with the same label on the edges though:

d = {0 : ["red","apple","rotten"], 1 : ["black","pen"]}
h = hnx.Hypergraph(d)
hnx.draw(h,edge_labels={0:"is",1:"is"},edge_labels_kwargs={'fontsize':15})

Screen Shot 2021-08-12 at 5 54 43 PM

You can also attach properties to each hyperedge that store "is" as data. This will be easier in our next release.