I have a similar project to one posted on Sep 29th, 2009: Interactive Timetable. The difference is that the timetable is to be generated automatically. Lessons can be placed anywhere on the timetable.There are 11 lessons in a day, and three breaks. Could anyone help with this or give any ideas?

Dani AI

Generated

asked for an automated timetable (11 lessons per day, three breaks) and checked whether someone would build it. Below is a practical, low-friction approach that stays useful years later and can be implemented in PHP/SQL with an external solver if needed.

Model first: represent lessons as objects with duration, allowable time ranges, teacher(s), room(s), and hard/soft constraints (no teacher or room clashes; preferred times; fixed breaks). Choose a time resolution (15 or 30 minutes) and generate discrete start slots. If lessons are all equal length, model as a graph‑coloring / slot‑assignment problem; if variable, treat it as an interval/constraint problem. The general timetabling problem is computationally hard, so expect to combine heuristics with exact methods ().

Algorithm choices: start simple — greedy first‑fit using a priority order (largest/most constrained lessons first). Add backtracking with constraint propagation for cases the greedy fails. For robust results, use constraint programming or integer programming and an optimizer (e.g., Google OR‑Tools) to satisfy many constraints and optimize soft goals (Google OR‑Tools). For large or very constrained instances, consider local search or metaheuristics to improve an initial feasible timetable.

Implementation tips: keep a validator that checks an assignment fast, log conflicts for diagnostics, run heavy solves asynchronously (cron/job queue) and allow manual overrides that lock slots. If a solver fails, relax soft constraints or coarsen the time resolution. Start with the greedy+validator approach to get immediate results, then incrementally replace it with a CP/ILP solver for tougher cases.

Recommended Answers

All 2 Replies

Do you expect someone to develop it for you or something else

No. I need ideas on how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.