Propose and Reject

  • Published on
    04-Jun-2015

  • View
    503

  • Download
    0

Embed Size (px)

DESCRIPTION

Demonstration of Propose and Reject algorithm by an example

Transcript

<ul><li> 1. </li></ul> <p> 2. Victor proposes to Bertha. Victor Bertha 3. Victor proposes to Bertha. -Bertha accepts since previously unmatched. Victor Bertha 4. Wyatt proposes to Diane. Victor Bertha Diane Wyatt 5. Wyatt proposes to Diane. -Diane accepts since previously unmatched. Victor Bertha Diane Wyatt 6. Xavier proposes to Bertha. Victor Bertha Diane Wyatt Bertha Xavier 7. Xavier proposes to Bertha. -Bertha dumps Victor and accepts Xavier. Victor Bertha Diane Wyatt Bertha Xavier 8. Diane Wyatt Bertha Xavier Victor proposes to Amy. Victor Bertha Amy Victor 9. Diane Wyatt Bertha Xavier Amy Victor Victor proposes to Amy. -Amy accepts since previously unmatched. Victor Bertha 10. Diane Wyatt Bertha Xavier Amy Victor Yancey proposes to Amy. Victor Bertha Amy Yancey 11. Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Yancey proposes to Amy. -Amy rejects since she prefers Victor. Victor Bertha 12. Diane Wyatt Bertha Xavier Amy Victor Yancey proposes to Diane. Amy Yancey Victor Bertha Diane Yancey 13. Diane Wyatt Bertha Xavier Amy Victor Diane Yancey Yancey proposes to Diane. -Diane dumps Wyatt and accepts Yancey. Amy Yancey Victor Bertha 14. Bertha Xavier Amy Victor Diane Yancey Wyatt proposes to Bertha. Diane Wyatt Amy Yancey Victor Bertha Bertha Wyatt 15. Victor Bertha Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Diane Yancey Bertha Wyatt Wyatt proposes to Bertha. -Bertha rejects since she prefers Xavier. 16. Bertha Xavier Amy Victor Diane Yancey Wyatt proposes to Amy. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt 17. Bertha Xavier Amy Victor Diane Yancey Wyatt proposes to Amy. -Amy rejects since she prefers Victor. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt 18. Victor Bertha Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Wyatt proposes to Clare. Clare Wyatt 19. Bertha Xavier Amy Victor Diane Yancey Clare Wyatt Wyatt proposes to Clare. -Clare accepts since previously unmatched. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt 20. Bertha Xavier Amy Victor Diane Yancey Clare Wyatt Zeus proposes to Bertha. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt Bertha Zeus 21. Bertha Xavier Amy Victor Diane Yancey Clare Wyatt Zeus proposes to Bertha. -Bertha rejects since she prefers Xavier. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt Bertha 22. Bertha Xavier Amy Victor Diane Yancey Clare Wyatt Zeus proposes to Diane. Victor Bertha Diane Wyatt Amy Yancey Bertha Wyatt Amy Wyatt Bertha Diane Zeus 23. Victor Bertha Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Clare Wyatt Bertha Zeus Zeus proposes to Diane. -Diane rejects Yancey and accepts Zeus. Diane Zeus 24. Bertha Xavier Amy Victor Clare Wyatt Yancey proposes to Clare. Victor Bertha Diane Wyatt Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Bertha Zeus Diane Zeus Clare Yancey 25. Victor Bertha Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Clare Wyatt Bertha Zeus Clare Yancey Yancey proposes to Clare. -Clare rejects since she prefers Wyatt. Diane Zeus 26. Bertha Xavier Amy Victor Clare Wyatt Yancey proposes to Bertha. Victor Bertha Diane Wyatt Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Bertha Zeus Clare Yancey Diane Zeus Bertha Yancey 27. Victor Bertha Diane Wyatt Bertha Xavier Amy Victor Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Clare Wyatt Bertha Zeus Clare Yancey Bertha Yancey Yancey proposes to Bertha. -Bertha rejects since she prefers Xavier. Diane Zeus 28. Bertha Xavier Amy Victor Clare Wyatt Yancey proposes to Erika. Victor Bertha Diane Wyatt Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Bertha Zeus Clare Yancey Bertha Yancey Diane Zeus Erika Yancey 29. Bertha Xavier Amy Victor Clare Wyatt Erika Yancey Yancey proposes to Erika. -Erika accepts since previously unmatched. Victor Bertha Diane Wyatt Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Bertha Zeus Clare Yancey Bertha Yancey Diane Zeus 30. Bertha Xavier Amy Victor Clare Wyatt Erika Yancey STOP -Everyone matched. -Stable matching! Victor Bertha Diane Wyatt Amy Yancey Diane Yancey Bertha Wyatt Amy Wyatt Bertha Zeus Clare Yancey Bertha Yancey Diane Zeus</p>