NetworkX

Previous topic

networkx.is_directed_acyclic_graph

Next topic

networkx.diameter

networkx.eccentricity

eccentricity(G, v=None, sp=None, with_labels=False)

Return the eccentricity of node v in G (or all nodes if v is None).

The eccentricity is the maximum of shortest paths to all other nodes.

The optional keyword sp must be a dict of dicts of shortest_path_length keyed by source and target. That is, sp[v][t] is the length from v to t.

If with_labels=True return dict of eccentricities keyed by vertex.