grape.general_graph.GeneralGraph.shortest_path

property GeneralGraph.shortest_path

Shortest existing paths between all node pairs. Returns the shortest path if already stored in the nodes. Otherwise, the attribute is computed.

Returns

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

Return type

dict