In network virtualization, one of its core challenges lies in how to map the virtual networks (VNs) to the shared substrate network (SN) that is managed by an infrastructure provider, termed as the virtual network embedding problem. Prior studies on this problem only consider one objective, e.g., maximizing the revenues by mapping more VNs or minimizing the energy cost. In this paper, we addressed the virtual network embedding problem with these two objectives. We leverage niche particle swarm optimization technique to design a meta-heuristic algorithm to solve this problem. Extensive simulations illustrate that the efficiency of our proposed algorithm is better than the state-of-the-art algorithms in terms of both revenue and energy cost.