I'm a novice in learning NetworkX. When I learned how to create a network via coding, taking network G as an example, the textbook told me to use code "G.add_nodes_from(1,2,3,4)." However, when it comes to subnetworks, the book gave an example. The code said:
K5 = nx.complete_graph(5)
clique = nx.subgraph(K5, (0,1,2))
My question is: for this network, why does the number of nodes start from 0? It is 0,1,2,3,4. Why is it not "1,2,3,4,5"? I'm confused.
Thanks for all the help in advance!