I have bipartite graph and I would like to extract the bipartite complement of this graph. This is the G' graph explained in this link :
I tried to do it in using the complement algorithm of the Networkx library but I got edges between my vertices A and B that shouldn't be connected because in bipartite graph there are no edges between a same group of vertices.
Here is the code that I tried :
from networkx.algorithms.operators.unary import complement
B = bipartite.random_graph(5, 7, 0.2)
B = complement(B)
But I have got connections into same group of vertices. Is there a networkx function or Python function that handle it ?