Hill Climbing Search-1
Hill Climbing Search-1
Hill Climbing Search-1
Let the heuristic function for this problem has been defined as the combination of g(x) and
h(x).
i.e. F(x)= g(x) and h(x)
where g(x) : how many steps in the problem you have already done or the current state
from the initial state.
h(x) : Number of ways through which you can reach at the goal state from the current
state or
how many states are displaced from the initial or the current state. After calculating the F(x)
value at each step finally take the smallest F(x) value at every step and choose that as the
1 2 3 1 2 3
5 6 4 5 6
4 7 8 7 8
Step1
2 3
1 5 6 F(x) = 1+4=5
4 7 8
1 2 3
1 2 3
5 6
5 6 F(x) = 1+4=5
4 7 8
4 7 8
1 2 3
4 5 6 F(x) = 1+2=3
7 8
1 2 3
4 5 6 F(x) = 2+1=3
7 8
1 2 3
4 5 6
7 8
1 2 3
5 6 F(x) = 2+3=5
4 7 8
Step3
1 2 3
4 6 F(x) = 3+2=5
7 5 8
1 2 3
1 2 3
4 5 6
4 5 6 F(x) = 3+2=5
7 8
7 8
1 2 3
4 5 6 F(x) = 3+0=3
7 8
Ridge
2. Steepest-Ascent Hill Climbing : It first examines all the neighboring nodes and then
selects the node closest to the solution state as next node.
Step 1 : Evaluate the initial state. If it is goal state then exit else make the current state as
initial state.
Step 2 : Repeat these steps until a solution is found or current state does not change:
i. Let ‘temp’ be a state such that any successor of the current state will be better than it;
ii. for each operator that applies to the current state
References:
(1) Rich & Knight, Artificial Intelligence – Tata McGraw Hill, 2nd edition, 1991.
(2) e-PG Pathshala (Gateway for e-books for UG & PG) http://epgp.inflibnet.ac.in/