Title: Convergence Rate of Distributed Averaging Dynamics and Optimization in Networks