change adjacency labels to pattern ensuring that we don't have overlap with class names