On a certain distance between isomorphism classes of graphs