Conversion from nx.Graph to ig.Graph in utils.__from_nx_to_igraph breaks when there are isolates (nodes without edges) present. It throws the following error:
networkx.exception.AmbiguousSolution: Disconnected graph: Ambiguous solution for bipartite sets.
Describe the bug
Conversion from
nx.Graph
toig.Graph
inutils.__from_nx_to_igraph
breaks when there are isolates (nodes without edges) present. It throws the following error:networkx.exception.AmbiguousSolution: Disconnected graph: Ambiguous solution for bipartite sets.
To Reproduce
Steps to reproduce the behavior:
CDlib version
0.3.0
Operating System
macOS Monterey 12.5.1
Python version
3.11.0
Version(s) of CDlib required libraries
angelcommunity == 2.0.0
demon == 2.0.6
dynetx == 0.3.2
eva-lcd == 0.1.1
markov-clustering == 0.0.6.dev0
matplotlib == 3.8.1
networkx == 3.1
nf1 == 0.0.4
numpy == 1.25.2
pandas == 2.1.1
pooch == 1.8.0
pulp == 2.7.0
python-igraph == 0.10.8
python-levenshtein == 0.23.0
python-louvain == 0.16
scikit-learn == 1.3.2
scipy == 1.11.3
seaborn == 0.13.0
thresholdclustering == 1.1
tqdm == 4.66.1
Expected behavior Conversion to igraph.Graph should succeed, error free.