Digital Assignment-1 ITE2010 - Artificial Intelligence: Cal Course
Digital Assignment-1 ITE2010 - Artificial Intelligence: Cal Course
SLOT A2+TA2
CAL COURSE
In
By
SITE
C
G
F
H
B
E
A
D
Answer:
Step 1:
G +1
F -1
G -1
B -1
-1
E
-1 -1
A
-1
D C
Score: -6
Here we are facing problem. As score in step 1 is same as score in step 0, the
Hill Climbing algorithm comes to halt. We define a new heuristic function
which is called Global function.
Global Function:
For each block that has the correct support structure (i.e. the complete structure
underneath it is exactly as it should be), add one point for every block in the
support structure. For each block that has an incorrect support structure,
subtract one point for every block in the existing support structure.
Step 0:
C -7
G -6
F -5
H -4
B -3
E -2
A -1
D 0
Initial State: -28
H +7
G +6
F +5
E +4
D +3
C +2
B +1
A 0
Final State: +28
Step 1:
G -6
F -5
H -4
B -3
-2
E
-1 0
A 0
D C
Score: -21
Step 2:
(i)
C -7
G -6
F -5
H -4
B -3
E -2
A -1
D 0
Score: -28
(ii)
F -5
H -4
B -3
E -2
A -1 G -1
D 0 C 0
Score: -16
(iii)
A -5
E -4
B -3
D -2
0
C -1 0
H 0 C G
Score: -15
The score of option (iii) is the highest score. So, we go ahead with option (iii).
Step 3:
H -4
B -3
E -2
A 0 0 0
-1
D C G F
0
Score: -10
Step 4:
B -3
E -2
A -1
D E
0 0 0 0 0
C G F H
Score: -6 `
Step 5:
B -3
E -2
A -1
D E
0 0 0 0 0 0
C G F H B
Score: -3 `
Step 6:
B -3
E -2
A -1
D E
0 0 0 0 0 0
0
E C G F H B
Score: -1 `
Step 7:
B -3
E -2
A -1
D E
0 00 0 0 0 0 0 0
B
A D E C G F H B
Score: 0 `
Step 8:
B +1 0 0 H0 + 0 0 0
A 0 C D E F G H
Score: +1
Step 9:
C +2
B +1 0 0 H +1 0 0
A 0 D E G 0 F
Score: +3
Step 10:
D +3
C +2
B +1 0 0 H +1 0 0
A 0 E F G 0
Score: +6
Step 11:
E +4
D +3
C +2
B +1 0 H0 +1 H +1 0 0
A 0 F G 0 G 0
Score: +10
Step 12:
+
F +5
E +4
D +3
C +2
B +1 0 H0 +1 H +1 0 0
A 0 F G 0 G 0
Score: +15
Step 13:
H +7
G +6
F +5
E +4
D +3
C +2
B +1
A 0
Score: +21
Step 14:
H +7
G +6
F +5
E +4
D +3
C +2
B +1
A 0
Score: +28
Final State is reached. So, we stop here as we have reached goal state.