contract function

Edge contraction