Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(e) The Stable Match problem is concerned with matching n members of one set A = {an, ... , an} with n members of a

image text in transcribed

(e) The Stable Match problem is concerned with matching n members of one set A = {an, ... , an} with n members of a set B = {b1, ..., bn}, according to a set of preferences. The aim is to produce a stable and perfect match. An algorithm to solve this problem is presented below (the Gale and Shapley algorithm we studied in our class). Initialise each element in A and B to be free While an element from A is free and has elements in B still to propose to Choose an element a from A Let b be the next best option b e B from a's preference list If b is free Match a and b Else if b prefers a to b's existing match denoted bcurrent Match a and b and set beurrent to be free Else b rejects a Explain what the complexity classes are for the best and worst case running time for this algorithm. You answer should include a diagram to illustrate one example each of the conditions where the best and worst case would occur. Each diagram should show the sets A and B, their preferences and the final match pairings produced by the algorithm. Use a size for sets A and B of 3 in your diagrams. [10 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago