是“互换搬厂”吗?值得付出努力吗?

发布于 2025-01-03 13:28:33 字数 1653 浏览 6 评论 0原文

我注意到,对于 Cloudbalancing 等问题,存在移动工厂来生成移动和交换。 “移动移动”将云进程从一台计算机转移到另一台计算机。 “交换移动”交换来自各自计算机的任意两个进程。

我正在开发一个时间表应用程序。

  1. subjectTeacherHour(科目和教师的组合)有 仅是可以为其分配的期间的子集。如果 Jane 在一节课上教 6 个小时,则必须为每个 6 个 subjectTeacherHour 分配一个 Period(可能为 30 个 Period)该类的;与 cloudbalance 示例不同,在 cloudbalance 中,进程可以移动到任何计算机。
  2. 只能为一个subjectTeacherHour分配一个Period(自然地)。

它尝试将 subjectTeacherHour 放置到符合条件的 Periods 中,直到找到最佳组合。


优点

手册< /a> 似乎推荐它。

...但是,正如巡回锦标赛的示例所证明的那样,如果您可以删除 通过使用某组大招的硬约束,你就可以获胜 性能和可扩展性...

...`[有大动作的版本]评估不可行的程度要低很多 解决方案,使其能够超越简单的解决方案 版本....

...使用多个选择器通常是一个好主意,混合良好 颗粒移动和课程颗粒移动:...

虽然只有一个 subjectTeacher 可以分配给 Period,但求解器必须暂时打破这样的约束,以发现交换两个特定的 >周期分配会带来更好的解决方案。互换举措“拆除了这两个州之间的这堵砖墙”。

因此,交换举措有助于更快地找到更好的解决方案

缺点

subjectTeacher仅具有可分配的Period的子集。因此,找到任意两个 subjectTeacher 之间的相交(共同)时间有点困难(但可以通过一种优雅的方式实现:从对象属性中查找重叠值的好算法/技术? )。

它只会给我带来时间和最优性方面的微小收益吗?

我还担心两种移动可能会导致疯狂交互,从而导致陷入糟糕的解决方案。

I noticed that for problems such as Cloudbalancing, move factories exist to generate moves and swaps. A "move move" transfers a cloud process from one computer to another. A "swap move" swaps any two processes from their respective computers.

I am developing a timetabling application.

  1. A subjectTeacherHour (a combination of subject and teacher) have
    only a subset of Periods to which they may be assigned. If Jane teaches 6 hours at a class, there are 6 subjectTeacherHours each which have to be allocated a Period, from a possible 30 Periods of that class ;unlike the cloudbalance example, where a process can move to any computer.
  2. Only one subjectTeacherHour may be allocated a Period (naturally).

It tries to place subjectTeacherHour to eligible Periods , till an optimal combination is found.


Pros

The manual seems to recommend it.

...However, as the traveling tournament example proves, if you can remove
a hard constraint by using a certain set of big moves, you can win
performance and scalability...

...The `[version with big moves] evaluates a lot less unfeasible
solutions, which enables it to outperform and outscale the simple
version....

...It's generally a good idea to use several selectors, mixing fine
grained moves and course grained moves:...

While only one subjectTeacher may be allocated to Period, the solver must temporarily break such a constraint to discover that swapping two certain Period allocations lead to a better solution. A swap move "removes this brick wall" between those two states.

So a swap move can help lead to better solutions much faster.

Cons

A subjectTeacher have only a subset of Periods to which they may be assigned. So finding intersecting (common) hours between any two subjectTeachers is a bit tough (but doable in an elegant way: Good algorithm/technique to find overlapping values from objects' properties? ) .

Will it only give me only small gains in time and optimality?

I am also worried about crazy interactions having two kinds of moves may cause, leading to getting stuck at a bad solution.

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

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

发布评论

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

评论(1

浅笑依然 2025-01-10 13:28:33

互换动作至关重要。

考虑将 2 门课程分配到已满的房间。如果没有交换,就必须打破硬性约束,将 1 门课程移动到冲突的房间,并选择该移动作为步骤(这不太可能)。

您可以使用内置的通用交换 MoveFactory。如果您自己编写,则当您将任何一方移动到不符合条件的时间段时,您可以说交换移动 isDoable() false。

Swap moves are crucial.

Consider 2 courses assigned to a room which is fully booked. Without swapping, it would have to break a hard constraint to move 1 course to a conflicted room and chose that move as the step (which is unlikely).

You can use the build-in generic swap MoveFactory. If you write your own, you can say the swap move isDoable() false when your moving either sides to an ineligible period.

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