Evolution of cooperation on dynamical graphs