Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
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