Adaptive neighborhood