00:01
Okay, we're going to use dykstra's algorithm to find the source path and its distance between vertices a and all other vertices the following graphs in figure six.
00:14
Okay, so let's look at this one.
00:16
Once we do this one, maybe it'll help you with this one.
00:20
Okay.
00:22
So we start with a and then so i'm just going to list a, b, and then a, c.
00:32
A, d, a, e, a, f.
00:39
I'm just looking from, i'm just trying to figure out what we're gonna do.
00:43
So what we're gonna do is we're gonna start at a, and we're trying to find the shortest path to each one of these vertices, from a to each one of these vertices.
00:52
So the one from b we have, we can either go, we can either go this way or we can go this way.
01:02
From a to b obviously it's going to be one.
01:06
So this one we're just going to say that's one.
01:09
Okay, what about a to c? now a to c, i could go, so now we're starting over again.
01:14
We're not worried about b.
01:15
We're still starting from a.
01:18
And then we go, okay, well, from a to c, i could either do four, or i could go from a to b and b to c.
01:25
And from a to b and b to c is only three.
01:29
So that would be one plus two which is three okay all right let's let's see here let's see what are we doing a to d okay so d's right here so there's several things we can do right now we can go to a to b is one stop it and then we can go from b to e which is five or b to c which is two let's see here so we went five okay so if we went five and then up to three that's eight we could go these are the different paths from b we could go we're trying to go to trying to go to d and we chose to start at b because that was only from one one it only cost us one from a to b from here to from b is only six so that's winning we could also go down to 2 then to 1 and then to 3 to 1 and 3 that's 6 as well let's just choose the let's just either way that's going to be be 6 so let's do the abd 1 so that's going to be that's going to be 1 plus 6 which is 7 and we could have done 2 plus 1 plus 3 which is 7 is the same so we'll just do the one the one path instead of the multiple paths again we're just trying to find this is the shortest path between each each vertex okay so now what are we doing a to so we're going from a to e notice from a to e i mean we can go here again to b i'm like in this is a two so that's probably going to be nice i mean we could go six then three which is nine we could go five or we could go two and one which is three right, because we already got this one here.
03:44
So i could go there.
03:47
I could go here.
03:50
Or i could go here.
03:52
So i've got five.
03:54
I've got the six and three is nine.
03:56
Not even going to work.
03:57
Two and one is three.
03:59
So we're going to do that one.
04:00
So the e is one plus two plus one, which is four.
04:10
Okay.
04:15
What do we got last one, f? okay, f.
04:25
Okay, what have we got for f? let's see.
04:34
So we have a here and we have f here.
04:37
So there's lots of different ways.
04:39
Let's take the, if we go, if we go one and then two, and then one, and then three and then two...