简体   繁体   中英

How to find subgraphs of strongly connected components using networkx

as nx.strongly_connected_component_subgraphs() is now removed in version 2.4, I have tried using (G.subgraph(c) for c in strongly_connected_components(G)) similar to what we do for connected component subgraphs. but this just shows strongly_connected_component_subgraphs is deprecated. What to do for strongly connected subgraphs in.networkx? sorry if this question is repeated.

Using nx.strongly_connected_components as in your shared approach, should be fine:

(G.subgraph(c) for c in nx.strongly_connected_components(G))

This function is included in the latest version, 2.5 , and does not rely on any other deprecated methods, as you can see in the source code . So make sure you aren't using the method that is actually raising the deprecation warning, nx.strongly_connected_component_subgraphs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM