The Graph class – undirected networks

In NetworkX, the Graph class is used to represent undirected networks and analyze their structure. The previous chapter showed how to create a network from scratch by adding nodes and edges. This section will instead use one of the ready-made networks available in NetworkX: Zachary's karate club (Zachary, 1977).

This network represents the friendships (edges) between members (nodes) of a karate club studied between 1970 and 1972. This particular karate club has long been of interest to sociologists and network scientists, because it eventually split into two different clubs after a disagreement between the instructor and the club president (this might explain why there aren't any famous studies of conflict ...

Get Network Science with Python and NetworkX Quick Start Guide 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.