Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / examples / graph / plot_karate_club.py @ 5cef0f13

History | View | Annotate | Download (529 Bytes)

1
#!/usr/bin/env python
2
"""
3
===========
4
Karate Club
5
===========
6

7
Zachary's Karate Club graph
8

9
Data file from:
10
http://vlado.fmf.uni-lj.si/pub/networks/data/Ucinet/UciData.htm
11

12
Reference:
13
Zachary W. (1977).
14
An information flow model for conflict and fission in small groups.
15
Journal of Anthropological Research, 33, 452-473.
16
"""
17

    
18
import matplotlib.pyplot as plt
19
import networkx as nx
20

    
21
G = nx.karate_club_graph()
22
print("Node Degree")
23
for v in G:
24
    print('%s %s' % (v, G.degree(v)))
25

    
26
nx.draw_circular(G, with_labels=True)
27
plt.show()