In this paper, we propose a modified cooperative localization algorithm based on the sum-product algorithm over a wireless network (SPAWN) in a mixed line-of-sight (LOS) and non-line-of-sight (NLOS) scenario. To alleviate the practical limitations of high computational complexity and increased network traffic, we design a node selection method for the cooperative localization algorithm. This method chooses the nodes with highest utilities which are indicated by the contribution each node makes and the maintenance cost it consumes. In addition, considering the positively biased distance errors caused by NLOS connections, we use a link condition indicator (LCI) to quantify the link quality of selected nodes corresponding to the LOS/NLOS conditions. By assigning different weights to the links according to this indicator, we penalize the NLOS measurements and mitigate the biases in the proposed cooperative localization algorithm. The simulation results demonstrate that this algorithm can achieve significant performance improvement compared with that without complexity reduction and NLOS mitigation.