Ad hoc, rapidly deployed wireless sensor networks require lightweight algorithms due to the simplicity of the sensor nodes. In this work, we consider a wireless sensor network consisting of a single sink node at the center of a field of randomly distributed low-cost sensors. Following the guideline of co-design, we propose a distributed partition-based localization algorithm and a distributed energy-efficient geographic routing algorithm, and evaluate their individual performances as well as joint performance under practical application scenarios. Simulations confirm that our co-design approach achieves desirable performance economically. The proposed approach should be especially useful to professionals in Wireless Sensor Network fields, or anyone else who may be considering utilizing ad hoc, rapidly deployed wireless sensor networks consisting of low-cost sensors.