Consistent sensor, relay, and link selection in wireless sensor networks