In order to improve the search efficiency and localization accuracy of the heuristic localization algorithm, a localization algorithm base on penalty function and water wave optimization for wireless sensor network (WSN) is proposed. Firstly, the proposed algorithm uses the bounding-box method to construct the penalty function, which improves the water wave optimization algorithm's searching efficiency. Then the dynamic learning strategy is used to improve the propagation stage of the traditional water wave optimization algorithm, which encoura...