Proof. There are two cases, depending on the value of k. Case 1 (k = 2). In the worst case, one of the robots has a section x that is less than or equal to half the path. If x is longer than a third (1/3) of the entire path, the other robot covers a section less than 2/3 of the path, and we are done. If x is equal to a 1/3 of the path, then the other robot covers 2/3 of the path, i.e., d2n/3 − 1e, and we are done. Otherwise, x is shorter than a 1/3 of the path, i.e., x = n/3 − y, y > 0. The robot that covers x backtracks over it. In this time the other robot passes twice that length, i.e., 2(n/3 − y) = 2n/3 − 2y. At this point, the portion of the path remaining uncovered is n − (n/3 − y) − (2n/3 − 2y) = 3y. The two robots cover it together so each of them covers half of it. Hence, the total time taken by each is 2n/3 − 2y + 1.5y = 2n/3 − y/2. If y is even, then, this is at most 2n/3 − 1. If y is odd, then one robot covers by/2c and the other by/2c + 1; i.e., the worst time in this case is 2n/3 − by/2c − 1 = 2n/3 − 1. Case 2 (k > 2). If there is no section that is longer than half of the path, then when every robot covers its section, no robot covers more than half of the path. On the other hand, if there is a section longer than half the path, then necessarily it is the only one. We denote it as [Sh, Si) (as in the algorithm). There are three possible cases
đang được dịch, vui lòng đợi..
