I have a pandas dataframe df which looks as follows:
From To
0 Node1 Node2
1 Node1 Node3
2 Node2 Node4
3 Node2 Node5
4 Node3 Node6
5 Node3 Node7
6 Node4 Node8
7 Node5 Node9
8 Node6 Node10
9 Node7 Node11
df.to_dict() is:
{'From': {0: 'Node1',
1: 'Node1',
2: 'Node2',
3: 'Node2',
4: 'Node3',
5: 'Node3',
6: 'Node4',
7: 'Node5',
8: 'Node6',
9: 'Node7'},
'To': {0: 'Node2',
1: 'Node3',
2: 'Node4',
3: 'Node5',
4: 'Node6',
5: 'Node7',
6: 'Node8',
7: 'Node9',
8: 'Node10',
9: 'Node11'}}
I have plotted this pandas dataframe as a network graph using networkx package which looks as follows:

I want to get the list of unique scenarios/branches from this network graph. There are four branches here starting from Node1.
Node1-Node2-Node4-Node8
Node1-Node2-Node5-Node9
Node1-Node3-Node6-Node10
Node1-Node3-Node7-Node11
How can I get the list of the branches above from the given pandas dataframe in Python?
