1
00:00:00,720 --> 00:00:02,750
All right, we have the plausibility.

2
00:00:02,940 --> 00:00:06,120
Now we will be developing the full service pathfinding algorithm.

3
00:00:06,360 --> 00:00:07,680
That is disaster.

4
00:00:08,100 --> 00:00:12,240
For this, we move inside the Fort Benning Art Park and create the class.

5
00:00:12,780 --> 00:00:19,350
So we start by writing class destruct and then we define its first function.

6
00:00:19,650 --> 00:00:23,250
That would be the initialize and function inside.

7
00:00:23,250 --> 00:00:28,200
It will be defined the instance variable for this class and the very first instance variable would be

8
00:00:28,200 --> 00:00:33,630
a state variable that basically keeps track of whether we have already used data to find the shortest

9
00:00:33,630 --> 00:00:34,260
path or not.

10
00:00:35,730 --> 00:00:41,940
So this would be the shortest path found and this would be initialized to false because this is the

11
00:00:41,940 --> 00:00:42,930
initial action states.

12
00:00:43,590 --> 00:00:48,510
Then we create the actual container that will store the shortest path once it has been found.

13
00:00:51,910 --> 00:00:54,010
And this would be initialize to an empty list.

14
00:00:54,880 --> 00:00:57,290
The third instance variable would be the Mini.

15
00:00:59,890 --> 00:01:02,720
And the Milky Way will be used to create the priority queue.

16
00:01:02,920 --> 00:01:09,310
That is a necessity for the disaster algorithm and this would be initialized to the heap class object

17
00:01:09,310 --> 00:01:10,390
that we created earlier.

18
00:01:11,110 --> 00:01:16,660
And finally, we'll be creating two dictionaries that basically stores the relationship between Vertex

19
00:01:16,660 --> 00:01:18,770
and the responding corresponding indices.

20
00:01:18,790 --> 00:01:23,410
And why are we creating these two dictionaries will be apparently drawn at this moment.

21
00:01:23,620 --> 00:01:25,690
They are just named as indices to what it is.

22
00:01:25,870 --> 00:01:31,750
And where does this indices to basically contain, to convert the vertex to index and index to the vertex.

23
00:01:32,800 --> 00:01:37,030
And then we proceed to perform or create the next function for this class.

24
00:01:37,300 --> 00:01:43,840
That would be the final results are the five vessels is name as such and not fine, but because this

25
00:01:43,840 --> 00:01:49,210
particular algorithm of destroyer not only find the shortest path to the goal, but also all the sub

26
00:01:49,230 --> 00:01:52,600
parts of the short distance between the respective nodes.

27
00:01:52,930 --> 00:01:57,040
This is why it is named as fine vessels because it finds the best results.

28
00:01:58,240 --> 00:02:03,220
So we proceed inside it and the very first thing that we need to do is create the index for our start

29
00:02:03,220 --> 00:02:05,860
vertex and why do we need to do that?

30
00:02:06,040 --> 00:02:12,010
The reason is that the information that can be stored inside the mean heap cannot be the vertex itself

31
00:02:12,730 --> 00:02:16,510
because he only takes in integers as an argument.

32
00:02:16,960 --> 00:02:22,480
So we need to convert the vertex which is in tuple to some other integer format and that is the best

33
00:02:22,480 --> 00:02:26,050
thing that can be stored is basically the index of that vertex.

34
00:02:26,590 --> 00:02:30,310
So we stored that index in just replacing its vertex.

35
00:02:30,610 --> 00:02:35,200
So this is why we required index for each vertex for all vertex that will be using.

36
00:02:35,500 --> 00:02:37,660
So we require the index for our start vertex.

37
00:02:39,150 --> 00:02:41,520
And that would be named as starter index.

38
00:02:41,850 --> 00:02:45,210
And that would be created as using list comprehension.

39
00:02:45,780 --> 00:02:51,570
Now the various comprehension works we enter define which type or what type of list do we want to create.

40
00:02:51,870 --> 00:02:53,850
So we want to create the list for the indices.

41
00:02:54,270 --> 00:02:56,610
But where do we get the industries for?

42
00:02:57,240 --> 00:03:01,470
So we get the indices form by looping over indices for indices.

43
00:03:02,530 --> 00:03:08,890
And by using an order that loops over an well, that would be the graph items.

