是否有一种算法可以创建整个学期的大学时间表?

发布于 2024-09-06 04:09:52 字数 956 浏览 1 评论 0原文

我必须实现一种算法来生成大学的时间表。我搜索并发现了很多算法。但问题就在这里。我需要一种算法来生成整个学期的时间表,而不是每周的时间表。它还应该考虑课程各部分的预定义顺序,例如练习 1 应该在讲座 2 之后、讲座 3 之前。您有什么建议吗?

谢谢。

更新:
我有以下硬性限制:
H1:在任何时间段,每个房间仅分配一个课程部分。
H2:该房间可以容纳所有参加的学生,并满足活动所需的所有功能。
H3:没有学生同时修读一门以上课程(至少是必修课)
H4:没有老师同时教授多个课程部分。

软约束是:
S1:课程部分不应分配给讲师不方便的时间段。
S2:老师的班级之间应该有最小数量的间隙。
S3:学生的课程之间应该有最少的间隙。
S4:课程应满足讲师的偏好 - 日期和时间段。
S5:课程部分应按照预先定义的顺序进行安排。

示例:
《软件架构》课程

Week No   Course    Room    Course Part   Day       Time
--------+---------+-------+--------------+----------+-----
Week 1:   SA        435     Lecture 1     Wednesday  8.15-11
Week 2:   SA        435     Lecture 2     Wednesday  8.15-11
Week 3:   SA        47      Lab 1         Monday     13-15
Week 3:   SA        436     Lecture 3     Wednesday  11-14
Week 4:   SA        243     Exercise 1    Monday     13-15
Week 5:   SA        436     Lecture 4     Wednesday  8.15-11

I have to implement an algorithm that generates a timetable for a university. I've searched and found a lot of algorithms. But here is the problem. I need an algorithm that generates a timetable for the whole semester, not on a weekly base. It should also consider the predefined order of the course's parts, e.g. exercise 1 should be after lecture 2 and before lecture 3. Do you have any suggestions?

Thanks.

UPDATE:
I have the following hard constraints:
H1: Only one course part is assigned to each room at any time slot.
H2: The room can host all attending students and satisfies all features required by the event.
H3: No student attends mode than one course at the same time (at least the obligatory courses)
H4: No teacher teaches more than one course part at the same time.

The soft constraints are:
S1: A course part should be not allocated to a time slot inconvenient for a lecturer.
S2: There should be a minimal number of gaps between classes of a teacher.
S3: There should be a minimal number of gaps between classes for student.
S4: Classes should satisfy lecturer preferences - days and time slots.
S5: Course parts should be scheduled to predefine order.

Example:
Course "Software architecture"

Week No   Course    Room    Course Part   Day       Time
--------+---------+-------+--------------+----------+-----
Week 1:   SA        435     Lecture 1     Wednesday  8.15-11
Week 2:   SA        435     Lecture 2     Wednesday  8.15-11
Week 3:   SA        47      Lab 1         Monday     13-15
Week 3:   SA        436     Lecture 3     Wednesday  11-14
Week 4:   SA        243     Exercise 1    Monday     13-15
Week 5:   SA        436     Lecture 4     Wednesday  8.15-11

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

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

发布评论

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

评论(4

奶茶白久 2024-09-13 04:09:52

您可能需要查看间隔调度。听起来您需要一个修改版本,添加一些限制,例如允许放置练习的位置。贪婪算法通常很容易修改,并且有一大堆已经修改的版本基本 IS 算法。

You might want to look into interval scheduling. It sounds like you would need a modified version that added some constraints such as where the exercises are allowed to be placed. Greedy algorithms are usually rather easy to modify, and there's a whole bunch of already modified versions of the basic IS algorithm.

末が日狂欢 2024-09-13 04:09:52

我最终得到了此处建议的算法的修改版。我使用迭代前向算法,然后对软约束应用模拟退火。我更改了时间段集,以便它包含该学期的整个时间段集,不包含周末和假期。例如,如果学期有 6 周,每周有 40 个小时,那么我的时隙集将包含全部 240 个时隙。

我还为订单添加了约束。当不满足此约束时,就会对当前解决方案给予较高的权重。通过这种方式,我可以防止算法选择课程不符合顺序的解决方案。

I ended up with a modified algorithm of the one suggested here. I used the Iterative Forward Algorithm and then applied the simulated annealing for the soft constraints. I changed the timeslots set, so that it contains the whole set of timeslots for the semester without the weekends and the holidays. For example, if the semester has 6 weeks and for each week I have 40 hours, then my set of timeslots will contain the whole 240 timeslots.

I also added a constraint for the order. When this constraint is not satisfied then it put a high weight for the current solution. In this way I prevent the algorithm to choose a solution with courses that are not in the with order.

夏末 2024-09-13 04:09:52

我正在从事类似的项目,并使用自适应遗传算法来解决手头的问题。

详细研究遗传算法,然后使用您的约束设计一个流程图来解决您的问题,同时考虑到您提到的所有约束。

I am working on similar kind of project and using Adapted Genetic Algorithm to solve the problem at hand.

Study genetic algorithm in detail and then using your constraints design a flowchart to solve your problem, taking into account all of the constraints you've mentioned.

爱*していゐ 2024-09-13 04:09:52

IIRC这样的问题并不能完全用算法来解决。

IIRC such a problem is not entirely solveable by algorithm.

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