00:01
Hello students, here i have to use the dijkstra algorithm on the given graph and i have to find the shortest distance.
00:07
So, i did this with the help of dv equal to du plus wuv.
00:11
So here i have to relax the nodes.
00:14
So, dv is the destination node, du is the source node and wuv is the distance or the weight of the edges.
00:21
So, here i will use the dijkstra algorithm.
00:24
So, first i write the all nodes a, b, c, d, e, f, g.
00:28
So, these are the total nodes.
00:29
At the starting, i will provide their value infinity and for the source from where i am starting that i will initialize the value 0.
00:37
This is the distance matrix.
00:40
And now after this what i am finding, i will find the adjacent of a.
00:43
A adjacent having e, f and c.
00:58
So, i will take a from the queue and i have written here and i have relaxed all these.
01:23
And after this i have to find the minimum value.
01:26
I find f is the minimum because f having 1 as compared to other at the starting time.
01:34
So, i will take f and i will read its adjacent f having the adjacent c.
01:39
So, i have to f having the adjacent g.
01:42
So, i have to relax this as compared to infinity 3 is minimum that's why i replaced.
01:48
How 3 comes? because 3 is the weight and in the value as compared to infinity i write here 3.
01:56
So, here 3 plus 0, 3 plus 0 equal to 3.
02:03
And after this i find, after taking f i find the c, but c having no adjacent that say it will not relax.
02:12
Now i go towards the e, e having adjacent g.
02:18
So, e having adjacent g.
02:19
So, i have to find out g adjacent.
02:24
So, according to given graph g adjacent here is d.
02:29
G adjacent here is d...