An Approximation Algorithm and Dynamic Programming for Reduction in Heterogeneous Environments