Return adjacency matrix of G.
Parameters : | G : graph
nodelist : list, optional
weight : string or None, optional (default=’weight’)
|
---|---|
Returns : | A : numpy matrix
|
See also
to_numpy_matrix, to_dict_of_dicts
Notes
If you want a pure Python adjacency matrix representation try networkx.convert.to_dict_of_dicts which will return a dictionary-of-dictionaries format that can be addressed as a sparse matrix.
For MultiGraph/MultiDiGraph, the edges weights are summed. See to_numpy_matrix for other options.