Skip to content
Advertisement

Plotting subgraphs identified by connected components

I have detected connected components in my graph. Now I would need to plot them in separate charts for analyzing them individually.As example I am using karate club network, but my network has actually 5 connected components.

JavaScript

I used nx.draw but nothing has been displayed:

JavaScript

Advertisement

Answer

S is not a subgraph but a list of subgraphs so you have to iterate over list even there is only one subgraph (this is the case for karate_club_graph dataset):

JavaScript

karate network

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement