For most of the applications in wireless sensor networks, localization is fundamental and essential. The localization systems can be categorized into two types: range-based and range-free. In this paper, the authors propose a new range-free localization algorithm. The basic principle of this algorithm is to define two classes of nodes according to the number of anchors in the neighborhood, and then to apply the proposed localization methods to each class of nodes. The computation complexity of related algorithms has also been estimated and analyzed.