NetworkX

Previous topic

networkx.MultiDiGraph.predecessors_iter

Next topic

networkx.MultiDiGraph.adjacency_iter

Quick search

networkx.MultiDiGraph.adjacency_list

MultiDiGraph.adjacency_list()

Return an adjacency list as a Python list of lists

The output adjacency list is in the order of G.nodes(). For directed graphs, only outgoing adjacencies are included.

Examples

>>> G=nx.path_graph(4)
>>> G.adjacency_list() # in sorted node order 0,1,2,3
[[1], [0, 2], [1, 3], [2]]