# distribute Periods in a school timetable

1. ## distribute Periods in a school timetable

Peace to you all
I'm still new here but after I searched the forum I found great work done
for the needy like me.
So I'm so hopeful
I'm concerned with making a timetable for my school which we used to do it manually
I need a code to distribute each teacher timetable with the following basis:
the number of classes_ the teacher is assinged to work with_multiplied by the number of periods ( which is changeable ).
e.g ; Teacher 1 has 2 classes (1-1 &1-2). Each class should be visited 9 timea a week.
So Teacher 1 should work 18 periods a week
the distribution I need 'd look like the example in Sheet("timetable")
Please don't let me down
any help 'd be greately appreciated

2. ## Re: distribute Periods in a school timetable

Working out how many periods a teacher should work is trivial. On your front sheet you could do it with a simple formula...

``Please Login or Register  to view this content.``

But you don't give any description of what alogorithm is meant to be used to distribute the periods across the week and they don't seem to fall into any particular pattern, so could you explain that a little more, please?

3. ## Re: distribute Periods in a school timetable

Hi Andrew
Thanks for trying to help
Working out how many periods a teacher should work is trivial. On your front sheet you could do it with a simple formula...
That was a very good suggestion. I did itat once
But you don't give any description of what alogorithm is meant to be used to distribute the periods across the week and they don't seem to fall into any particular pattern, so could you explain that a little more, please?
The most important basis I need is to distribute the periods in doubles.I mean every two periods should be neighboured ( 1-1 1-1 = = = 2-1 2-1) as soon as possible.
Also the distribution should be done with some kind of justice (fair enough)
Thanks again

4. ## Re: distribute Periods in a school timetable

The number one requirement for solving a problem in any coding language is ensuring that you understand the problem and can explain the solution to others. If you can't explain to another human the solution then you've got no chance of explaining it to a machine.

I mention this because, in your example, teacher 1 has 9 periods with 1-1 and 9 with 2-1, so if we say that the rules are:

#1 Where possible periods should be placed in pairs
#2 Where possible periods should alternate between the teacher's classes

The result for your example would be:

1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,2-1

So with 8 periods/day this would fill up 2.25 days of the 1st teacher's time, but I'm guessing it would fall foul of your justice/fairness rule, so what you need to do is explain how this rule operates.

I'm guessing that there are also other rules, e.g. that one class can't have different lessons with different teachers in the same period.

Assuming this then at some point in the near future this question is going to hit the P versus NP problem, where it becomes impossible to prove that an optimal solution can be found without computing all possible solutions, which means a great deal of processing time.

5. ## Re: distribute Periods in a school timetable

Hi again Andrew
So Sorry for lack of information
#1 Where possible periods should be placed in pairs
may be in period 1&2 or 4&5 or 6&7 there is no condition
#2 Where possible periods should alternate between the teacher's classes
alternate between the teacher's classes depends on the neighbouring classes
But it isn't that important (It's so luxury to care about that rule.
1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,1-1,2-1,2-1,1-1,2-1
It's impossible for any teacher to work more than three or four periods continuously.So the 18 periods for teacher 1 should be distributed over the whole weet work time.Each teacher should have free time to relax and prepare for other students with other attentions.
Finally each class ,of course,would be visited by more than three teachers a day.
Please ,Take care that there are teachers assinged to visit a class 1 time a week.
So sorry if there are still lack of information.
Please Don't be annoyed with me

6. ## Re: distribute Periods in a school timetable

I'm not annoyed with you, it's just that before anybody tries writing code to solve this problem we should be absolutely clear as to the parameters of this solution.

Perhaps think of it this way - you said that previously this has been done manually. Imagine that the person who normally does it has to go on holiday and their boss has employed somebody with the IQ of a moderately bright cat to do the job while they're away and you've been put in charge of writing instructions for this person to follow. What would that list of instructions look like?

7. ## Re: distribute Periods in a school timetable

So happy that you aren't annoyed, Andrew
What would that list of instructions look like?
#1-Don't leave any class without a teacher in any period.= Urgent =
#2-Periods should be distributed in Pairs= as possible
#3-Keep an eye on the justice/fairness when distributing.i.e: Every teacher should work at the begining,middle and the end of the day.= as poosible=
#4-One class can't have different lessons with different teachers in the same period.
#5-A teacher won't be able to work efficiently with more than three or four periods continuously.=as poosible.
#6-Teachers must have time to relax and rest between periods.
I think these will be the instrucyions I 'll give.
You don't know how much time and effort you 'll save.
So curious about the outcome.
Awaiting !!!

8. ## Re: distribute Periods in a school timetable

OK, I'll have a think about it, but please be aware this isn't a trivial couple-of-lines-of-code sort of solution, this is really quite a serious bit of coding.

9. ## Re: distribute Periods in a school timetable

Hi once more Andrew
I Know it's a great descipline of ideas,a great thinking and a great creativity Needed to acheive what I ask for.Hope you could acheive & I'm sure you can.
Again
You don't know how much time and effort you 'll save.
So curious about the outcome.
Awaiting !!!
Awaiting and dreaming.

10. ## Re: distribute Periods in a school timetable

I'll do my best, but I spent an hour or so thinking about this last night and didn't get anything other than a headache. I've handled similar problems in the past and I'd warn you that even if I do get my head around the problem the final code will be:

a. Massive
b. Incomprehensible
c. Slow

If this is something that you really need then you're probably best off paying somebody to do the development for you so that you can then have them support the code, fix bugs and make any changes you need.

11. ## Re: distribute Periods in a school timetable

Hi once more Andrew
So Sorry to bother & get you troubles.
You can get around or ignore tyes marked= as possible) in my instructions.
the final code will be:

a. Massive
b. Incomprehensible
c. Slow
For me,it'd be a great work.
If you have done all that work manually in my school,you'd have accepted the code anyway happily.
Awaiting & curious
So sorry & So grateful.

12. ## Re: distribute Periods in a school timetable

FWIW, working out time tables for teachers according to efficiency rules is, and has been, a major headache. There are commercial software packages that do the job. It's no wonder you have to pay for them, because working out the solution is time-consuming.

13. ## Re: distribute Periods in a school timetable

To me this sounds like a typical Solver problem.

http://www.solver.com/schcenter.htm

Perhaps shg will have a go at it as his Solver "know how" is secend to none in this forum.

14. ## Re: distribute Periods in a school timetable

Hi all
teylyn
FWIW, working out time tables for teachers according to efficiency rules is, and has been, a major headache.
Seems like What you say.I didn't know
So many thanks for Andrew's thinking & help
There are commercial software packages that do the job. It's no wonder you have to pay for them
I'm still awaiting Andrew's code

15. ## Re: distribute Periods in a school timetable

Originally Posted by TOTO_POP
I'm still awaiting Andrew's code
Please don't hold your breath while you're waiting, it's a pretty big bit of work and I've got a day job to do as well.

Whereabouts in Egypt are you? My daughter (10 years old) says that her best holiday ever was in Egypt.

Page 1 of 2 1 2 Last

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1