grape.general_graph.GeneralGraph.compute_efficiency

GeneralGraph.compute_efficiency()[source]

Efficiency calculation.

Note

The efficiency of a path connecting two nodes is defined as the inverse of the path length, if the path has length non-zero, and zero otherwise.

Returns

efficiency attribute computed for every node. The keys correspond to source, while as value a dictionary keyed by target and valued by the source-target efficiency.

Return type

dict