00:02
We are given a weighted graph and we are asked to use prims algorithm to find a minimum spanning tree for this graph.
00:12
So the graph is a graph on the vertices, a, b, c, d, e, f, g, h, and i.
00:19
I don't have it pictured here, but it can be found in the book.
00:24
Exercise 3, it's very detailed, so i suggest that you just use the book to look at the graph.
00:32
Now, to use prims algorithm, first, we want to just draw the graph with the vertices of the given graph and with no edges.
00:45
So that's what we have here, a, b, c, d, e, f, g, h, and i.
00:50
And then let's pick a vertex b, the root, say, vertex a.
00:57
This will be the root of our tree.
01:01
And now, looking at the edges that are incidence to a in this graph, we see that edge ad has the smallest weight.
01:13
Edge id has a weight, in fact, of 2.
01:17
And so we'll add this to the tree in green.
01:27
And now, in the next step, we have that there's still one edge incident to a, and four edges incident to d now.
01:36
And we have that the smallest weight of these edges is going to be 3, and this belongs to the edge bd.
01:45
And since this edge doesn't cause a circuit, if we add it, we can of course add it to the graph.
01:49
So we'll add bd, which has a weight of 3.
01:58
In the next step of all the remaining edges that are incident to a, b, or d, there's a lot of these.
02:05
The smallest weight, which is 4, belongs to the edge b .c.
02:14
And if we add b .c, we don't obtain a circuit so we can add it to the graph.
02:23
In the next step, we have all the remaining edges that are incident to the vertices a, b, c, or d...