NetworkX

Previous topic

networkx.generators.line.line_graph

Next topic

networkx.generators.stochastic.stochastic_graph

networkx.generators.ego.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