Question
In this assignment, you will implement a variation of the stable matching problem. We will assume that there are more students graduating than there are
In this assignment, you will implement a variation of the stable matching problem. We will assume that there are more students graduating than there are slots available in the m hospitals. We want to find a way of assigning each student to at most one hospital, in such a way that all available positions in all hospitals were filled. (Since we are assuming a surplus of students, there would be some students who do not get assigned to any hospital) We say that an assignment of students to hospitals is stable if neither of the following situations arises: First type of instability: There are students s and s 0 , and a hospital h, such that s is assigned to h, and s 0 is assigned to no hospital, and h prefers s 0 to s Second type of instability: There are students s and s 0 , and hospitals h and h 0 , so that s is assigned to h, and s 0 is assigned to h 0 , and h prefers s 0 to s, and s 0 prefers h to h 0 . So we basically have the Stable Matching Problem as presented in class, except that (i) hospitals generally want more than one resident, and (ii) there is a surplus of medical students. a) Consider a Brute Force Implementation of the algorithm where you find all combinations of possible matchings and verify if they are a stable marriage one by one. Give the runtime complexity of this brute force algorithm in Big O notation and explain why
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started