1 00:00:00,499 --> 00:00:02,830 The following content is provided under a Creative 2 00:00:02,830 --> 00:00:04,350 Commons license. 3 00:00:04,350 --> 00:00:06,680 Your support will help MIT OpenCourseWare 4 00:00:06,680 --> 00:00:11,050 continue to offer high quality educational resources for free. 5 00:00:11,050 --> 00:00:13,670 To make a donation or view additional materials 6 00:00:13,670 --> 00:00:17,566 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,566 --> 00:00:18,191 at ocw.mit.edu. 8 00:00:22,889 --> 00:00:24,680 PROFESSOR: So today we're going to continue 9 00:00:24,680 --> 00:00:26,960 our course on the graph theory. 10 00:00:26,960 --> 00:00:30,110 It's going to be a mixture of all kinds of topics. 11 00:00:30,110 --> 00:00:32,729 We first start off with Euler tour, 12 00:00:32,729 --> 00:00:34,810 and then we get into directed graphs 13 00:00:34,810 --> 00:00:37,500 and cover the definitions. 14 00:00:37,500 --> 00:00:39,850 And we'll talk about a special type, which 15 00:00:39,850 --> 00:00:42,030 are called tournament graphs. 16 00:00:42,030 --> 00:00:45,040 And we'll do a whole bunch of proofs, 17 00:00:45,040 --> 00:00:50,220 and hopefully you will all contribute to make this work 18 00:00:50,220 --> 00:00:52,750 and think about how to do this. 19 00:00:52,750 --> 00:00:56,110 So next week we will continue with graph theory, 20 00:00:56,110 --> 00:00:59,940 and we will discuss a very special type. 21 00:00:59,940 --> 00:01:03,970 We will use directed graphs in communication networks. 22 00:01:03,970 --> 00:01:09,070 And on Thursday, we'll actually use these special types 23 00:01:09,070 --> 00:01:11,330 of graphs that we'll talk about in a moment, DAGs. 24 00:01:13,960 --> 00:01:17,250 So let's talk about Euler tour. 25 00:01:17,250 --> 00:01:21,280 Euler, a famous mathematician, he asked the question 26 00:01:21,280 --> 00:01:24,865 like-- he lived in Konigsberg. 27 00:01:24,865 --> 00:01:26,180 And there were seven bridges. 28 00:01:26,180 --> 00:01:29,940 He was wondering, can you traverse all the bridges 29 00:01:29,940 --> 00:01:30,810 exactly once. 30 00:01:30,810 --> 00:01:33,980 So he would start walking and try to cross all those bridges. 31 00:01:33,980 --> 00:01:37,310 And apparently this little islands in sort of the river 32 00:01:37,310 --> 00:01:38,620 as well, and so on. 33 00:01:38,620 --> 00:01:40,980 So how can you do that? 34 00:01:40,980 --> 00:01:43,390 This is actually the birth of graph theory. 35 00:01:43,390 --> 00:01:47,030 And this particular problem is named after him. 36 00:01:47,030 --> 00:01:48,570 So what is an Euler tour? 37 00:01:52,830 --> 00:01:59,920 It's actually defined as a special walk. 38 00:02:06,380 --> 00:02:14,270 It's a walk that traverses every edge exactly once. 39 00:02:23,110 --> 00:02:25,640 So it turns out the you can actually characterize 40 00:02:25,640 --> 00:02:28,210 these types of graphs. 41 00:02:28,210 --> 00:02:31,330 So we are talking here about undirected graph, 42 00:02:31,330 --> 00:02:34,990 so continuation of last time. 43 00:02:34,990 --> 00:02:37,690 So the edges that we consider have no direction. 44 00:02:37,690 --> 00:02:39,840 We'll come back to that in a moment. 45 00:02:39,840 --> 00:02:42,210 We will start defining those later. 46 00:02:42,210 --> 00:02:45,220 So Euler tour is a walk that traverses every edge exactly 47 00:02:45,220 --> 00:02:46,240 once. 48 00:02:46,240 --> 00:02:50,840 And at the same time, it's also a tour. 49 00:02:50,840 --> 00:02:58,700 So that means that it actually starts and finishes 50 00:02:58,700 --> 00:02:59,980 at the same vertex. 51 00:03:10,050 --> 00:03:12,485 Now it turns out that undirected graphs, 52 00:03:12,485 --> 00:03:16,530 the graphs that we've been talking about, 53 00:03:16,530 --> 00:03:19,680 those that Euler tours can be easily characterized. 54 00:03:19,680 --> 00:03:23,460 And that's the theorem that we're going to prove next. 55 00:03:23,460 --> 00:03:28,390 The theorem states that actually, 56 00:03:28,390 --> 00:03:42,590 if a connected graph has an Euler tour, 57 00:03:42,590 --> 00:03:53,140 if and only if, every vertex of the graph has even degree. 58 00:03:56,120 --> 00:03:59,730 So that's a very nice and simple and straightforward 59 00:03:59,730 --> 00:04:00,560 characterization. 60 00:04:00,560 --> 00:04:02,202 So how can we prove this? 61 00:04:04,980 --> 00:04:06,070 So let's have a look. 62 00:04:08,820 --> 00:04:14,140 So first of all, we have an if and only if statement. 63 00:04:14,140 --> 00:04:16,930 So we need to prove two directions. 64 00:04:16,930 --> 00:04:20,200 We need to proof that if I have a connected graph that 65 00:04:20,200 --> 00:04:23,550 has an Euler tour, I need to show that every vertex has 66 00:04:23,550 --> 00:04:24,470 even degree. 67 00:04:24,470 --> 00:04:28,000 And also the reverse-- if I have a graph for which every vertex 68 00:04:28,000 --> 00:04:31,080 has even degree, I need to show that it has an Euler tour. 69 00:04:31,080 --> 00:04:34,590 So the proof consists of two parts. 70 00:04:34,590 --> 00:04:38,430 So let's first do this implication, 71 00:04:38,430 --> 00:04:40,280 where we assure that we have connected 72 00:04:40,280 --> 00:04:42,660 graph that has an Euler tour. 73 00:04:42,660 --> 00:04:47,030 So assume we have a graph. 74 00:04:47,030 --> 00:04:52,370 So we have G with the vertex at V, edge is at E, 75 00:04:52,370 --> 00:04:55,810 and it has an Euler tour. 76 00:04:55,810 --> 00:04:57,730 So what does it mean? 77 00:04:57,730 --> 00:05:01,810 Well, it's really means that we can walk 78 00:05:01,810 --> 00:05:05,960 from some start vertex, V0. 79 00:05:05,960 --> 00:05:11,440 We can go all the way around to V1, and some more, and so on, 80 00:05:11,440 --> 00:05:15,170 to V, say, k minus 1. 81 00:05:15,170 --> 00:05:19,510 And then end vertex is the same as the start vertex. 82 00:05:19,510 --> 00:05:24,060 So we have a walk that goes all around the whole graph. 83 00:05:24,060 --> 00:05:30,770 So every edge in this walk are exactly the edges 84 00:05:30,770 --> 00:05:31,740 that are in the graph. 85 00:05:31,740 --> 00:05:36,700 And each edge in the graph is offered exactly once. 86 00:05:36,700 --> 00:05:38,200 So what does it mean? 87 00:05:38,200 --> 00:05:40,240 So let's write this down actually. 88 00:05:40,240 --> 00:05:57,720 So since every edge is traversed once-- every edge in E 89 00:05:57,720 --> 00:06:01,020 is traversed once-- what can we conclude from that? 90 00:06:01,020 --> 00:06:11,980 Can we say something about, given such as walk of length k, 91 00:06:11,980 --> 00:06:14,560 what can we say about the number of edges, for example? 92 00:06:14,560 --> 00:06:19,777 What can we say about the degree of the vertices? 93 00:06:19,777 --> 00:06:21,610 Because that's what you want to show, right? 94 00:06:21,610 --> 00:06:25,270 You want to show that every vertex has even degree. 95 00:06:25,270 --> 00:06:27,690 Does anyone know how to go ahead here? 96 00:06:27,690 --> 00:06:31,670 So we know that every single edge in E 97 00:06:31,670 --> 00:06:34,097 is referred ones within this whole walk. 98 00:06:34,097 --> 00:06:35,805 So what kind of properties can we derive? 99 00:06:41,998 --> 00:06:44,430 AUDIENCE: [INAUDIBLE] 100 00:06:44,430 --> 00:06:46,291 PROFESSOR: That's true. 101 00:06:46,291 --> 00:06:47,166 AUDIENCE: [INAUDIBLE] 102 00:06:51,657 --> 00:06:54,152 PROFESSOR: Maybe someone else can pick up here. 103 00:06:54,152 --> 00:06:59,467 So every vertex that I have here, I will enter it. 104 00:06:59,467 --> 00:07:00,300 But I also leave it. 105 00:07:00,300 --> 00:07:04,760 So if I see a vertex in here, I can 106 00:07:04,760 --> 00:07:07,120 see at least two contributing edges 107 00:07:07,120 --> 00:07:10,235 that are coming from this. 108 00:07:10,235 --> 00:07:12,360 AUDIENCE: Then you know that that note has at least 109 00:07:12,360 --> 00:07:14,440 degree 2, but it can't be more than 2 110 00:07:14,440 --> 00:07:17,147 because otherwise that would be the endpoint. 111 00:07:17,147 --> 00:07:17,730 PROFESSOR: Ah. 112 00:07:17,730 --> 00:07:23,010 But is it true though that-- so for example, 113 00:07:23,010 --> 00:07:26,120 this particular note here may repeat itself somewhere else. 114 00:07:26,120 --> 00:07:29,830 I only have a condition on the Euler tour 115 00:07:29,830 --> 00:07:34,340 that every edge occurs exactly ones. 116 00:07:34,340 --> 00:07:37,062 So how could I formally sort of continue to prove? 117 00:07:37,062 --> 00:07:39,020 AUDIENCE: Well, it will intersect itself again, 118 00:07:39,020 --> 00:07:41,360 and you'll leave again and it will still 119 00:07:41,360 --> 00:07:42,394 have the even number. 120 00:07:42,394 --> 00:07:43,060 PROFESSOR: Yeah. 121 00:07:43,060 --> 00:07:43,770 That's true. 122 00:07:43,770 --> 00:07:45,410 That's right. 123 00:07:45,410 --> 00:07:46,895 Any other additions? 124 00:07:46,895 --> 00:07:48,875 AUDIENCE: You can define the number of edges 125 00:07:48,875 --> 00:07:50,855 that it will test by how many you enter it, 126 00:07:50,855 --> 00:07:52,835 so the number of edges that it has 127 00:07:52,835 --> 00:07:56,129 is twice the number of [INAUDIBLE]. 128 00:07:56,129 --> 00:07:56,795 PROFESSOR: Yeah. 129 00:07:56,795 --> 00:08:00,260 That's correct. [INAUDIBLE] 130 00:08:00,260 --> 00:08:06,200 AUDIENCE: [INAUDIBLE] traverse once, then every time you enter 131 00:08:06,200 --> 00:08:07,685 a node you have to leave it. 132 00:08:07,685 --> 00:08:09,912 So you can say that you're never going 133 00:08:09,912 --> 00:08:18,410 to leave a node for a node that it already left for from there. 134 00:08:18,410 --> 00:08:21,410 And you're never going to enter from a node you already entered 135 00:08:21,410 --> 00:08:22,743 from or left to from there. 136 00:08:22,743 --> 00:08:24,742 So that's how you can say that you're only going 137 00:08:24,742 --> 00:08:28,412 to increment your degree by 2. 138 00:08:28,412 --> 00:08:29,370 PROFESSOR: That's true. 139 00:08:29,370 --> 00:08:30,790 So what he's essentially saying is 140 00:08:30,790 --> 00:08:32,419 that every edge as I start to count 141 00:08:32,419 --> 00:08:35,299 here, in this particular tour, well they're all different. 142 00:08:35,299 --> 00:08:39,179 So they all counts towards a degree of the node. 143 00:08:39,179 --> 00:08:43,590 So everything that you have been saying is right on. 144 00:08:43,590 --> 00:08:48,560 What we can conclude here is that if you look at a vertex, 145 00:08:48,560 --> 00:09:00,230 say vertex U-- for example, somewhere over here-- well, 146 00:09:00,230 --> 00:09:02,240 it may repeat itself over here. 147 00:09:02,240 --> 00:09:04,990 And it has an incoming and outgoing edge, incoming 148 00:09:04,990 --> 00:09:07,140 and outgoing edge. 149 00:09:07,140 --> 00:09:08,780 And I may have it somewhere else, 150 00:09:08,780 --> 00:09:11,040 but say it's just at those two. 151 00:09:11,040 --> 00:09:13,570 Well, I know that all the edges are different. 152 00:09:13,570 --> 00:09:16,220 So I can clearly count this now. 153 00:09:16,220 --> 00:09:20,290 I can say that the degree of U must 154 00:09:20,290 --> 00:09:27,020 be equal to the number of times that U actually 155 00:09:27,020 --> 00:09:30,900 appears in this tour. 156 00:09:37,400 --> 00:09:41,540 So in the tour from V0 all the way to Vk minus 1. 157 00:09:41,540 --> 00:09:45,447 And then I have to multiply times 2. 158 00:09:45,447 --> 00:09:47,780 And what I said, it's exactly what you have been saying, 159 00:09:47,780 --> 00:09:51,640 all the edges occur exactly once of the whole graph. 160 00:09:51,640 --> 00:09:54,470 So I just count the number of times I see U in here. 161 00:09:54,470 --> 00:09:57,620 I come the number of edges that go into it and leave from it. 162 00:09:57,620 --> 00:10:01,860 Well, that's twice times the number of times 163 00:10:01,860 --> 00:10:04,060 that U actually appears in this tour. 164 00:10:04,060 --> 00:10:07,560 So this implication is pretty straightforward 165 00:10:07,560 --> 00:10:12,630 because now we actually note that the degree of U is even. 166 00:10:12,630 --> 00:10:14,130 So that's great. 167 00:10:14,130 --> 00:10:17,390 So let's talk about the other implication 168 00:10:17,390 --> 00:10:21,490 and see whether we can find a trick to make that happen. 169 00:10:21,490 --> 00:10:25,150 So what do we need to start off with? 170 00:10:25,150 --> 00:10:29,020 Well, now we have to assume that every vertex has even degree. 171 00:10:29,020 --> 00:10:31,010 So let's write this down. 172 00:10:31,010 --> 00:10:32,210 So say we have the graph. 173 00:10:35,030 --> 00:10:40,010 And for this graph we actually issue 174 00:10:40,010 --> 00:10:45,805 that the degree of every vertex V is even. 175 00:10:52,670 --> 00:10:53,780 Well, what can we do? 176 00:10:58,179 --> 00:10:59,720 Well, this is sort of creative trick, 177 00:10:59,720 --> 00:11:01,970 so let me just continue here. 178 00:11:01,970 --> 00:11:07,870 So what we have is if you start to consider a walk, W, 179 00:11:07,870 --> 00:11:15,830 that touches, say, a lot of vertices in such a way 180 00:11:15,830 --> 00:11:20,500 that W is actually the longest walk. 181 00:11:20,500 --> 00:11:23,130 So that's often what you do in graph theory. 182 00:11:23,130 --> 00:11:25,866 You think about, say, the shortest path 183 00:11:25,866 --> 00:11:28,240 or whatever with a certain property, or the longest walk, 184 00:11:28,240 --> 00:11:29,960 or whatever with a certain property. 185 00:11:29,960 --> 00:11:31,760 So that's what you're doing here. 186 00:11:31,760 --> 00:11:33,670 So let W be the longest walk. 187 00:11:38,020 --> 00:11:42,420 And well, we want to prove something about an Euler tour. 188 00:11:42,420 --> 00:11:44,480 An Euler tour has a very specific property 189 00:11:44,480 --> 00:11:46,420 that all the edges occur only once. 190 00:11:46,420 --> 00:11:51,220 So it makes sense to look at walks 191 00:11:51,220 --> 00:11:56,280 in which all the edges of which it walks are unique, 192 00:11:56,280 --> 00:11:57,980 are occurring only once. 193 00:11:57,980 --> 00:12:07,950 So we're interested in the longest walk that traverses 194 00:12:07,950 --> 00:12:15,930 no edge more than once. 195 00:12:15,930 --> 00:12:18,430 So that's important. 196 00:12:22,060 --> 00:12:25,510 Now, let's think about this a little bit. 197 00:12:25,510 --> 00:12:29,230 So the first property that you may want to consider it-- you 198 00:12:29,230 --> 00:12:32,230 really want to show that W is going to be an Euler tour. 199 00:12:32,230 --> 00:12:34,880 That's what we're going to try to prove here. 200 00:12:34,880 --> 00:12:36,560 So the first thing we may want to show 201 00:12:36,560 --> 00:12:39,270 is that actually it goes all around. 202 00:12:39,270 --> 00:12:42,090 So V0 is equal to Vk. 203 00:12:42,090 --> 00:12:44,540 That will be great if we can do this. 204 00:12:44,540 --> 00:12:48,720 So we want to show that this is true. 205 00:12:48,720 --> 00:12:52,645 So what would happen if this would not be the case? 206 00:12:55,580 --> 00:13:00,380 So suppose these two would not be equal to one another. 207 00:13:05,860 --> 00:13:11,010 Well, actually, I'm skipping a little bit ahead here 208 00:13:11,010 --> 00:13:14,570 in the proof, I notice. 209 00:13:14,570 --> 00:13:17,380 So this will be the conclusion of another observation. 210 00:13:17,380 --> 00:13:22,940 So let me start with the first observation. 211 00:13:22,940 --> 00:13:27,820 So first of all, let us consider this end node over 212 00:13:27,820 --> 00:13:30,300 here, this end vertex, Vk. 213 00:13:30,300 --> 00:13:37,800 Now if there is an edge that is not covered in this walk-- 214 00:13:37,800 --> 00:13:39,860 and I can lengthen the walk, right? 215 00:13:39,860 --> 00:13:44,080 So if I have, say, another edge, which 216 00:13:44,080 --> 00:13:51,730 looks like Vk, an edge from Vk to some U, where 217 00:13:51,730 --> 00:13:56,970 this edge is not in the walk. 218 00:13:59,600 --> 00:14:02,820 Or the other one is not in the walk. 219 00:14:02,820 --> 00:14:06,450 Well, it doesn't matter in an indirect graph, of course. 220 00:14:06,450 --> 00:14:08,630 So if this is not in the walk, then what can I do? 221 00:14:08,630 --> 00:14:10,140 I can just lengthen it, right? 222 00:14:10,140 --> 00:14:15,190 I can just say V0 goes to V1 goes to Vk goes 223 00:14:15,190 --> 00:14:19,590 to U. Now I have a longer walk. 224 00:14:19,590 --> 00:14:22,340 And that's a contradiction. 225 00:14:22,340 --> 00:14:31,660 So I know that all the edges in which Vk is participating 226 00:14:31,660 --> 00:14:33,910 are actually covered by the walk. 227 00:14:33,910 --> 00:14:35,360 So that's a great property. 228 00:14:35,360 --> 00:14:36,930 So let's write this down. 229 00:14:36,930 --> 00:14:52,150 So all edges that are incident to Vk 230 00:14:52,150 --> 00:15:00,370 are actually used-- traversed-- in the walk, W. 231 00:15:00,370 --> 00:15:02,950 So now let's have a look whether we 232 00:15:02,950 --> 00:15:08,710 can show that it's a walk that goes all the way around. 233 00:15:08,710 --> 00:15:12,460 So let's try to prove this statement. 234 00:15:12,460 --> 00:15:17,060 So let me repeat this over here. 235 00:15:17,060 --> 00:15:22,200 So what we want to show is that Vk equals V0. 236 00:15:22,200 --> 00:15:25,260 So given this statement, do you have any idea 237 00:15:25,260 --> 00:15:27,210 how we could possibly prove this, 238 00:15:27,210 --> 00:15:31,170 also given what we have been doing over here? 239 00:15:31,170 --> 00:15:33,230 Suppose this would not be the case, right? 240 00:15:35,910 --> 00:15:42,240 So suppose the start and the end node in this walk 241 00:15:42,240 --> 00:15:45,970 are not equal to one another. 242 00:15:45,970 --> 00:15:50,180 So what can we do here? 243 00:15:50,180 --> 00:15:53,500 So maybe there's some suggestions? 244 00:15:53,500 --> 00:15:56,560 I already had you once. 245 00:15:56,560 --> 00:15:57,430 Maybe someone else? 246 00:16:01,624 --> 00:16:05,060 AUDIENCE: It has to attach to another vertex. 247 00:16:05,060 --> 00:16:07,460 And you know that all the degrees are even. 248 00:16:07,460 --> 00:16:13,322 So it means that Vk must attach to V0. 249 00:16:13,322 --> 00:16:15,280 PROFESSOR: So what you're saying, first of all, 250 00:16:15,280 --> 00:16:19,660 is that if this would not be the case, then 251 00:16:19,660 --> 00:16:26,006 you know that the degrees must be even. 252 00:16:26,006 --> 00:16:27,630 But suppose this would not be the case. 253 00:16:27,630 --> 00:16:32,091 That would mean actually that the degree would be odd, right? 254 00:16:32,091 --> 00:16:32,590 OK. 255 00:16:32,590 --> 00:16:34,600 So let's think about that a little bit. 256 00:16:34,600 --> 00:16:36,380 So let's write this down. 257 00:16:36,380 --> 00:16:42,010 So otherwise the Vk has odd degree. 258 00:16:42,010 --> 00:16:46,330 But the only node has odd degree in this particular walk, 259 00:16:46,330 --> 00:16:50,140 W. So that's what we do now. 260 00:16:50,140 --> 00:16:56,410 Because we really consider this walk. 261 00:17:01,490 --> 00:17:07,260 So we see that if I have V0 unequal to Vk and Vk 262 00:17:07,260 --> 00:17:10,240 maybe repeated in this walk a number of times, 263 00:17:10,240 --> 00:17:12,400 each time it is repeated it has an incoming 264 00:17:12,400 --> 00:17:14,390 and an outgoing edge. 265 00:17:14,390 --> 00:17:18,510 And all these edges are different because they do not 266 00:17:18,510 --> 00:17:19,790 occur more than once. 267 00:17:19,790 --> 00:17:24,680 So whenever Vk enters in this middle part over here-- 268 00:17:24,680 --> 00:17:28,520 it's partaking over here-- it gives an even contribution 269 00:17:28,520 --> 00:17:30,830 to the number of edges in this walk, 270 00:17:30,830 --> 00:17:34,050 and it has one extra incoming edge over here. 271 00:17:34,050 --> 00:17:38,750 So if V0 is not equal to Vk, we will 272 00:17:38,750 --> 00:17:45,500 have an odd degree of edges in W, 273 00:17:45,500 --> 00:17:49,010 in which Vk is participating. 274 00:17:49,010 --> 00:17:52,500 So now we can go ahead and we can have a look over here 275 00:17:52,500 --> 00:17:57,100 because we just showed here that all the edges incident to Vk 276 00:17:57,100 --> 00:18:01,790 are actually used in W. So we can now conclude that this 277 00:18:01,790 --> 00:18:04,920 means that Vk also has odd degree in G 278 00:18:04,920 --> 00:18:09,540 because all the edges in G, in which Vk is participating, 279 00:18:09,540 --> 00:18:11,810 are actually used in the walk. 280 00:18:11,810 --> 00:18:12,920 So I hope that is clear. 281 00:18:15,670 --> 00:18:18,840 So let's write this down. 282 00:18:18,840 --> 00:18:24,070 So we'll use the first statement over here, so by 1. 283 00:18:24,070 --> 00:18:32,410 We have that Vk has odd degree in G. 284 00:18:32,410 --> 00:18:34,160 And now we come to what you were saying. 285 00:18:34,160 --> 00:18:38,490 We have assumed over here that the degree is even. 286 00:18:38,490 --> 00:18:42,000 So this cannot be the case, so that's a contradiction. 287 00:18:42,000 --> 00:18:45,740 So we know that the otherwise situation cannot occur. 288 00:18:45,740 --> 00:18:48,960 So we know that Vk must be equal to V0. 289 00:18:48,960 --> 00:18:51,690 So that's proving that we actually have 290 00:18:51,690 --> 00:18:54,380 a walk that goes all around. 291 00:18:54,380 --> 00:18:56,710 Now, we are not yet done. 292 00:18:56,710 --> 00:19:00,790 Because why would this be an Euler tour? 293 00:19:00,790 --> 00:19:02,465 For an Euler tour, we really want 294 00:19:02,465 --> 00:19:08,390 that every single edge that G has 295 00:19:08,390 --> 00:19:11,450 is actually used in the tour. 296 00:19:11,450 --> 00:19:14,850 So we need much more. 297 00:19:14,850 --> 00:19:19,608 So let's use this board. 298 00:19:35,420 --> 00:19:42,460 So suppose that W is not an Euler tour. 299 00:19:42,460 --> 00:19:45,720 We're going to use contradiction. 300 00:19:45,720 --> 00:19:48,630 But we already have shown this particular property, 301 00:19:48,630 --> 00:19:50,060 so we can use this. 302 00:19:50,060 --> 00:19:52,720 So suppose W is not an Euler tour. 303 00:19:52,720 --> 00:19:56,710 Well, we know that G is connected. 304 00:19:56,710 --> 00:20:00,020 So that's a good thing because that 305 00:20:00,020 --> 00:20:03,740 means that if it is not an Euler tour, 306 00:20:03,740 --> 00:20:12,050 there is an edge that is not used in W, in the walk, 307 00:20:12,050 --> 00:20:28,730 but it is incident to some vertex that is used in W. 308 00:20:28,730 --> 00:20:30,510 So this is where the connectivity here 309 00:20:30,510 --> 00:20:31,800 comes in play. 310 00:20:31,800 --> 00:20:37,580 Now let us call this edge-- so let 311 00:20:37,580 --> 00:20:40,570 U-Vi be this particular edge. 312 00:20:43,710 --> 00:20:48,170 So U is not used in the walk-- well, it's 313 00:20:48,170 --> 00:20:52,130 maybe used in the walk, but the edge is not used in the walk. 314 00:20:52,130 --> 00:20:54,350 And Vi is part of the walk. 315 00:20:54,350 --> 00:20:57,490 So what can we do here? 316 00:20:57,490 --> 00:21:00,030 So does anybody see what we could do here? 317 00:21:00,030 --> 00:21:03,140 Can we somehow get a contradiction? 318 00:21:03,140 --> 00:21:06,760 So when we started out here, we actually 319 00:21:06,760 --> 00:21:12,480 assumed that W is the longest walk in which the edges do not 320 00:21:12,480 --> 00:21:16,270 occur more than once. 321 00:21:16,270 --> 00:21:19,660 Can we create a longer walk by simply using this? 322 00:21:19,660 --> 00:21:26,606 Now, notice that we did prove that V0 goes all around 323 00:21:26,606 --> 00:21:30,410 to Vk, and so on. 324 00:21:30,410 --> 00:21:34,670 So can we find a longer walk that uses this extra edge? 325 00:21:38,020 --> 00:21:40,447 Any ideas? 326 00:21:40,447 --> 00:21:45,630 What would happen if we, for example, started a walk with U? 327 00:21:45,630 --> 00:21:47,610 Let's see how that would work out. 328 00:21:47,610 --> 00:21:51,570 We can have U. We walk to Vi. 329 00:21:51,570 --> 00:21:55,720 Well, let's just simply start walking all around. 330 00:21:55,720 --> 00:22:00,865 So essentially we have Vi over here and U over here. 331 00:22:03,630 --> 00:22:08,620 So we could do is we can start walking like this 332 00:22:08,620 --> 00:22:10,290 and then end over here. 333 00:22:10,290 --> 00:22:13,310 And notice we have used one extra edge. 334 00:22:13,310 --> 00:22:15,070 So we get a longer walk. 335 00:22:15,070 --> 00:22:18,940 So we go to Vi plus 1, and we go all the way 336 00:22:18,940 --> 00:22:23,230 up to Vk, which is equal to V0. 337 00:22:23,230 --> 00:22:27,870 And then we go up to V1, all the way up to Vi. 338 00:22:27,870 --> 00:22:29,960 This is a longer walk. 339 00:22:29,960 --> 00:22:34,240 And therefore we have a contradiction. 340 00:22:34,240 --> 00:22:37,600 And now the proof is finished because that means 341 00:22:37,600 --> 00:22:39,740 that this assumption was wrong. 342 00:22:39,740 --> 00:22:41,560 So W actually is an Euler tour. 343 00:22:41,560 --> 00:22:44,390 So now we have shown the existence of an Euler tour, 344 00:22:44,390 --> 00:22:46,390 and that was the other direction of the theorem. 345 00:22:49,800 --> 00:22:56,130 So let's now start with a new topic on directed graphs. 346 00:22:56,130 --> 00:23:01,140 And later on, we will talk about how Hamiltonian paths. 347 00:23:01,140 --> 00:23:03,390 And these are different from an Euler 348 00:23:03,390 --> 00:23:07,990 tour in that in an Euler tour, every edge is used exactly 349 00:23:07,990 --> 00:23:08,490 once. 350 00:23:08,490 --> 00:23:11,270 In a Hamiltonian path, we will have that every vertex 351 00:23:11,270 --> 00:23:13,160 is used exactly once. 352 00:23:13,160 --> 00:23:17,100 So we'll do that a bit later. 353 00:23:17,100 --> 00:23:18,660 So what are directed graphs? 354 00:23:18,660 --> 00:23:22,860 Directed graphs are graphs where we have edges 355 00:23:22,860 --> 00:23:24,410 that have a specific direction. 356 00:23:24,410 --> 00:23:29,030 So we can walk from one vertex to the other. 357 00:23:32,760 --> 00:23:34,425 Let me just depict an example. 358 00:23:38,050 --> 00:23:42,420 For example, we could have something that looks like this. 359 00:23:42,420 --> 00:23:43,960 We have V1. 360 00:23:43,960 --> 00:23:47,950 We have V2, V3. 361 00:23:47,950 --> 00:23:51,360 We may have an edge that goes like this with an arrow. 362 00:23:51,360 --> 00:23:53,720 We use arrows in this case. 363 00:23:53,720 --> 00:23:55,710 I can go to V2 and V3. 364 00:23:55,710 --> 00:24:00,920 From V2 I may be able to go to V3, and from V3 to V2. 365 00:24:00,920 --> 00:24:04,100 So this will be a directed graph, as an example. 366 00:24:04,100 --> 00:24:05,640 We also call these digraphs. 367 00:24:09,680 --> 00:24:14,820 And as you can see, we may have an edge that goes from V2 to V3 368 00:24:14,820 --> 00:24:17,330 and also one that goes from V3 to V2. 369 00:24:17,330 --> 00:24:19,690 So these are two separate edges. 370 00:24:19,690 --> 00:24:21,960 So every edge has a direction. 371 00:24:21,960 --> 00:24:27,140 And we usually say that if we have an edge that 372 00:24:27,140 --> 00:24:35,210 points from V2 to, say, V3, then we call this the tail 373 00:24:35,210 --> 00:24:37,530 and over here we have the head. 374 00:24:37,530 --> 00:24:39,600 So this is some notation that you may use. 375 00:24:43,840 --> 00:24:45,520 We also have now a different notion 376 00:24:45,520 --> 00:24:49,420 for the degree of a vertex because we have different types 377 00:24:49,420 --> 00:24:51,260 of edges, essentially. 378 00:24:51,260 --> 00:24:53,330 Take, for example, V2. 379 00:24:53,330 --> 00:24:56,235 You have incoming edges and outgoing edges. 380 00:24:56,235 --> 00:24:57,610 So that's why we're going to talk 381 00:24:57,610 --> 00:25:03,120 about an indegree and an outdegree. 382 00:25:03,120 --> 00:25:07,210 So, for example, the indegree of V2 is equal to, well, I 383 00:25:07,210 --> 00:25:10,380 have one, two incoming edges. 384 00:25:10,380 --> 00:25:17,060 And the outdegree of V2 is actually something different. 385 00:25:17,060 --> 00:25:18,790 It's just one outgoing edge. 386 00:25:18,790 --> 00:25:22,010 So this is equal to 1. 387 00:25:22,010 --> 00:25:24,560 So this is some notation. 388 00:25:24,560 --> 00:25:28,930 So let's talk about walks. 389 00:25:28,930 --> 00:25:30,850 Let's figure out where we can enumerate 390 00:25:30,850 --> 00:25:35,940 walks in a directed graph and compute those. 391 00:25:35,940 --> 00:25:38,830 So how many walks do I have, say, 392 00:25:38,830 --> 00:25:43,180 of length k that go exactly from, say, V1 to V3. 393 00:25:43,180 --> 00:25:45,290 How can I compute this? 394 00:25:45,290 --> 00:25:48,840 So I'd like to introduce adjacency matrices. 395 00:25:48,840 --> 00:25:50,540 You've probably seen them before. 396 00:25:50,540 --> 00:25:53,510 But let's go over this once more because induction is also 397 00:25:53,510 --> 00:25:55,470 important. 398 00:25:55,470 --> 00:25:57,420 So let's do the theorem. 399 00:25:57,420 --> 00:26:00,110 So the theorem is this. 400 00:26:00,110 --> 00:26:01,260 Suppose we have a graph. 401 00:26:05,560 --> 00:26:07,495 And suppose it has end nodes. 402 00:26:16,170 --> 00:26:22,250 And we have the vertices V1 up to Vn. 403 00:26:22,250 --> 00:26:33,650 And now we let the matrix that contains the entries aij denote 404 00:26:33,650 --> 00:26:46,860 the adjacency matrix for G. 405 00:26:46,860 --> 00:26:49,910 And what does it mean? 406 00:26:49,910 --> 00:26:52,550 It's actually means that in this case, 407 00:26:52,550 --> 00:27:01,360 we say that aij is equal to 1 if we actually 408 00:27:01,360 --> 00:27:06,520 have an edge that goes from Vi to Vj-- 409 00:27:06,520 --> 00:27:15,000 so this is an edge-- and 0 if this is not the case. 410 00:27:15,000 --> 00:27:17,630 So this is the adjacency matrix. 411 00:27:17,630 --> 00:27:22,460 And now we can state something about the number of directed 412 00:27:22,460 --> 00:27:28,150 walks in a directed graph. 413 00:27:28,150 --> 00:27:31,300 So it turns out that this is easily 414 00:27:31,300 --> 00:27:36,455 computed by taking powers of the adjacency matrix. 415 00:27:47,890 --> 00:27:53,800 Let aij with the superscript k be 416 00:27:53,800 --> 00:28:06,130 equal to the number of directed walks of length k 417 00:28:06,130 --> 00:28:13,530 that go from Vi to Vj. 418 00:28:13,530 --> 00:28:18,110 So you want to compute this and it turns out 419 00:28:18,110 --> 00:28:22,000 that-- wait a minute. 420 00:28:22,000 --> 00:28:25,140 So what did I do here? 421 00:28:25,140 --> 00:28:29,190 So actually let p kij be the number 422 00:28:29,190 --> 00:28:34,440 of directed walks of length k from phi i to phi j. 423 00:28:34,440 --> 00:28:38,600 Then what you can show is if you look at matrix A 424 00:28:38,600 --> 00:28:44,110 to the power k, this actually is the matrix that 425 00:28:44,110 --> 00:28:50,190 contains all these numbers. 426 00:28:50,190 --> 00:28:51,710 So let me give a few examples. 427 00:28:54,710 --> 00:28:57,670 So let's take the matrix over here. 428 00:28:57,670 --> 00:29:00,240 Look at this ajc matrix, take a few powers 429 00:29:00,240 --> 00:29:02,030 and see what happens. 430 00:29:02,030 --> 00:29:04,210 So the matrix looks like this. 431 00:29:04,210 --> 00:29:09,590 If you just label the rows by, say, V1, V2, and V3. 432 00:29:09,590 --> 00:29:13,340 The columns by V1, V2, and V3. 433 00:29:13,340 --> 00:29:16,020 Well, V1 has an edge to V1. 434 00:29:16,020 --> 00:29:19,360 V1 has an edge to V2 and also one to V3. 435 00:29:19,360 --> 00:29:24,560 V2 has only one edge to V3, so we have zeros here. 436 00:29:24,560 --> 00:29:26,710 And we have this. 437 00:29:26,710 --> 00:29:30,210 So this is the matrix A. 438 00:29:30,210 --> 00:29:33,180 For example, if you compute a squared. 439 00:29:33,180 --> 00:29:34,510 So how do we do this? 440 00:29:34,510 --> 00:29:37,210 How many of you know about matrix multiplication? 441 00:29:37,210 --> 00:29:38,160 Everybody knows? 442 00:29:41,310 --> 00:29:44,005 Well anyway, so let's assume that you do know actually. 443 00:29:47,390 --> 00:29:48,560 So that's pretty simple. 444 00:29:48,560 --> 00:29:49,580 So you take the column. 445 00:29:49,580 --> 00:29:52,110 You take the inners product with the first row, and so on. 446 00:29:52,110 --> 00:29:54,840 And you can easily compute this otherwise 447 00:29:54,840 --> 00:29:57,810 you may want to do it yourself later on. 448 00:29:57,810 --> 00:30:02,270 And you get this particular matrix. 449 00:30:02,270 --> 00:30:05,410 And, for example, a to the power of 3 450 00:30:05,410 --> 00:30:12,900 is something very similar-- 1, 3, 3, 0, 0, 1, 0, 1, 0. 451 00:30:12,900 --> 00:30:15,700 Well, it turns out that if you look at this graph 452 00:30:15,700 --> 00:30:17,970 and we, for example, want to know the number of walks 453 00:30:17,970 --> 00:30:22,380 of length 3 that go from V1 to, say, V2, 454 00:30:22,380 --> 00:30:29,370 let's see whether we can see those over here. 455 00:30:29,370 --> 00:30:33,830 Well, if I travel from V1 to V2 in three steps, 456 00:30:33,830 --> 00:30:36,600 I can go like this. 457 00:30:36,600 --> 00:30:39,350 I can go one, two, three. 458 00:30:39,350 --> 00:30:41,010 So that's one option. 459 00:30:41,010 --> 00:30:44,240 I can go one, and another one time, 460 00:30:44,240 --> 00:30:46,470 so it's a second step, and three. 461 00:30:46,470 --> 00:30:49,920 I can also go directly over here and go back here, and back over 462 00:30:49,920 --> 00:30:50,960 here. 463 00:30:50,960 --> 00:30:53,620 So it turns out that's I can compute this. 464 00:30:53,620 --> 00:30:55,580 So how do we prove this? 465 00:30:55,580 --> 00:30:58,370 We'll use induction. 466 00:30:58,370 --> 00:31:06,130 And the steps are pretty straightforward. 467 00:31:06,130 --> 00:31:09,020 So let's first define, because we 468 00:31:09,020 --> 00:31:12,730 want to prove that kth power of a is equal to that matrix 469 00:31:12,730 --> 00:31:19,350 up there, where all the entries represent the number of walks. 470 00:31:19,350 --> 00:31:32,690 So let's say that aijk, that this denote the i jth 471 00:31:32,690 --> 00:31:38,680 entry in a to the power k. 472 00:31:42,610 --> 00:31:45,510 And you want to show that this number is actually 473 00:31:45,510 --> 00:31:51,930 equal to pijk for all the entries. 474 00:31:51,930 --> 00:31:55,620 So if you're going to use induction, 475 00:31:55,620 --> 00:32:03,440 it makes sense to assume that the theorem is true for k. 476 00:32:03,440 --> 00:32:10,000 So the induction hypothesis could be something like this. 477 00:32:10,000 --> 00:32:16,700 The theorem is true for k. 478 00:32:16,700 --> 00:32:20,900 And this is really the same as stating 479 00:32:20,900 --> 00:32:32,370 that all these entries for all i and j-- aij 480 00:32:32,370 --> 00:32:34,208 is equal to the pijk. 481 00:32:37,310 --> 00:32:39,710 So this is what you want to prove. 482 00:32:39,710 --> 00:32:41,780 And this is pretty straightforward 483 00:32:41,780 --> 00:32:44,220 because now what we can do is we can 484 00:32:44,220 --> 00:32:52,020 start to look at how we compute walks of length k, or k plus 1. 485 00:32:52,020 --> 00:32:54,110 So let's first do the base case. 486 00:32:54,110 --> 00:32:56,680 That's how we always start. 487 00:32:56,680 --> 00:32:59,210 The base case is k equals 1. 488 00:32:59,210 --> 00:33:03,850 And we have essentially two options. 489 00:33:03,850 --> 00:33:06,560 So we want to prove this, so take an i and a j, 490 00:33:06,560 --> 00:33:08,340 whatever you want. 491 00:33:08,340 --> 00:33:14,030 So suppose we has an edge, Vi, that goes to Vj. 492 00:33:14,030 --> 00:33:16,820 Well in that case, we know that the number 493 00:33:16,820 --> 00:33:23,700 of walks of length 1, from i to j, 494 00:33:23,700 --> 00:33:26,170 is exactly 1 because there's this edge. 495 00:33:26,170 --> 00:33:27,510 So this is equal to 1. 496 00:33:27,510 --> 00:33:31,270 But this is also the definition of my adjacency matrix. 497 00:33:31,270 --> 00:33:35,480 So I can just write out here aij 1. 498 00:33:35,480 --> 00:33:36,380 So that's great. 499 00:33:36,380 --> 00:33:39,780 This case definitely works. 500 00:33:39,780 --> 00:33:45,530 Now, if there is no edge of this type, 501 00:33:45,530 --> 00:33:50,210 then you know that in one step, we can never achieve Vj from Vi 502 00:33:50,210 --> 00:33:51,630 because there's no edge. 503 00:33:51,630 --> 00:33:54,420 So we know this is equal to 0. 504 00:33:54,420 --> 00:33:56,050 There's no such walk. 505 00:33:56,050 --> 00:33:58,490 And this is, by definition of the adjacency matrix, 506 00:33:58,490 --> 00:34:01,045 also equal to the aij. 507 00:34:01,045 --> 00:34:01,860 So this works. 508 00:34:01,860 --> 00:34:04,000 So the base case it's easy. 509 00:34:04,000 --> 00:34:11,658 And induction step always starts by issuing pk. 510 00:34:16,429 --> 00:34:18,443 As you can see, these types of proofs 511 00:34:18,443 --> 00:34:19,734 always have the same structure. 512 00:34:26,340 --> 00:34:33,822 In this case, let me again assume pk. 513 00:34:39,300 --> 00:34:42,300 We want to prove pk plus 1. 514 00:34:42,300 --> 00:34:43,770 So what you want to know is what's 515 00:34:43,770 --> 00:34:46,050 the number of walks of length k plus 1. 516 00:34:46,050 --> 00:34:49,110 So how can we express those? 517 00:34:49,110 --> 00:34:53,360 pij k plus 1. 518 00:34:53,360 --> 00:34:58,260 How can we use this assumption over here? 519 00:34:58,260 --> 00:35:00,550 Do you have an idea so we can-- 520 00:35:04,790 --> 00:35:08,450 AUDIENCE: Any walk of length k plus 1 521 00:35:08,450 --> 00:35:15,505 can be got by taking one of-- let's say from Vs 522 00:35:15,505 --> 00:35:25,360 to Vx. [INAUDIBLE] You go from Vs to V in k steps 523 00:35:25,360 --> 00:35:27,312 and then V to Vf in one step. 524 00:35:27,312 --> 00:35:28,270 PROFESSOR: That's true. 525 00:35:28,270 --> 00:35:30,570 We could do that. 526 00:35:30,570 --> 00:35:31,960 So let's write it down. 527 00:35:31,960 --> 00:35:33,710 So what you're essentially saying 528 00:35:33,710 --> 00:35:37,150 is that you can enumerate all the walks 529 00:35:37,150 --> 00:35:43,390 by going of length k plus 1 by first going from i in, say, 530 00:35:43,390 --> 00:35:49,620 k steps, to whatever V, and then in one 531 00:35:49,620 --> 00:35:55,791 step to, say, Vi to V in k steps and then in one step to Vj. 532 00:35:58,320 --> 00:36:01,310 So let's write this down because V can be anything. 533 00:36:01,310 --> 00:36:05,320 So what to do is we have a sum over all the Vs 534 00:36:05,320 --> 00:36:08,600 such that-- well, we will use indices here 535 00:36:08,600 --> 00:36:11,030 let me do that a little bit differently. 536 00:36:11,030 --> 00:36:12,800 So let's say I have an h over here. 537 00:36:12,800 --> 00:36:20,110 So all the indices h such that Vh to Vj 538 00:36:20,110 --> 00:36:26,110 is actually an edge in G. 539 00:36:26,110 --> 00:36:32,020 So then we can write out here that we go in k steps to Vh. 540 00:36:32,020 --> 00:36:35,110 So how many walks are there? 541 00:36:35,110 --> 00:36:37,610 Well, we can use the induction hypothesis now, right? 542 00:36:37,610 --> 00:36:43,130 So we can say you go from i to h in k steps. 543 00:36:43,130 --> 00:36:49,360 And then, well, we can use this particular edge 544 00:36:49,360 --> 00:36:55,960 to complete it to a k plus 1th walk from i to j. 545 00:36:55,960 --> 00:36:58,110 So now what is this equal to? 546 00:36:58,110 --> 00:37:00,550 Can we simplify this sum? 547 00:37:00,550 --> 00:37:04,830 We can, right, because we know that there's 548 00:37:04,830 --> 00:37:09,310 an edge if and only if the adjacency matrix has a 1 549 00:37:09,310 --> 00:37:11,300 in a particular position. 550 00:37:11,300 --> 00:37:19,910 So we could rewrite it and sum over all h from 1 to n. 551 00:37:19,910 --> 00:37:32,510 And write pij k times, and then aj-- oh, this should be an h. 552 00:37:32,510 --> 00:37:34,100 So we have the same over here. 553 00:37:34,100 --> 00:37:39,610 And then we have one edge from h to 2j. 554 00:37:39,610 --> 00:37:44,360 So I only count this number over here if this is equal to 1, 555 00:37:44,360 --> 00:37:46,500 and that happens exactly if there's an edge. 556 00:37:46,500 --> 00:37:49,230 I do not count this if there's a 0 over here, 557 00:37:49,230 --> 00:37:51,930 that is as if there's no edge. 558 00:37:51,930 --> 00:37:56,650 But now we can use induction hypothesis because I know that 559 00:37:56,650 --> 00:37:59,620 these numbers are equal to the a's. 560 00:37:59,620 --> 00:38:03,040 So we rewrite this. 561 00:38:03,040 --> 00:38:07,760 And we see that we get aih k. 562 00:38:07,760 --> 00:38:11,920 So this is where we use the induction step. 563 00:38:11,920 --> 00:38:18,110 So it's like we assume pk over here. 564 00:38:18,110 --> 00:38:20,530 And I need to finish this formula. 565 00:38:20,530 --> 00:38:21,970 So we have this. 566 00:38:21,970 --> 00:38:29,400 Now, by the definition of matrix multiplication, 567 00:38:29,400 --> 00:38:41,700 we actually see that this is equal to a k plus 1 ij 568 00:38:41,700 --> 00:38:45,390 to the ij-th entry in the k plus oneth power 569 00:38:45,390 --> 00:38:47,050 of the adjacency matrix. 570 00:38:47,050 --> 00:38:50,630 Here we have this represents the matrix of the kth power. 571 00:38:50,630 --> 00:38:53,440 This represents the matrix of a. 572 00:38:53,440 --> 00:38:56,140 So we multiply essentially a to the power k times a 573 00:38:56,140 --> 00:38:58,190 and get a to the power k plus 1. 574 00:38:58,190 --> 00:39:00,260 And that's what we see here. 575 00:39:00,260 --> 00:39:04,000 So this is the induction step, and so this proves the theorem 576 00:39:04,000 --> 00:39:04,500 up here. 577 00:39:07,480 --> 00:39:11,670 So let's talk about a few more definitions concerning 578 00:39:11,670 --> 00:39:13,150 directed graphs. 579 00:39:13,150 --> 00:39:18,730 And then you go a step into a very special type 580 00:39:18,730 --> 00:39:23,480 of graph, which are the tournament graphs up here. 581 00:39:31,840 --> 00:39:34,240 One of the things that we have in undirected 582 00:39:34,240 --> 00:39:37,750 graphs, so where we have no directed edges, 583 00:39:37,750 --> 00:39:42,720 we talked last time a lot about cyclicity and stuff like that. 584 00:39:42,720 --> 00:39:47,530 And we talked about acyclic connected graphs. 585 00:39:47,530 --> 00:39:51,350 And as we categorized those, so we defined them as trees, 586 00:39:51,350 --> 00:39:54,130 and they have a very special structure. 587 00:39:54,130 --> 00:40:04,950 So what would happen here, if we look at a directed graph, 588 00:40:04,950 --> 00:40:08,260 and we wonder, what does it mean to be connected. 589 00:40:08,260 --> 00:40:10,007 Can we really talk about that? 590 00:40:10,007 --> 00:40:10,840 What does that mean? 591 00:40:14,350 --> 00:40:17,720 For example, if I look at this particular example 592 00:40:17,720 --> 00:40:20,220 graph over here, I can say, well, 593 00:40:20,220 --> 00:40:24,200 V1 has an edge that points towards V1 itself, 594 00:40:24,200 --> 00:40:28,220 and towards V2, and towards V3. 595 00:40:28,220 --> 00:40:31,230 So maybe I would call this graph connected. 596 00:40:31,230 --> 00:40:35,370 But if I look at V2, I only see an edge 597 00:40:35,370 --> 00:40:38,510 that goes from V2 to V3, and not to V2. 598 00:40:38,510 --> 00:40:41,270 So maybe I do not call it connected. 599 00:40:41,270 --> 00:40:48,610 So that's why we define a stronger notion for a digraph. 600 00:40:48,610 --> 00:41:09,570 So a digraph, G, VE is called strongly connected 601 00:41:09,570 --> 00:41:18,180 if we know that for every pair-- so if for all vertices 602 00:41:18,180 --> 00:41:25,190 U and V in the vertex set-- there exists 603 00:41:25,190 --> 00:41:39,550 a directed path that starts in U and ends up in V in G. 604 00:41:39,550 --> 00:41:41,940 So this is what we would call strongly connected. 605 00:41:46,180 --> 00:41:49,900 So now in undirected graphs, we had connectivity 606 00:41:49,900 --> 00:41:53,540 and then we said, well, if a connected, undirected graph 607 00:41:53,540 --> 00:41:54,740 has no cycles. 608 00:41:54,740 --> 00:41:56,910 We have trees and they have special properties 609 00:41:56,910 --> 00:41:57,790 and all that. 610 00:41:57,790 --> 00:42:00,370 So what about this over here? 611 00:42:00,370 --> 00:42:06,820 Suppose you have an acyclic strongly connected digraph. 612 00:42:06,820 --> 00:42:09,064 What does that look like? 613 00:42:09,064 --> 00:42:10,105 So let's give an example. 614 00:42:12,800 --> 00:42:18,070 It's not completely clear what kind of structure it has. 615 00:42:18,070 --> 00:42:25,940 So for example, I may have a graph that 616 00:42:25,940 --> 00:42:27,645 looks like this, for example. 617 00:42:34,690 --> 00:42:39,760 Say this is an acyclic graph. 618 00:42:39,760 --> 00:42:50,400 but It does not have at all a tree structure. 619 00:42:50,400 --> 00:42:54,500 So actually, the type of graph the we have here 620 00:42:54,500 --> 00:42:57,872 is called a directed acyclic graph. 621 00:42:57,872 --> 00:42:59,330 As you can see, there are no cycles 622 00:42:59,330 --> 00:43:01,970 because I only go forward, essentially. 623 00:43:01,970 --> 00:43:05,180 I can never go backward in this particular way 624 00:43:05,180 --> 00:43:07,370 that I depicted the graph. 625 00:43:07,370 --> 00:43:12,930 So this is an example for directed acyclic graph. 626 00:43:12,930 --> 00:43:16,540 But it doesn't look like a tree at all. 627 00:43:16,540 --> 00:43:18,870 So it's worth to define it separately, 628 00:43:18,870 --> 00:43:23,600 and we will use this on Thursday when we'll 629 00:43:23,600 --> 00:43:25,700 talk about partial orderings. 630 00:43:25,700 --> 00:43:29,780 And it turns out that, as you can see here-- well, 631 00:43:29,780 --> 00:43:31,980 at that case, a directed acyclic graph 632 00:43:31,980 --> 00:43:33,790 has really nice properties, and one of them 633 00:43:33,790 --> 00:43:37,505 is that you can order these vertices in such a way 634 00:43:37,505 --> 00:43:43,050 that you go from, say, left to right in a directed fashion. 635 00:43:43,050 --> 00:43:44,930 And that will lead to partial ordering. 636 00:43:44,930 --> 00:43:49,880 So that's something that we will talk about as well. 637 00:43:49,880 --> 00:43:52,200 So what's the definition? 638 00:43:52,200 --> 00:44:09,890 A directed graph is called a directed acyclic graph, 639 00:44:09,890 --> 00:44:14,250 and we appreciate this by DAG. 640 00:44:14,250 --> 00:44:15,690 We call them DAGs. 641 00:44:15,690 --> 00:44:18,250 They're used everywhere, actually. 642 00:44:26,660 --> 00:44:33,390 If it does not contain any directed cycles. 643 00:44:38,570 --> 00:44:39,945 So these kinds of graphs are used 644 00:44:39,945 --> 00:44:43,465 in scheduling and optimization, and we 645 00:44:43,465 --> 00:44:47,310 will use them next week in the lecture on partial orderings. 646 00:44:50,680 --> 00:44:52,510 Now we have done a lot of definitions 647 00:44:52,510 --> 00:44:57,330 concerning directed graphs. 648 00:44:57,330 --> 00:45:00,080 So now let's talk about these very special ones, tournament 649 00:45:00,080 --> 00:45:03,230 graph, and see whether we can prove a few really nice 650 00:45:03,230 --> 00:45:04,280 theorems about them. 651 00:45:08,780 --> 00:45:12,040 Let's see whether we can figure that out together. 652 00:45:22,150 --> 00:45:23,590 So what is a tournament graph? 653 00:45:36,790 --> 00:45:39,760 In a tournament graph, I have a bunch of vertices. 654 00:45:39,760 --> 00:45:43,930 And essentially we want to represent like a tournament. 655 00:45:43,930 --> 00:45:47,770 So every vertex, say, represents a team. 656 00:45:47,770 --> 00:45:51,070 And a team can play against another team, 657 00:45:51,070 --> 00:45:54,660 and beat them or lose against the other team. 658 00:45:54,660 --> 00:45:58,670 So we want to use the directed edges to indicate 659 00:45:58,670 --> 00:46:01,050 who is winning from home. 660 00:46:01,050 --> 00:46:05,270 And such types of graphs have very special property. 661 00:46:05,270 --> 00:46:08,250 So let me first depict one. 662 00:46:08,250 --> 00:46:19,060 So for example, we have E goes to A, goes through B, 663 00:46:19,060 --> 00:46:26,700 incoming edge from C, one coming from B. 664 00:46:26,700 --> 00:46:29,240 And over here we have this directed edge. 665 00:46:33,080 --> 00:46:36,160 We have this one. 666 00:46:36,160 --> 00:46:37,790 We have this one. 667 00:46:37,790 --> 00:46:44,020 Let me see [INAUDIBLE] don't make any mistakes here. 668 00:46:44,020 --> 00:46:45,790 And this one. 669 00:46:45,790 --> 00:46:47,025 And over here is another one. 670 00:46:49,560 --> 00:46:51,470 So what do we see in this graph? 671 00:46:51,470 --> 00:47:02,840 We see that either say, team U, beats team V. 672 00:47:02,840 --> 00:47:06,600 And that means that we have a directed edge from U pointing 673 00:47:06,600 --> 00:47:12,200 at V. Or it's other way around. 674 00:47:12,200 --> 00:47:19,970 V actually beats U, and we have a directed edge from V to U. 675 00:47:19,970 --> 00:47:25,140 Let's have a look at this graph and see how this works. 676 00:47:25,140 --> 00:47:30,360 So for example, we have that B is beating E, 677 00:47:30,360 --> 00:47:33,150 and E is beating A, and so on. 678 00:47:33,150 --> 00:47:34,030 So let's have a look. 679 00:47:34,030 --> 00:47:39,540 Maybe we can figure out who's the best player in here. 680 00:47:39,540 --> 00:47:41,414 So this is sort of a general question 681 00:47:41,414 --> 00:47:42,580 if who would like to answer. 682 00:47:42,580 --> 00:47:44,690 Maybe you cannot answer this. 683 00:47:44,690 --> 00:47:46,910 So let's have an example. 684 00:47:46,910 --> 00:47:55,980 Has anybody seen an example where we start with A, 685 00:47:55,980 --> 00:48:00,350 then we may beat another vertex, and maybe another vertex, 686 00:48:00,350 --> 00:48:04,540 and so on, until we have covered all the different vertices. 687 00:48:04,540 --> 00:48:07,530 Do you see a path that works like that? 688 00:48:07,530 --> 00:48:10,760 And that could gives us an ordering on who 689 00:48:10,760 --> 00:48:14,840 is the best player, like the one at the top, 690 00:48:14,840 --> 00:48:20,030 like A, is able to, for example, beat B. 691 00:48:20,030 --> 00:48:27,170 And B is, for example, able to beat D and this one, E, 692 00:48:27,170 --> 00:48:30,660 and this one, C. So you would say, OK, that's great. 693 00:48:30,660 --> 00:48:33,850 Now I know that this one is the strongest player. 694 00:48:33,850 --> 00:48:36,810 But there's a little problem here, right? 695 00:48:36,810 --> 00:48:39,600 Because I can produce many such paths. 696 00:48:39,600 --> 00:48:45,060 And actually, if I look at C, then C beats A as well. 697 00:48:45,060 --> 00:48:47,260 So that's kind of weird. 698 00:48:47,260 --> 00:48:48,565 So wait a minute. 699 00:48:51,820 --> 00:48:56,950 We have that there's a directed edge from C to A. 700 00:48:56,950 --> 00:48:59,120 It's like teams beats one another. 701 00:48:59,120 --> 00:49:05,800 And it's not very clear how we can talk about a best player. 702 00:49:05,800 --> 00:49:07,180 Well, we would have a best player 703 00:49:07,180 --> 00:49:15,090 if one player sort of wins from everybody else. 704 00:49:15,090 --> 00:49:16,820 But there's many examples here. 705 00:49:16,820 --> 00:49:19,840 So let's look at another walk. 706 00:49:19,840 --> 00:49:25,550 For example, C can go to B, to D, and then to E, and then 707 00:49:25,550 --> 00:49:28,280 to A. So there are many possibilities here. 708 00:49:28,280 --> 00:49:30,630 So this leads us to a concept. 709 00:49:33,640 --> 00:49:40,140 And we call that's a directed Hamiltonian path. 710 00:49:40,140 --> 00:49:43,260 And we're going to show that, in a tournament graph, 711 00:49:43,260 --> 00:49:46,120 you can always find such a directed Hamiltonian path. 712 00:49:46,120 --> 00:49:48,060 So what's a Hamiltonian path? 713 00:49:48,060 --> 00:49:50,360 This is actually an example of it. 714 00:49:50,360 --> 00:49:53,710 There's a walk that goes around the graph 715 00:49:53,710 --> 00:49:57,240 and visits every vertex exactly once. 716 00:49:57,240 --> 00:50:00,870 So we're going to prove that a tournament graph has 717 00:50:00,870 --> 00:50:02,213 this beautiful property. 718 00:50:18,070 --> 00:50:21,190 So let's first write out a definition of this. 719 00:50:26,620 --> 00:50:48,140 A directed Hamiltonian path is a directed walk 720 00:50:48,140 --> 00:51:05,570 that visits every vertex exactly once. 721 00:51:08,090 --> 00:51:12,630 So as I said already, here we have such an example. 722 00:51:12,630 --> 00:51:16,140 We can go from A to B, to D to E, to C. Maybe 723 00:51:16,140 --> 00:51:18,440 there are even other examples. 724 00:51:18,440 --> 00:51:20,160 I did not actually see them. 725 00:51:20,160 --> 00:51:22,540 Maybe you can have a look at them as well. 726 00:51:22,540 --> 00:51:25,800 So maybe there's something that starts with B going to E maybe. 727 00:51:25,800 --> 00:51:30,660 That's a very different direction, like this. 728 00:51:30,660 --> 00:51:35,960 There will be one as well, and so forth. 729 00:51:35,960 --> 00:51:38,960 So what's the theorem that you want to prove? 730 00:51:38,960 --> 00:51:49,160 The theorem in that you want to show that every tournament 731 00:51:49,160 --> 00:52:00,260 graph actually contains such a directed Hamiltonian path. 732 00:52:16,710 --> 00:52:19,190 So let's have a look at how we can prove this. 733 00:52:38,849 --> 00:52:40,890 What kind of proof technique are we going to use? 734 00:52:45,220 --> 00:52:46,245 Do you have an idea? 735 00:52:48,595 --> 00:52:50,470 Well, usually we use induction so that's what 736 00:52:50,470 --> 00:52:52,310 we're going to do here as well. 737 00:52:52,310 --> 00:52:55,770 But what kind of induction hypothesis can we do? 738 00:52:55,770 --> 00:52:57,990 So what would we induct on, you think? 739 00:53:00,834 --> 00:53:01,782 Someone else? 740 00:53:01,782 --> 00:53:04,626 Maybe someone up there? 741 00:53:04,626 --> 00:53:06,060 AUDIENCE: The number of nodes. 742 00:53:06,060 --> 00:53:08,670 PROFESSOR: The number of nodes. 743 00:53:08,670 --> 00:53:16,050 So we use induction on the number of nodes. 744 00:53:16,050 --> 00:53:17,930 And why would that be of interest? 745 00:53:17,930 --> 00:53:21,130 So let's have a look at how we can think of that. 746 00:53:21,130 --> 00:53:24,500 So we start thinking about such a problem, this really 747 00:53:24,500 --> 00:53:29,070 sort of-- one parameter here that's the number of nodes 748 00:53:29,070 --> 00:53:31,960 in a tournament graph. 749 00:53:31,960 --> 00:53:33,580 I also have edges. 750 00:53:33,580 --> 00:53:41,290 But if I think about edges, then, the edges 751 00:53:41,290 --> 00:53:45,340 is always directly related to the number 752 00:53:45,340 --> 00:53:47,430 of nodes in a tournament graph. 753 00:53:47,430 --> 00:53:50,640 So I really have just that one parameter. 754 00:53:50,640 --> 00:53:55,040 So it makes sense to use induction on number of nodes. 755 00:53:55,040 --> 00:54:03,947 So induct on n, where Pn is going to be that every-- 756 00:54:03,947 --> 00:54:06,280 and essentially, the theorem holds true for a tournament 757 00:54:06,280 --> 00:54:19,800 graph on n nodes-- so every tournament graph on n nodes 758 00:54:19,800 --> 00:54:30,270 actually contains a directed Hamiltonian path. 759 00:54:32,820 --> 00:54:36,440 So this is semi induction hypothesis. 760 00:54:36,440 --> 00:54:38,954 So when you think about that, well, I 761 00:54:38,954 --> 00:54:40,370 feel pretty confident because if I 762 00:54:40,370 --> 00:54:45,430 look at the base case-- that's how we always start-- well, 763 00:54:45,430 --> 00:54:46,730 n equals 1. 764 00:54:46,730 --> 00:54:49,440 If n equals 1, I have just a single vertex. 765 00:54:49,440 --> 00:54:50,420 There's no edges. 766 00:54:50,420 --> 00:54:53,130 Everything is fine because the single edge 767 00:54:53,130 --> 00:54:55,660 is a directed Hamiltonian path. 768 00:54:55,660 --> 00:54:57,280 So this is great. 769 00:54:57,280 --> 00:54:59,250 So this works. 770 00:54:59,250 --> 00:55:00,570 So what about inductive step? 771 00:55:03,460 --> 00:55:05,700 Now with inductive step, we always 772 00:55:05,700 --> 00:55:07,800 perceived in the same way. 773 00:55:07,800 --> 00:55:13,540 We start to assume that Pn is true. 774 00:55:13,540 --> 00:55:16,000 Essentially, the theorem holds for a tournament graph 775 00:55:16,000 --> 00:55:17,524 on n vertices. 776 00:55:20,510 --> 00:55:23,050 Actually, let me keep this over here. 777 00:55:29,570 --> 00:55:33,150 So now let's just think about how we can prove this induction 778 00:55:33,150 --> 00:55:35,090 step. 779 00:55:35,090 --> 00:55:38,570 I need to prove P of n plus 1. 780 00:55:38,570 --> 00:55:40,050 So how do I start? 781 00:55:40,050 --> 00:55:42,640 I have to start with a tournament graph 782 00:55:42,640 --> 00:55:44,950 on n plus 1 vertices. 783 00:55:44,950 --> 00:55:50,360 And somehow I got to be able to use this property 784 00:55:50,360 --> 00:55:53,060 because that's what I assume. 785 00:55:53,060 --> 00:55:55,410 And the property only holds for a tournament graph 786 00:55:55,410 --> 00:55:56,330 on end points. 787 00:55:56,330 --> 00:55:57,930 So what will be a really good strategy 788 00:55:57,930 --> 00:56:00,900 to do here to sort of proceed our proof? 789 00:56:00,900 --> 00:56:08,380 So let me first write out what we want to do here. 790 00:56:08,380 --> 00:56:15,040 Maybe you can think about how to advance here. 791 00:56:15,040 --> 00:56:18,460 So we have shown Pn. 792 00:56:18,460 --> 00:56:22,840 Now we want to actually prove something 793 00:56:22,840 --> 00:56:25,765 about tournament graphs on n plus 1 nodes, 794 00:56:25,765 --> 00:56:28,250 so let's consider one. 795 00:56:28,250 --> 00:56:41,310 Consider a tournament graph on n plus 1 nodes. 796 00:56:41,310 --> 00:56:47,970 Now how can I use my induction hypothesis? 797 00:56:47,970 --> 00:56:52,390 So I start with this, and I want to use 798 00:56:52,390 --> 00:56:55,780 something that talks about the tournament graph on n nodes. 799 00:56:55,780 --> 00:56:57,270 So how could I proceed here? 800 00:57:02,616 --> 00:57:04,560 Any suggestions? 801 00:57:04,560 --> 00:57:07,130 So what do you usually do, right? 802 00:57:07,130 --> 00:57:09,850 If I have like an n plus 1 nodes, 803 00:57:09,850 --> 00:57:13,000 I have to somehow look at least maybe there 804 00:57:13,000 --> 00:57:15,240 exists a subgraph in this bigger graph. 805 00:57:15,240 --> 00:57:17,330 So this is really how you always think 806 00:57:17,330 --> 00:57:21,140 about these types of proofs or also other problems. 807 00:57:21,140 --> 00:57:23,340 So there must be some kind of subgraph 808 00:57:23,340 --> 00:57:26,400 that already has this property. 809 00:57:26,400 --> 00:57:31,440 Well, let's take out one node and see 810 00:57:31,440 --> 00:57:35,470 what happens because then we have one node less 811 00:57:35,470 --> 00:57:41,380 and maybe we will be able to apply our induction step. 812 00:57:41,380 --> 00:57:51,550 So let's take out one node V. 813 00:57:51,550 --> 00:57:54,740 And what can we say about remaining graph 814 00:57:54,740 --> 00:57:56,040 if we take out one node? 815 00:57:56,040 --> 00:57:59,670 For example, if I take out the node E over here 816 00:57:59,670 --> 00:58:01,400 and I just look at all the rest, I 817 00:58:01,400 --> 00:58:05,900 can still see that for all the other nodes either, 818 00:58:05,900 --> 00:58:09,100 say, U beats V or V beats U. So I still 819 00:58:09,100 --> 00:58:15,130 have an edge in one direction between each two nodes. 820 00:58:15,130 --> 00:58:17,350 So actually I still have a tournament graph, 821 00:58:17,350 --> 00:58:18,140 so that's great. 822 00:58:23,340 --> 00:58:25,995 So this gives a tournament graph. 823 00:58:29,490 --> 00:58:31,810 So essentially, so far, we really 824 00:58:31,810 --> 00:58:35,660 haven't done anything creative or anything 825 00:58:35,660 --> 00:58:40,420 that we had to make a big leap in order to prove this theorem. 826 00:58:40,420 --> 00:58:42,890 We started out with, if you want to prove something 827 00:58:42,890 --> 00:58:45,770 like this you have to really look at the number of vertices. 828 00:58:45,770 --> 00:58:49,140 And then we start to write down this stuff over here 829 00:58:49,140 --> 00:58:50,290 that makes total sense. 830 00:58:50,290 --> 00:58:53,880 And then we are going to figure out where 831 00:58:53,880 --> 00:58:55,720 we can use this induction step. 832 00:58:55,720 --> 00:58:57,150 And so we just take out one node. 833 00:58:57,150 --> 00:59:04,180 And yes, it is a tournament graph on n nodes. 834 00:59:04,180 --> 00:59:05,630 So this is very systematic. 835 00:59:05,630 --> 00:59:07,850 That's what I try to get at here. 836 00:59:07,850 --> 00:59:14,060 So by the induction step because by the induction hypothesis, 837 00:59:14,060 --> 00:59:20,120 we know now that we actually have a directed Hamiltonian 838 00:59:20,120 --> 00:59:21,070 path. 839 00:59:21,070 --> 00:59:27,835 So let V1 to V2 to Vn be such a path. 840 00:59:31,170 --> 00:59:35,230 So now that we can use this, we apply it and we get a path. 841 00:59:35,230 --> 00:59:37,030 Now what do we want to do? 842 00:59:37,030 --> 00:59:40,670 We want to show that we can create a new path, which 843 00:59:40,670 --> 00:59:44,140 is also a directed Hamiltonian path, but now one that also 844 00:59:44,140 --> 00:59:46,460 includes V in the bigger graph. 845 00:59:46,460 --> 00:59:48,020 If we can do that, we are done. 846 00:59:48,020 --> 00:59:50,220 So now we have to start really looking 847 00:59:50,220 --> 00:59:52,580 at how we can make that happen. 848 00:59:59,590 --> 01:00:06,550 In order to do this, we have to see how we can somehow 849 01:00:06,550 --> 01:00:10,120 plug V, the vertex that we have removed, 850 01:00:10,120 --> 01:00:11,640 in this path over here. 851 01:00:11,640 --> 01:00:15,460 If you can do this, we are in really good shape. 852 01:00:18,080 --> 01:00:21,200 So far, we haven't used at all-- so there's also something 853 01:00:21,200 --> 01:00:22,580 that you can look at if you start 854 01:00:22,580 --> 01:00:27,530 solving these types of problems-- we haven't used 855 01:00:27,530 --> 01:00:30,430 at all the property that the tournament graph has, 856 01:00:30,430 --> 01:00:33,900 which I just wiped out. 857 01:00:33,900 --> 01:00:36,030 So let's figure out what we can do here. 858 01:00:38,870 --> 01:00:41,070 We should be able to use something. 859 01:00:41,070 --> 01:00:43,740 So of course, we have a few simple cases. 860 01:00:43,740 --> 01:00:51,170 For example, if V has a directed edge into V1, 861 01:00:51,170 --> 01:00:55,970 and I have a Hamiltonian path that goes from V to V1 to V2 862 01:00:55,970 --> 01:00:59,500 all the way to Vn, and then I cover all the vertices exactly 863 01:00:59,500 --> 01:01:00,610 once. 864 01:01:00,610 --> 01:01:03,540 And I will have a direct Hamiltonian path. 865 01:01:03,540 --> 01:01:04,480 So this is great. 866 01:01:04,480 --> 01:01:07,420 So this is definitely easy. 867 01:01:07,420 --> 01:01:10,615 So this is case one. 868 01:01:10,615 --> 01:01:19,300 In case two, suppose that V1 has a directed edge to V. 869 01:01:19,300 --> 01:01:24,790 And So now we have a little problem because somehow there 870 01:01:24,790 --> 01:01:30,470 is an edge like this to V, but they cannot go like this. 871 01:01:30,470 --> 01:01:31,870 This is not a Hamiltonian path. 872 01:01:31,870 --> 01:01:35,530 I need to have a directed walk that covers 873 01:01:35,530 --> 01:01:36,980 all the vertices exactly once. 874 01:01:36,980 --> 01:01:38,690 So now we have a little problem. 875 01:01:38,690 --> 01:01:40,400 So now we have to start really thinking 876 01:01:40,400 --> 01:01:43,550 about how we can solve this. 877 01:01:43,550 --> 01:01:47,566 So are there any suggestions to make this happen? 878 01:01:47,566 --> 01:01:49,190 So let's think a little bit about this. 879 01:01:52,760 --> 01:01:55,160 So somehow if I start thinking about this, 880 01:01:55,160 --> 01:01:59,450 I would like to plug V somewhere in this sequence. 881 01:01:59,450 --> 01:02:02,955 That will be like a pretty obvious way to-- go ahead. 882 01:02:02,955 --> 01:02:03,830 AUDIENCE: [INAUDIBLE] 883 01:02:16,270 --> 01:02:17,015 PROFESSOR: Yeah. 884 01:02:17,015 --> 01:02:18,440 That's true. 885 01:02:18,440 --> 01:02:23,160 So for example, I may have that for example, 886 01:02:23,160 --> 01:02:27,110 V2 beats V as well. 887 01:02:27,110 --> 01:02:32,820 But suppose that I have V3 over here, and this one beats V3. 888 01:02:32,820 --> 01:02:35,790 Then, as you say, I could sort of plug V in here 889 01:02:35,790 --> 01:02:38,860 in this sequence and I may have a longer sequence. 890 01:02:38,860 --> 01:02:46,250 Or if this is not the case, then maybe the next one, V4, 891 01:02:46,250 --> 01:02:49,450 may have the property and I can plug V in here. 892 01:02:49,450 --> 01:02:54,620 So essentially what I want to show is that I can plug V 893 01:02:54,620 --> 01:03:00,200 somewhere in the middle of two of these Vi's. 894 01:03:00,200 --> 01:03:02,490 And the property that you were using 895 01:03:02,490 --> 01:03:07,040 is actually that you said, well, I know that V2 either 896 01:03:07,040 --> 01:03:09,730 beats V, or V beats V2. 897 01:03:09,730 --> 01:03:12,320 So that's the property of the tournament graph 898 01:03:12,320 --> 01:03:15,600 that we're going to use here in order to prove this. 899 01:03:15,600 --> 01:03:19,430 So yes, that's a great observation. 900 01:03:19,430 --> 01:03:23,220 So the way you formulated it, we can maybe use induction, 901 01:03:23,220 --> 01:03:24,770 for example, to prove this. 902 01:03:24,770 --> 01:03:30,900 We can sort of go recursively through this 903 01:03:30,900 --> 01:03:33,850 until you find the right spot. 904 01:03:33,850 --> 01:03:38,390 Maybe they can immediately precisely indicate such a spot. 905 01:03:38,390 --> 01:03:39,750 So how do we usually do that? 906 01:03:39,750 --> 01:03:43,690 If we are thinking about other theorems 907 01:03:43,690 --> 01:03:44,978 that we have tried to prove. 908 01:03:51,850 --> 01:03:53,540 AUDIENCE: What's the smallest value of i 909 01:03:53,540 --> 01:03:56,652 such that V beats Vi? 910 01:03:56,652 --> 01:03:57,600 PROFESSOR: OK. 911 01:03:57,600 --> 01:04:02,350 So what's the smallest value of i where V beats Vi. 912 01:04:14,930 --> 01:04:21,780 So usually we have words in our mind like largest or smallest, 913 01:04:21,780 --> 01:04:25,357 et cetera, and sort of an extreme precision. 914 01:04:25,357 --> 01:04:27,690 And then we like to find out that we can make it happen. 915 01:04:27,690 --> 01:04:32,880 And then we say, well, if something goes wrong, 916 01:04:32,880 --> 01:04:36,090 we violate that smallest condition. 917 01:04:36,090 --> 01:04:37,300 So let's do that here. 918 01:04:37,300 --> 01:04:41,380 So let's indicate a specific spot. 919 01:04:41,380 --> 01:04:54,883 Let's considered the smallest i such that V beats Vi. 920 01:04:58,860 --> 01:05:00,710 Well, let's have a look how this would work. 921 01:05:04,030 --> 01:05:07,760 So this is a little bit of a different proof 922 01:05:07,760 --> 01:05:11,129 than what I had but this should work fine as well. 923 01:05:11,129 --> 01:05:12,420 So let's just see how it works. 924 01:05:16,210 --> 01:05:17,210 So we have V1. 925 01:05:22,640 --> 01:05:26,650 First of all, we notice that, of course, if i equals 1, 926 01:05:26,650 --> 01:05:30,970 which that cannot be the case, so we know that i is larger 927 01:05:30,970 --> 01:05:31,850 than 1. 928 01:05:31,850 --> 01:05:38,310 So there's really somewhere a Vi minus 1-- 929 01:05:38,310 --> 01:05:39,560 we have to check that, right? 930 01:05:39,560 --> 01:05:41,780 If that exists, this index is not 931 01:05:41,780 --> 01:05:46,050 equal to zero-- that goes to Vi and then goes all the way up 932 01:05:46,050 --> 01:05:49,320 to Vn. 933 01:05:54,580 --> 01:06:03,680 So now we say we can use this, that V actually beats Vi. 934 01:06:03,680 --> 01:06:09,870 Now what's about-- maybe someone else can help me here-- 935 01:06:09,870 --> 01:06:13,285 I would like to have that Vi minus 1 936 01:06:13,285 --> 01:06:19,310 beats V. That would be fantastic because then I have a path that 937 01:06:19,310 --> 01:06:21,300 goes from V1 all the way up here, 938 01:06:21,300 --> 01:06:24,470 goes here, goes there, and all the way up to here. 939 01:06:24,470 --> 01:06:26,535 So we have a directed Hamiltonian path 940 01:06:26,535 --> 01:06:29,950 that covers all the vertices exactly once, 941 01:06:29,950 --> 01:06:32,210 and that's what you want to prove. 942 01:06:32,210 --> 01:06:36,933 But why would there be an edge that goes this way? 943 01:06:36,933 --> 01:06:38,224 So how do we reason about this? 944 01:06:44,390 --> 01:06:46,300 Someone else? 945 01:06:46,300 --> 01:06:52,270 AUDIENCE: Because Vi is the smallest number that V beats, 946 01:06:52,270 --> 01:06:56,729 then anything smaller than i must have beat V. 947 01:06:56,729 --> 01:06:58,780 PROFESSOR: Exactly. 948 01:06:58,780 --> 01:07:04,110 So if V would beat Vi minus 1, that 949 01:07:04,110 --> 01:07:07,130 would contradict the smallest property over here. 950 01:07:07,130 --> 01:07:09,010 So that's a contradiction. 951 01:07:09,010 --> 01:07:12,070 Now we use a property of the tournament graph. 952 01:07:12,070 --> 01:07:16,150 So now I know that Vi minus 1 must beat V. 953 01:07:16,150 --> 01:07:19,920 So I really have an edge over here. 954 01:07:19,920 --> 01:07:21,450 So that works. 955 01:07:21,450 --> 01:07:24,040 So that's the end of the proof. 956 01:07:24,040 --> 01:07:27,480 Now another version could have been 957 01:07:27,480 --> 01:07:31,280 in which we would do something similar like this. 958 01:07:31,280 --> 01:07:32,800 But we could also have used, say, 959 01:07:32,800 --> 01:07:38,480 the largest i-- just something that you may want to look at. 960 01:07:38,480 --> 01:07:41,580 You can also use the largest i such 961 01:07:41,580 --> 01:07:49,660 that Vi beats V. We have a completely symmetrical argument 962 01:07:49,660 --> 01:07:52,630 here, but you could use this solution as well. 963 01:07:52,630 --> 01:07:54,570 So I'm just trying to sketch here 964 01:07:54,570 --> 01:07:56,920 the way of thinking that you may want to consider 965 01:07:56,920 --> 01:07:58,550 in these types of problems. 966 01:07:58,550 --> 01:08:00,220 So why would this work, by the way? 967 01:08:00,220 --> 01:08:02,780 Well, we have the same kind of argument like this. 968 01:08:02,780 --> 01:08:06,610 We plug V right after Vi. 969 01:08:06,610 --> 01:08:09,560 We know there's an edge from V to Vi plus 1. 970 01:08:09,560 --> 01:08:10,340 Why? 971 01:08:10,340 --> 01:08:14,400 If it's not the case, there will be a large index, i, 972 01:08:14,400 --> 01:08:16,490 that contradicts our assumption that we 973 01:08:16,490 --> 01:08:18,470 have the largest i already. 974 01:08:18,470 --> 01:08:20,960 It's a tournament graph, so we know that there's 975 01:08:20,960 --> 01:08:24,890 an edge from V to Vi plus 1. 976 01:08:24,890 --> 01:08:27,534 And we get a directed Hamiltonian path as well. 977 01:08:27,534 --> 01:08:29,200 So you may want to look at that as well. 978 01:08:34,729 --> 01:08:36,370 So this is about tournament graphs. 979 01:08:36,370 --> 01:08:41,439 So let's talk about an interesting tournament graph 980 01:08:41,439 --> 01:08:42,450 with a funny game. 981 01:08:46,040 --> 01:08:50,569 And this is actually a chicken tournament, 982 01:08:50,569 --> 01:08:54,870 like the chickens here represent the vertices 983 01:08:54,870 --> 01:08:59,630 and they are pecking one another, but in a certain rule 984 01:08:59,630 --> 01:09:01,643 that defines a chicken to be the king chicken. 985 01:09:01,643 --> 01:09:02,809 So let's see how that works. 986 01:09:07,399 --> 01:09:11,159 So that's a great application of graph theory. 987 01:09:15,189 --> 01:09:17,210 So what do we have? 988 01:09:17,210 --> 01:09:30,130 We have that either a chicken, U, pecks a chicken, V. 989 01:09:30,130 --> 01:09:33,540 And we said that U has a direct edge to V, 990 01:09:33,540 --> 01:09:36,250 so we're actually defining a tournament graph here. 991 01:09:36,250 --> 01:09:42,500 Or we have a chicken, V, that pecks a chicken, U, 992 01:09:42,500 --> 01:09:44,950 and we get V has a direct edge to U. 993 01:09:44,950 --> 01:09:47,000 So we have a tournament graph. 994 01:09:47,000 --> 01:09:50,680 But now we define something new. 995 01:09:50,680 --> 01:10:02,660 We say that U virtually pecks V if one of the two conditions 996 01:10:02,660 --> 01:10:06,710 holds-- one of these two conditions-- either U, 997 01:10:06,710 --> 01:10:09,950 of course, pecks V. That's great. 998 01:10:09,950 --> 01:10:11,060 He's in good shape. 999 01:10:14,520 --> 01:10:18,660 Or there exists another chicken, W, such 1000 01:10:18,660 --> 01:10:27,760 that U actually pecks W and W, in turn, 1001 01:10:27,760 --> 01:10:35,740 pecks V. So this is very special kind of first relationship. 1002 01:10:35,740 --> 01:10:45,350 So we are wondering now can we now define something-- 1003 01:10:45,350 --> 01:10:46,250 is there a question? 1004 01:10:46,250 --> 01:10:49,250 AUDIENCE: [INAUDIBLE] in between? 1005 01:10:49,250 --> 01:10:52,540 To be virtually pecked, is one chicken 1006 01:10:52,540 --> 01:10:56,282 in between U and the other one? 1007 01:10:56,282 --> 01:10:58,240 PROFESSOR: Well, there can be multiple chickens 1008 01:10:58,240 --> 01:11:01,649 in between here. 1009 01:11:01,649 --> 01:11:04,728 I have several friends who help me out pecking someone else. 1010 01:11:10,410 --> 01:11:15,080 So when we were looking at these tournament graphs, 1011 01:11:15,080 --> 01:11:21,520 we were wondering, can we really indicate a winning player? 1012 01:11:21,520 --> 01:11:24,440 Well in this case, if you start to talk about virtual pecking, 1013 01:11:24,440 --> 01:11:26,580 we look at the pecking order. 1014 01:11:26,580 --> 01:11:33,350 Then we can actually define something like a chicken king. 1015 01:11:33,350 --> 01:11:36,737 So let me write that down. 1016 01:11:42,986 --> 01:11:47,040 Let me first explain what I mean here. 1017 01:11:47,040 --> 01:11:48,610 And I give an example of a graph. 1018 01:11:59,260 --> 01:12:07,180 So a chicken that is able to virtually peck everyone 1019 01:12:07,180 --> 01:12:10,870 else, we will call a king. 1020 01:12:14,100 --> 01:12:28,670 So chicken that virtual pecks every other chicken 1021 01:12:28,670 --> 01:12:36,490 is called a king chicken. 1022 01:12:41,250 --> 01:12:45,340 So let's give an example of a graph. 1023 01:12:45,340 --> 01:12:51,200 So, for example, suppose I have four chickens that 1024 01:12:51,200 --> 01:12:54,655 know how to pick one another in this order. 1025 01:13:02,200 --> 01:13:06,668 So who in the pecking party here is going to be king? 1026 01:13:06,668 --> 01:13:11,350 Do you see some solutions here? 1027 01:13:14,740 --> 01:13:16,760 So take, for example, this one. 1028 01:13:16,760 --> 01:13:19,220 So this one pecks this one. 1029 01:13:22,830 --> 01:13:24,890 Because we talk about virtually pecking, 1030 01:13:24,890 --> 01:13:27,390 it can also peck this one over here. 1031 01:13:27,390 --> 01:13:28,780 It does, right? 1032 01:13:28,780 --> 01:13:32,000 It pecks this one and this one helps out, and can peck 1033 01:13:32,000 --> 01:13:33,590 both this one and this one. 1034 01:13:33,590 --> 01:13:34,610 That's cool. 1035 01:13:34,610 --> 01:13:37,480 So this one is king. 1036 01:13:37,480 --> 01:13:41,650 And this one, actually-- let's have a look. 1037 01:13:41,650 --> 01:13:44,490 It pecks this one this one, and it virtually 1038 01:13:44,490 --> 01:13:45,450 also pecked this one. 1039 01:13:45,450 --> 01:13:45,950 Yay. 1040 01:13:45,950 --> 01:13:49,640 He has a friend over here that is doing that for him. 1041 01:13:49,640 --> 01:13:51,730 So this one is actually also a king. 1042 01:13:51,730 --> 01:13:55,740 So you can have multiple king chickens in here. 1043 01:13:55,740 --> 01:13:56,820 What about this one? 1044 01:13:56,820 --> 01:14:05,550 The same story-- pecks this one, pecks this one, 1045 01:14:05,550 --> 01:14:07,710 and virtually-- wait a minute. 1046 01:14:12,780 --> 01:14:16,400 The one on the left-- oh yeah, over here. 1047 01:14:16,400 --> 01:14:18,170 This, this. 1048 01:14:18,170 --> 01:14:20,480 So this one is king as well. 1049 01:14:20,480 --> 01:14:22,510 Now what about this one? 1050 01:14:22,510 --> 01:14:25,570 Well, it can peck this one. 1051 01:14:25,570 --> 01:14:28,050 And then in one more step from here, 1052 01:14:28,050 --> 01:14:30,280 because there's only one outgoing edge, 1053 01:14:30,280 --> 01:14:33,360 it can virtually peck this one, but not this one. 1054 01:14:33,360 --> 01:14:36,740 So this one is definitely the loser of the four. 1055 01:14:36,740 --> 01:14:41,610 So he's not the king. 1056 01:14:41,610 --> 01:14:46,200 So now what we want to prove this a theorem 1057 01:14:46,200 --> 01:14:49,221 sort of trans-identify one of the chickens 1058 01:14:49,221 --> 01:14:50,970 that we know for sure is going to be king. 1059 01:14:50,970 --> 01:14:52,950 So you can have multiple kings. 1060 01:14:52,950 --> 01:14:56,060 But maybe there's one chicken that, from our intuition, 1061 01:14:56,060 --> 01:15:00,890 we may feel is definitely going to be king. 1062 01:15:00,890 --> 01:15:03,420 So what will be a good intuition? 1063 01:15:03,420 --> 01:15:06,130 So we're talking here about virtual pecking. 1064 01:15:06,130 --> 01:15:07,670 We have this definition. 1065 01:15:07,670 --> 01:15:13,560 So what kind of node in a tournament graph 1066 01:15:13,560 --> 01:15:21,727 essentially would be-- can we know for sure that it's a king? 1067 01:15:21,727 --> 01:15:23,310 Do you have an intuition for a theorem 1068 01:15:23,310 --> 01:15:25,830 that you may want to prove? 1069 01:15:25,830 --> 01:15:28,460 So that's often what we do in mathematics. 1070 01:15:28,460 --> 01:15:31,080 We have some kind of funny new structure, 1071 01:15:31,080 --> 01:15:32,741 and then we want to find out whether we 1072 01:15:32,741 --> 01:15:34,490 can prove interesting properties about it. 1073 01:15:34,490 --> 01:15:39,180 So we start to search for actual nice properties and theorems. 1074 01:15:39,180 --> 01:15:44,350 So in this case, it makes sense that the vertex 1075 01:15:44,350 --> 01:15:49,490 that has the most outgoing edges may be always king. 1076 01:15:49,490 --> 01:15:51,820 Can we prove this? 1077 01:15:51,820 --> 01:15:53,920 So that's what we're going to do. 1078 01:15:53,920 --> 01:15:55,950 So that's the theorem. 1079 01:15:55,950 --> 01:16:03,050 And let's see whether we can do this in an elegant way. 1080 01:16:03,050 --> 01:16:06,030 So the theorem is that even though there 1081 01:16:06,030 --> 01:16:07,730 are multiple kings-- as indicated 1082 01:16:07,730 --> 01:16:09,970 in that particular example, that may happen-- 1083 01:16:09,970 --> 01:16:19,592 but I certainly know that the chicken that has the highest 1084 01:16:19,592 --> 01:16:24,506 outdegree is definitely a king. 1085 01:16:30,590 --> 01:16:35,820 And the way we're going to prove this is by contradiction. 1086 01:16:35,820 --> 01:16:38,080 Let's assume that's not the case. 1087 01:16:38,080 --> 01:16:39,860 That must be really, really weird. 1088 01:16:39,860 --> 01:16:43,140 If you are the one who has the largest outdegree, 1089 01:16:43,140 --> 01:16:46,130 it means that you can directly, just by yourself, 1090 01:16:46,130 --> 01:16:47,760 peck the most others. 1091 01:16:47,760 --> 01:16:50,180 So suppose you're not king. 1092 01:16:53,272 --> 01:17:03,440 So by contradiction, first of all, 1093 01:17:03,440 --> 01:17:06,650 let U have the highest outdegree. 1094 01:17:10,910 --> 01:17:16,010 And we want to show that this U is king. 1095 01:17:16,010 --> 01:17:19,250 So let's assume the contrary. 1096 01:17:19,250 --> 01:17:24,475 So let's suppose that U is not king. 1097 01:17:29,810 --> 01:17:31,960 So what does that mean? 1098 01:17:31,960 --> 01:17:35,930 So let's look at a definition over there 1099 01:17:35,930 --> 01:17:41,790 and see what it means that U is not king. 1100 01:17:44,730 --> 01:17:50,470 So that means that both those conditions are violated 1101 01:17:50,470 --> 01:17:55,390 because if one of those two holds, 1102 01:17:55,390 --> 01:17:57,880 I know there must be one vertex, V, 1103 01:17:57,880 --> 01:18:03,050 such that U does not virtually peck V. So I know that. 1104 01:18:03,050 --> 01:18:07,860 So let's see what that implies. 1105 01:18:11,020 --> 01:18:13,665 So I know that there must be a V such 1106 01:18:13,665 --> 01:18:22,060 that U does not virtually peck V. So maybe can help me out. 1107 01:18:22,060 --> 01:18:23,900 What does that mean? 1108 01:18:23,900 --> 01:18:26,775 It means that both these conditions are not true. 1109 01:18:26,775 --> 01:18:27,900 So let's look at the first. 1110 01:18:27,900 --> 01:18:31,320 So U pecks V. If that's not true, 1111 01:18:31,320 --> 01:18:33,350 and we're in the tournament graph, 1112 01:18:33,350 --> 01:18:40,350 we know that V must peck U. So we have this. 1113 01:18:40,350 --> 01:18:43,560 and we also know that the other condition, the second one 1114 01:18:43,560 --> 01:18:45,580 over here, does not hold. 1115 01:18:45,580 --> 01:18:51,120 So what's the negation of this second condition? 1116 01:18:51,120 --> 01:18:53,500 Maybe you can help me out. 1117 01:18:53,500 --> 01:18:57,720 So we have here, there exists a W such that U pecks 1118 01:18:57,720 --> 01:19:02,470 W and W pecks V. So how do we negate that logical expression? 1119 01:19:06,059 --> 01:19:08,930 AUDIENCE: [INAUDIBLE] 1120 01:19:08,930 --> 01:19:14,325 PROFESSOR: For all W, what's over there is not through true. 1121 01:19:14,325 --> 01:19:16,200 So can we formulate that a little bit better? 1122 01:19:16,200 --> 01:19:23,820 So it's not true that U pecks W and W pecks V. So that 1123 01:19:23,820 --> 01:19:32,520 means that either U pecks W is not true, 1124 01:19:32,520 --> 01:19:35,579 or W pecks V is not true. 1125 01:19:35,579 --> 01:19:36,620 So let's write that down. 1126 01:19:40,550 --> 01:19:41,780 Let's just write it all out. 1127 01:19:41,780 --> 01:19:54,460 So not U pecks W or not W pecks V. Well, 1128 01:19:54,460 --> 01:19:56,520 how can we rewrite this? 1129 01:19:56,520 --> 01:19:58,110 Well, it's a tournament graph, so we 1130 01:19:58,110 --> 01:20:09,110 know that W pecks U. Or this particular condition, which 1131 01:20:09,110 --> 01:20:14,640 is V pecks W. 1132 01:20:14,640 --> 01:20:15,649 So what do I have here? 1133 01:20:15,649 --> 01:20:17,190 Is this going in the right direction? 1134 01:20:20,540 --> 01:20:28,780 Well, I want to prove something about-- if I use contradiction 1135 01:20:28,780 --> 01:20:32,110 and I suppose that U is not the king, 1136 01:20:32,110 --> 01:20:34,600 I've assumed that U has the highest outdegree. 1137 01:20:34,600 --> 01:20:36,690 So I want to show that I somehow violated. 1138 01:20:36,690 --> 01:20:41,680 So somehow I'm able to construct some vertex, V. 1139 01:20:41,680 --> 01:20:44,030 And by negating that U is not a king 1140 01:20:44,030 --> 01:20:47,880 it seems that this vertex, V, makes a really good candidate 1141 01:20:47,880 --> 01:20:50,830 to show that there's a higher degree outdegree than U. 1142 01:20:50,830 --> 01:20:52,430 So let's see whether we can do this. 1143 01:20:55,040 --> 01:20:58,070 We can rewrite this logical expression once more. 1144 01:20:58,070 --> 01:21:05,990 We can also say that, well, if U pecks W-- so this 1145 01:21:05,990 --> 01:21:10,090 is not true-- then it must be true 1146 01:21:10,090 --> 01:21:15,700 that this one holds because if that's not the case, 1147 01:21:15,700 --> 01:21:17,720 then this condition is not true. 1148 01:21:17,720 --> 01:21:21,280 So if U pecks W, then this is not true. 1149 01:21:21,280 --> 01:21:23,200 So then it must be the case that that is true. 1150 01:21:23,200 --> 01:21:28,960 So V pecks W. So now let's have a look at V. 1151 01:21:28,960 --> 01:21:35,130 We noticed that for all outgoing edges from U, 1152 01:21:35,130 --> 01:21:39,890 there exists a similar outgoing edge for V. 1153 01:21:39,890 --> 01:21:42,570 But V has one more outgoing edge. 1154 01:21:42,570 --> 01:21:45,030 V, actually, is an outgoing edge to U. 1155 01:21:45,030 --> 01:21:46,870 So what do we see here? 1156 01:21:46,870 --> 01:21:57,180 That the outdegree of V is actually at least the outdegree 1157 01:21:57,180 --> 01:22:02,040 of U-- which is this particular condition over here 1158 01:22:02,040 --> 01:22:04,100 that we show here, for all the W we 1159 01:22:04,100 --> 01:22:08,690 have that this is true-- plus and we have an extra one. 1160 01:22:08,690 --> 01:22:09,990 It's this one. 1161 01:22:09,990 --> 01:22:11,500 Oh, but now we have a contradiction 1162 01:22:11,500 --> 01:22:14,830 because we said that U has the highest degree. 1163 01:22:14,830 --> 01:22:16,750 But it turns out that you have constructed one 1164 01:22:16,750 --> 01:22:18,750 that has a higher outdegree. 1165 01:22:18,750 --> 01:22:20,810 So that's a contradiction. 1166 01:22:20,810 --> 01:22:25,260 That means that our original assumption is actually wrong. 1167 01:22:25,260 --> 01:22:29,010 So suppose that U is not the king was a wrong assumption, 1168 01:22:29,010 --> 01:22:31,387 and U must be king. 1169 01:22:31,387 --> 01:22:32,720 So that's the end of this proof. 1170 01:22:36,290 --> 01:22:38,780 This is the end of this lecture. 1171 01:22:38,780 --> 01:22:40,710 So see you tomorrow at recitation 1172 01:22:40,710 --> 01:22:43,540 and next week we will continue with communication graphs 1173 01:22:43,540 --> 01:22:45,970 and partial orderings.