[英]How can I segment out disconnected regions of nodes (arc nodes?) in a graph network?
The image below shows the Node-Edge graph.下图显示了节点边缘图。
I would like to segment out clusters of nodes into separate graphs as shown below.我想将节点集群分割成单独的图形,如下所示。 Nodes 4, 5 are not part of the reset of the graph.
节点 4、5 不是图形重置的一部分。 How can I do this algorithmically for an arbitrary graph network?
如何在算法上为任意图形网络执行此操作?
I am using python 3.8 and windows 10.我正在使用 python 3.8 和 windows 10。
You can use scipy.sparse.csgraph.connected_components您可以使用 scipy.sparse.csgraph.connected_components
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csgraph.connected_components.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csgraph.connected_components.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.