Wireless sensor networks will be widely deployed in the future for monitoring important environmental conditions, security, and health care. One of the most important challenges in the implementation of such networks is minimizing energy dissipation. Given that many of the energy optimization problems defined for sensor networks are very hard, heuristics are commonly employed. Evaluating the effectiveness of these heuristics, i.e., how close do they come to the optimal solutions, is a challenge. While algorithms that give optimal solutions cannot be on-line (since they are expensive), if they are used off-line, they can provide invaluable insight to improve existing heuristics and to derive new ones. In this paper, we present an integer linear programming (ILP)-based tool that can be used to evaluate optimal solutions for communication energy optimization in sensor networks under specific constraints. This tool, which is based on the required sensing and communication schedules, determines optimal sensor movement and communication strategies to minimize energy consumption due to inter-sensor communication. The tool can also accommodate several constraints related to movement capabilities of sensor nodes, their battery capacities, and their communication ranges since all these can be expressed in a linear form. In addition, it can also work with objective functions other than minimizing communication energy. Our experience with the tool indicates that it is very useful for studying different scenarios under which an objective function needs to be optimized. (c) 2004 Published by Elsevier Inc.