44
00:03:09,430 --> 00:03:15,240
So we tried graph items and once we have loop over the graph items, we now call the condition that

45
00:03:15,250 --> 00:03:17,890
which indices do we want to store inside the index list?

46
00:03:18,280 --> 00:03:19,990
And that would be right on right here.

47
00:03:20,170 --> 00:03:20,710
That if.

48
00:03:21,820 --> 00:03:26,650
The key that is a vortex is equally equal to the start vortex.

49
00:03:27,100 --> 00:03:33,670
So if such a condition arise that when we are looping over the keys present inside the graph and that

50
00:03:33,670 --> 00:03:39,280
key is equal to our start vertex then stored index for that vertex and that will be the start vertex.

51
00:03:39,610 --> 00:03:43,570
And then we only keep the first index if we have multiple matches.

52
00:03:44,050 --> 00:03:45,700
So this gives us the stock index.

53
00:03:46,210 --> 00:03:51,610
Once we have this information, we create two new lists and that would be a distance list and the parent

54
00:03:51,610 --> 00:03:51,910
list.

55
00:03:52,360 --> 00:03:56,860
Now, this list is basically just a list to store the distances for each corresponding vertex.

56
00:03:57,160 --> 00:04:01,510
And apparently, as is used to store the closest vertex for all vertices.

57
00:04:03,040 --> 00:04:07,600
And next we create or update the min heap size that we'll be creating later on.

58
00:04:07,930 --> 00:04:13,450
So the heap size is basically storing all the words that are present inside the graph.

59
00:04:13,720 --> 00:04:19,090
So all the graph keys or the number of graph keys is basically going to be the size of the heap once

60
00:04:19,180 --> 00:04:19,930
it has been created.

61
00:04:20,260 --> 00:04:24,970
So we update this variable so that we know what is the size of the main heap or the priority group.

62
00:04:25,570 --> 00:04:28,210
Then we proceed to iterate over our graph keys.

63
00:04:29,290 --> 00:04:36,580
And this would this would be done to initialize our mean heap that we were done before in enumerate

64
00:04:37,780 --> 00:04:38,350
enumerate.

65
00:04:38,500 --> 00:04:40,570
And we would be iterating over our graph keys.

66
00:04:41,080 --> 00:04:43,720
We're writing, graphed our keys, enumerate.

67
00:04:43,930 --> 00:04:49,900
And this provides us enumerate, provides us the index and the vertex present inside those keys, inside

68
00:04:49,900 --> 00:04:50,380
those graph.

69
00:04:50,890 --> 00:04:56,950
So we not only have the iterable, but also the value of that iterable.

70
00:04:56,950 --> 00:04:57,910
That is the vertex.

71
00:04:58,270 --> 00:05:03,310
So we are going to use this information in creating our mean heap and our distance list.

72
00:05:03,970 --> 00:05:05,800
So we start by updating our distance list.

73
00:05:06,040 --> 00:05:09,730
And that will be done very simply by writing or appending.

74
00:05:11,010 --> 00:05:12,990
Appending infinity to our distance list.

75
00:05:13,410 --> 00:05:20,130
And this would be named as one into ten, five minus ten by seven, and we initialize our distances

76
00:05:20,130 --> 00:05:21,750
for each vertex to infinity.

77
00:05:21,870 --> 00:05:24,750
And this is the first step for attempting the diaspora algorithm.

78
00:05:25,830 --> 00:05:30,660
Then we proceed to creating our main array from our notes that are present inside our graph.

79
00:05:31,140 --> 00:05:37,190
So that will be done by accessing the main heap object, by writing surfboard 20 and accessing it's

80
00:05:37,200 --> 00:05:44,430
only and now because it was a list, access is a function of append for that list and here we open each

81
00:05:44,430 --> 00:05:47,550
node and we create each node and then append it to the array.

82
00:05:47,730 --> 00:05:49,020
That is a list for our mean.

83
00:05:49,920 --> 00:05:56,010
So that is done by accessing the functional main heap that is new in heap node.

84
00:05:56,190 --> 00:05:58,950
This creates a new meaning of Node partaking in two arguments.

85
00:05:59,250 --> 00:06:02,580
The fourth is the vertex and second is a distance of that vertex.

