Proof (⟸). Let's denote the characteristic vector of
optimal solution z∗ and the greedy solution z′. Ti={1,…i}.
We will sum only up
to m but won't write it for the sake of brevity.
∑wizi∗=∑wiz∗(Ti)−wi−1z∗(Ti−1)
=∑wi(z∗(Ti)−z∗(Ti−1))
=wmz∗(Tm)+∑m−1(wi−wi+1)z∗(Ti)
≤wmr(Tm)+∑m−1(wi−wi+1)r(Ti)
the inequality holds because number of elements in optimum is bounded by the
rank and both terms are non-negative so changing z∗ for rank gives upper
bound. By the greedy algorithm:
=wmz′(Tm)+∑m−1(wi−wi+1)z′(Ti)
=∑wizi
Proof (⟸ using LP). Let the primal program be
maxi∈X∑wixi
s.t. xi≥0
i∈A∑xi≤r(A),∀A⊆X
Then the dual is
minA⊆X∑r(A)yA
s.t. yA≥0,A⊆X
i∈A,A⊆S∑yA≥wi,∀i∈X
Let's take the following for the dual solution:
- yA=wi−wi+1 if A={1,…k}, where k<m
- yA=wm if A={1,…m}
- yA=0 otherwise
Now by the complementarity we will show that this is indeed the optimal
solution. Let Z be the set containing elements of the greedy solution.
xi>0⟹i∈A,A⊆X∑yA=wi
this is true by the choice of the dual solution.
yA>0⟹i∈A∑xi=r(A)
which is the same as :
yA>0⟹∣Z∩A∣=r(A)
this comes from the way greedy algorithm constructs the solution.