I have a Graph (G) where nodes are split into two distinct subgraphs (H, I). The nodes within each subgraph are interconnected. What I'm looking for is a list of edges that are connections between the subgraphs and only those in a way thats somewhat scaleable to big graphs.
Setup:
import networkx as nxG = nx.path_graph(10)H = nx.subgraph(G, [0,1,2,3,4])I = nx.subgraph(G, [5,6,7,8,9])G.add_edge(1,7)G.add_edge(2,9)Output I want:
[(4,5),(1,7),(2,9)]
