Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Write the deferred acceptance algorithm in pseudocode.

Short Answer

Expert verified

Pa,wais pair of women and their accepted proposals.

And return isPa,wa for alla1,2,...,n

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Step 1:

We will use ‘match’ algorithm.

Procedure match

m1,m2,,mn,w1,w2,.,wnwith preference listsM1,M2,Mn,W1,W2,Wn,respectively)

Herepi is the proposal list of womenwi .

Every man proposes to their preferred women and the women reject the proposal of all the men that are not their preferred man from the entire proposal. When the men will propose to the first women in their remaining preference list and the women will reject all the proposals of their no preferred men.

This will repeat until all women have exactly one remaining proposal.

02

Step 2:

For i : = 1 to n ,

Pi:=ϕ

While there exists aPi withi1,2,...,n such thatPi:=ϕ

For j : = 1 to n

PMi1:=PMi1Mj

For k : = 1 to n

best =pk1

03

Step 3

For all pPkdo if p is preferred over best inWk then,

Mbest:=Mbest-wk

Else

Mp:=Mp-wk

Hence,Pa,wa is pair of women and their accepted proposals.

And return isPa,wa for alla1,2,...,n

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free