86
00:06:03,060 --> 00:06:08,280
But the problem is, as mentioned earlier, we cannot store the vertex because it is in tuple format,

87
00:06:08,460 --> 00:06:10,710
but the mini heap only takes in the integer format.

88
00:06:11,070 --> 00:06:17,610
So we need to store something as that replaces our vertex and that that thing that will be replacing

89
00:06:17,620 --> 00:06:20,910
that vertex with will be the index of that vertex.

90
00:06:21,300 --> 00:06:26,580
So we instead of the V, we right here, the index and for the distance you provide in the distance

91
00:06:26,580 --> 00:06:29,820
of that vertex and that will be distance for that index.

92
00:06:30,540 --> 00:06:36,630
And once you have stored this information, we proceed further because our mean heap, once this loops

93
00:06:36,630 --> 00:06:42,390
completes, has been collated or created completely, then to create the next instance variable for

94
00:06:42,390 --> 00:06:47,760
our main heap or update our mean heap instance variable that is collection of where does this basically

95
00:06:47,760 --> 00:06:53,430
store the position of vertex for our heap and that will be initialized appended.

96
00:06:54,880 --> 00:06:57,250
With the index of that vertex.

97
00:06:57,400 --> 00:07:02,200
So instead of the verses we are storing here, sorting here, the index of that vertex.

98
00:07:03,190 --> 00:07:05,080
And this is basically the position of that vertex.

99
00:07:05,920 --> 00:07:10,600
Now, once you're done with this, we proceed to open our parent variable with negative one.

100
00:07:10,900 --> 00:07:11,800
And that would be done.

101
00:07:12,040 --> 00:07:17,620
Because if if we do not find any close vertex for any of the for any vertex, then we would know that

102
00:07:17,620 --> 00:07:20,260
we were unable to find the close vertex for that particular note.

103
00:07:20,680 --> 00:07:23,740
And that would be known by having a value of negative one.

104
00:07:24,010 --> 00:07:25,500
Otherwise it would be updated.

105
00:07:25,570 --> 00:07:26,530
Any other value.

106
00:07:27,280 --> 00:07:32,890
And finally, what we will do is we will update our dictionaries that basically store the relationship

107
00:07:32,890 --> 00:07:34,840
between vertices and the indices.

108
00:07:35,350 --> 00:07:40,900
And that will be done by writing support workers to indices and providing in the Vertex ASCII.

109
00:07:41,080 --> 00:07:47,800
Because we are basically converting or creating a dictionary that converts the vertex or vertex to indices.

110
00:07:48,070 --> 00:07:51,310
So vertex would be the key and index would be the value.

111
00:07:51,490 --> 00:07:58,030
So if we provide vertex to this dictionary, it gives us the index and the opposite books in the indices

112
00:07:58,030 --> 00:08:00,760
towards additionally where we provide in the index.

113
00:08:00,910 --> 00:08:04,020
And this gives us the vertex as the body value.

114
00:08:04,390 --> 00:08:10,660
So if we want to stretch either of the vertex or the index, we can do by simply accessing these dictionaries

115
00:08:10,660 --> 00:08:12,330
and providing in the respective key.

116
00:08:13,390 --> 00:08:19,570
Now that we have initialize the mini pre and also set the distance of each corresponding vertex to infinity,

117
00:08:19,780 --> 00:08:25,960
we can now proceed to the second step for our DICE algorithm and that is to simply decrease the key

118
00:08:26,170 --> 00:08:29,530
for our start vertex from infinity down to zero.

119
00:08:30,100 --> 00:08:36,100
So the way this works is that we access the distances and passing the index of the start vertex to the

120
00:08:36,100 --> 00:08:39,880
start index and decrease this value down to zero.

121
00:08:40,180 --> 00:08:44,750
And because we have updated the value inside the distances, we need to do the same inside the mean

122
00:08:44,770 --> 00:08:45,040
heap.

123
00:08:45,250 --> 00:08:48,850
And that is done by accessing its function of decrease key.

124
00:08:49,150 --> 00:08:54,010
Now this function fixing to input argument the force is the vortex of which you want to decrease the

125
00:08:54,010 --> 00:08:54,480
key off.

126
00:08:54,730 --> 00:08:56,800
And second is the newly formed shortest distance.

