Efficient Algorithms for Neighbor Discovery in Wireless Networks