Skip to content

Instantly share code, notes, and snippets.

@ziruihao
ziruihao / course_requirement_matcher.py
Last active August 15, 2021 16:34
Solving course requirement matching via the Edmonds-Karp max flow algorithm.
from typing import Deque
# standard degree requirements
DEGREE_REQS = set(['LIT', 'ART', 'SCI', 'TMV', 'TAS', 'INT'])
# course name followed by requirements that it satisfies
courses = {
'COSC_1': set(['TAS', 'SCI']),
'GOVT_30': set(['INT', 'TMV']),
'ENGL_16': set(['LIT', 'INT']),