Class AI::CSP::Backtracking
In: ai/csp/backtracking.rb
Parent: Object

Backtracking

Implements chronological backtracking for CSPs. If propagation is turned on, this amounts roughly to forward checking (depending on the constraints).

See AI::CSP for an overview and more examples.

Methods

Attributes

constraint_checks  [R]  For recording statistics
description  [R] 
nodes_explored  [R] 
solutions  [R] 
time  [R] 

Public Class methods

var_ordering can be STATIC or FAIL_FIRST (note that FAIL_FIRST, or dynamic variable orderings generally are only useful when propagation is true).

Public Instance methods

Calls block with each solution, where a solution is simply the problem with all variables instantiated.

Returns first solution, or nil if none found.

[Validate]