对要分配的任务进行排序
我有一个问题,我不知道从哪里开始。我真的很感激一些帮助。
问题:
我有几项 T 任务必须由 1 名员工在 D 天内完成(让我们忘记现在使用多种资源)。每个任务可以在某些时间内完成(并非所有任务都可以在所有时间完成)。例如:如果我的员工 8 点开始工作,其中一项任务是“打电话给客户”。也许客户办公室九点钟开门。
此外,每个任务都有一个持续时间(实际估计的)。假设D天足够完成所有任务。
我必须将任务分类给员工。例如:周一 8:00 执行任务 7,然后在 9:30 开始任务 2。在示例中,任务 7 的持续时间为 1 个半小时。
感谢您的帮助!
迭戈·
PD:如果有人有办法做到这一点,而且它不是一个算法,没关系,请回答,我会设法思考算法。我只是不知道如何面对这个问题。
编辑 项目有用吗?
编辑2 不需要任务/作业依赖性
I've got a problem that I don't know where to start. I'd realy appreciate some help.
The problem:
I have several T task that must be done in D days by just 1 employee (let's forget using several resources right now). Each task can be done in some times (not all tasks can be done all time). e.g.: If my employee starts working at 8 o'clock and one task is "call a client". Maybe the client office opens at 9 o'clock.
Also each task has a duration (really estimated). It is supposed that the D days are enough to do all task.
I've to sort the tasks to the employee. e.g.: at monday 8:00 do task 7, then at 9:30 starts with task 2. In the example task 7 duration would be 1 and a half hour.
Thanks for the help!
Diego
PD: If someone has a way to make this and it is not an algorithm never minds, please answer and I'll manage to think the algorithm. I just don't know how to face the problem.
Edit
Would Project be usefull?
Edit 2
Tasks / Jobs dependency is NOT required
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果这是“应用程序的一小部分”,您可能需要与客户重新协商:作业车间调度 是 NP 完全(俗语:随着复杂性的增加,很快就会变得非常困难).
思考的一些要点:
当你在谷歌上搜索“作业车间调度”时,你会遇到比你想阅读的“应用程序的一小部分”更多的科学论文......
(披露:我工作的公司提供不同 工具来完成这类事情。)
If this is a "little part of an app" you might want to renegotiate with the client: Job shop scheduling is NP-complete (vulgo: gets real difficult real quickly with increasing complexity).
Some points to ponder:
When you google for "job shop scheduling" you'll come across more scientific papers than you'll ever want to read for a "little part of an app"...
(Disclosure: I work for a company that offers different tools to do just this sort of thing.)
您的问题是运筹学问题的一部分。这个主题已经被大量研究,并且没有简单的算法。这类调度问题通常是非多项式的,所以基本上你必须尝试每种组合,但是当约束被打破时你可以中断。也就是说,如果您知道自己不能在 9:00 之前完成,则无需从 8:00 致电客户开始尝试所有组合。
因此,谷歌搜索有关运筹学和约束规划算法以及组合优化的内容。
Your problem is a part of operations research problems. This topic has been massively studied and there is no simple algorithm from that. Those kind of scheduling problem are usually non-polynomial, so basically you have to try every combinations, but you can cut-off when a constraint is broken. I.e there is not need to try all the combinations starting by call the client a 8:00 if you know that you can not do it before 9:00.
So google stuff about operations research and constraint programming algorithms and combinatorial optimization.
您需要找出算法的输入是什么。输入的一部分是任务列表以及每个任务的持续时间。每个任务也有要求:
可能有更多要求。要发现您还需要什么,您应该尝试手动解决一些具体问题。当您尝试时,可能会发现更多要求。无论要求是什么,您的算法都应该尝试以类似的方式满足它们,就像您手工完成的那样:当时的一个要求,如果某些要求发生冲突,则回溯并尝试不同的路线。算法应该首先从最严格的要求开始。
You need to find out what is the input for your algorithm. Part of the input is list of tasks with duration for every task. Each task also has requirements:
There could be more requirements. To discover what more you need you should try to solve some concrete problems by hand. While you try some more requirements may be discovered. Whatever the requirements are your algorithm should try to satisfy them in similar fashion like you did it by hand: one requirement at the time, and if some collide then trace back and try different route. Algorithm should start from most restrictive requirements first.
您可以使用约束规划来解决此类问题,前提是元素数量不太大。
查看 ECLiPSe(请参阅 http://eclipseclp.org/)。
You can solve these kind of problems using constraint programming, provided the number of elements is not too big.
Take a look at ECLiPSe (see http://eclipseclp.org/).
这是解决此类问题的另一个库:Drools Planner(开源,java )。
请注意,它一起解决了所有要求(=约束),因为特别是如果您有硬约束和软约束,您会发现通常可以解决所有硬约束,但不可能解决所有软约束(您仍然希望最小化尽可能多地使用它们)。
Here's yet another library for these kind of problems: Drools Planner (open source, java).
Note that it solves all the requirements (=constraints) together, because especially if you have hard and soft constraints, you'll find that it's usually possible to solve all hard constraints, but impossible to solve all soft constraints (you still want to minimize them as much as possible).