Start with Global Measures

Let’s start with a “black box” view of a complex network. Let’s pretend we are at a distance and instead of nodes, edges, and their attributes, we see a fuzzy grayish cloud. What can we tell about that cloud? Not much: only its size and density.

To be specific, in this chapter, we will experiment with the network of CNA-related Wikipedia pages constructed in Chapter 5, Case Study: Constructing a Network of Wikipedia Pages and available in the file cna.graphml.[33]

The size of a network is either its node count or edge count. You can measure both using the standard Python len function and other specialized functions.

 len(G) ​# Number of nodes
 len(G.node)
 len(G.nodes)
 len(G.nodes())
 nx.number_of_nodes(G) ...

Get Complex Network Analysis in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.