0

Hill Climbing

I need to make a code that based on implementation in hill climbing logic, iw ould like the problem be arranging school subject schedule with ease using hill climbing logic, in data, we have 31 classes and around 80 teacher (lets just say 80), we need to arrange 10 hour of lesson in a day (5 days in total for a week) and conclude the subject hour into one subject every 2 hour of schedule, help me to understand the logic

30th Jul 2025, 1:28 AM
Watson REYY
Watson REYY - avatar
3 Risposte
+ 3
it's not a simple task. and what parameter are you trying to optimize? Also, the information seems to be insufficient. can teachers teach more than one subject, is there any limit on the number of classes a teacher can teach? etc ... https://scispace.com/pdf/courses-timetabling-based-on-hill-climbing-algorithm-3jwezhnu8j.pdf
30th Jul 2025, 8:38 AM
Bob_Li
Bob_Li - avatar
+ 2
If your instructions are correct, how can you fit 31 classes x 2 hours into 5 days x 10 hours? My other advice is to look up "Hill climbing logic", then maybe put your classes into an array or ENUMS... should start you off. If you start to code and come into problems, read these and if you still need help, feel free to add to this thread. https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app https://sololearn.com/compiler-playground/W0uW3Wks8UBk/?ref=app
30th Jul 2025, 7:31 AM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Hill climbing for scheduling works by starting with a random schedule and iteratively improving it. A "state" is a potential schedule. A "neighbor" is a slightly modified version of the current schedule (e.g., swapping two classes). A "cost function" measures how good a schedule is (e.g., how many conflicts it has). * Initial State: Create a random schedule, even if it has many conflicts. * Evaluate: Calculate the "cost" of this schedule. A lower cost is better. * Find Best Neighbor: Generate all possible "neighboring" schedules. Evaluate the cost of each neighbor. * Move: If a neighbor has a better (lower) cost than the current schedule, move to that neighbor. * Repeat: Continue this process until you reach a "peak" – a schedule where no neighbor has a lower cost. This is your solution.
31st Jul 2025, 5:21 PM
Omi Patil
Omi Patil - avatar