O'Reilly logo

Complex Network Analysis in Python by Dmitry Zinoviev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required