Virtualization of optical networks is key enabler of cloud computing. A main part of optical network virtualization is virtual network mapping on the physical infrastructure. One major issue in Routing and Wavelength Assignment, RWA, problem is optimized allocation of optical network resources. In this paper at first a background on Particle Swarm Optimization concept and formulation is presented. Then, an optimization scheme using PSO is proposed for virtual network mapping. Five different cost functions are formulated and a new encoding method for optical networks is proposed. The constraints for solutions of RWA problem are addressed and some heuristics are proposed to satisfy them. Proposed optimization scheme is simulated by finding the map of different virtual networks on a physical infrastructure in order to optimize five different cost functions. Results are presented and discussed for defined cost parameters.