1 00:00:00,750 --> 00:00:04,200 This is another version of hostile borders, but this in a triangle. 2 00:00:04,240 --> 00:00:12,910 So suppose we have a triangle with known dimensions and B are the dimensions of that triangle, and 3 00:00:12,910 --> 00:00:20,790 then we want to make sure that all borders or hostile borders are located in inside that triangle in 4 00:00:20,790 --> 00:00:25,360 a way that and there are minimum distance is maximized. 5 00:00:25,440 --> 00:00:31,470 So first of all, that the formula for calculating the distance between each pair of brothers is the 6 00:00:31,470 --> 00:00:31,940 same. 7 00:00:32,520 --> 00:00:40,020 But and now we need to make sure that the know the red dots are inside the triangle. 8 00:00:40,050 --> 00:00:47,430 OK, so for this purpose, I have to make sure that X is always between zero and one and B and why is 9 00:00:47,430 --> 00:00:56,850 between zero and A and B are the input parameters and also and all the dots are below that specific 10 00:00:56,850 --> 00:00:58,350 line connecting A to B.. 11 00:00:58,380 --> 00:01:00,340 OK, this is the formula for that. 12 00:01:00,660 --> 00:01:05,980 OK, so let's have a look at the Python code. 13 00:01:06,530 --> 00:01:08,880 OK, so here you can see that. 14 00:01:08,880 --> 00:01:13,490 And the Python code is what trying to do what. 15 00:01:13,760 --> 00:01:25,410 So at the beginning and the first top is importing the required packages and then we have to define 16 00:01:25,560 --> 00:01:30,030 a B set and and and also I n g. 17 00:01:30,240 --> 00:01:30,570 Hmm. 18 00:01:30,900 --> 00:01:32,430 And also the variables. 19 00:01:32,460 --> 00:01:35,490 So this part of the code is similar to the previous ones. 20 00:01:35,790 --> 00:01:45,450 So here you can see dots and we have to define three variables X, Y and R, and also some rules for 21 00:01:45,450 --> 00:01:47,260 calculating the minimum distance. 22 00:01:47,280 --> 00:01:53,340 It is a famous rule that we already use in the previous to that brother of a variance. 23 00:01:53,730 --> 00:01:59,280 And also C two is the line is specifying that we should always be below that line. 24 00:01:59,400 --> 00:02:03,140 OK, and finally, that's the objective function. 25 00:02:03,150 --> 00:02:05,790 So I run this part of the code as well. 26 00:02:06,210 --> 00:02:11,970 OK, it is run successfully and I specify and B and the number of brothers. 27 00:02:12,240 --> 00:02:12,720 Yeah. 28 00:02:13,730 --> 00:02:14,650 OK. 29 00:02:16,460 --> 00:02:25,730 So it takes a bit of time to run the code because it's non-linear but and it's and has 50 brothers, 30 00:02:25,730 --> 00:02:26,290 OK? 31 00:02:26,720 --> 00:02:34,490 And also at the peak, at the final stage and you can see here, that's how the brothers are allocated 32 00:02:34,490 --> 00:02:36,400 inside that triangle. 33 00:02:36,410 --> 00:02:44,690 If I changed a number of brothers, let's say they are 10 now, so it will run more quickly. 34 00:02:45,380 --> 00:02:52,350 And if I run the code, you can see that how they are scattered inside that triangle. 35 00:02:52,640 --> 00:02:58,240 OK, so you can change it as, uh, as you wish for your own purpose. 36 00:02:58,640 --> 00:02:59,570 Thank you very much.