资源调度问题
我正在开发一个摩托车租赁网站。我遇到的问题是如何高效地解决为客人分配摩托车的问题。我知道如何以“愚蠢”的方式做到这一点,但我想知道是否有一种经典算法可以解决此类问题。这与将客人分配到酒店房间是同样的问题。在最后一个示例中,目标是通过从不因调度效率低下而拒绝预订来实现最大入住率。
我很确定这个问题一定是一个有已知解决方案的经典问题。
多谢。
I'm developing a motorcycle hire website. The problem I have is how to solve the problem of assignment a guest to a motorcycle in an efficient way. I know how to do it in a "silly" way, but I want to know if there is a classical algorithm that solves this kind of problem. It's the same problem as the assignment of a guest to rooms in a hotel. In this last example, the goal is to achive maximum occupancy by never rejecting a reservation due to inefficient scheduling.
I'm pretty sure that this problem has to be a classic problem that has a known solution.
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您感兴趣的是间隔调度。假设所有预订都具有相同的权重(没有一个比其他预订更受青睐),您需要一个贪婪算法。
这里 (pdf) 是一些关于主题。
基本上,您希望首先安排最早结束的预订。
What you're interested in is called Interval Scheduling. Assuming all reservations have the same weight (none are favored over any other), you'd want a greedy algorithm.
Here (pdf) are some good slides about the topic.
Basically, you want to schedule the earliest-ending reservations first.
这是间隔调度,但它是一种在线算法。如果您想进一步阅读,可以在这里阅读:
http://www- bcf.usc.edu/~dkempe/teaching/online.pdf
This is Interval scheduling but it's an online algorithm. If you want to read further you can read here:
http://www-bcf.usc.edu/~dkempe/teaching/online.pdf