127
00:08:57,220 --> 00:09:01,930
So for the vertex we provide this corresponding index that is the start index.

128
00:09:02,770 --> 00:09:06,250
And for the distance we provided the newly falling short assistance.

129
00:09:06,580 --> 00:09:08,500
That is a distance of the start index.

130
00:09:08,830 --> 00:09:15,220
And what this function of decrease key will do will basically decrease this particular start index value

131
00:09:15,220 --> 00:09:15,950
inside the mean heap.

132
00:09:16,570 --> 00:09:21,850
And this would basically take it right to the top of our main heap or the priority queue, because it

133
00:09:21,850 --> 00:09:25,930
would have the minimum value and the highest priority next.

134
00:09:25,960 --> 00:09:28,060
We simply create a loop that is a value.

135
00:09:28,240 --> 00:09:32,860
And this would run for as long as the main heap or the priority queue has an inside of it.

136
00:09:33,220 --> 00:09:40,030
So that can be accessed by accessing the min heap and checking its size variable and that is not equal

137
00:09:40,030 --> 00:09:40,540
to zero.

138
00:09:40,960 --> 00:09:45,700
So if it is if it has still a node inside of it, then we can continue this loop.

139
00:09:45,910 --> 00:09:47,230
Otherwise we stop the loop.

140
00:09:47,860 --> 00:09:52,810
So the very first thing that we do inside this group is extract the node with the minimum value, and

141
00:09:52,810 --> 00:09:56,290
that can be done by accessing the main function of extract min.

142
00:09:56,620 --> 00:10:01,990
And this node would be our start vertex because it has the minimum value, because every other node

143
00:10:02,110 --> 00:10:04,600
has the value or distance of infinity.

144
00:10:05,200 --> 00:10:10,540
And let's call this minimum value node as currently because it is at the top.

145
00:10:12,100 --> 00:10:18,880
So once we have this current of and this would be of the type integer and this is the indices and distance

146
00:10:18,880 --> 00:10:19,690
of those indices.

147
00:10:20,080 --> 00:10:26,380
So we simply extract the index of that particular note and that can be extracted as you index.

148
00:10:27,460 --> 00:10:30,340
And we access this from the current Top Zero Index.

149
00:10:31,030 --> 00:10:35,410
Now, because we have the index of our current node, we also require the vertex of this current node.

150
00:10:35,560 --> 00:10:42,040
And that can be done by accessing that dictionary that we earlier that was the indices to vertices.

151
00:10:42,370 --> 00:10:45,880
So we have the index it providing the index of U index.

152
00:10:46,790 --> 00:10:51,470
On the correct note and we and we will retrieve the current note and rename it.

153
00:10:52,640 --> 00:10:57,950
Now, once we have the right note and its corresponding index, we can now access its neighbor nodes

154
00:10:57,950 --> 00:11:03,470
per our current node and that can be done by accessing by writing for neighbor node.

155
00:11:03,470 --> 00:11:08,750
Let's call them B for B in graph, providing the current node you.

156
00:11:09,530 --> 00:11:11,750
So now the V is in the form of tuple.

157
00:11:11,960 --> 00:11:13,790
That is the neighbor node for our graph.

158
00:11:14,240 --> 00:11:20,390
So we start all by checking if the neighbor node is not equal to case because we don't want to do anything

159
00:11:20,510 --> 00:11:21,080
with the case.

160
00:11:21,080 --> 00:11:29,120
No, that is done by writing if condition if we are not equal to case because we don't want to do or

161
00:11:29,240 --> 00:11:30,640
take care of case notes.

162
00:11:31,190 --> 00:11:36,530
So if we have the b b node now, it will be the vertex and we require its corresponding index.

163
00:11:37,480 --> 00:11:45,160
So that can be accessed for writing the index from the dictionary that basically converts the vertices

164
00:11:45,160 --> 00:11:45,880
to indices.

165
00:11:46,240 --> 00:11:50,560
So I provide in the vertex that is the neighbor node we and the neighbor node we.

166
00:11:51,840 --> 00:11:52,350
Index.

167
00:11:52,680 --> 00:11:58,170
Once we have this information, we can now perform a few checks to check whether we have found a shortest

168
00:11:58,200 --> 00:12:00,960
distance from our cart, nor to the neighbor.

