Dinkelbach's algorithm returns an optimal ratio after finitely many and, for integer data, O(log U) iterations full
This proof shows: correctness.
We use the pseudocode of the page. X is a finite set, N,D:X→R with D>0 on X, λ∗=minx∈XN(x)/D(x), and F(λ)=minx∈X(N(x)−λD(x)). The oracle of line L4 returns a minimizer of N−λD. Write x0,x1,… for the successive values of x, λk=N(xk)/D(xk), Dk=D(xk), and Fk=F(λk)=N(xk+1)−λkDk+1, where xk+1 is the point returned at line L4 in round k.
Lemma 1 (Dinkelbach). F(λ)≥0 if and only if λ≤λ∗, and F(λ∗)=0.
Proof. N(x)−λD(x)=D(x)(N(x)/D(x)−λ) with D(x)>0. If λ≤λ∗, each term is ≥0, so F(λ)≥0. If λ>λ∗, an optimal x∗ gives a negative term, so F(λ)<0. At λ∗ the optimal x∗ gives 0. □
Claim 1 (correctness and finiteness). The algorithm stops, and it returns xk with λk=λ∗.
Proof. In round k, Fk≤N(xk)−λkDk=0, since xk is one of the candidates. If line L5 finds Fk≥0, then Fk=0=F(λk), so λk≤λ∗ by Lemma 1. Also λk≥λ∗ because it is the ratio of a feasible point. So λk=λ∗ and xk is optimal. Otherwise Fk<0, that is N(xk+1)<λkDk+1, so λk+1<λk. The ratios strictly decrease, so no point of X appears twice, and the algorithm stops after at most ∣X∣ rounds. □
Lemma 2 (monotone denominators). If y minimizes N−μD and z minimizes N−νD with μ<ν, then D(y)≤D(z).
Proof. By the two minimalities, N(y)−μD(y)≤N(z)−μD(z) and N(z)−νD(z)≤N(y)−νD(y). Adding and cancelling N(y)+N(z) gives (ν−μ)D(y)≤(ν−μ)D(z). □
For k≥1, xk minimizes at λk−1 and xk+1 minimizes at λk<λk−1, so Dk+1≤Dk: the denominators do not increase from round 1 on.
Claim 2 (the halving step). For every round k≥1 in which the algorithm does not stop,
∣Fk−1∣∣Fk∣+DkDk+1≤1. Proof. Since xk minimizes N−λk−1D, its value is at most the value of xk+1: Fk−1=N(xk)−λk−1Dk≤N(xk+1)−λk−1Dk+1. Hence
Fk=N(xk+1)−λkDk+1≥Fk−1+(λk−1−λk)Dk+1. From Fk−1=N(xk)−λk−1Dk=Dk(λk−λk−1) we get λk−1−λk=∣Fk−1∣/Dk. With Fk,Fk−1<0 the inequality reads −∣Fk∣≥−∣Fk−1∣+∣Fk−1∣Dk+1/Dk, which is the claim after division by ∣Fk−1∣. □
So in each such round, ∣F∣ drops to at most half, or D drops to at most half, because both ratios cannot exceed 1/2.
Claim 3 (integer data). If N and D take integer values with ∣N(x)∣≤U and 1≤D(x)≤U, with U≥2, the algorithm makes O(logU) rounds.
Proof. While the algorithm runs, Fk=(N(xk+1)Dk−N(xk)Dk+1)/Dk has a non-zero integer numerator, so ∣Fk∣≥1/Dk≥1/U. Also ∣Fk∣≤∣N(xk+1)∣+∣λk∣Dk+1≤U+U⋅U≤2U2. So among the rounds k≥1, the value ∣Fk∣ can halve at most lg(2U2⋅U)=1+3lgU times. By Lemma 2, Dk is non-increasing from k=1 and lies in [1,U], so it can halve at most lgU times. By Claim 2, each round k≥1 before the last does one of the two. With the first round and the last round, the number of rounds is at most 4lgU+3. □