文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>knapsack problem, solved in python

knapsack problem, solved in python

时间:2008-10-12  来源:rockins

Knapsack problem can be described as follows: given n objects, whose weights are w[1], w[2], ..., w[n], respectively. There's a knapsack whose maximum capability is W. The question is: how to select objects from the n objects, so that the selected objects can be fitted in the knapsack?
Theoretically, dynamic progamming can solve knapsack problem in polynomial time. Inspired by this conclusion, I developed a proof-of-concept programme in Python, and here it is:


if __name__ == '__main__':
    knapsackTest()

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载