To solve a programming problem, I need to solve a graph problem, but I am weak at graph theory.
Given an undirected graph $G$ with edges $E$, I need to find $n=2$ subgraphs $G_1$ and $G_2$, so that $G_1 \cap G_2 = \emptyset $ and $G_1 \cup G_2 = G$, and the number of edges, where edge $u - v$ where $u \in G_1 $ and $v \in G_2 $ are minimal. For extra points I'm interested in alternative partiotions, other cases, where $n>2$, or solution for weighted graphs, but they are not important.
For the curious, the programming problem is to divide a big class into smaller classes.