grape.general_graph.GeneralGraph.efficiency_kernel

GeneralGraph.efficiency_kernel(nodes, shortest_path_length)[source]

Compute efficiency, starting from path length attribute. Efficiency is a measure of how good is the exchange of commodities flowing from one node to the others.

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

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

Returns

nested dictionary with key corresponding to source, while as value a dictionary keyed by target and valued by the source-target efficiency.

Return type

dict