Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello. I have an access database that consists of 5 tables: one of student information including a student ID, one of teacher information including a teacher ID, one of course information including a course ID, one the refers to a student and course (the student wants to take that class) and one that refers to a teacher and a course (a teacher that can teach that class). What I need to do is to generate a schedule of classes that allows the most students to take the classes they want. The school day is 7 periods long and each student is required to take 6 classes. Each teacher must teach 5 classes. The problem is that, for lets say calculus, there are only enought students interested to fill 3 classes, so I can't be offered all periods. The only algorithm I thought of (very inefficient) is to generate all possible schedules and determine for each how many students cannot take all there classes. Establish a max number of these unfulfilled students and discard those schedules that are above that number. The max number can also be dynamically changed as each successive permutation is generated. Any ideas would be great!!

how much info is being provided?
I assume you know which students want which classes and which teachers can teach which classes.The problem is very large as is. pick it apart. What are the class size limits? Are there too many students to fit in the class? How many classes would be required to fit all students who want the class if only the minimum number attend? if the maximum number attend? Is this number of classes greater than the number of teachers who can teach it?
These kinds of questions break down your problem into a set of functions that will make your program easier.
Generating all possible permutations should not be necessary if you take out the impossibilities before hand. Set limits. Then run the permutations.

![]() |
using rundll32
|
static vs dynamic lib
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |