寻找 3 分区组合情况的解或启发式近似

发布于 2024-12-19 04:27:21 字数 357 浏览 2 评论 0原文

如何将 48 件物品(每件都有其自身的美元价值)分配给 3 名继承人中的每一位,以便赋予每位继承人的价值相等或接近相等?

这是一种 NP 完全(或类似)划分问题,因此不可能用 48 个项目完美回答。我正在寻找一种实用且普遍认可的近似算法来做到这一点。这是许多人在解决遗嘱和遗产时面临的问题。答案一定就在某个地方!答案可能是计算机脚本或只是手动方法。

“普遍接受”的启发式就足够了。带着我的程序员帽子,我寻求一个近乎完美的解决方案。带着我的法律执行者的帽子,我寻求一些被普遍接受或法律先例认为“足够好”的东西。

编程语言环境:LibreOffice 中的 Visual Basic 其他研究:维基百科、MathIsFun、CodingTheWheel

How do I distribute 48 items each with its own dollar value to each of 3 inheritors so that the value given to each is equal or nearly equal?

This is a form of partitioning problem with is NP-complete (or some such) and therefore impossible to perfectly answer with 48 items. I'm looking for a practical and generally acknowledged approximate algorithm to do this. It's a problem faced by many in resolving wills and estates. Answer must be out there somewhere! The answer could be a computer script or just a manual method.

A heuristic that is "Generally Accepted" would suffice. With my programmer hat on I seek a near-perfect solution. With my legalistic executor hat on I seek something for which there is a generally accepted or legal precedent as being "good enough".

Programming Language env: visual basic in LibreOffice
Other research: Wikipedia, MathIsFun, CodingTheWheel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

む无字情书 2024-12-26 04:27:21

我从 justanswer.com 找到了一个“足够好”的答案。足以满足分割珠宝的合法性,并且足以使各方满意。过程:

按价值降序对项目进行排序。使用贪婪算法:从第一项(最有价值)开始,填充下一个 bin(有 3 个继承者,因此 3 个 bin),直到该 bin 不再是价值最小的 bin。选择随后最小值的 bin 并类似地填充它。重复。

欢迎评论。

I have found a "good enough" answer from justanswer.com. Good enough for the legalities of dividing up the jewelry and close enough to being equal to satisfy all parties. The procedure:

Sort the items in descending order of value. Use greedy algorithm: start with 1st item (the most valuable) and fill the next bin (there are 3 inheritors so 3 bins) until that bin is no longer the bin of least value. Choose bin of subsequent least value and similarly fill it. Repeat.

Comments welcome.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文