Joint routing and charging to elongate sensor network lifetime