One of the most favorable technology for exploiting the huge bandwidth of optical networks is known as Wavelength Division Multiplexing (WDM). Given a set of demands, the problem of setting up all connection requests is known as Routing and Wavelength Assignment (RWA) problem. In this work, we suggest the use of computational swarm intelligent for solving the RWA problem. A new heuristic based on the law of gravity and mass interactions (Gravitational Search Algorithm, GSA) is chosen for this purpose, but adapted to a multiobjective context (MO-GSA). To test the performance of the MO-GSA, we have used a real-world topology, the Nippon Telegraph and Telephone (NTT, Japan) network and six sets of demands. After performing several comparisons with other approaches published in the literature, we can conclude that this algorithm outperforms the results obtained by other authors.