IBM ILOG Solver Debugger User's Manual > Debugging and Performance Tuning for Solver-based Applications > Visualizing the Search > Monitoring Local Search

To obtain a new Search Tree for each move, proceed as follows:

  1. Type:
IlcSolverDebugger debugger(solver); 
solver.extract(model); 
while (debugger.initialize()) { 
  1. Create the initial solution:
solver.solve(IloGenerate(env, knightArr) 
              && IloStoreSolution(env, sol)); 
do { 
  1. While there are iterations, create a new Search Tree view and start a new search for each iteration:
  while (--iter >= 0 
         && debugger.newSearchTreeView() && solver.solve(move)) {
    moves++; 
  1. Store the new best solution if there is one, and display it:
    if (sol.getObjectiveValue() < best.getObjectiveValue()) { 
      ostrstream txt; 
      txt << "Move " << moves 
      << ", Knights = " << sol.getObjectiveValue() << endl<< ends;
      debugger.sendSolution(txt.str()); 
      best.copy(sol); 
    } 
  } 
  1. If iterations are still left, ask tabu if it is complete:
 } while (iter > 0 && !tabu.complete()); 
  1. Restore the best solution found:
    debugger.sendConsole("Restoring solution...\n"); 
    debugger.newSearchTreeView(); 
    solver.solve(IloRestoreSolution(env, best)); 
} 

See the debuglsknight example for details on local search.