Question: a) Devise a greedy algorithm that determines the fewest lecture halls needed to accommodate n talks given the starting and ending time for each talk.
b) Prove that your algorithm is optimal. Suppose we have s men m1,m2, . . . , ms and s women w1,w2, . . . ,ws .We wish to match each person with a member of the opposite gender. Furthermore, suppose that each person ranks, in order of preference, with no ties, the people of the opposite gender.We say that a matching of people of opposite genders to form couples is stable if we cannot find a man m and a woman w who are not assigned to each other such that m prefers w over his assigned partner and w prefers m to her assigned partner.
Step by Step Solution
3.45 Rating (165 Votes )
There are 3 Steps involved in it
a We propose the following greedy algorithm Order the talks by starting time Number the lecture halls 1 2 3 and so on For each talk assign it to lowest numbered lecture hall ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
923-M-C-M-S (1515).docx
120 KBs Word File
