预留分配算法
我正在寻找为资源分配预留的算法。这可以是与可用房间匹配的酒店预订-与可用会议室匹配的会议预订-与餐桌匹配的餐厅预订。
它们的共同点是:
- 每个预订都有特定的、不可更改的开始和结束时间。
- 每个预留在开始时间之前不绑定到特定资源。
- 资源的数量可以是可变的。
- 每次新的预留到来时,算法至少应该能够检查是否可以匹配资源。
到目前为止,我主要研究了解决该问题的遗传算法方法,但我在将问题编码到染色体上时遇到了麻烦。
关于算法的任何想法都是受欢迎的,也欢迎只找到“好的”解决方案而不是最佳解决方案的算法。
I am looking for algorithms for allocating reservations to resources. This could be Hotel reservations matched to available rooms - Meeting reservations matched to available meeting rooms - Restaurant reservations matched to tables.
What they have in common:
- Each reservation has a specific unchangeable start and end time.
- Each reservation is not bound to a specific resource before the start time.
- There can be a variable number of resources.
- Every time a new reservation comes, the algorithm should at least be able to check if it is possible to match to a resource or not.
So far I have mostly looked at genetic algorithm approaches to solve the problem, but I'm having trouble encoding the problem to chromosomes.
Any thoughts on algorithms for this is welcome, also algorithms that only finds a "good" solution as opposed to an optimal one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这篇文章包含各种时间操作,用于检查空闲、重叠和相交的时间段。您可以轻松地将此类与您的业务对象结合起来:
This article includes various time operation to check for free, overlapping and intersecting time periods. You can easily combine this classes with your business objects:
看一下禁忌搜索和模拟退火作为遗传算法的替代品。
这与 Drools Planner(java,开源)中的 PAS 示例非常相似,其中是关于在各种限制下将患者安排到医院病床上。
请参阅 幻灯片 和下一张幻灯片。
Take a look at Tabu search and Simulated Annealing as a replacement for genetic algorithms.
This is very similar to the PAS example in Drools Planner (java, open source), which is about scheduling patients into hospital beds with all kinds of constraints.
See the slide and the next slide.
使用稀疏矩阵。
在酒店客房预订 ax x 的情况下,
所有它们(1,2,3)都可以表示为列表,或者 3 可以表示为哈希表。
示例:
然后添加所有插入、删除、冲突等保留逻辑的方法。
可以证明,通过这种结构,您可以通过移动矩阵轻松管理任何预订。
Use a sparse matrix.
In the case of a hotel rooms reservations
All them (1,2,3) could be represented as a list or for 3 a hash table.
Example:
Then you add all the methods for inserting, deleting, collisions etc. reservations logic.
It can be proved that with this structure you can easily manage any reservation by traveling the matrix.