本文簡要介紹
networkx.MultiGraph.adjacency
的用法。用法:
MultiGraph.adjacency()
返回所有節點的 (node, adjacency dict) 元組的迭代器。
對於有向圖,隻包括傳出的鄰居/鄰接。
- adj_iter:迭代器
圖中所有節點的迭代器(節點,鄰接字典)。
返回:
例子:
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> [(n, nbrdict) for n, nbrdict in G.adjacency()] [(0, {1: {}}), (1, {0: {}, 2: {}}), (2, {1: {}, 3: {}}), (3, {2: {}})]
相關用法
- Python NetworkX MultiGraph.add_weighted_edges_from用法及代碼示例
- Python NetworkX MultiGraph.add_node用法及代碼示例
- Python NetworkX MultiGraph.add_nodes_from用法及代碼示例
- Python NetworkX MultiGraph.add_edge用法及代碼示例
- Python NetworkX MultiGraph.add_edges_from用法及代碼示例
- Python NetworkX MultiGraph.size用法及代碼示例
- Python NetworkX MultiGraph.clear用法及代碼示例
- Python NetworkX MultiGraph.has_edge用法及代碼示例
- Python NetworkX MultiGraph.neighbors用法及代碼示例
- Python NetworkX MultiGraph.remove_node用法及代碼示例
- Python NetworkX MultiGraph.copy用法及代碼示例
- Python NetworkX MultiGraph.number_of_edges用法及代碼示例
- Python NetworkX MultiGraph.__contains__用法及代碼示例
- Python NetworkX MultiGraph.remove_nodes_from用法及代碼示例
- Python NetworkX MultiGraph.has_node用法及代碼示例
- Python NetworkX MultiGraph.edge_subgraph用法及代碼示例
- Python NetworkX MultiGraph.__len__用法及代碼示例
- Python NetworkX MultiGraph.nodes用法及代碼示例
- Python NetworkX MultiGraph.to_undirected用法及代碼示例
- Python NetworkX MultiGraph.remove_edges_from用法及代碼示例
- Python NetworkX MultiGraph.order用法及代碼示例
- Python NetworkX MultiGraph.number_of_nodes用法及代碼示例
- Python NetworkX MultiGraph.degree用法及代碼示例
- Python NetworkX MultiGraph.__iter__用法及代碼示例
- Python NetworkX MultiGraph.update用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.MultiGraph.adjacency。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。