为大学生制定潜在的时间表

发布于 2024-09-19 18:18:15 字数 266 浏览 5 评论 0原文

这是我的问题:我正在设计一个应用程序,允许学生选择他们想要在本学期学习的课程,并为他们创建潜在的时间表布局。每个课程通常都有几个可能的部分,这些部分在不同的时间发生。

因此,我正在寻找一种好的数据结构来开发一种可以执行此操作的算法。

有一个通用的方法可以做到这一点吗?我可以将任何数据结构和/或算法应用于这种情况吗?我只是在寻找一个开始的地方。

编辑:课程通常是周一、周三、周五或周二、周四。在很多情况下,一周中的不同时间也会进行实验或背诵,

谢谢, 抢

Here is my problem: I am designing an application that will allow students to select the classes they want to take for the semester and create potential schedule layouts for them. Each class typically has several possible sections that occur at different times.

So I am looking for a good data structure to use in order to develop an algorithm that will do this.

Is there a common way to do this? Any data structures and/or algorithms I can apply to this situation? I am just looking for a place to get started.

EDIT: The classes tend to be Monday, Wednesday, Friday or Tuesday, Thursday. In a lot of cases there are also labs or recitations that occur at various times during the week

Thanks,
Rob

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

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

发布评论

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

评论(3

千年*琉璃梦 2024-09-26 18:18:15

这是一个适合遗传算法的问题。至少,我的大学工作人员基于它开发了一种算法。以下是他们介绍该技术的一些论文。

http://morgoth.zemris.fer。 hr/people/Marko.Cupic/files/2009-425555.EvoCOP_2009.pdf

http://morgoth.zemris.fer.hr/people/Marko.Cupic/files/2009-422047.iti2009.pdf

This is a problem where genetic algorithms are suitable. At least, my University staff developed an algorithm based on it. Here are some of their papers where the technique is presented.

http://morgoth.zemris.fer.hr/people/Marko.Cupic/files/2009-425555.EvoCOP_2009.pdf

http://morgoth.zemris.fer.hr/people/Marko.Cupic/files/2009-422047.iti2009.pdf

掌心的温暖 2024-09-26 18:18:15

我会用一棵树
在每个节点(代表一个班级)每个部分的分支以及不参加课程的附加分支
您可以随时修剪日程安排冲突

,只要您不永远存储这些内容,并且每个学生每学期不包含太多课程,


该树就不应该变得太大该树将扎根于任何位置任意类。从根开始的每个分支都是该类的一部分(以及不接受它的额外分支)
然后在每个分支的末尾有更多的节点。这些节点都代表您在时间表中适合的第二类。
每个节点对于第二类的每个部分都有另一个分支。等等。

前任:

              math  
 /            /           \  
2:00        1:00         blank  
  |           |             |  
 p.e          p.e           p.e  
/    \        /   \        /  \   
2:00  blank  2:00  blank  2:00 blank  
 |  
conflict

I would use a tree
At each node (which represents a class) branch for each section and an additional branch for not taking the course
You can prune for scheduling conflicts at any time

This shouldn't get too big as long as you aren't storing these forever, and as long as you don't include too many courses per student per semester


The tree would be rooted at any arbitrary class. Each branch from root would be a section of that class (and the extra branch for not taking it)
Then at the end of each of these branches you have more nodes. These nodes would all represent the second class you're fitting in the schedule.
Each of these nodes would have another branch for each section of the second class. And so on.

ex:

              math  
 /            /           \  
2:00        1:00         blank  
  |           |             |  
 p.e          p.e           p.e  
/    \        /   \        /  \   
2:00  blank  2:00  blank  2:00 blank  
 |  
conflict
千纸鹤带着心事 2024-09-26 18:18:15

每个班级每周的每一天都有相同的时间表吗?还是像我的一样,有些是 MWF,有些是 TuTh,有些是 Sat?

如果所有课程都在一周中每天的同一时间进行,则该模型非常简单。您需要学生表、班级表、classSections 表和studentSchedules 表。

对于您的 classSection 表,由于课程每天的时间不同,如果每周的日期相同,您可以包含一周中的每一天 (M-Sa)、开始时间、课程时长(以小时),当然还有 classCodeID。

至少:

Student
   ID
Class
   classCodeID
   description
classSection
   classCodeID
   classSectionID
   isOnM
   isOnTu
   isOnW
   isOnTh
   isOnF
   isOnSat
   startTime
   length
studentSchedule
   studentID
   classCodeID
   classSectionID

您还可以标准化一周中的几天,而不是将它们放在 classSection 表中,但我喜欢看到在一堆复选框中映射出一周。

我发现您每周有多个开始时间,因此您需要在 classSection 表中添加另一个 ID 字段。

您拥有的应用程序看起来不错,您还没有数据模型吗?看来您甚至不需要成为学生就可以查看课程表。

Does each class have the same schedule each day of the week? Or are they like mine were, where some were MWF, others TuTh, and others Sat?

If all the classes are at the same time every day of the week, the model's pretty easy. You need tables for students, classes, classSections, and studentSchedules.

For your classSection table, since the classes aren't the same time every day, if they're the same days each week, you can include fields for each day of the week (M-Sa), start time, class length (in hours,) and, of course, the classCodeID.

At a minimum:

Student
   ID
Class
   classCodeID
   description
classSection
   classCodeID
   classSectionID
   isOnM
   isOnTu
   isOnW
   isOnTh
   isOnF
   isOnSat
   startTime
   length
studentSchedule
   studentID
   classCodeID
   classSectionID

You could also normalize the days of the week instead of having them in the classSection table, but I like seeing the week mapped out in a bunch of checkboxes.

I see you have multiple start times per week, so you'll need another ID field in the classSection table.

The app you have seems ok, don't you have a data model already? Looks like you don't even need to be a student to see the class schedules.

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