NetworkX

Previous topic

networkx.line_graph

Next topic

networkx.stochastic_graph

networkx.ego_graph

ego_graph(G, n, center=True)

Returns induced subgraph of neighbors centered at node n.

Parameters:

G : graph

A NetworkX Graph or DiGraph

n : node

A single node

center : bool, optional

If False, do not include center node in graph