Author Topic: Schedule all activities as early as possible  (Read 71 times)

0 Members and 1 Guest are viewing this topic.

stuartsjb

  • Level 1
  • *
  • Posts: 4
    • View Profile
Schedule all activities as early as possible
« on: February 12, 2018, 06:50:20 AM »
This program is fantastic. I'm using it to schedule student interviews over a two-day event at a university, as this has complicated requirements that are very similar to school timetabling.

One requirement that would be useful to me is the ability to tell FET to schedule all activities as early as possible. That is, I usually want everyone (teachers and classes, in FET terminology) to finish as early as possible, with as many of the gaps at the end of the day as possible.

Currently I do that by gradually making teachers unavailable during late slots in the day, and/or by fixing some activities. However this is time-consuming, and I haven't found a neat way to do this using constraints. Might it be possible or useful to add a 'schedule all activities as early as possible' constraint, to avoid FET spreading activities out over a day, please?

Thanks again for such a helpful program.

Stuart.

Volker Dirr

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 1952
    • View Profile
Re: Schedule all activities as early as possible
« Reply #1 on: February 12, 2018, 07:03:38 AM »
In normal case "all early" is impossible.

I am not 100% sure how you did enter activities. With students and teachers or teachers only?

But reading your whole suggestion i think it might be already possible today:
you need to add constraint "students must start early" and "students max gaps". (Since you might need that for teachers, you need to add teachers as students.)


stuartsjb

  • Level 1
  • *
  • Posts: 4
    • View Profile
Re: Schedule all activities as early as possible
« Reply #2 on: February 12, 2018, 07:14:14 AM »
Hi Volker,

Ah at the moment I just make each student a year group, each interviewer a teacher, each interview type a subject, and each of our sites a building -- it works really well! For two years running now, FET has saved us some considerable timetabling headaches on the first evening of our two-day recruitment event.

I'll give those two constraints a go next time -- although I think I did try those before. My understanding is that both those constraints need to be set at 100%. However it won't be possible in all cases: there will always be some students and teachers where there won't be a solution that doesn't involve them starting late and/or having more gaps in the day. What I'm really trying to do is to ask FET to try to push all activities towards the start of the day where possible, and only using later slots where necessary.

Perhaps I'm doing the right thing already as a consequence: adjusting the constraints gradually, re-running 'generate timetable' repeatedly until it's only just possible to find a solution?

Stuart.

Volker Dirr

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 1952
    • View Profile
