center#

center(G, e=None, usebounds=False)[source]#

Returns the center of the graph G.

The center is the set of nodes with eccentricity equal to radius.

Parameters:
GNetworkX graph

A graph

eeccentricity dictionary, optional

A precomputed dictionary of eccentricities.

Returns:
clist

List of nodes in center

Examples

>>> G = nx.Graph([(1, 2), (1, 3), (1, 4), (3, 4), (3, 5), (4, 5)])
>>> list(nx.center(G))
[1, 3, 4]