Implement the generic search algorithm and variate it to
implement (a) Depth-First Search, (b) Breadth-First Search,
(c) Branch-and-Bound, (d) Best-First Search, (e) Heuristic
Depth-First Search and (f) A* algorithm. Run them on the
following graph (note: for non-horizontal edges, * denotes the
head and the number near an edge is its cost).
Use 3 heuristic functions: h1(n) = distance of Goal from n,
h2(n) = distance of n from Start and h3(n) = distance of Goal
from n minus 1.
8 4 5
d ------> e ------> n -------> o
* \ / *
/ 2 \ 1 / \
4 / \ / 1 \
3 / 16 * 5 * \ 3
Start -----> b ----------------> g -------> m s -----> t
/ \ * * \ * |
1 / \ 2 / / \ 1 / 2 |
/ 3 \ / 2 / 1 \ / |
* * 7 / 5 / * / 5 *
i c ------> f ------> v p ----------> u
/ \ * | * * \
1 / \ \ | / | \ 2
/ 1 \ \ 1 | 3 / | \
* * \ | / | *
j k 1 \ | / 3 | Goal
\ | / |
\ | / |
\ * / 2 2 |
h -------> q ------> r