SUMMARYWireless sensor networks (WSNs) are made of spatially distributed autonomous sensors, which cooperate to monitor physical or environmental parameters and to deliver such data to one or more data sinks. A promising field of application of WSNs is planetary exploration, characterized by a continuous monitoring of the surface to have clear notion of planet conditions and prepare for future manned missions. The potentially large size of the region to be monitored and the line-of-sight limitations (as, for instance, on the Moon, which is the case study discussed in the paper) hamper the possibility of having 1-hop sensorsink communications. Therefore, to allow sensed data to reach the sink(s), the sensors must be able to create and maintain a multi-hop ad hoc network. This paper proposes an ad hoc routing algorithm applicable to WSNs for planetary exploration, aiming at (i) assuring any-cast communications with multiple data sinks, (ii) minimizing the control overhead for routing maintenance, (iii) being light in terms of memory/computational requirements, to be installed into low-power and low-memory/processing devices, (iv) being rapid to reconfigure in the presence of node failures and (v) optimizing the choice of the paths, to achieve energy balancing and saving. Extensive simulations show the efficiency of the proposed approach.