In wireless sensor networks (WSN), node localization is a key function, and only by knowing the coordinate positions of the nodes can correct decisions be made. In certain applications, such as smart cities, environmental monitoring, or industrial automation, irregular areas can be complex and affected by environmental complexity and inhomogeneity. Coverage gaps may exist between the nodes to be located and the anchor nodes, and communication paths between the nodes may deviate significantly from the ideal straight line, resulting in a large error between the final positioning result of the algorithm and the actual position. In order to solve this problem, this paper proposes a non-ranging node localization method (RANP-PSO) for irregular regions based on PSO algorithm and anchor node pair selection. The way firstly selects anchor node pairs with higher reliability parameters for the nodes to be located by introducing the hop count constraint mechanism for distance estimation; then uses the regularized least squares method for further constraints on the estimated distances; Finally, the PSO algorithm is utilized to optimize the coordinates of the target node, so as to solve to obtain the position of the node. When the proportion of anchor nodes is 20%, the communication radius of nodes is 30m, and the distribution density of nodes is 0.008, the proposed algorithm reduces the root mean square error by approximately 11.94% compared to AEML and LRAQS algorithms, 7.26% compared to the BDMCL algorithm, and 0.69% compared to the MSVR-DV-Hop algorithm. This demonstrates the advantage of the proposed algorithm in terms of localisation accuracy.