Exchange colors to be able to calculate the lokal energy of each node