Why My Graphs Are Not Bipartite, Thought I Create Them As Bipartite Using Corresponding Networkx Function?
Solution 1:
You've assigned the nodes an attribute bipartite=0
or 1
. However, that's just an attribute of the nodes. You can assign them any attribute you want, with any name (a color, a weight, a species name, etc) - it has no impact on what edges exist. In particular, there's no special attention paid to the name of the attribute. You've named an attribute 'bipartite'
, but as far as the networkx commands are concerned you could have just as easily named that attribute 'fubar'
. It doesn't care.
You added an edge between nodes 1 and 2. Networkx won't look at the attributes of the graph and make a choice to refuse to allow you the edge you asked it to create.
In your case, I think the answer to your question is that there doesn't seem to be a point in setting an attribute named 'bipartite'
.
Post a Comment for "Why My Graphs Are Not Bipartite, Thought I Create Them As Bipartite Using Corresponding Networkx Function?"