The frequency partition of a graph