其中优化算法,我应该使用带有时间限制利润最大化?算法、利润、时间

2023-09-06 19:33:45 作者:背叛

我想找到一个合适的算法来解决这个问题:

I would like to find an appropriate algorithm to solve this problem:

假设我们有N个项目,我们知道多少钱,我们将每一个项目赚,这是多少时间需要对每一个项目做(估计时间为每个项目)。我们有一定的可用时间来完成所有的项目。我们要选择项目,使我们的利润最大化和整体估计时间不超过可用的时间。能否请您指教我应该使用哪种算法?是否有任何我可以在C#,.NET技术或Java技术?

Suppose we have N projects and we know how much money we will earn by each project and how much time it is required for each project to be done(estimated time for each project). We have certain amount of available time to do all projects. We want to select projects so that our profit is maximized and overall estimated time does not exceed available time. Can you please advise which optimization algorithm should I use? Are there any already made things that I could use in C#, .NET technology or Java technology?

推荐答案

这听起来简单明了背包问题:

给定一组的物品的,每一个的重量和的值,确定每个项目的计数在一个集合包括使总重量小于或等于给定的限度,总价值是一样大的可能的。

Given a set of items, each with a weight and a value, determine the count of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.

在你的情况下,重量所需项目的时间,与限制是时间限制。

In your case, the weight is the time required for the projects, and the limit is the time limit.

通常情况下,如果你正在做这个现实世界,那么蛮力就足以为小的情况下,贪婪近似一些随机应该是大的情况下,足够好,如果你真的不关心准确的最大的。但是,我怀疑是否有人会用这样严格的模式,为现实世界。

Normally, if you are doing this for the real world, then a brute-force would suffice for the small cases, and greedy approximation with some randomization should be good enough for the large cases if you don't really care for the accurate maximal. However, I doubt if anyone would use such a strict model for the real world.

在理论兴趣的情况下,背包问题是一个NP难和算法的活跃领域。

In the case of theoretical interest, knapsack problem is NP-hard, and an active field of algorithm.