Characteristic polynomial of a graph