使用图论生成考试时间表
我在互联网上寻找有关 adj 的帮助时偶然发现了这个网站。 矩阵/图论。
我的程序布局如下:
- 学生姓名+课程存储在
- 包含所有不同课程的二维数组
中我试图实现以下目标:
- 使用邻接矩阵创建一个 没有学生需要的考试时间表 每天写多个考试
一旦制作了矩阵,屏幕上的结果应显示为:
- 按课程输出每日考试时间表
- 查询的任何学生的考试日期
输出我 不太确定如何解决这个问题。 AFAIK,最好的方法是创建所有不同课程的总体考试时间表,并以考试彼此不冲突的方式进行计算。
非常感谢任何帮助/建议/链接。
关于如何编程有什么建议吗? 我似乎找不到任何关于对图形着色问题进行编程的伪代码或指南。
I came across this website while looking for help on the internet regarding adj. matrix / graph theory.
My program layout is as follows:
- student name + courses stored in a 2D
- array array with all distinct courses
I am trying to achieve the following:
- use adjacency matrix to create an
exam schedule where no student needs
to write more than one exam a day
Once the matrix is made, the results on the screen should be displayed as:
- output a day by day exam schedule by course
- output the exam days of any student inquired
I am not really sure how to work on this. AFAIK, the best approach would be to create an overall exam schedule of all the distinct courses and computing it in such a way that no exams conflict with one another.
Any help/advice/links is greatly appreciated.
Any suggestions on how to program this? I can't seem to find any pseudo code or guidance on programming the graph coloring problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将您的问题建模为图形着色问题。
编辑:
另一种启发式方法使用遗传算法。
You can model your problem as a graph coloring-problem.
Edit:
Another heuristic approach using genetic algorithms.
我建议首先采用暴力方法。 可能的考试安排数量可能很小,足以彻底搜索它们。
为了提供解决方案的更多细节,了解更多有关问题的信息将有所帮助:每天有多少次考试? 是否可以同时进行多项考试,或者它们都是按顺序进行的?
I would suggest taking the brute-force approach, to start. The number of possible arrangements of exams is likely small enough to exhaustively search them.
To give more detail for a solution, it would help to know more about the problem: How many exams per day? Is it possible for there to be multiple simultaneous exams, or are they all sequential?