Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.classes.function.info

info(G, n=None)[source]

Return a summary of information for the graph G or a single node n.

The summary includes the number of nodes and edges, or neighbours for a single node.

Parameters
GNetworkx graph

A graph

nnode (any hashable)

A node in the graph G

Returns
infostr

A string containing the short summary

Raises
NetworkXError

If n is not in the graph G