For the problem below, two ”high level” greedy strategy is given. One of the strategies givesa correct solutions, and the other sometimes gives an incorrect solutions. Decide which greedy strategyproduces optimal solutions, and give a proof that it is correct and a counter-example showing the otherstrategy is incorrect.( show proof and counter example)
You are given a list of classes C and a list of classrooms R. Each class c has a positive enrollment E(c)and each room r has a positive integer size S(r) which denotes its capacity. You want to assign eachclass a room in a way that minimizes the total sizes of rooms used. However, the capacity of the roomassigned to a class must be at least the enrollment of the class. You cannot assign two classes to thesame room.
Greedy strategy A: Repeat until all classes are assigned, or a class cannot be included in any unassignedroom. Assign the largest unassigned class to the smallest unassigned room larger than or equal to itsenrollment.
Greedy Strategy B: Repeat until all classes are assigned or a class cannot be included in any unassignedroom: Assign the largest unassigned room to the largest unassigned class smaller than or equal to itscapacity.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here