csp v0.1.0 Csp.MinConflicts

Min-conflicts algorithm implementation, with Tabu search to allow overcoming local minimums.

Link to this section Summary

Functions

Solves csp with min-conflicts algorithm, using tabu search to overcome local minimums.

Link to this section Functions

Link to this function

solve(csp, opts \\ [])

Specs

solve(Csp.t(), Keyword.t()) :: {:solved, Csp.assignment()} | :no_solution

Solves csp with min-conflicts algorithm, using tabu search to overcome local minimums.

Options

Supported opts:

  • :max_iteration - positive integer, the number of iteration to perform before giving up. Defaults to 10_000.
  • :optimize_initial_state - boolean, defaults to false. If set to true, will use a greedy algorithm to set an initial state minimizing the number of conflicts for each variable.
  • :tabu_depth - positive integer or nil, defaults to nil. If set to an integer, will limit tabu stack depth by the specified integer.