本文簡要介紹
networkx.algorithms.traversal.breadth_first_search.descendants_at_distance
的用法。用法:
descendants_at_distance(G, source, distance)
從
source
中的G
返回固定distance
的所有節點。- G:NetworkX 圖
圖表
- source:
G
中的節點 - distance:
source
所需節點的距離
- set()
G
中source
的後代在給定的distance
來自source
參數:
返回:
例子:
>>> G = nx.path_graph(5) >>> nx.descendants_at_distance(G, 2, 2) {0, 4} >>> H = nx.DiGraph() >>> H.add_edges_from([(0, 1), (0, 2), (1, 3), (1, 4), (2, 5), (2, 6)]) >>> nx.descendants_at_distance(H, 0, 2) {3, 4, 5, 6} >>> nx.descendants_at_distance(H, 5, 0) {5} >>> nx.descendants_at_distance(H, 5, 1) set()
相關用法
- Python NetworkX descendants用法及代碼示例
- Python NetworkX dedensify用法及代碼示例
- Python NetworkX degree_assortativity_coefficient用法及代碼示例
- Python NetworkX degree_mixing_matrix用法及代碼示例
- Python NetworkX degrees用法及代碼示例
- Python NetworkX degree_pearson_correlation_coefficient用法及代碼示例
- Python NetworkX density用法及代碼示例
- Python NetworkX draw_networkx_edge_labels用法及代碼示例
- Python NetworkX double_edge_swap用法及代碼示例
- Python NetworkX draw用法及代碼示例
- Python NetworkX dag_longest_path_length用法及代碼示例
- Python NetworkX dfs_successors用法及代碼示例
- Python NetworkX draw_planar用法及代碼示例
- Python NetworkX draw_circular用法及代碼示例
- Python NetworkX dijkstra_path_length用法及代碼示例
- Python NetworkX draw_spectral用法及代碼示例
- Python NetworkX dijkstra_path用法及代碼示例
- Python NetworkX directed_configuration_model用法及代碼示例
- Python NetworkX draw_random用法及代碼示例
- Python NetworkX directed_joint_degree_graph用法及代碼示例
- Python NetworkX draw_shell用法及代碼示例
- Python NetworkX difference用法及代碼示例
- Python NetworkX disjoint_union用法及代碼示例
- Python NetworkX draw_networkx用法及代碼示例
- Python NetworkX dfs_predecessors用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.algorithms.traversal.breadth_first_search.descendants_at_distance。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。