We propose an adaptive-alternative routing algorithm for all-optical networks, named NrPSR. The algorithm finds the Nrroutes with minor cost for a given source-destination pair according to a cost function expanded in a power series (PSR) in which the coefficients are determined by a Particle Swarm Optimizer. The selected route to attend to the call request is chosen among the Nr found routes depending on a predefined policy which takes into account the wavelength availability along the links. In our simulations we considered the following physical layer effects: ASE noise generation, Optical Amplifier gain saturation, ASE saturation and OXC crosstalk. We compared the performance of our algorithm through simulation with four other well known algorithms described in the literature.