collapse vertices