1 00:00:00,860 --> 00:00:03,380 PROFESSOR: The stable match problem that we just looked at 2 00:00:03,380 --> 00:00:07,330 is one example of a bipartite matching problem. 3 00:00:07,330 --> 00:00:09,660 So the setup with a bipartite matching problem 4 00:00:09,660 --> 00:00:12,050 is you've got a simple graph. 5 00:00:12,050 --> 00:00:14,440 And the vertices are split into two groups, 6 00:00:14,440 --> 00:00:17,600 as in the stable matching problem, 7 00:00:17,600 --> 00:00:21,340 we can call them the girls and the boys, the G and the b. 8 00:00:21,340 --> 00:00:23,980 So the definition of a bipartite graph 9 00:00:23,980 --> 00:00:26,760 is a graph where there are some vertices called 10 00:00:26,760 --> 00:00:29,717 the left vertices and a disjoint set of vertices 11 00:00:29,717 --> 00:00:30,800 called the right vertices. 12 00:00:30,800 --> 00:00:33,050 And every vertex is either left or right. 13 00:00:33,050 --> 00:00:37,296 And edges only go between a left vertex and a right vertex. 14 00:00:37,296 --> 00:00:38,920 Now, in this case, the matching problem 15 00:00:38,920 --> 00:00:41,820 that we want to consider is that there 16 00:00:41,820 --> 00:00:44,320 is a specification that each girl is 17 00:00:44,320 --> 00:00:49,260 willing to be paired with certain boys, 18 00:00:49,260 --> 00:00:50,600 but not all of them. 19 00:00:50,600 --> 00:00:54,070 So we can specify that by adding edges where, 20 00:00:54,070 --> 00:00:56,130 if this is the first girl on the list, 21 00:00:56,130 --> 00:00:58,830 and she is willing to be paired with the second boy 22 00:00:58,830 --> 00:00:59,850 and the last boy. 23 00:00:59,850 --> 00:01:02,260 And that's what those two edges indicate. 24 00:01:02,260 --> 00:01:05,540 So edges are signaling compatibility constraints 25 00:01:05,540 --> 00:01:07,950 on matching up the girls and the boys. 26 00:01:07,950 --> 00:01:09,690 And what we're trying to accomplish 27 00:01:09,690 --> 00:01:13,530 is getting all of the girls matched with a unique boy-- 28 00:01:13,530 --> 00:01:16,970 match each girl to a unique compatible boy. 29 00:01:16,970 --> 00:01:18,600 So there's an example of a match, 30 00:01:18,600 --> 00:01:24,240 where there is one highlighted magenta edge out of each girl. 31 00:01:24,240 --> 00:01:26,500 And they go to different boys. 32 00:01:26,500 --> 00:01:30,690 So formally, we want a bijection from the girls 33 00:01:30,690 --> 00:01:35,200 to the boys that follows edges. 34 00:01:35,200 --> 00:01:39,630 Well, let's look at a case where I can't find a match. 35 00:01:39,630 --> 00:01:41,650 Suppose that that edge was missing. 36 00:01:41,650 --> 00:01:43,610 We used that edge in the match. 37 00:01:43,610 --> 00:01:46,200 But let's suppose it was not there. 38 00:01:46,200 --> 00:01:47,630 Let's get rid of it. 39 00:01:47,630 --> 00:01:52,950 And what we find now is that this last girl no longer 40 00:01:52,950 --> 00:01:56,180 can be matched to this second boy, which 41 00:01:56,180 --> 00:01:57,850 is what we previously had. 42 00:01:57,850 --> 00:01:59,950 So let's try to find some other match. 43 00:01:59,950 --> 00:02:00,970 And there isn't any. 44 00:02:00,970 --> 00:02:02,740 And the reason is that if you look 45 00:02:02,740 --> 00:02:05,730 at this group of three girls on the left 46 00:02:05,730 --> 00:02:09,110 and you look at all of the boys on the right 47 00:02:09,110 --> 00:02:11,390 that they are collectively compatible with-- that 48 00:02:11,390 --> 00:02:13,730 is, one of these three girls at least 49 00:02:13,730 --> 00:02:17,310 is willing to be paired with one of the boys on the right-- 50 00:02:17,310 --> 00:02:19,020 there are only two boys that have 51 00:02:19,020 --> 00:02:21,020 to be shared among three girls. 52 00:02:21,020 --> 00:02:25,190 And that is one example of what's called a bottleneck. 53 00:02:25,190 --> 00:02:26,560 So we have three girls. 54 00:02:26,560 --> 00:02:29,300 And collectively, they only like two boys. 55 00:02:29,300 --> 00:02:32,750 There just are not enough boys to go around for these girls. 56 00:02:32,750 --> 00:02:36,970 That proves that a match is not going to be possible. 57 00:02:36,970 --> 00:02:39,870 So more generally, if you have a set 58 00:02:39,870 --> 00:02:43,870 S of girls on the left and you look at the image of S 59 00:02:43,870 --> 00:02:45,800 under the edge relation-- that is 60 00:02:45,800 --> 00:02:49,870 E of S, which is collectively the set of all of the boys 61 00:02:49,870 --> 00:02:53,870 that are compatible with one or more of the girls in S-- then 62 00:02:53,870 --> 00:02:55,890 whenever you have-- So we previously just 63 00:02:55,890 --> 00:02:59,840 had an example where S was 3 and E of S was 2. 64 00:02:59,840 --> 00:03:01,720 And because 3 was greater than 2-- 65 00:03:01,720 --> 00:03:04,520 because S was greater than E of S-- we were bottlenecked. 66 00:03:04,520 --> 00:03:06,230 And we couldn't possibly find a match. 67 00:03:06,230 --> 00:03:08,860 And more generally, the definition of a bottleneck 68 00:03:08,860 --> 00:03:12,540 is that if you have a set where the size of S 69 00:03:12,540 --> 00:03:15,760 is greater than the size of the image of S, 70 00:03:15,760 --> 00:03:17,630 then that's called a bottleneck. 71 00:03:17,630 --> 00:03:19,670 And the first observation we can make 72 00:03:19,670 --> 00:03:24,170 is the bottleneck lemma says that a bottleneck is a set 73 00:03:24,170 --> 00:03:27,090 S of girls without enough boys. 74 00:03:27,090 --> 00:03:34,000 And if S is greater than E of S, that's called a bottleneck. 75 00:03:34,000 --> 00:03:38,520 And when there is one, no match is possible, obviously. 76 00:03:38,520 --> 00:03:40,990 So this is a reason why there might not 77 00:03:40,990 --> 00:03:44,010 be a match, is that there is a bottleneck. 78 00:03:44,010 --> 00:03:47,090 Now, a rather deep theorem is conversely, 79 00:03:47,090 --> 00:03:50,690 if there are no bottlenecks, then in fact there is a match. 80 00:03:50,690 --> 00:03:52,720 This is known as Hall's theorem. 81 00:03:52,720 --> 00:03:55,220 It's not obvious, although we'll find 82 00:03:55,220 --> 00:03:57,190 an understandable proof of it. 83 00:03:57,190 --> 00:04:00,370 And that's what we're going to do in the next segment.