Networkx Strongly Connected Components for Undirected Graphs
1,761 views
Skip to first unread message
Ayushi Dalmia
unread,
Mar 20, 2016, 4:28:28 PM3/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to networkx-discuss
Hi,
I am running the following piece of code on Networkx 1.6 and Networkx 1.11
import networkx as nx
G = nx.Graph()
G.add_edges_from([(1,2),(1,3)])
nx.strongly_connected_components((G))
The code runs fine on version 1.6 but raises an exception as: networkx.exception.NetworkXNotImplemented: not implemented for undirected type
How can I fix this?
Thanks and regards,
Ayushi
Aric Hagberg
unread,
Mar 20, 2016, 4:29:57 PM3/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to networkx...@googlegroups.com
Since you have an undirected graph you should use nx.connected_components(G).
The algorithm in nx.strongly_connected_components is for directed graphs.