Hi I'm trying to project a bipartite graph (B) using Networkx's projected_graph but due to memory constraints (B has more than 140K nodes), this keeps crashing. I tried a matrix multiplication using a sparse matrix for computing the adjacency matrix but due to my matrix not being sparse enough, that didn't work either. Can anyone please help with this?
import networkx as nx
from networkx.algorithms import bipartite
B.add_nodes_from(inmates_list, bipartite=0)
B.add_nodes_from(cells_list, bipartite=1)
inmates = set(n for n,d in B.nodes(data=True) if d['bipartite']==0)
cells = = set(B) - inmates
G = bipartite.projected_graph(B, inmates)