Recently, localization has become an indispensable technique for wireless applications. In view of the limitation of global position system (GPS) in certain environments, alternative approaches are in demand. In this paper, we consider a cooperative localization approach named sum-product algorithm over a wireless network (SPAWN). Although SPAWN theoretically facilitates cooperative localization, it has several practical limitations. Specifically, SPAWN results in high computational complexity and increased network traffic. The main complexity of SPAWN lies in the selection of agents/anchors involved in the cooperative localization. To this end, we formulate the agent/anchor selection problem into a network formation game. Together with a practical limit on the number of agents/anchors used for cooperative localization, our proposed approach can markedly reduce the computational complexity and the resultant network traffic. Simulations show that these advantages come with a slight degradation in the localization mean squared error (MSE) performance.