detect shared parent nodes