169
00:12:00,960 --> 00:12:06,330
Not the way the sick work is that we first check whether the neighbor node is part of the main heap

170
00:12:06,330 --> 00:12:06,660
or not.

171
00:12:06,900 --> 00:12:10,380
Because if it is not part of the mean, that means it's already visited.

172
00:12:10,560 --> 00:12:16,410
So we don't visit that note and then we check if the distance of the car door is not equal to infinity.

173
00:12:16,450 --> 00:12:20,640
Because if it is equal to infinity, then we are not proceeding correctly.

174
00:12:21,030 --> 00:12:25,950
And then finally, we check if we have found the shortest shorter distance from the previously known

175
00:12:25,950 --> 00:12:27,840
shorter distance for our neighbor node.

176
00:12:28,050 --> 00:12:34,380
And that is done by finding the traversal cost of our current or neighbor node and then adding that

177
00:12:34,950 --> 00:12:36,840
to the distance for our control.

178
00:12:37,200 --> 00:12:42,510
And if it is less than the distance of known distance for our neighbor node, then we update the distance

179
00:12:42,510 --> 00:12:48,570
for our neighbor, not because we have found a new shorter distance and that is done by simply starting

180
00:12:48,570 --> 00:12:51,000
working distance.

181
00:12:52,890 --> 00:12:56,490
We index and we write here.

182
00:12:57,360 --> 00:13:06,900
The graph or traversal cost from grant node to neighbor node accessing this cost and adding the adding

183
00:13:06,900 --> 00:13:10,260
the distance of the current note.

184
00:13:11,190 --> 00:13:12,810
So this is the newly found chart of distance.

185
00:13:12,990 --> 00:13:18,340
And because we have updated the distance for our neighbor node, we need to do the same inside the mean.

186
00:13:18,990 --> 00:13:22,110
And that is done by writing when he not decreasing.

187
00:13:22,350 --> 00:13:24,500
And this takes in two input argument one.

188
00:13:24,720 --> 00:13:27,750
First is the vertex of which we want to decrease the key kilo.

189
00:13:27,990 --> 00:13:31,410
And because you are decreasing the key of our neighbor node, that is a V indexed.

190
00:13:31,860 --> 00:13:36,660
So we provide in the V index and then we provide in the updated V in this distance.

191
00:13:37,530 --> 00:13:40,460
And this is basically decrease the key of this neighbor note.

192
00:13:40,950 --> 00:13:44,970
Then we simply update the newly found closest vertex for our neighbor node.

193
00:13:45,360 --> 00:13:51,500
And that is done by accessing the parent list and it providing the index of our neighbor node and provide

194
00:13:51,720 --> 00:13:55,740
the information of the newly found parent for our neighbor node.

195
00:13:56,130 --> 00:14:02,460
That is the U index because that has a distance shorter than the previously known distance for our neighbor

196
00:14:02,460 --> 00:14:02,700
node.

197
00:14:03,360 --> 00:14:09,630
Now, once you're done with this, we can now simply add a condition or end condition for our distance

198
00:14:09,630 --> 00:14:14,370
algorithm, because otherwise this function will loop until the priority queue is empty.

199
00:14:14,820 --> 00:14:20,580
So if you want to stop it earlier, when we have reached our end node and that would be when we are

200
00:14:20,580 --> 00:14:23,520
visiting and when our current node is a neighbor.

201
00:14:23,520 --> 00:14:28,460
Note Because when we have visited the current node and or when we have bought the current.

202
00:14:29,100 --> 00:14:31,990
That means that we have found the shortest distance to the current note.

203
00:14:32,190 --> 00:14:33,820
So we don't need to proceed further.

204
00:14:34,200 --> 00:14:36,420
So we simply add that end condition greater over here.

205
00:14:36,630 --> 00:14:43,140
We simply say that if our current node is the end node, then we have found the shortest distance to

206
00:14:43,140 --> 00:14:44,310
the to the gold node.

207
00:14:44,400 --> 00:14:49,740
So to access the shortest out to the goal note to create a new function, that access is on the finished

208
00:14:49,740 --> 00:14:50,010
list.

209
00:14:50,250 --> 00:14:51,390
And that would be known as.

210
00:14:53,500 --> 00:14:54,520
Certain shortcuts don't.

