Global behavior of graph dynamics with applications to Markov chains