Abstract : In a WDM network, setting up a new wavelength in a fiber requires recalibrating the other wavelengths passing through this fiber. This induces a cost (e.g., time, energy, degradation of QoS) that depends nonlinearly on the number of wavelengths using the fiber. When a set of connection requests must change their optical paths in the network (e.g., during a maintenance operation on a link in the network), the order in which requests are switched affects the total cost of the operation. That is, the reconfiguration of the routing in a WDM network has some cost due to physical layer impairments. We initiate the study of the corresponding optimization problem by modeling the cost of switching a request as a non-linear function depending on the load of the links used by the new lightpath. We prove that determining the optimal rerouting order is NP-complete for a $2$-nodes network. We then give general lower and upper bounds on the minimum cost and we identify classes of instances where the problem can be solved in polynomial time. Finally, we design heuristics for this problem and we analyze and compare them by simulations.