contraction of the graph