def adjacency_matrix(G, nodelist=None, weight='weight'):
 return nx.to_scipy_sparse_matrix(G, nodelist=nodelist, weight=weight)

def adjacency_matrix ( G , nodelist = None , weight = 'weight' ) : return nx . to_scipy_sparse_matrix ( G , nodelist = nodelist , weight = weight )
return adjacency matrix of g .