Re: Schedule all activities as early as possible
« Reply #3 on: February 12, 2018, 07:38:40 AM »
You should try the flag "allow second hour".
An other variant is to use activities allowed times with less than 100%.(Even i don't like that suggestion too much. It is working well with easy timetabletables, but it is difficult to find bugs with that constraints. especialy if you have a difficult one.)

stuartsjb

  • Level 1
  • *
  • Posts: 4
    • View Profile
Re: Schedule all activities as early as possible
« Reply #4 on: February 12, 2018, 07:46:34 AM »
Understood -- thanks! I think when I tried the 'max beginnings at second hour', I was finding that this constraint was met, but I'd find that a student with two interviews might then end up with one at the start of the day and one at the very end -- not ideal! I can't just use a 'max gaps' constraint, because there will always be an exception to the rule that means that I have to allow quite a lot of gaps ... just to cater for a handful of students.

From what you're saying, I think I'm probably working along the right lines already, by generating a timetable, and then looking for teachers with lots of gaps and gradually making them unavailable at the end of the day. That seemed the best way to optimise the result -- I'm pleased that I'm not missing some constraint that essentially does that automatically!

Volker Dirr

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 1952
    • View Profile
Re: Schedule all activities as early as possible
« Reply #5 on: February 12, 2018, 08:19:11 AM »
ok. if your timetable isn't too difficult you can try the activities preffered starting times constraints. you can add "not available" time for students/teacher (or better just the subject?) with less than 100%.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5273
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Schedule all activities as early as possible
« Reply #6 on: February 12, 2018, 08:56:03 AM »
Thank you for the appreciation!

There are some other kinds of (FET official) constraints I am thinking of and, if they are not enough, maybe a small customization might do something even better:

- Constraint students (set) / teacher(s) interval max days per week - in FET you are allowed to add maximum 3 constraints of these for each students set / teacher. Might be useful a combination of these. Say from 17:00 to 20:00 max 1 times per week, from 16:00 to 20:00 max 2 times per week, and from 12:00 to 20:00 max 4 times per week. Or something like this.

- Constraint activities occupy max time slots from selection - to force a students set / teacher to have activities at a given moment of the week. But I don't think this is useful.

I just turned on the computer. I'll read more carefully your problem and see what can be done.

If you want to help me more, you might want to send me your file (here or privately by email) so I can see what it is about.
« Last Edit: February 12, 2018, 10:29:14 AM by Liviu Lalescu »

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5273
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Schedule all activities as early as possible
« Reply #7 on: February 12, 2018, 11:22:48 AM »
If a progressive approach using the constraints students (set) / teacher(s) interval max days per week does not work, maybe I can implement a new constraint, to be used again in a progressive manner, but easier for you. I think it makes sense in practice to have only weight 100% possible for this constraint (even if I can make it have weight <100%, it would not be useful). I have the idea that each activity adds a quantity x to the total sum, where x is the number of hours from where the activity begins to the first slot of the day. So you can work with a single overall constraint, with a large value, and lower it. A value like maybe 1000*10 (n_activities*n_hours_per_day), but you can increase/decrease by much more than 1 in the beginning.

Question: x should be as above, or (but I think this is bad:) as the number of free hours to the nearest activity in the decreasing direction?

I do not see the use of this constraint useful for other users. Also, I am not sure I can implement this constraint is a perfect/best way. I need to think some more on it. This is why I would prefer to implement it only in a custom version for you.

stuartsjb

  • Level 1
  • *
  • Posts: 4
    • View Profile
Re: Schedule all activities as early as possible
« Reply #8 on: February 13, 2018, 05:09:05 AM »
Hi Liviu,

Many thanks for thinking about this for me! I could certainly send you a version of my data file (with the names changed, and my progressive constraints removed) -- how should I send it?

For me, an optimal solution is one that makes both 'teachers' and 'classes' finish as early as possible. The ideal would be that every 'class' would start with an activity in Slot 1, and then have every following slot filled until they finish. Similarly, though less critically, for teachers: they would start as early as possible and then have no gaps until they finish. This doesn't tend to be possible, of course, but every deviation from this ideal should be minimised.

Commonly, when I first generate a timetable at present, I initially get solutions that involve a student having their single activity right at the end of the day; or students with two activities having them in the first and last session, for example. I'm trying to let students travel back home as early as possible, with as little waiting around as is feasible; and where possible I'm also trying to minimise the disruption for the 'teachers', by having all their programmed activities in as short a chunk as possible.

It's definitely a tribute to the flexibility of FET that the optimisation procedures that you've created can be applied to such a different context as this!

Best wishes,
Stuart.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5273
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Schedule all activities as early as possible
« Reply #9 on: February 13, 2018, 05:36:37 AM »
Hello, Stuart,

If the file you intend to send is not private (no sensitive information), you can attach it here in a new reply to this topic (archived if it is too large). If it is private, you can send it to any of my email addresses, listed on FET homepage -> Contacts, or on the email address written (not in clear, to avoid spam) on my personal page (https://lalescu.ro/liviu/)

If you don't "tell" something to FET, it will not care about this. That is why you get many late hours/gaps if you don't add max gaps constraints.

There are available max gaps per day/week constraints for students and for teachers. For students there is also a constraint max beginnings at second hour, but I think it is too strong, since this does not allow a students set to begin at the third hour. For teachers, unfortunately, there is no constraint to take care of beginning early.

Maybe a good way is to slowly decrease the max gaps allowed per day/week. It is not possible to allow weight <100.0% for these constraints because I saw that practically even with the weight 99.99% the results were bad. But I might have a try to allow weights less than 100.0% for max gaps constraints, if you really want to test this.

I also wrote you about interval max days per week constraints. What do you say about them?

There is also the possible new constraint in a custom version. I am not sure it is what you really need, though, because while the overall activities will be early, the gaps might not be optimum.

Maybe also another variant could be a global maximum for all students sets / teachers number of gaps per day/week. This as a new constraint. I am not sure if it is feasible - as the speed of the program might not be very good compared to individual students sets / teachers max gaps, and you might end up with a students set with many gaps. But we can investigate even this variant, if you want.