摘要
0/1背包问题是计算机科学中的一个经典问题。动态规划法,递归法,回溯法是求解该问题的三种典型方法,使用这三种方法求解0/1背包问题,并对各算法进行了理论分析。用不同规模的0/1背包问题对三种算法进行测试,比较它们的运行时间,发现测试结果与其理论分析结果相符.最后指出就求解不同规模的0/1背包问题而言各算法的优劣。
The 0/1 knapsack problem is a classic problem in the computer science.dynamic programming,recursion and backtracking are three kinds of typical algorithms to solve the 0/1 knapsack problem.It solves the 0/1 knapsack problem through these three methods and provides analysis for each algorithm.Through testing these three kinds of algorithms and comparing their running time under different scale,it find that the result of test tally with that of theoretical analysis,and finally point out the advantage and disadvantage of each algorithm as for solving different scale of 0/1 knapsack problem.
作者
张景成
戴光明
ZHANG Jing-cheng,DAI Guang-ming (School Of Computer,China UniversiW Of Geoscience,Wuhan 430074,China)
出处
《电脑知识与技术》
2007年第6期1388-1389,1411,共3页
Computer Knowledge and Technology
关键词
背包问题
动态规划
递归法
回溯法
knapsack problem
dynamic programming
recursion
backtracking
作者简介
张景成(1980-),男,在读硕士,研究方向:算法研究;
戴光明(1964-),男,教授,博士,研究方向:算法设计、科学计算可视化等。