将长度为n的杆最佳切割为3种可能的4种尺寸中的任何一种 [英] Optimum Cutting of Rod with Length n into any of 3 possibly 4 sizes

查看:49
本文介绍了将长度为n的杆最佳切割为3种可能的4种尺寸中的任何一种的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我是否在堆叠中的正确区域内-所以我首先道歉..

I am not sure if I am in the correct area on stack - so my apologies first ..

我需要知道如何计算适合n个长度的杆的所有可能组合(对于3种不同的固定长度).

I need to know how I can calculate all possible combinations (for 3 different fixed lengths) that can fit into a Rod of n length.

例如,如果我有3个固定长度的8、10、12和一根长度可变的杆,则说50';我想知道我可以做的所有可能的削减.

So for example if I have 3 fixed lengths of 8, 10, 12 and a Rod of variable Length n say 50'; I want to know all the possible cuts that I can make.

推荐答案

使用

我们试图最大程度地减少杆长度与总和之间的差异,从而限制了总件数(在您的情况下,最大为50/8 = 6件).

where we trying to minimize the difference between the rod length and the sum of the items constraining the number of items (in your case max 50 / 8 = 6 items).

这篇关于将长度为n的杆最佳切割为3种可能的4种尺寸中的任何一种的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