IBM ILOG Scheduler User's Manual > Local Search in Scheduler > Tabu Search for the Jobshop Problem with Alternatives > Solving the Problem > The Local Search

The code that defines the local search, using the objects presented above, has only a few minor changes from the code of the previous chapter. Because we now have two neighborhoods, the definition of the hill-climbing move is as follows:

  CriticalPath cp(env);
  IloNHood nhood = N1NHood(env, &cp) + RelocateNHood(env, &cp);
  IloGoal greedyMove = IloSingleMove(env, 
                                     lsSolution, 
                                     nhood,
                                     IloImprove(env), 
                                     IloFirstSolution(env),
                                     IloInstantiate(env, makespan));

The IloNHood instance is composed of two sub-neighborhoods (N1Hood and RelocateNHood) and both of these neighborhoods are created with the same CriticalPath instances.

The actual hill-climbing loop is identical to that used in the previous chapter.

Similarly, the tabu search move is the same as defined in the previous chapter with the only exception being that the neighborhood used is composed of our two sub-neighborhoods.

  IloMetaHeuristic mh = MyTabu(env, makespan);
  IloGoal move = IloSingleMove(env, 
                               lsSolution,
                               nhood, 
                               mh, 
                               IloMinimizeVar(env, makespan),
                               IloInstantiate(env, makespan));

As with the hill-climbing code, the while-loop that implements the search is identical to that in the previous chapter.