This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the original algorithm with some renaming for clarity. | |
# DFS recursive function returns true if a matching for a_index is possible | |
def mcbm_can_match(graph, a_index, matches, seen): | |
# Try every resource one by one | |
for r_index in range(len(graph[0])): | |
# If resource at r_index can do assignment and assignment is not seen | |
if graph[a_index][r_index] and seen[r_index] == False: | |
# Mark resource as visited | |
seen[r_index] = True |
OlderNewer