Minimizing average flow time in sensor data gathering