1 3 4 5 6 7 8 Previous Next 110 Replies Latest reply on Jan 31, 2011 8:45 AM by PhHein Go to original post
      • 60. Re: Optimized Time table generator algorithm
        hey DileepBellamkonda
        can u plz send me the code for time table generator. I m in dire need of it.
        my id is : ace_ady18@yahoo.com
        Thank U.
        • 61. Re: Optimized Time table generator algorithm
          hi yar....i please need this...automated time table generator kindly...help..me since...im not well...i cant able to concentrate..much...can anyone teach...or give the code...can anyone help me...please mail to my id hi_nithia@yahoo.co.in
          • 62. Re: Optimized Time table generator algorithm
            It is a efficient way to use genetic algorithm in timetabling system? If the system need to allocating about 1500 events with resources(130 lecturers 200 groups of students and 60 room with different capacity available). The combination must be very large. It need to evaluate more than million of combination to get best fit timetable. I developed a system but it take about 200 hours (from caculation) to find the best fit timetable from above timetable problem. I gave up.
            • 63. Re: Optimized Time table generator algorithm
              Hi Marlin,
              I am new to Java and always wanted to develop some sophisticated applications or games using languages such as c++ and Java.
              I have read this thread several times while trying to get help for developing my first Java application. The application is a timetabling software for scheduling University Exams. I have noticed from your replies that you are quite knowlegable in this area.I have already started with the problem by defining the claasses I am going to use for the timetable problem. following are the current classes that I have defined for the application:
              public class Activity {
                   private int activityId;
                   private String activityName;
                   private List<Resource> requiredResources = new ArrayList<Resource>();
                   private List<Student> registeredStudents = new ArrayList<Student>();
                   private int duration;
                   private int preferedStartingTime;
              public class Day {
                   private int dayId;
                   private final String[] nameOfDay = {"Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"};
                   private List<TimeSlot> timeSlots = new ArrayList<TimeSlot>();
                   private String dayOfWeek;
              public class Problem {
                   private List<Activity> activities = new ArrayList<Activity>();
                   private List<TimeSlot> timeSlots = new ArrayList<TimeSlot>();
                   private List<Day> days = new ArrayList<Day>();
                   private List<Constraint> constraints = new ArrayList<Constraint>();
              public class Resource {
                   private int resourceId;
                   private String resourceName;
              public class College {
                   private int collegeId;
                   private String collegeName;
              public class Room {
                   private int roomId;
                   private String roomName;
                   private int roomCapacity;
                   private List<Resource> availableResources;
                   private College college;
              public class Student {
                   private int studentId;
                   private String studentName;
                   private List<Activity> studentActivities = new ArrayList<Activity>();
              public class TimeSlot {
                   private Day day;
                   private int timePeriod;
              public class TimeTableSolver {
              // This class will contain the algorythem to solve the problem
              public interface IConstraint {
              // This is the constraints interface that will have sub classes
              // that represent particular constraint
              I have also included the setters and getters method in each class as appropriate and methods for adding list elements and checking for a particular condition such as the following method in the Room class:
                    * @param requiredResource
                    * @return true or false
                   boolean hasResource(final Resource requiredResource) {
                        if (requiredResource != null) {
                             final Iterator<Resource> resourceIterator = availableResources.iterator();
                             while (resourceIterator.hasNext()) {
                                  final Resource currentResource = resourceIterator.next();
                                  if (currentResource.equals(requiredResource)) {
                                       return true;
                        return false;
              I am still reading more on how solve this problem; but getting some comments and tips would be of great help.


              • 64. Re: Optimized Time table generator algorithm
                Off the top of my head, here are reactions to your design:

                1) I don't understand why a Day has a list of time slots. I mean every TimeSlot has a Day, which has a list of TimeSlots which is a whole bunch of Days which are even more lists of TimeSlots... I mean, isn't a Day just like Saturday or Monday?
                2) I espically do not understand why each Day lugs around a copy of an array of strings that just name the days of the weeks. Seeing this makes me wonder if you know what static members are.
                3) why does Day even have a string dayOfWeek? If that String is just a bucket to hold the name, well the name is sitting right over there in the static final array nameOfDay. When you need it, you can look it up.
                4) I see where you have students hanging onto lists of activities and activities hanging onto lists of students. This is OK if necessary, but will require that you maintain these properly meaning that if you ever add or remove from one list you must add or remove from some other list as well. If you only have the list in one place and not in both places then automatically internal consistancy is insured. So as a general rule, if I see a list in only one place I know it is internally consistent and I don't worry if it is right. If I see the lists in two places, I expect to see comments explaining WHY it is needed in two places and a WARNING to anyone that plays with the code that they MUST rember to update the list in the other class if they ever play with the list in this class. On the other hand, I guess that it is possible that neither of these lists has anything to do with the solution at all. If all you are doing is deciding when and where to hold exams, you already know exactly which students are in which activities and none of that ever changes. It is just reference data set up before the solution process starts and it never changes during the solution. (I said that this was all off the top of my head.)
                5) I see no association between Rooms and anything else. Presumably the whole point of this code was to associate a room with an activity. So where is that data kept?
                6) your Problem class is pretty scary. It has a list of Activities and a list of TimeSlots and a list of Days. What are the relationships between these lists? Every TimeSlot on the list fits with every Activity? or are these lists just the static lists of all possible activities and all possible timeslots, from which a solution will be created? If it is the latter, it would seem more customary to have the individual classes hold onto their static lists. For example the Room class would have a static list of all the Rooms that exist so that if you need to find a Room you can run that list. Once again I wonder if you know about static elements.
                7) I shudder at the thought of a Constraints class, particularly one whose only members and methods are comments saying, // the magic all happens here!

                So let me check if I understand what the problem is that you want to solve. You have a bunch of students that have been attending courses all year and now they need to take exams. Each course will lead to a single Activity - namely the final exam for that course. The course may have met at 9:00 AM MWF in room 213 but the course was only an hour long whereas the exam may be a 2 hour exam and thus could collide with another class if we did not move it to another time/day/location. If we do move it to a different time/day/location then suddenly students might run into conflicts with other exams. So the problem is to a) assign a single time on a single day to a single room for each activity with no overlap and b) to minimize the number of students that are supposed to take two different exams at the same time.

                Is that substantially the problem or have I left out something.

                Perhaps the first step is to refine the one paragraph statement in english of the problem that our code is going to solve. Then we will refind the class definitions from that paragraph.
                • 65. Re: Optimized Time table generator algorithm
                  1) The Day class is not meant to just display days {Suturday, Monday, ...}. It is meant to keep track of how many slots we might have in one day. One day could have 9 slots each 1 hour long; or it could have 24 slots. The dayOfWeek variable returns a string from the nameOfDay depending on the value of dayId.
                  Since we have seven days defined in the nameOfDay array, I can return the name of day using the following formula:
                  dayOfWeek = nameOfDay[dayId%7], where dayId could be any number from 0 to number of days for the activities. I just realized that I have to remove the Day varibale from TimeSlot class.
                  2) To my understandng from text books; a static member or varibale is one that can be accessed through the class itself, without instatiating it!! Any how I did not include any static members in my initial design!! or did I.
                  3) The reason for the dayOfWeek member to return the name of the day for any dayId. Say you have days from 0 - 14 (two weeks). If I wanted to know the exact string representation of the day I would call the getDayOfWeek function to returns the day string. See (1).
                  4) I have to review the two lists , but initially the activities will need to have the list of registered students to determine the number of students registered that will be used when assigning a room to the activity. By the way the list might change if one decided to add some students to the activity or remove some students before processing the time table, so it is required to have the list of registered sturdents.
                  5) Rooms will be associated with Day and TimeSlots. In my Day class I will define an assignment multiple array of integers that will hold both roomIds and slotIds. This is still not implemented.
                  6) I am new to Java and I am still experimenting with it. Static modifier has always confused me, but as I explained earlier, to my understanding you can access static memebers and methods through the class itself without instantiating any object!!. The Problem class is not finalized. Infact neither of the classes are totally comeplted. These are just my initial thoughts. I am sure I will revisit most of the classes again and again till I reach to a satisfactory design.
                  7) The IConstraint class (actually an interface) is not finalized; it is not even initiated yet. I just included it here for a reference of the classes I am going to use for the application. Ofcourse it will hold many members and methods.

                  The Definition of the Problem is as follows:The university has specific number of students who have attended specific course and would have to seat for a specific exam (ie. Activity). The exam could could be set in any day of the week (typically during weekdays) depending on room availability and capacity. Some courses can lead to multple exams; but that is not important as we are only concerned about the exam itself and not the course. During the exam period no course are being held, so all rooms will be dedicated to the exams. We need to find away to assign exams to a specific period in a day during the exams period provided that each exam (Activity) is held a single room (activities can not exist in two different rooms at the same time in the same day). students should not be in two different locations in the same day at the same time. Some large rooms can host multiple exams. The solution should allow exams with a predefined starting time be allocated always in the prefered stating time (eg. the first slot(s)). There should breaks between slots (eg. 2 hours for lunch). Should be able to define the period using two date variables from which the number of days can be determined. The user should specify which days are weekend and which are weekdays in the preference dialoge windows. Soft and Hard constraints should be included when deriving the solution.
                  In general the application should solve a University Exam time Table.

                  This what I have for now.

                  • 66. Re: Optimized Time table generator algorithm
                    Dear Friends,
                    Did anyone of you find any help regarding the algorithm for generating a time table? Can someone help me with the same? I'm also in the quest of generating a time table. It'l be helpful if someone could get back with algorithms or some doc.
                    • 67. Re: Optimized Time table generator algorithm
                      Dear Friends,
                      Did anyone of you find any help regarding the
                      algorithm for generating a time table? Can someone
                      help me with the same? I'm also in the quest of
                      generating a time table. It'l be helpful if someone
                      could get back with algorithms or some doc.
                      Did you even read the entire thread? Did you try Google?
                      • 68. Re: Optimized Time table generator algorithm
                        I have some PDFs that I can share with you, which might help you with your quest. Unfortunately I am way from my computer but once I am home I will post the links to these PDFs. they describe some of the algorithms used, but they don't provide full working code examples.

                        but as suggested by PrometheUzz, you could always try to search for these documents using google. try using Exam timetabling or school timetabling as your search string.

                        • 69. Re: Optimized Time table generator algorithm
                          I'm also in the quest of
                          generating a time table. It'l be helpful if someone
                          could get back with algorithms or some doc.
                          I suggest you start here - Its a free article provided
                          by the European Journal of Operational Research.
                          Its called "Introduction to Timetabling".

                          • 70. Re: Optimized Time table generator algorithm
                            Here are a list of links that might help:







                            • 71. Re: Optimized Time table generator algorithm
                              give time table generation algorithm
                              • 72. Re: Optimized Time table generator algorithm
                                give time table generation algorithm
                                How can we resist such a friendly request?
                                • 73. Re: Optimized Time table generator algorithm

                                  if u have please send me the code 4 automatic timetable generator....thnx
                                  • 74. Re: Optimized Time table generator algorithm
                                    Guys check out this site ...

                                    1 3 4 5 6 7 8 Previous Next