Homework 1, Greedy Stable Matching.

Short Description:

Explore the greedy Stable Matching Algorithm.

Goals

When you finish this homework, you should have:

Formal Description

  1. Consider the greedy stable matching algorithm
    GREEDY-STABLE-MATCH(M,W)
    
    1. mark all m ∈ M and w∈ W as free
    2. S ← {}
    3. while there is a m ∈ M who is free
    4. w ← highest choice in m's preference list that is free
    5. S ← S ∪ (m, w)
    6. mark m and w as engaged
    7. return S
    1. [10 points] Trace this algorithm with the following data. Show your work.
      1CBEAD
      2ABECD
      3DCBAE
      4ACDBE
      5ABDEC
      A35214
      B52143
      C43512
      D12345
      E23415
    2. [10 points] Is your solution a stable match? Argue that it is or show an in-stable pair.
    3. [10 points] Discuss how the selection of m in line 3 changes the result of the algorithm. Could you change the answer with a different set of random selections?
  2. Testing a solution to the stable match algorithm
    1. [10 points] Create an algorithm which, given the input to the stable match problem and (M, W) the output (S) determines if S is a stable match. Use algorithm notation similar to that in the lectures and above.
    2. [10 points] Using the results from the notes, run your algorithm on a stable match and a match that is not stable to show that it works for known example data.
    3. [10 points] Argue that your algorithm is correct.

Notes

Make sure you note all collaborators and any AI used in completing this homework.

Required Files

A single document containing your answers. Word or PDF are the acceptable formats.

Submission

Submit the assignment to the D2L folder Homework 1 by the due date.