Maximizing entropy of cycles on trees