Energy transmission and synchronization in complex networks : mathematical principles