0
8.2kviews
Branch and bound strategy.
1 Answer
written 8.4 years ago by |
The general B&B algorithm follows:.
Procedure DFBranchAndBound(G,s,goal,h,bound0)
Inputs:
G: graph with nodes N and arcs A
s: start node
goal: Boolean function on nodes
h: heuristic function on nodes
bound0: initial depth bound (can be ∞ if not specified)
Output
a least-cost path from s to a goal node if there is a solution with cost less than bound0 or ⊥ if there is no solution with cost less than bound0
Local
best_path: path or ⊥
bound: non-negative real
Procedure cbsearch(⟨n0,...,nk⟩)
if (cost(⟨n0,...,nk⟩)+h(nk) < bound) then
if (goal(nk)) then
best_path ←⟨n0,...,nk⟩
bound ←cost(⟨n0,...,nk⟩)
else
for each arc ⟨nk,n⟩∈A do
cbsearch(⟨n0,...,nk,n⟩)
best_path ←⊥
bound ←bound0
cbsearch(⟨s⟩)
return best_path
The internal procedure cbsearch, for cost-bounded search, uses the global variables to provide information to the main procedure.