new vertex clustering logic