211
00:14:54,850 --> 00:14:57,910
Now this particular function takes in three or four input arguments.

212
00:14:58,090 --> 00:15:02,890
The first is the parent list, which has the close vertex for all corresponding vertices, and then

213
00:15:02,890 --> 00:15:08,740
the start node and then the end of the go note and then the root, which will basically store the shortest

214
00:15:08,740 --> 00:15:09,880
down to the goal.

215
00:15:10,940 --> 00:15:13,010
So now we need to call this particular function.

216
00:15:14,280 --> 00:15:22,290
Right over here, which is basically surfboard return shorted up the sticks in the parent list, then

217
00:15:22,290 --> 00:15:29,910
the start node and at the end node and here for the routing, providing the shortest path list.

218
00:15:30,820 --> 00:15:33,940
And this would become populated with the shortest path to the goal.

219
00:15:34,210 --> 00:15:39,010
So we need to create this, this variable of shortest path container for the shortest path, and we

220
00:15:39,010 --> 00:15:40,450
initialize this to an empty list.

221
00:15:41,270 --> 00:15:47,080
And when this function runs it, find the shortest path to the goal from the parent or the closed vertex

222
00:15:47,080 --> 00:15:47,350
list.

223
00:15:47,650 --> 00:15:50,560
And then stores this inside the shortest spot list.

224
00:15:51,160 --> 00:15:51,460
Sorry.

225
00:15:52,480 --> 00:15:54,070
I missed my word.

226
00:15:54,580 --> 00:15:56,020
Once I have this information.

227
00:15:56,110 --> 00:16:00,100
We aim to store the shortest part inside our instance variable of shorter spot.

228
00:16:00,340 --> 00:16:05,290
And that can be done very simply by simply reversing our a spot that is in the reverse.

229
00:16:05,680 --> 00:16:06,580
Reverse this list.

230
00:16:06,820 --> 00:16:07,360
Store this.

231
00:16:07,360 --> 00:16:07,900
Store this.

232
00:16:07,900 --> 00:16:10,060
Inside this shortest instance variable.

233
00:16:10,270 --> 00:16:16,570
And then set our boolean variable or shortest path to true because the Dijkstra algorithm was successful

234
00:16:16,690 --> 00:16:18,370
in finding the shortest path to go.

235
00:16:19,430 --> 00:16:24,420
So this dataset algorithm definition is now completed and all that is there for us to do.

236
00:16:24,440 --> 00:16:30,020
It is simply integrated to our main project and see what finds the shortest path to the goal.

237
00:16:31,190 --> 00:16:31,430
Right.

238
00:16:32,060 --> 00:16:37,250
In the previous coding session, we developed the dice algorithm and now all that is left for us to

239
00:16:37,250 --> 00:16:40,040
do is to simply integrated to our project.

240
00:16:40,670 --> 00:16:43,800
For this, you move inside the board part, then a clause.

241
00:16:44,210 --> 00:16:49,490
We are in the new instance variable or dice this guess assigned object of the dice class.

242
00:16:50,060 --> 00:16:54,710
Then we move to the find path and display a function that actually finds the path to the goal.

243
00:16:55,010 --> 00:17:00,490
And we provide in the new method that we have justifying that is a dice for algorithm inside it.

244
00:17:00,980 --> 00:17:04,520
We simply check if the shortest path is not already found or not.

245
00:17:05,000 --> 00:17:10,610
So if it hasn't been found as of yet, then we find the shortest path to the goal by calling the function

246
00:17:10,610 --> 00:17:11,480
of dice to class.

247
00:17:11,630 --> 00:17:15,200
That is fine but starts this takes in three input arguments.

248
00:17:15,320 --> 00:17:21,080
The first is the graph that is the output of the mapping algorithm and then the start and end vertex,

249
00:17:21,500 --> 00:17:24,260
the goal of which you want to find the shortest path up.

250
00:17:25,040 --> 00:17:28,610
Then this obvious, the shortest part is just variable.

251
00:17:28,610 --> 00:17:31,790
And then we assign this value for the path to display variable.

252
00:17:32,240 --> 00:17:38,240
Then we simply display that shortest path back onto the maze from which it was expected.

253
00:17:38,480 --> 00:17:41,880
And this is displayed to the user in the form of a colourful thought.

