i think you wrote ,thought,and worked a lot on this topic
i have a simple suggestion
why don't you make a simple tool to be added to the tools reburique on the form
this tool will distrubute the groups to teachers taking into consideration some conditions
1 the hours will be approximate (no more than 2 hours gap between teachers)
and ,,,,,
i attach a file
I distrubuted manually the subject ع فيزيائية here is the file
i want a tool to make it automatically
I am not sure I understand.
Anyway, I think you can see FET-aap. This is what you want. But it needs to be adapted to your case.