Note -「0/1 Fractional Programming」
What is that?
Let us pay attention to a common problem that we often meet in daily life:
There are \(n\) different commodities. Each commodity has two attributes, one for value \(v,v>0\), the other for cost \(w, w>0\). Now, you should to choose some of them to let the cost performance highest.
Mathematically, if we let \(V = {\large \sum \limits _{i = 1}^{n}} v(i)x(i)\), \(W = {\large \sum \limits _{i = 1}^{n}} w(i)x(i)\), the answer will change to \(\dfrac {V} {W}\). Noticed every element \(x(i)\) of function \(x\), we stipulate that \(x(i)\) only can equal to \(0\) or \(1\). They respectively indicate whether the commodity is taken or not.
The Fractional Programming is such a solution to these kind of problem.
How to do it?
Let the biggest integer \(D\) equals to \(\dfrac {V} {W}\). Because the situation \(W\) equal to zero is meaningless, so it is easy to find that \(DW = V\). Deform this equation, \(DW - V = 0\).
So we can make a function, which has independent variable \(d\), and dependent variable \(f(d) = dW-V\). It's true that if \(f(d) = 0\), we can know the relationship \(d = D\).
Algorithmically, we can binary search the \(d\). And if the \(d\) we find now satisfies \(f(d) < 0\), we enlarge the \(d\). Also, if it satisfies \(f(d) > 0\), we decrease the \(d\). Besides, if it satisfies \(f(d) = 0\), that is truly the answer we want to obtain.

浙公网安备 33010602011771号