0:00
Hi.
00:01
In this problem, we're going to use the greedy and edge -picking algorithms to find hamiltonian circuits on these two graphs.
00:11
So we'll start with the first graph and with the greedy algorithm.
00:20
So we'll draw, we have a, wait, sorry, a, b, c, d, and e.
00:32
So we want to start with a.
00:34
So we look at all of the edges going out from a and their weights, and we pick the one with the smallest weight.
00:45
So in this case, that's going to d with weight 5.
00:49
And then of all the edges from d, the smallest one is here with weight 4.
00:57
And then from c, the smallest is going to b.
01:02
And then that means we have to end by going to e and then back to a.
01:21
So now with the edge picking algorithm, it's similar to greedy, but we don't make ourselves begin with a.
01:27
We just find a hamiltonian circuit, and then it's going to go through a, so then we can start from there.
01:34
So we just look at all of the edges and take the one with the smallest weight.
01:39
So that starts with this one with weight three.
01:42
The next smallest is going to be this one with weight four.
01:49
And then we have three with length five, and we can choose any of them that, don't create a circuit already.
01:57
So d to b does create a circuit so we can't use that, but we can choose d to a and we can choose e to b and then that gives us the last remaining one.
02:11
So in this case they both gave us the same circuit.
02:19
So now we're going to do a much bigger graph but the process is the same.
02:39
So now we started a, which is over here, and of all of the edges going out from a, it appears that the smallest one is to f with weight 3.
02:53
And then going out of f, it looks like the smallest one is to b with weight 2.
03:06
And then there's an edge of weight 1 going to e.
03:16
And then of the remaining, the smallest is this one of weight 2.
03:27
And then the next would be over here, the g.
03:33
And that means we must end going over to d.
03:39
Back to a.
04:07
Okay, so then with edge picking, again, we do the same thing, but now we just, we don't make ourselves follow a certain path.
04:14
We just take as many of the smallest edges as we can without creating circuits...