A Hybrid Dynamic Programming Algorithm for Solving the 0-1 Knapsack Problem

Date

2022-08-17

Authors

Xing, Feifan

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

The 0-1 knapsack problem is a classic non-deterministic polynomial complete problem and has a wide range of applications in many fields. It is a multistage decision problem and can be solved using dynamic programming. First, this report presents the concept, terminology, conditions, and steps of dynamic programming algorithms. Then, two algorithms are introduced to solve the 0-1 knapsack problem, namely Tradition Dynamic Programming (TDP) and Efficient Dynamic Programming (EDP). It is shown that the time complexity and space complexity of TDP are both O(nW), and the time complexity of EDP is O(nW) while the space complexity is only O(W). However, EDP cannot provide any information about item selection, which limits its application. Next, a new hybrid algorithm that combines EDP and the divide-and-conquer method is proposed. This algorithm eliminates the backtracking process used in TDP for item selection but can still determine which items are in the optimal solution. Analysis shows that the time complexity of the hybrid algorithm is O(nW) and the space complexity is O(W+log⁡n). Results are presented which show that compared with TDP, the new hybrid algorithm has significant advantages in solving large-scale knapsack problems.

Description

Keywords

Dynamic Programming, Knapsack Problem, Divide-and-conquer

Citation