python - 使用networkx在无向图中进行社区搜索?
问题描述
我想使用 networkx 在网络中发现社区。我正在研究的网络是猫脑,可以下载为 .EDGES 文件。它是一个无向图。我是这样读的:
import networkx as nx
import matplotlib.pyplot as plt
cat_brain = ".//data//cat_brain.graphml"
cat = nx.read_graphml(cat_brain)
plt.title("Cat brain")
nx.draw(cat,pos=nx.spring_layout(cat),node_size=25, width=0.1) # use spring layout
我想用 networkx 来更详细地描述这个社区。甚至可能评估其弹性和连通性。但是,我很难找到有关此过程的大量信息。到目前为止我所做的是:
from networkx.algorithms.approximation import clique
from networkx.algorithms.community import k_clique_communities
print("Cat brain basic graph info:",nx.info(cat))
print("max clique of cat",clique.max_clique(cat))
我想运行相似性分析并搜索网络中的社区。此后,我将运行一个分裂算法来隔离社区,并最终能够绘制网络,重新设计颜色以显示多个社区。但是,networkx 社区算法的文档仅限于一种算法。networkx 中是否有工具可以完成这项工作?我应该在别处寻找另一个 python 包吗?
非常感谢!
解决方案
推荐阅读
- python - python aiohttp-sse 恰好在 6 个请求后超时
- java - 通过 BLE 向 MCU 发送字节数组
- xml - jaxb2 SAXParseException:发现无效内容
- node.js - Realm.io 未在 macos 上设置
- c# - 使用 WebClient 而不是 HttpClient
- python - Python - 使用“With Module as x”和 Threading.Timer
- actions-on-google - 在对话框流中添加输入选项(或卡片、标签)
- r - 我们如何在“ggplot”中设置“aes”参数?
- r - ggplot2 geom_violon 填充颜色
- selenium-webdriver - 在 Python3.6(硒模块)中: ConnectionAbortedError: [WinError 10053] 已建立的连接被主机中的软件中止