Add centrality calculation to analyze.py.