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
Exemplo n.º 2
0
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