xgi-org / xgi

CompleX Group Interactions (XGI) is a Python package for higher-order networks.
https://xgi.readthedocs.io
Other
182 stars 30 forks source link

Random edge position for dyads? #396

Closed nwlandry closed 1 year ago

nwlandry commented 1 year ago

I was noticing that the edge positions of dyads is random and not according to the spring layout:

Screenshot 2023-06-09 at 8 42 21 AM

I think this is because spring layout is using _augmented_projection which excludes dyads.

Is this desired behavior, or should we use convert.to_bipartite_graph so that dyads also have nodes?

thomasrobiglio commented 1 year ago

Actually the positions are computed after adding phantom nodes also for dyads, but those added phantom nodes make it so that the positions that are assigned are different than those that would be assigned if we used the spring_layout on the hypergraph obtained by converting the DH.

Anyway it would be nice to modify the draw_dihypergraph function in order to take a pos like the other drawing functions (it would allow e.g. to draw a DH and its skeleton/converted HG with the same positions and/or to use the different layouts we have).