1. A method, implemented by a computer, for dynamic routing an optical signal in an optical network comprising a plurality of nodes, the method comprising: executing, by the computer, a shortest-path algorithm receiving input information concerning a source node, a destination node and a topology of the optical network, and providing as output a shortest-path tree comprising nodes and arcs connecting the nodes, the shortest-path tree comprising a plurality of branches along which an effective attenuation accumulated by the optical signal is at most equal to a predetermined limit, each branch comprising an end node and each end node being associated with a corresponding set of wavelengths; checking, for each end node that has no wavelength conversion resources and for each wavelength of the corresponding set of wavelengths, if the end node is connected to at least another node external to the corresponding branch through the wavelength; excluding, for any end node for which the result of the checking is negative for at least one wavelength of the corresponding set of wavelengths, the at least one wavelength from the corresponding set of wavelengths, thus updating the topology; and re-executing, by the computer, the shortest-path algorithm with the updated topology.