Skip to content

Instantly share code, notes, and snippets.

@duartefdias
Created November 27, 2018 16:51
Show Gist options
  • Save duartefdias/84d7e3e5febf03dad020da251e928107 to your computer and use it in GitHub Desktop.
Save duartefdias/84d7e3e5febf03dad020da251e928107 to your computer and use it in GitHub Desktop.
# # C1: Each room can only hold 1 class at a time
def check_C1(self, A, a, B, b):
if a[0] == b[0] and a[1] == b[1] and a[2] == b[2]:
return False
return True
# # C2: Each student (class) can only attend a class at a time
def check_C2(self, A, a, B, b):
for key in dict1:
if dict2[key] == True:
if a[0] == b[0] and a[1] == b[1]:
return False
return True
# # C3: No two weekly class of the same course may occur on the same day
def check_C3(self, A, a, B, b):
if a[0] == b[0] and A[0] == B[0] and A[1] == B[1]:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment