I'm trying to generate a teaching timetable, where a teacher has a set number of pupils to teach indivudually (eg for music lessons) once a week. The pupils have to rotate, ie not be taught at the same time week on week (the minimum gap allowable between lessons at the same time I call the 'rotation period'). To come up with the simplest form is trivial:
Week 1 Week 2 Week 3 Week 4 Week 5 Week 6
10.00 Alice Edgar David Charles Bertha Alice
10.30 Bertha Alice Edgar David Charles Bertha
11.00 Charles Bertha Alice Edgar David Charles
11.30 David Charles Bertha Alice Edgar David
12.00 Edgar David Charles Bertha Alice Edgar
But I want the user to be able to add rules, eg Alice can't make 10.30 or 11.00 on Week 3, etc. I started with a simple backtracking loop but soon realised that the number of possibilities makes this umfeasible. I'm not a very experienced programmer, and do I realise this might be leading me into advanced programming techniques. But if someone could give me some ideas on how to approach the problem I'd be very grateful. I have of course looked round for help but most of the discussion seems to be for the more complicated task of generating a whole school timetable. Is genetic programming something to look into for this? I'm building the program as a web page using php.