I'm trying to reduce an optimization problem to a decision problem, more specifically, consider the Max-Cut problem in its decision version:
Given $(G=(V,E),k)$ as input, where $G$ is an undirected weighted graph (all weights are positive integers, formally: $w: E\rightarrow \mathbb{N}$ is the weight function) and $k\in\mathbb{N}$, one should decide whether there exist a cut $(V_1,V_2)$, s.t its weight is at least $k$, meaning $k\leq \sum _{u\in V_1, v\in V_2}w(u,v)$.
The optimization version is simply finding the maximum weighted cut.
What I'm trying to achieve is, given an algorithm $A$ that can solve the decision problem, I want to describe an algorithm that can find the maximum cut in $G$.
So, first of all, this is what I had in mind:
- Find the weight of the maximum cut in $G$ (this can be done with a simple for loop that starts with 1 and stops at $m$, where $m=\sum _{e\in E}w(e)$ while in each iteration the algorithm queries $A$), define $k$ to be the weight of the maximum cut.
- Initialize new set $S\leftarrow \phi$
- For $e\in E$ do:
- Omit edge $e=(u,v)$ from $G$, to create new graph $G_e$.
- If $A(G_e,k)=0$ (both ends of $e$ are at the same set), $S\leftarrow S\cup \left \{ u,v \right \}$
- else if $A(G_e,k)=1$ then...(?)
This is where I'm stuck, I'm not sure how can I tell which end of $e$ should be in $S$...
In fact, I'm not even sure if this is the right way to do it.
Any help and thoughts will be appreciated.