Dynamics of and on complex networks