带有 CPLEX 的动态 CSP

发布于 2024-12-25 08:36:05 字数 488 浏览 1 评论 0原文

您是否知道是否有办法更改已解决的 CPLEX 约束优化问题中的某些约束,然后再次解决它,但结果尽可能接近之前的解决方案。

示例:

任务分配给不同的资源。资源 1 有任务 A、B 和任务 A、B 和 A。 C,资源 2 有任务 D,E 和F.

当我添加资源 3 时,我希望新的分配类似于:

R1 = A & B
R2 = D & E
R3 = C & F

但 CPLEX 可能会返回类似于:

R1: F & E
R2: A & B 
R3: C & D

或任何其他可能与初始解决方案完全不同的组合。

我认为这个问题称为动态约束满足问题。

我已经做了很多研究,但似乎没有一种简单的方法可以做到这一点。看起来我必须自己实现(这是可以的)。在这种情况下,您建议我应该如何解决这个问题?

谢谢

Do you know if there's a way to change some constraints in an already solved Cplex constraint optimization problem, and solve it again but with the result being as close as possible to the previous solution.

Example:

Tasks are assigned to different resources. Resource 1 has tasks A, B & C, Resource 2 has tasks D, E & F.

When I add Resource 3, I want the new assignment to be something like:

R1 = A & B
R2 = D & E
R3 = C & F

But Cplex will probably return something like:

R1: F & E
R2: A & B 
R3: C & D

Or any other possible combination that could be completely different to the initial solution.

I think this problem is called Dynamic Constraint Satisfaction Problem.

I've been doing a lot of research but it doesn't look like there's an easy way to do it. Looks like I'll have to do my own implementation (which is ok). In that case, how do you propose I should approach the problem?

Thanks

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

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

发布评论

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

评论(1

黯然 2025-01-01 08:36:05

这类问题在运筹学中通常被称为分配问题

很简单,我们在一定的约束下将任务分配给资源。 目标函数(目标)是最小化此类任务的成本。一组约束可确保每个作业都分配给一个资源。

您当然可以使用 CPLEX(或任何 LP 求解器)来获得解决方案。尤其是赋值问题“更容易”,因为您甚至不需要调用 Simplex。称为匈牙利方法的方法将产生最佳解决方案。

具体来说,在您的情况下,由于您希望保留大部分现有解决方案,因此您可以分配成本或权重来激励某些任务。例如,在您的问题中,如果您将分配 A & 的成本设为BR1 非常低,最终的解决方案将具有这一点,除非迫切需要更改该分配。

这是作业问题的参考资料。

另请查找维基百科中的匈牙利方法,其中有一个非常易于理解的部分,称为外行的解释< /em>.完成此操作后,您还可以阅读 CPLEX 中的敏感性分析,其中您使用所谓的“热启动”来使用之前生成的解决方案。

The class of these problems is more generally referred to as as assignment problem in Operations Research.

Very simply, we assign tasks to resources under certain constraints. The objective function (goal) is minimize the cost of such assignments. One set of constraints ensures that every job is assigned to a resource.

You can certainly use CPLEX (or any LP solver) to get the solution. Assignment problems in particular are "easier" in that you don't even need to invoke Simplex. A method known as the Hungarian Method will yield the optimal solution.

Specifically, in your case, since you want to retain most of the existing solution, you can assign costs or weights to give incentives to certain assignments. For example, in your problem, if you make the cost of assigning A & B to R1 very low, the final solution will have that unless there is a compelling need to change that assignment.

Here's one reference for the Assignment Problem.

Also look up The Hungarian Method in Wikipedia which has a very accessible section called layman's explanation. Once you do that, you can also read up on Sensitivity Analysis in CPLEX, wherein you use the so-called "warm-start" to use previously generated solutions.

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