Utilizing to_scipy_matrix() for centrality computation