1 00:00:00,960 --> 00:00:08,130 OK, in this example, suppose we have a plane and the. 2 00:00:10,990 --> 00:00:13,300 OK, in this example, Anna. 3 00:00:27,320 --> 00:00:28,080 Sarbaz. 4 00:00:31,390 --> 00:00:31,630 On. 5 00:00:44,380 --> 00:00:51,820 OK, this example is referring to the problem of finding bigger circle on the surface. 6 00:01:02,250 --> 00:01:11,130 OK, this example is referring to finding the biggest circle on a surface with some obstacle, so I 7 00:01:11,130 --> 00:01:15,570 suppose we do have given surface for simplicity. 8 00:01:15,570 --> 00:01:21,870 We have assumed it's like a square and the dimensions are equal to one one on one. 9 00:01:21,910 --> 00:01:22,280 OK. 10 00:01:23,330 --> 00:01:33,140 One on one and also the there are some US points are specified here, we want to find out the location 11 00:01:33,140 --> 00:01:44,540 and the radius of the biggest circle that can be placed on the top of this and surface without and without 12 00:01:45,330 --> 00:01:46,190 an. 13 00:02:00,300 --> 00:02:07,800 This example is referring to the problem of finding bigger circle on a surface with some obstacles. 14 00:02:07,830 --> 00:02:14,520 So suppose we do have some obstacles here on the surface and the dimension of that surface is one and 15 00:02:14,520 --> 00:02:14,880 one. 16 00:02:15,070 --> 00:02:16,160 It's like a square. 17 00:02:17,220 --> 00:02:22,620 And we want to find out the location and the radius of the bigger circle that we can place on the top 18 00:02:22,620 --> 00:02:28,980 of the surface without and overlapping any of these obstacles. 19 00:02:29,040 --> 00:02:41,930 OK, so first of all, we want to make sure that every obstacle is outside the circle. 20 00:02:42,330 --> 00:02:53,990 OK, so if the center of the circle is specified by Capital X and Y then and X I next year, X and Y, 21 00:02:53,990 --> 00:02:57,060 J are all already specify for us. 22 00:02:57,060 --> 00:02:59,430 These are the coordinates of the obstacles. 23 00:03:00,210 --> 00:03:09,780 And also we want to make sure that X is bigger than R because we don't want to have a circle outside 24 00:03:09,780 --> 00:03:11,490 the surface. 25 00:03:11,640 --> 00:03:20,010 And also X is less than one minus R, so the circle is not coming out of the box from this side. 26 00:03:20,190 --> 00:03:22,680 The same philosophy holds for Y. 27 00:03:22,890 --> 00:03:27,480 OK, so let's have a look at the Python code for this purpose. 28 00:03:31,170 --> 00:03:42,780 OK, so first of all, I import every required packages and also I define the abstract model parameter 29 00:03:43,650 --> 00:03:52,930 and is telling us how many obstacles we have and also the range of them is specified here. 30 00:03:53,580 --> 00:03:57,620 So we might need a random, um. 31 00:03:59,600 --> 00:04:01,670 Uh, initialization. 32 00:04:01,700 --> 00:04:10,790 OK, so for this purpose, I define this function, so define had any final model and I for every I 33 00:04:10,790 --> 00:04:14,910 can provide you, um, an initial kind of, um. 34 00:04:16,490 --> 00:04:28,400 So, um, location for those obstacles, actually, and also, um, the X, Y and R R or variable decision 35 00:04:28,400 --> 00:04:34,580 variables, they are positive numbers, um, varying between zero and one. 36 00:04:35,570 --> 00:04:36,190 OK. 37 00:04:37,820 --> 00:04:42,650 So they are all on the on the surface, OK? 38 00:04:42,980 --> 00:04:51,970 So we want to find out the area of that circle as the decision variable or the objective one. 39 00:04:52,940 --> 00:04:54,980 And there are some rules. 40 00:04:55,010 --> 00:04:59,990 The first rule is making sure that every obstacle is outside that circle. 41 00:05:01,320 --> 00:05:11,490 The other one is telling us that X is bigger than, ah, I couldn't put our here on the interval because 42 00:05:11,490 --> 00:05:21,000 our is a variable and Y is bigger than ours as well, and Y is less than one minus R and X is less than 43 00:05:21,000 --> 00:05:29,790 one minus R, OK, as we discussed before, and also the area is obtained by this formula using this 44 00:05:29,970 --> 00:05:30,650 constraint. 45 00:05:31,200 --> 00:05:36,540 So the objective function is obtained using this expression modeled on the area. 46 00:05:37,690 --> 00:05:46,360 And the sense is maximisation, I choose the solver, OK, I choose the solver, I can specify the number 47 00:05:46,360 --> 00:05:48,420 of obstacles here. 48 00:05:48,920 --> 00:05:49,200 Hmm. 49 00:05:49,930 --> 00:05:56,380 And finally I ask matplotlib to show me the obtain solution. 50 00:05:56,380 --> 00:06:00,280 I run the code and see the results. 51 00:06:00,310 --> 00:06:03,840 OK, so we have to wait and see the results here. 52 00:06:03,870 --> 00:06:10,540 So 50 random obstacles are generated on the graph here. 53 00:06:10,540 --> 00:06:16,630 You can see and then the center of that circle is found. 54 00:06:16,630 --> 00:06:19,700 The radius of that circle is also found. 55 00:06:20,530 --> 00:06:21,400 You can see it here. 56 00:06:22,740 --> 00:06:32,460 OK, so you can easily change the number of obstacles instead of, let's say 50, let's try 10, OK, 57 00:06:33,060 --> 00:06:34,830 and rerun the code. 58 00:06:41,800 --> 00:06:52,300 So for 10 obstacles, the location of the circle is also found, the radius is obviously bigger than 59 00:06:52,300 --> 00:06:58,930 before, and also the location of the center of the circle is an updated. 60 00:06:59,470 --> 00:07:00,460 Thank you very much.