Self-healing gradients are distributed estimates of the distance from each device in a network to the nearest device designated as a source, and are used in many pervasive computing systems. With previous self-healing gradient algorithms, even the smallest changes in the source or network can produce small estimate changes throughout the network, leading to high communication and energy costs. We observe, however, that in many applications, such as routing and geometric restriction of processes, devices far from the source need only coarse estimates, and that a device need not communicate when its estimate does not change. We have therefore developed Flex-Gradient, a new self-healing gradient algorithm with a tunable trade-off between precision and communication cost. When distance is estimated using Flex-Gradient, the constraints between neighboring devices are flexible, allowing estimates to vary by an amount proportional to a device’s distance to the source. Frequent small chan...