[LRUG] Timetabling library in Ruby

Luis Correa d'Almeida luis.ca at gmail.com
Thu Aug 11 15:38:30 PDT 2011


The idea is to come up  with an acceptable (ideally optimal) schedule
given a list of students, lectures, teachers and classrooms. Beyond
that, you would need to obey certain criteria, such that, for example,
students and/or teachers cannot be in two rooms at the same time. You
would need to ensure that the right teachers teach the right subjects
to the students that enrolled in a particular subject. You could even
conceive of scenarios where a student cannot have more than 2 hours
between lectures.

I think the problem is understood, and there are solutions out there.
My questions was more around whether anyone knew of a gem or library
in Ruby that would handle this.

On Thu, Aug 11, 2011 at 9:02 PM, Raul Guiu <raulguiu at gmail.com> wrote:
> Do not overcomplicate it.
>
> Before you save a new appointment you can check if the startdate is
> between the start and end date of the existing appointments for that
> user.
>
> The academic problem gives you a hole list of appointments and ask you
> if any overlaps. It is a bit harder, one way of solving it is by
> ordering by start date and look at them in order, you keep the "latest
> end date" and keep looking at the appointments, if the start date is
> later than the last date that have recorder there is a conflict.
>
> But as I said, if you add the appointments in order you just reject
> the ones overlap. SELECT count(*) where start_date <
> MY_NEW_APPOINTMENT_START_DATE and end_date >
> MY_NEW_APPOINTMENT_END_DATE. (or the equivalent in active record).
>
> Excuse me if my comment is not very helpful or what you expected.
>
>
> On 11 August 2011 20:23, Riccardo Tacconi <rtacconi at gmail.com> wrote:
>> Hi
>>
>> The StackOverFlow thread Genetic Algorithms are mentioned. May be you can
>> find this book useful: http://www.cleveralgorithms.com/
>>
>> On 11 August 2011 20:06, Luis Correa d'Almeida <luis.ca at gmail.com> wrote:
>>>
>>> Hello all
>>>
>>> Wondering if anyone has published/knows of any gems/libraries in Ruby
>>> that can compute timetables based on a set of simple restrictions
>>> (people can only be in one place at a time, meeting rooms can only
>>> hold one meeting at a time, etc...) Classic example would be building
>>> the schedule for a university.
>>>
>>> There are some implementations in Java, but I'd rather not go down
>>> that path. In case you are interested, links below.
>>>
>>> http://www.jboss.org/drools/drools-planner.html
>>> http://www.unitime.org/index.php?tab=0
>>> http://timefinder.sourceforge.net/
>>>
>>> Another interesting thread on the subject
>>>
>>>
>>> http://stackoverflow.com/questions/2177836/algorithm-for-creating-a-school-timetable
>>>
>>>
>>> --
>>> Luis Corrêa d'Almeida
>>> tribe.fm/luis
>>> _______________________________________________
>>> Chat mailing list
>>> Chat at lists.lrug.org
>>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>>
>> --
>> Riccardo Tacconi
>> Ruby on Rails and PHP development - System Administration
>> VIRTUELOGIC LIMITED
>>
>> http://github.com/rtacconi
>> http://riccardotacconi.blogspot.com
>> http://twitter.com/rtacconi
>> http://www.linkedin.com/in/riccardotacconi
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



-- 
Luis Corrêa d'Almeida
tribe.fm/luis



More information about the Chat mailing list