I’m trying to think of an algorithm that checks the existence of partition $(V_1,V_2)$ in undirected $G$ where all the edges are crossing edges between $V_1$ and $V_2$. For example, if $e=(a,b)$ then $a in V_1$, $b in V_2$. Oh and $V_1+V_2=V$.

I’ve been thinking to come up with an algorithm but I simply cannot. I’ve checked some previous posts and they weren’t that helpful. Can someone give me a hint?