如何使用networkx查找强连接组件的子图

由于class(data$Feature) 在版本2.4中已被删除,因此我尝试使用nx.strongly_connected_component_subgraphs(),类似于对连接的组件子图所做的操作。但这仅表明Strong_connected_component_subgraphs已弃用。对networkx中的强连接子图怎么办?很抱歉,如果这个问题再次出现。

iCMS 回答:如何使用networkx查找强连接组件的子图

在您的共享方法中使用nx.strongly_connected_components应该没问题:

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

此功能包含在latest version,2.5中,并且不依赖于任何其他不推荐使用的方法,正如您在source code中看到的那样。因此,请确保您没有使用实际上引发过时警告的方法nx.strongly_connected_component_subgraphs

本文链接:https://www.f2er.com/1519575.html

大家都在问