1 00:00:09,500 --> 00:00:11,050 Let us demonstrate the fundamentals 2 00:00:11,050 --> 00:00:14,730 of the approach that is called integer optimization that 3 00:00:14,730 --> 00:00:17,930 is used in the eHarmony matching algorithm. 4 00:00:17,930 --> 00:00:20,980 Suppose we have three men and three women. 5 00:00:24,950 --> 00:00:29,680 Their compatibility scores range between 1 and 5 for all pairs, 6 00:00:29,680 --> 00:00:31,700 and they are shown in the figure. 7 00:00:31,700 --> 00:00:34,210 For example, the first man and the first woman 8 00:00:34,210 --> 00:00:36,600 have a compatibility score of 1. 9 00:00:36,600 --> 00:00:38,300 The first man and the second woman 10 00:00:38,300 --> 00:00:41,170 have a compatibility score of 3, and so forth. 11 00:00:44,370 --> 00:00:46,850 So how should we match pairs together 12 00:00:46,850 --> 00:00:48,130 to maximize compatibility? 13 00:00:51,730 --> 00:00:54,370 The red line indicates a match. 14 00:00:54,370 --> 00:00:57,290 In this case man one is matched to the third woman 15 00:00:57,290 --> 00:00:59,870 with a compatibility score of 5. 16 00:00:59,870 --> 00:01:02,020 The second man to the first woman 17 00:01:02,020 --> 00:01:03,860 with a compatibility score of 4. 18 00:01:03,860 --> 00:01:06,450 And the third man to the second woman with a compatibility 19 00:01:06,450 --> 00:01:07,650 score of 5. 20 00:01:07,650 --> 00:01:09,870 And a total compatibility score of 14. 21 00:01:12,740 --> 00:01:15,490 Let us now formulate this matching problem 22 00:01:15,490 --> 00:01:18,960 in the language of integer optimization. 23 00:01:18,960 --> 00:01:24,410 We denote the data for the matching problem as w_ij. 24 00:01:24,410 --> 00:01:27,210 These numbers represent the compatibility score 25 00:01:27,210 --> 00:01:30,770 between user i and user j. 26 00:01:30,770 --> 00:01:37,670 In the example shown in the figure, w_13 is 5. 27 00:01:37,670 --> 00:01:41,979 We first define decision variables x_ij. 28 00:01:41,979 --> 00:01:43,550 These are binary variables taking 29 00:01:43,550 --> 00:01:48,759 value 1 if we match user i and user j together, and value 0 30 00:01:48,759 --> 00:01:50,950 otherwise. 31 00:01:50,950 --> 00:01:53,380 We next define the objective function, 32 00:01:53,380 --> 00:01:56,410 which is to maximize compatibility between matches. 33 00:01:56,410 --> 00:02:01,970 In this case, we maximize the sum of (w_11*x_11) + 34 00:02:01,970 --> 00:02:05,400 (w_12*x_12) and so forth, up to (w_33*x_33). 35 00:02:08,960 --> 00:02:12,530 We next define the constraints for the decision variables 36 00:02:12,530 --> 00:02:14,420 x_ij. 37 00:02:14,420 --> 00:02:19,630 Each man-- say, man one --should match to exactly one woman. 38 00:02:19,630 --> 00:02:24,060 And we represent this by the mathematical constraint 39 00:02:24,060 --> 00:02:28,780 as follows-- x_11 + x_12 + x_13 = 1. 40 00:02:28,780 --> 00:02:33,260 Similarly, each woman-- say, woman one 41 00:02:33,260 --> 00:02:35,760 --should match to exactly one man. 42 00:02:35,760 --> 00:02:38,579 And we represent this constraint mathematically 43 00:02:38,579 --> 00:02:44,829 as x_11 + x_21 + x_31 = 1. 44 00:02:44,829 --> 00:02:50,060 The full optimization problem is indicated next. 45 00:02:50,060 --> 00:02:54,620 First we have the objective function we indicated earlier. 46 00:02:54,620 --> 00:02:56,990 Next we have the set of constraints 47 00:02:56,990 --> 00:03:00,660 that indicate that every man should match with exactly one 48 00:03:00,660 --> 00:03:01,650 woman. 49 00:03:01,650 --> 00:03:05,170 Next we have the constraints that every woman 50 00:03:05,170 --> 00:03:06,360 should match with one man. 51 00:03:06,360 --> 00:03:11,310 And finally that the variables are binary. 52 00:03:11,310 --> 00:03:15,790 Let us now extend the methodology to other areas. 53 00:03:15,790 --> 00:03:19,090 Suppose, for example, we want to show each woman her top two 54 00:03:19,090 --> 00:03:20,170 matches. 55 00:03:20,170 --> 00:03:23,450 This is represented by the constraint x_11 56 00:03:23,450 --> 00:03:27,780 + x_21 + x_31 = 2.