When the Greedy Solution Solves a Class of Knapsack Problems

Abstract
This paper analyzes a heuristic for the knapsack problem that recursively determines a solution by making a variable with smallest marginal unit cost as large as possible. Recursive necessary and sufficient conditions for the optimality of such “greedy” solutions and a “good” algorithm for verifying these conditions are given. Maximum absolute error for nonoptimal “greedy” solutions is also examined.