I recently used networkx.adjacency_matrix(G)
to generate an adjacency matrix for a graph. I was surprised it showed these distinct clusters when I plotted the adjacency matrix (1). These clusters disappear when the node order is plotted in the order I added them to the graph (2) [equivalent to networkx.adjacency_matrix(G, sorted(list(G.nodes())
].
What is the default ordering protocol of networkx when it makes an adjacency matrix? This does not seem to be documented.
Default "order":
Order in which nodes/edges added to graph: