Similar Items: Learning stability on graphs