FRAMES NO FRAMES

IloSample

public IloNHood IloSample(IloEnv env, IloNHood nhood, IloNum proportion, const char * name=0)
public IloNHood IloSample(IloEnv env, IloNHood nhood, IloNum proportion, IloRandom rand, const char * name=0)
Definition file: ilsolver/iimnhood.h
Include file: <ilsolver/iimls.h>

This function creates a neighborhood that samples a proportion proportion of neighborhood nhood at each move. Normally, the sampling is done in a round-robin fashion. For example, if the proportion was set to 0.4, then on the first move the neighborhood would correspond to the first 40% of the neighbors of nhood. On the next move, the neighborhood would be the next 40% of the neighbors of nhood. On the third move, the neighborhood would be the last 20% followed by the first 20% of the neighbors of nhood.

This round-robin behavior can be replaced with a completely random behavior by suppling the option argument rand. In this case, at each move (assuming proportion=0.4) 40% of the neighbors of nhood are sampled entirely at random by drawing random numbers from rand.

The optional argument name, if provided, becomes the name of the newly created neighborhood.

In such a neighborhood, the member function IloNHood::define defines the appropriate neighbor from nhood neighborhood using the sampling rule; the functions IloNHood::notify and IloNHood#notifyOther perform the corresponding actions using the same sampling rule; the function IloNHood::start calls start for nhood; and the function IloNHood::getSize returns proportion times nhood.getSize(), rounded to the nearest integer.

This type of neighborhood can be useful for simple diversification of search in a “best accept” context, where the best move is taken at each step of the search. By limiting the neighborhood at each step, it becomes possible to move out of local minima more easily. Such a neighborhood can also be useful in conjunction with tabu search.

See Also: