Improving labeling of neighborhood graphs