csp v0.1.0 Csp.Searcher

Search strategies for CSP.

Link to this section Summary

Functions

Performs a brute force search on csp.

Link to this section Functions

Link to this function

brute_force(csp, opts \\ [])

Specs

brute_force(Csp.t(), Keyword.t()) :: Csp.solve_result()

Performs a brute force search on csp.

NOTE: don't use it for real stuff. This is provided only for comparison with backtracking. Use backtracking instead!

If solution is found, returned {:solved, assignment | assignments}, otherwise returns :no_solution.

Options

  • all, boolean: if all solutions should be found. By default is set to false, so only the first found solution is returned. If all is true, all solutions are found, and instead of returning a single assignment, returns a list of assignments.