NetworkX: connect nodes of two separate graphs in Python
问题 This question is about attempting to model interdependent networks with NetworkX. There are dedicated packages (such as Pymnet), but they don't seem as flexible as NetworkX. And by the way, I wanted to give NetworkX one last chance. So, let's say we have 2 separate graphs, G1 and G2, which we plot in the same figure: import networkx as nx import matplotlib.pyplot as plt G1=nx.barabasi_albert_graph(3, 2) #n=3, m=2 (number of initial links) G2=nx.barabasi_albert_graph(3, 2) pos1=nx.spring