NetworkX

Previous topic

adjacency_data

Next topic

tree_data

adjacency_graph

adjacency_graph(data, directed=False, multigraph=True)

Return graph from adjacency data format.

Parameters :

data : dict

Adjacency list formatted graph data

Returns :

G : NetworkX graph

A NetworkX graph object

directed : bool

If True, and direction not specified in data, return a directed graph.

multigraph : bool

If True, and multigraph not specified in data, return a multigraph.

Examples

>>> from networkx.readwrite import json_graph
>>> G = nx.Graph([(1,2)])
>>> data = json_graph.adjacency_data(G)
>>> H = json_graph.adjacency_graph(data)