I have a graph that has many subgraphs. I have some edges that connect two nodes in both directions, that is, A-->B and B-->A. The bidirectionality is important, as it represents a lack of knowledge on our part as to whether A goes to B or B goes to A, and we have no easy way of determining which is the correct one.
I'd like to know how many subgraphs there are, and output to a Pandas DataFrame the edges in each subgraph. However, NetworkX only takes in undirected graphs in the provided connected_components_subgraph(G) function. When I convert the graph to an undirected graph, I can use connected_components_subgraph() to get the nodes in each edge, but I lose edge directionality.
Is there an easy way to do what I'm trying to achieve?