def arc_consistent(puzzle): state = parse_puzzle(puzzle) result,num_nodes = arc_consistent_helper(state) if result['Solved']: return unparse_puzzle(result),num_nodes else: None,None
def forwardchecking(puzzle): state = parse_puzzle(puzzle) result, num_nodes = forwardchecking_helper(state) if result['Max_depth']: return unparse_puzzle(result), num_nodes else: None
def backtracking(puzzle): state = parse_puzzle(puzzle) result, num_nodes = backtrackingHelper(state) if result['Solved']: return unparse_puzzle(result), num_nodes else: return None, None