Question: Brac University plans to optimize its course scheduling for the upcoming academic semester. The university offers a variety of courses across different disciplines, each with
Brac University plans to optimize its course scheduling for the upcoming academic semester. The university offers a variety of courses across different disciplines, each with specific scheduling requirements and constraints. The university needs to find a way to schedule its courses into a limited number of timeslots per day while ensuring that each course is scheduled exactly once and no timeslot has more than one course planned at the same time.
You are tasked with optimizing the schedule for courses offered at Brac University using the popular Genetic Algorithm.
Chromosome Representation Encoding:
Each chromosome will be a binary string that encodes the schedule of courses across different time slots. Here's how we will represent a chromosome:
Length of the Chromosome: The length of a chromosome will be equal to NxT product of N and T where N is the number of courses and T is the number of timeslots.
Structure of the Chromosome: Each chromosome will be divided into T segments, where each segment will be of length N Each segment will represent a timeslot, and each bit within a segment will represent whether a particular course is scheduled in that time slot.
Fitness Calculation:
The fitness function will evaluate each solution based on the number of course overlaps and consistency of a course.
The fitness function evaluates the quality of a schedule based on minimizing course overlaps and making sure a course is scheduled exactly once:
Fitness S PenaltyoverlapSPenaltyconsistencyS
Here:
S: Binary String representing schedule
PenaltyoverlapS: Number of courses overlap in schedule S in the same timeslot
PenaltyconsistencyS: Number of times courses appeared more than once in schedule S
Overlap Penalty:
For each timeslot, count the number of courses scheduled.
If more than one course is scheduled in the same timeslot, add a penalty equal to the number of extra courses.
Consistency Penalty:
For each course, check if it is scheduled exactly once.
If a course is not scheduled exactly once, add a penalty.
Task Breakdown:
Model the course schedule array in a way suitable for the problem.
Implement the fitness function that penalizes overlapping courses and ensures each course is scheduled exactly once.
Choose two parents based on random selection for crossover. Show it as a separate function.
Perform singlepoint crossover to create offspring from each pair of selected parents. Show it as a separate function.
Write the mutation function to introduce random changes.
Create a population of randomly generated course schedules.
Run genetic algorithms on the population until the highest fitness has been reached andor the number of maximum iterations has been reached.
Input
The first line has a number N denoting the number of courses and a number T denoting the number of timeslots for a particular day. It will be followed by N lines each having a string that represents a course code that needs to be scheduled where,
TN
In this problem statement, we are considering that course will have only section
Output
The output should be a binary string denoting for scheduled courses and for not scheduled courses in each timeslot. A string consisting of all zeros wont be accepted. You also need to print the fitness value of the output string.
Example:
Sample Input
CSE
MAT
PHY
Sample Output
Explanation
Chromosome Representation
NT
A chromosome of length represents the schedule of courses across timeslots.
Each timeslot is represented by a segment of length N
Fitness Calculation
Let's take the output chromosome:
Timeslot :
CSE: scheduled
MAT: scheduled
PHY: not scheduled
Timeslot :
CSE: scheduled
MAT: scheduled
PHY: not scheduled
Timeslot :
CSE: not scheduled
MAT: scheduled
PHY: not scheduled
Interpretation of the Chromosome
Timeslot : CSE MAT are scheduled.
Timeslot : CSE MAT are scheduled.
Timeslot : MAT is scheduled.
Penalty Calculation
Overlap Penalty:
Timeslot : courses scheduled, penalty
Timeslot : courses scheduled, penalty
Timeslot : course scheduled, penalty
Total overlap penalty
Consistency Penalty:
CSE: scheduled times, penalty
MAT: scheduled times, penalty
PHY: scheduled times, penalty
Total consistency penalty
Total penalty overlap penalty consistency penalty
Summary
Chromosome results in a penalty of So Fitness will be
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
