Algorithmic performance of large-scale distributed networks: A spectral method approach