我有这个问题,我需要它的帮助,这是我的代码:派系在python
cliques=[clique for clique in nx.find_cliques(GC) if len(clique)>2]
for clique in cliques:
if len (clique)==3:
GC.remove_edge()
print "Clique to appear: ",clique
#draw the graph
nx.draw(GC)
plt.show()
首先我搜索我的图表找到拉帮结派,我测试后,如果长度为3的集团,如果它真的我想删除一条边所以我可以消除完整图(3)。 我该怎么做?
感谢
您的示例没有有效的缩进。发布Python代码时,请确保您发布有效缩进的示例。 – 2012-03-15 03:15:47
所有使用'size> = 3'的派系将包含'complete_graph(3)'。你不关心剩下的事情? – Avaris 2012-03-15 03:22:46
我想全部complete_graph(3) – Python 2012-03-15 03:45:49