A simple rule for the evolution of cooperation on graphs