1 00:00:01,310 --> 00:00:03,740 PROFESSOR: Now we can use the unique path characterization 2 00:00:03,740 --> 00:00:05,520 of trees to very quickly figure out 3 00:00:05,520 --> 00:00:07,280 that every tree is 2-colorable. 4 00:00:07,280 --> 00:00:10,900 So we know that a tree is a graph with unique paths 5 00:00:10,900 --> 00:00:13,020 between every pair of vertices. 6 00:00:13,020 --> 00:00:15,620 And as a consequence, the chromatic number 7 00:00:15,620 --> 00:00:21,620 of a tree with two or more vertices is 2. 8 00:00:21,620 --> 00:00:24,120 The proof is just to show you how to color it. 9 00:00:24,120 --> 00:00:26,380 You clearly can't get by with one color 10 00:00:26,380 --> 00:00:29,060 if you've got any two adjacent vertices. 11 00:00:29,060 --> 00:00:34,220 The 2-colorable way is that you just choose an arbitrary vertex 12 00:00:34,220 --> 00:00:37,850 and-- call it the root-- but you make the arbitrary choice 13 00:00:37,850 --> 00:00:39,020 on what the root is. 14 00:00:39,020 --> 00:00:46,080 And there's a unique path from the root to every vertex, 15 00:00:46,080 --> 00:00:48,340 using this unique path characterization. 16 00:00:48,340 --> 00:00:50,210 And so we're just going to color vertices 17 00:00:50,210 --> 00:00:54,370 by whether the path from the root is of odd or even length. 18 00:00:54,370 --> 00:00:56,330 If it's of even length, color it red. 19 00:00:56,330 --> 00:00:59,410 And if it's odd length, color it green. 20 00:00:59,410 --> 00:01:02,420 And so we wind up alternating red and green. 21 00:01:02,420 --> 00:01:05,330 And the fact is that adjacent nodes 22 00:01:05,330 --> 00:01:07,800 are going to be at a distance where one is an odd distance 23 00:01:07,800 --> 00:01:09,216 and one is an even distance, which 24 00:01:09,216 --> 00:01:11,600 is why this method of coloring is going to work. 25 00:01:11,600 --> 00:01:13,470 A general property of 2-coloring is 26 00:01:13,470 --> 00:01:15,870 that to figure out whether or not a graph is 2-colorable 27 00:01:15,870 --> 00:01:18,670 and how to do it, is you just start. 28 00:01:18,670 --> 00:01:21,300 Pick an arbitrary vertex, color it red. 29 00:01:21,300 --> 00:01:24,040 And then color all the vertices adjacent to it green. 30 00:01:24,040 --> 00:01:28,620 And keep going in that way, coloring a vertex 31 00:01:28,620 --> 00:01:32,440 with a color different from an adjacent vertex that's colored, 32 00:01:32,440 --> 00:01:33,340 until you get stuck. 33 00:01:33,340 --> 00:01:35,020 If you don't get stuck it's 2-colorable. 34 00:01:35,020 --> 00:01:37,960 And if it's not 2-colorable, you're guaranteed to get stuck. 35 00:01:37,960 --> 00:01:40,160 So it's a very easy way to figure out 36 00:01:40,160 --> 00:01:41,950 if a graph is 2-colorable. 37 00:01:41,950 --> 00:01:46,630 Another characterization of 2-colorability in general, 38 00:01:46,630 --> 00:01:51,110 is that a graph is 2-colorable providing 39 00:01:51,110 --> 00:01:54,820 that all the cycles that it has, if any, are of even lengths. 40 00:01:54,820 --> 00:01:56,780 Of course, a tree has no cycles, so that 41 00:01:56,780 --> 00:02:00,110 makes it 2-colorable for sure.