Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我看来,这可能是背包问题的一个版本:我有一个不同大小的矩形列表,我想将它们放在一个字段中,而不重叠或分组相似的大小。
开始朝背包方向看是否正确?
谢谢。
它至少和背包一样难,因为它可以通过使字段和矩形固定宽度(宽度小于任何矩形的最小长度)来解决背包问题。
是的,这与背包问题类似——这更困难,因为你必须处理二维,而不仅仅是一个——但是在寻找背包问题时,你就走对了。