networkx 2.8.2 Pypi GitHub Homepage
Other Docs
BackRef

The preferred way of converting data to a NetworkX graph is through the graph constructor. The constructor calls the to_networkx_graph() function which attempts to guess the input type and convert it automatically.

Functions to convert NetworkX graphs to and from other formats.

See Also

nx_agraph
nx_pydot

Functions to convert NetworkX graphs to and from other formats.

The preferred way of converting data to a NetworkX graph is through the graph constructor. The constructor calls the to_networkx_graph() function which attempts to guess the input type and convert it automatically.

Examples

Create a graph with a single edge from a dictionary of dictionaries

>>> d = {0: {1: 1}}  # dict-of-dicts single edge (0,1)
>>> G = nx.Graph(d)

See Also

nx_agraph, nx_pydot

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.classes.multigraph.MultiGraph.__init__ networkx.classes.graph.Graph.__init__ networkx.classes.digraph.DiGraph.__init__ networkx.classes.multidigraph.MultiDiGraph.__init__

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/convert.py#0
type: <class 'module'>
Commit: