The Routing and Spectrum Assignment (RSA) algorithm has a direct influence on the performance of flexible grid optical networks. We propose in this paper a novel routing algorithm, named NrPSR-Elastic, which aims to find Nr routes with minor cost for a given source-destination pair according to a cost function expanded in a Power Series (PSR). In this proposal, the coefficients are determined by a global optimizer, called Particle Swarm Optimizer (PSO). We also propose a new input variable to be used in the PSR cost function, called contiguous frequency slot availability. The selected route to be assigned to the call request is chosen among the Nr found routes, depending on a Minimum Hop based policy, which takes into account the number of links in each route. We compared the performance of our proposal through simulation with the Shortest Path (SP) routing algorithm for two different link-capacity scenarios in well-known network topology. For both cases, the NrPSR-Elastic algorithm far outperformed the SP routing algorithm.