def dfs_solver(csp): """depth-first search solver""" path = Searcher(Search_from_CSP(csp)).search() if path is not None: return path.end() else: return None
def ac_search_solver(csp): """arc consistency (search interface)""" sol = Searcher(Search_with_AC_from_CSP(csp)).search() if sol: return {v:select(d) for (v,d) in sol.end().items()}