On the core of a graph