grape.general_graph.GeneralGraph.closeness_centrality_kernel

GeneralGraph.closeness_centrality_kernel(nodes, shortest_path_length, tot_shortest_paths_list, graph_size)[source]

Compute betweenness centrality, from shortest path list.

Parameters
  • nodes (list) – list of nodes for which to compute the efficiency between them and all the other nodes.

  • shortest_path (dict) – nested dictionary with key. corresponding to source, while as value a dictionary keyed by target and valued by the source-target shortest path.

  • tot_shortest_paths_list (list or multiprocessing.managers.list) – list of shortest paths with at least two nodes.

  • graph_size (int) – graph size.

Returns

closeness centrality dictionary keyed by node.

Return type

dict

Raises

ValueError