[英]Optimal solution to fit the items in multiple capacity bags
I have been working on this problem ( https://github.com/alexpchung/File-Distribution-Planning/blob/master/README.pdf ) where I need to find an optimal solution to place the files in the node. 我一直在研究这个问题( https://github.com/alexpchung/File-Distribution-Planning/blob/master/README.pdf ),我需要找到一个最佳的解决方案来将文件放在节点中。
Here is my algorithm which I have used so far 这是我到目前为止使用的算法
Say number of nodes is N. 说节点数是N.
keep track of available file size for every node iterate through every file, it has N choices to go to (assuming file fits in etc) 跟踪每个节点的可用文件大小迭代每个文件,它有N个选择去(假设文件适合等)
Recursively evaluate for every 递归评估每一个
Another solution which I have thought is to iterate through each and every node and do a knapsack 0/1. 我想到的另一个解决方案是迭代每个节点并做一个背包0/1。 Unfortunately, i got struck because since the node sizes are not fixed it will be an incorrect solution.
不幸的是,我受到了打击,因为由于节点大小没有修复,这将是一个不正确的解决方案。
If you have any pointers that would be great. 如果你有任何指针会很棒。
Thanks. 谢谢。
Maybe you can benchmark this: 也许你可以对此进行测试:
Sort two lists.(capacity,size, all increasing) 排序两个列表。(容量,大小,所有增加)
Start from biggest file. 从最大的文件开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.