merge-queue procedure.
best-first-merge takes the queue, the new paths, and
the problem-specific estimate procedure, adds
the new paths to queue, and then sorts the new queue by the
values returned by estimate when applied to the first
state on each path. You can use the Scheme procedure sort
to do this. sort takes a comparison predicate and a list
and sorts the list using the predicate to compare items.
((1 2 3) () ())
goal?, extend,
estimate, and print-state procedures
for your particular problem.
search procedure on the problem-specific
states and procedures.
Representation and Reasoning: First Page
Last updated: 25 January 1996
URL: http://www.indiana.edu/~gasser/Q351/search_ex2.html
Comments:
gasser@salsa.indiana.edu
Copyright 1996,
The Trustees of
Indiana University