So I am trying to make a course scheduler. The program would contain all the courses offered in a particular semester. The user will input the courses he wants to take for a particular semester, and the program would generate all possible timetables based on the users input. (For example a particular course maybe taught my multiple instructors in multiple time slots, that is what I mean by ALL possible timetables)
The approach I am taking is the following I have a Course class which stores all the information about a particular course I have a CourseContainer which has an ArrayList of all the courses I am having hard time in generating all possible timetables So far I have a getAllCourse method
public ArrayList<Courses> getAllCourse(String name){
ArrayList<Courses> all = new ArrayList<>();
for (Courses course : container) {
if (course.getName().equals(name))
all.add(course);
}
return all;
}
This way I have multiple arraylists of all the courses the user wants. I can not figure out how to get the combinations out of this.
I would appreciate if any one can tip me on how to do this or a better way.
Thank you!