For the 8-puzzle, the rule is that we can move a tile from position x to position y if (1) x and y are adjacent, and (2) y is blank. Heuristic h1 ignores both constraints, while heuristic h2 ignores the second constraint.
This relaxation idea above is an example of what is called meta-level knowledge. It is knowledge about other knowledge. Meta-level knowledge can be the most valuable type of knowledge, because it is the most general-purpose.
Many AI programs have similar architectures: they consist of a fixed reasoning algorithm based on search, which is guided by problem-specific information represented in some explicit fashion. In this case the algorithm implementation can be called an inference engine and the problem-specific information is called a knowledge base.
Different inference engines work with different levels of
knowledge. The output of one AI program can be knowledge for use
by another program.
Suppose the solution to problem P is found by algorithm A at depth d, after expanding k nodes.
Definition: The effective branching factor b(P,A) is the solution for b of the equation k = 1 + b + ... + b^d = (b^(d+1) - 1)/(b - 1). This is approximately the dth root of k since k = O(b^d).
Effective branching factor is the best way to compare a (P,A) combination. Percentage speedup is meaningless when comparing algorithms that take exponential time.
Any algorithm that takes time polynomial in d, say O(d^m) where m is fixed, will have effective branching factor tending to 1 as d tends to infinity. Proof: log b = log (d^m)^(1/d) = (m/d) log d = m (log d)/d. Now (log d)/d -> zero from above as d -> infinity and m is constant`, so log b -> 0 from above as d -> infinity, and therefore b -> 1 from above.
We will restrict attention to CSPs with a finite number of variables each with a finite (hence discrete) domain. Some examples are:
This algorithm is called generate-and-test, because each state is fully instantiated before it is tested. (Assigning a value to an unassigned variable is called instantiating the variable.) The rest of our analysis of CSPs will look at improvements to it, staying within the same framework as much as possible.
Incremental consistency checking is the idea that each
constraint should be checked as soon as the variables involved have been
assigned values. If any constraint is not satisfied at a node in
the search tree, then the entire subtree rooted at this node cannot
contain a solution, so the node should not be expanded, and search
should continue with a sibling node. This refinement of DFS is
called backtracking search.