本文簡要介紹
networkx.MultiDiGraph.adjacency
的用法。用法:
MultiDiGraph.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 MultiDiGraph.add_edge用法及代碼示例
- Python NetworkX MultiDiGraph.add_nodes_from用法及代碼示例
- Python NetworkX MultiDiGraph.add_node用法及代碼示例
- Python NetworkX MultiDiGraph.add_edges_from用法及代碼示例
- Python NetworkX MultiDiGraph.add_weighted_edges_from用法及代碼示例
- Python NetworkX MultiDiGraph.number_of_nodes用法及代碼示例
- Python NetworkX MultiDiGraph.in_degree用法及代碼示例
- Python NetworkX MultiDiGraph.degree用法及代碼示例
- Python NetworkX MultiDiGraph.__init__用法及代碼示例
- Python NetworkX MultiDiGraph.edges用法及代碼示例
- Python NetworkX MultiDiGraph.update用法及代碼示例
- Python NetworkX MultiDiGraph.clear用法及代碼示例
- Python NetworkX MultiDiGraph.out_degree用法及代碼示例
- Python NetworkX MultiDiGraph.subgraph用法及代碼示例
- Python NetworkX MultiDiGraph.to_directed用法及代碼示例
- Python NetworkX MultiDiGraph.remove_nodes_from用法及代碼示例
- Python NetworkX MultiDiGraph.__len__用法及代碼示例
- Python NetworkX MultiDiGraph.remove_node用法及代碼示例
- Python NetworkX MultiDiGraph.remove_edges_from用法及代碼示例
- Python NetworkX MultiDiGraph.nodes用法及代碼示例
- Python NetworkX MultiDiGraph.edge_subgraph用法及代碼示例
- Python NetworkX MultiDiGraph.__iter__用法及代碼示例
- Python NetworkX MultiDiGraph.to_undirected用法及代碼示例
- Python NetworkX MultiDiGraph.get_edge_data用法及代碼示例
- Python NetworkX MultiDiGraph.has_edge用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.MultiDiGraph.adjacency。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。