data-structures-algorithms-group4 / student-project-matching

1 stars 0 forks source link

suboptimal_algorithm.py does not pass for time efficiency comparison #29

Closed lonnychen closed 6 months ago

lonnychen commented 6 months ago

While attempting to run matching_algorithm in suboptimal_algorithm.py using random data (and also the usual test suite cases), several failing modes are being seen and are documented below. The algorithm needs to also "work" in order to compare time efficiency with our best algorithm.

My suggestion is to switch to a brute-force (random or exhaustive search until stable matching) algorithm for a most likely more favorable comparison and guaranteed working by design if using the stable match checker to verify.

Error: ValueError: list.remove(x): x not in list Code issue: project_assignments[project].remove(student) Output log: DEBUG:reevaluate_assignments:current_assignees: ['s3'] DEBUG:reevaluate_assignments:sorted_assignees: ['s3'] DEBUG:reevaluate_assignments:displaced_students: ['s3'] DEBUG:reevaluate_assignments:project_assignments[project]: []

Error: AssertionError: INVALID: s2 is not in p4 preference list! Code issue: if project_availability[project] > 0: Output log: INFO:stable_match_checker:Checking for stable match: s2 and p4 ERROR:stable_match_checker: -> INVALID: s2 is not in p4 preference list!

lonnychen commented 6 months ago

Looks good as the algorithm now passes the stable_match_checker and can be integrated fully into the efficiency evaluation code.