用法:
closeness_vitality(G, node=None, weight=None, wiener_index=None)
返回图中节点的接近生命力。
在 [1] 的第 3.6.2 节中定义的节点的
closeness vitality
是排除该节点时所有节点对之间距离总和的变化。- G:NetworkX 图
strongly-connected 图。
- weight:string
用作权重的边属性的名称。这直接传递给
wiener_index()
函数。- node:对象
如果指定,则仅返回此节点的接近生命力。否则,将返回一个字典,将每个节点映射到它的接近生命力。
- 字典或浮点数
如果
node
为None,则此函数返回一个字典,其中节点为键,亲密度为值。否则,它只返回指定node
的接近生命力。如果删除该节点会断开图,则该节点的接近生命力可能是负无穷大。
- wiener_index:数字
如果您已经计算了图
G
的维纳 index ,则可以在此处提供该值。否则,它将为您计算。
参数:
返回:
其他参数:
参考:
- 1
Ulrik Brandes, Thomas Erlebach (eds.).
Network Analysis: Methodological Foundations
. Springer, 2005. <http://books.google.com/books?id=TTNhSm7HYrIC>
例子:
>>> G = nx.cycle_graph(3) >>> nx.closeness_vitality(G) {0: 2.0, 1: 2.0, 2: 2.0}
相关用法
- Python networkx.algorithms.voronoi.voronoi_cells用法及代码示例
- Python networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path用法及代码示例
- Python networkx.algorithms.tree.mst.maximum_spanning_edges用法及代码示例
- Python networkx.algorithms.bipartite.basic.color用法及代码示例
- Python networkx.algorithms.bipartite.cluster.latapy_clustering用法及代码示例
- Python networkx.algorithms.bipartite.edgelist.generate_edgelist用法及代码示例
- Python networkx.algorithms.cycles.recursive_simple_cycles用法及代码示例
- Python networkx.algorithms.link_prediction.within_inter_cluster用法及代码示例
- Python networkx.algorithms.non_randomness.non_randomness用法及代码示例
- Python networkx.algorithms.traversal.depth_first_search.dfs_tree用法及代码示例
- Python networkx.algorithms.operators.product.cartesian_product用法及代码示例
- Python networkx.algorithms.traversal.depth_first_search.dfs_labeled_edges用法及代码示例
- Python networkx.algorithms.tree.operations.join用法及代码示例
- Python networkx.algorithms.shortest_paths.generic.shortest_path_length用法及代码示例
- Python networkx.algorithms.assortativity.node_degree_xy用法及代码示例
- Python networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra用法及代码示例
- Python networkx.algorithms.euler.eulerian_circuit用法及代码示例
- Python networkx.algorithms.dag.all_topological_sorts用法及代码示例
- Python networkx.algorithms.chordal.is_chordal用法及代码示例
- Python networkx.algorithms.tree.coding.from_prufer_sequence用法及代码示例
注:本文由堆栈答案筛选整理自networkx.org大神的英文原创作品 networkx.algorithms.vitality.closeness_vitality。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。