00:01
So first i'm going to start by drawing out this graph.
00:03
You have x, y, z, and w.
00:46
All right, so this is the graph that you gave me.
00:51
Question a asked to find the simple paths from x to z.
00:58
So for our path to be simple, we can't repeat a vertex.
01:03
We can't repeat an edge.
01:04
So we want to find all the paths from x to z that do not repeat a vertex and do not repeat an edge.
01:12
So our simplest path here is going to be just the edge from x to z.
01:25
And then we see we have one other direction we can go right here, so we can go from x to y, and then y to w, and then w to z.
01:45
So we have x, y, y, y, z.
01:49
There is one last one, and this is because x has three out edges, so we can take x to w and then w to z.
02:09
So we have three x to z paths on this graph.
02:21
So now i ask to find y to z pass.
02:37
So we want to look at it and say, well, how many? different directions can we go out of y? well we see it has two out edges so we can either go down or we can go to the left.
02:49
So let's start by going down.
02:51
So we can go from y to w and then from here there's only one out edge from w that goes and it goes towards z.
03:01
So that'll be our last edge.
03:03
So y to w to z.
03:07
So now our next option is to go from y to x.
03:11
But we see x has two different out edges that we can take.
03:17
Not this one, though, because we've already visited y.
03:20
So y, x, are two options.
03:23
The first one, we go down, takes us directly to z.
03:28
But if we go diagonal, it's going to take us from x to w and then from w to z.
03:38
So these are our three simple paths from y to z.
03:42
All right, so now it asks us to find all cycles in g.
03:53
And since this is a multi -graph, because we have multiple edges between some of the vertices, we will assume that we can have a path that's smaller than a length of three.
04:06
So a loop, this is a cycle that's smaller than the length of three.
04:16
So a loop, this is considered a cycle of length 1.
04:25
So our first cycle is just z.
04:28
It goes from z to z.
04:31
We also have another loop, and that's y.
04:34
It just goes from y to y.
04:39
And then next we have these edges that have multiple directions.
04:46
So we can go from x to y and then y to z.
04:52
So we have x to y back to x which is equal to y x y x y they're the same cycle.
05:01
And then we can also do the same down here between z and w.
05:07
So we have z to w back to z or you can also write this as w z w.
05:14
So are there any cycles that go from x to to z...