254
00:17:42,560 --> 00:17:48,140
Then we can head over to the Miss Salvador part where we have called the function of find and display

255
00:17:48,350 --> 00:17:54,280
to find the shortest out the goal using specified method previously where you were using DFS.

256
00:17:54,980 --> 00:17:59,630
And now we modify this to use the currently made dice to algorithm.

257
00:18:00,140 --> 00:18:00,920
So we right here.

258
00:18:02,470 --> 00:18:07,360
Destruct as the method that should be used for finding the path to the goal.

259
00:18:08,340 --> 00:18:14,190
Now, once we sign this, we save this and head over to the terminal building project.

260
00:18:15,170 --> 00:18:16,790
I've already started simulation.

261
00:18:17,060 --> 00:18:18,290
So we run the maze solver.

262
00:18:20,090 --> 00:18:23,330
Once this runs, you will see the output of the locals and state.

263
00:18:23,840 --> 00:18:25,100
Then you press spacebar again.

264
00:18:25,490 --> 00:18:30,350
This outputs the output of mapping state, passing the spacebar again.

265
00:18:31,560 --> 00:18:31,920
Woops.

266
00:18:32,130 --> 00:18:36,750
We have landed on an error and the error stays at the rotor again.

267
00:18:37,230 --> 00:18:44,250
This line was unable to work because of a key error and we're passing in tuples so this tuple cannot

268
00:18:44,250 --> 00:18:48,630
be accessed from cannot be accessed for this index to vertices.

269
00:18:49,350 --> 00:18:54,780
Now this problem is occurring because we want to convert an index to vertex, but we are providing in

270
00:18:54,780 --> 00:18:55,350
vertex.

271
00:18:56,100 --> 00:18:57,270
So why is this happening?

272
00:18:57,900 --> 00:19:02,010
So we have provided and that is not index but rather the vertex.

273
00:19:02,310 --> 00:19:06,960
So we need to provide here that the proper index of that particular vertex.

274
00:19:07,440 --> 00:19:12,510
So what we do right here is we head on over to the board part, then the part where we have defined

275
00:19:12,510 --> 00:19:13,350
the distal clause.

276
00:19:13,560 --> 00:19:15,900
I don't want to head over to the find results.

277
00:19:17,000 --> 00:19:21,500
Right in the bottom where we have called the function of written short shortstop.

278
00:19:22,070 --> 00:19:28,520
We have passing in the parent class, but the parent class only gives the closest vertex index for each

279
00:19:28,520 --> 00:19:29,840
corresponding vertex index.

280
00:19:30,320 --> 00:19:35,750
So we do not provide in the start vertex, but rather you should provide here the start index.

281
00:19:35,990 --> 00:19:41,330
And for the end we also providing an index so we already have the START index.

282
00:19:41,660 --> 00:19:45,260
So we like to start indexed, but we don't have the end index.

283
00:19:45,350 --> 00:19:47,900
So we can compute that by accessing our.

284
00:19:48,870 --> 00:19:51,900
Visionary that converts the vertex to indices.

285
00:19:52,560 --> 00:19:56,370
So it falls in the vortex of RN and retrieved an index.

286
00:19:56,760 --> 00:20:00,930
And you provide it to the written shortlist round and hopefully the error will go away.

287
00:20:01,860 --> 00:20:03,270
And I will build this project again.

288
00:20:05,430 --> 00:20:07,110
And this time we run the simulation.

289
00:20:08,530 --> 00:20:13,990
After the localizing stage, we have the map and state pressing experience, but again, we retrieve

290
00:20:13,990 --> 00:20:16,060
the output of the dice algorithm.

291
00:20:16,360 --> 00:20:21,310
And as you can see, this current line showed the path from the maze entry to the maze exit, which

292
00:20:21,310 --> 00:20:24,340
is the actual shortest path found using the Die Star algorithm.

293
00:20:24,790 --> 00:20:26,260
So this seems to be correct.

294
00:20:26,650 --> 00:20:32,230
So now we can proceed to finding the shortest path using the estar algorithm and see if it does a better

295
00:20:32,230 --> 00:20:34,900
job in finding the shortest spot till then.

296
00:20:35,290 --> 00:20:35,860
Thank you.

297
00:20:36,010 --> 00:20:36,220
And.

298
00:20:36,220 --> 00:20:36,520
But.
