我在spyder中完成了以下代码:
df = nx.from_pandas_adjacency(pd.read_excel(r"path/to/file.xlsx", sheet_name="Sheet4",index_col=0,usecols = "A:BR"))
df1=pd.DataFrame(list(nx.enumerate_all_cliques(nx.Graph(df))))
我有69个对象nx.enumerate_all_cliques
从excel文件中找到所有47000个可能的兼容组合。我在这个列表中有一些必须在一起的对象,我想忽略所有不包含all这些对象的组合。我可以列出必须在一起的项目组,因为只有少数项目
您可以使用集合来确定所需的所有节点是否都在给定的群组内。下面是一个基于随机图的示例
相关问题 更多 >
编程相关推荐