networkx.center
networkx.shortest_path
Enter search terms or a module, class or function name.
Return the average shortest path length.
G : NetworkX graph
weighted : bool, optional, default=False
If true use edge weights on path. If False, use 1 as the edge distance.
Examples
>>> G=nx.path_graph(4) >>> print nx.average_shortest_path_length(G) 1.25