📜  networkx 获取邻居 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:53.383000             🧑  作者: Mango

代码示例1
>>> G = nx.path_graph(4)  # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> [n for n in G.neighbors(0)]
[1]