摘要
0-1背包问题是算法中的经典问题,现实中应用广泛,它是属于NP难问题。该文就0-1背包问题的三种策略:动态规划、贪心算法、回溯和分支限界策略进行了分析。主要从三种策略的基本思想、求解方法包括主要关键代码和算法时间复杂度几个方面进行阐述,从而分析了当遇到具体问题,如何决策使用哪种策略解决问题。
In algorithm 0-1 knapsack problem is a classical problem. It is widely used in reality, which belongs to NP-hard problem.This paper discusses three strategies for 0-1 knapsack problem, as Dynamic Programming, Greedy Algorithm, Backtracking and Branch-and-Bound. Based on the basic ideas and solving methods, including the main key codes and the time complexity of the algorithm, this paper analyses how to use strategy to solve the specific problems.
作者
鄢莉
YAN Li(Panzhihua University,Panzhihua 617000,China)
出处
《电脑知识与技术》
2020年第4期259-260,264,共3页
Computer Knowledge and Technology
关键词
0-1背包问题
动态规划
贪心算法
回溯法
分支限界法
时间复杂
0-1 knapsack problem
dynamic programming
greedy algorithm
backtracking method
branch and bound method
time complexity
作者简介
鄢莉(1978—),女,四川人,副教授,研究生,研究方向为计算机应用及算法。