update link length and number of colors