In the above example, when trying to insert new activity X, the current route contains 3 tour activities in sequence ABC, where B is a break activity, and the location of B is the same as that of A at this point. The locations of A, B and X are different. Insertion of X before A or after C is not possible due to time window constraint. Thus, only two possible insertion positions for X are to be evaluated, i.e., 1) b/w A and B; and 2) b/w B and C.
insertion of X b/w A and B is not allowed, because, otherwise, the sequence would be AXBC, the arrival time of B would be 7 (because the location of B is fixed and the same as that of A, even though X is between A and B now) and outside the time window of the break;
insertion of X b/w B and C is also not allowed, because, otherwise, the sequence would be ABXC, the arrival time of X would be 5, which is outside the time window of X.
Thus, the returned solution would be that Delivery X is unassigned.
However, the sequence of AXBC should be perfectly fine (because the location of B should not be the same as that of A in this situation, instead, it would be the same as the location of X). The arrival times at AXBC would be 1, 4, 5, and 11, respectively, all inside corresponding time windows.