wergstatt / gale-shapley

Implementation of Gale-Shapley Matching Algorithm in Scala
0 stars 0 forks source link

Allow for empty matches #6

Closed wergstatt closed 4 years ago

wergstatt commented 4 years ago

The following example would fail:

val prefM = Map( 1 -> List( 2 ), 2 -> List( 1 ) )
val prefW = Map( 1 -> List( 2 ), 2 -> List( 1 ) )
val alloc: Alloc = Map( )
GaleShapleyState( prefM, prefW, alloc ).matches

The problem should be solvable by excluding unmatched boys that have an exhausted proposal list.