Algorithms and Heuristics for Data Mining in Sensor Networks