IBM ILOG Dispatcher User's Manual > Developing Dispatcher Applications > Developing Your Own Neighborhoods > Neighborhood Description

It is often a good idea to break down a neighborhood into its simplest form. This technique is used here. This new neighborhood exchanges all pairs of visits within a certain distance of each other. You can then break down this neighborhood such that there is a single neighborhood per visit which exchanges just this visit with all others in its vicinity. Then, by using IloConcatenate on an array of such subneighborhoods (one for each visit), you can achieve the desired result. Unfortunately, with this idea, an unwanted symmetry is introduced; each pair of visits within the distance limit will be considered twice. For example, consider the swap of visit pair A/B. The neighborhood which swaps visit A with its close neighbors and the neighborhood which swaps visit B with its close neighbors will both consider the same swap. Therefore, you add an additional rule. Given a total order for the visits, a subneighborhood which exchanges visit A with the visits in its vicinity can only exchange visit A with visits ranked after visit A in the total order.

To simplify the design of the subneighborhood, you specify the "focus" visit and the set of visits that can be used in an exchange. The code relating to proximity and the symmetry rule exists outside of this neighborhood. It is invoked only to construct the set of visits which will be exchanged with the "focus" visit.