This documents the development version of NetworkX. Documentation for the current release can be found here.
Returns Zachary’s Karate Club graph.
Each node in the returned graph has a node attribute ‘club’ that
indicates the name of the club to which the member represented by that node
belongs, either ‘Mr. Hi’ or ‘Officer’.
Zachary, Wayne W.
“An Information Flow Model for Conflict and Fission in Small Groups.”
Journal of Anthropological Research, 33, 452–473, (1977).
Data file from:
To get the name of the club to which a node belongs:
>>> G = nx.karate_club_graph()