Both sides can match with multiple partners: workers can take multiple part-time jobs, and firms can hire multiple workers. Pairwise stability prevents any unmatched worker-firm pair from mutually benefiting.
Many-to-Many DA (Worker-proposing):
while ∃ worker w with unused quota
and remaining acceptable firms:
f ← w's top remaining firm
if f has unused quota:
add match (w, f)
else if f prefers w to its
worst current match w':
remove (w', f), add (w, f)
else: f rejects w
Echenique, F. and Oviedo, J. (2006). "A Theory of Stability in Many-to-Many Matching Markets." Theoretical Economics, 1, 233-273.
Run the algorithm to see matching properties.