返回图中两个节点的公共邻居。
网络X无向图。
图表中的节点。
图中u和v的公共邻居的迭代器。
如果u或v不是图中的节点。
实例
>>> G = nx.complete_graph(5) >>> sorted(nx.common_neighbors(G, 0, 1)) [2, 3, 4]