IBM ILOG Dispatcher User's Manual > The Basics > Solving a Vehicle Routing Problem > Solve > Declare the RoutingSolver class

The code for the declaration of the class RoutingSolver is provided for you:

class RoutingSolver {
  IloEnv              _env;
  IloModel            _mdl;
  IloSolver           _solver;
  IloDispatcher       _dispatcher;
  IloRoutingSolution  _solution;
  IloGoal             _instantiateCost;
  IloGoal             _restoreSolution;
  IloGoal             _goal;

public:
  RoutingSolver(RoutingModel mdl);
  ~RoutingSolver() {}
  IloBool findFirstSolution();
  void improveWithNhood();
  void printInformation(const char* =0) const;
};

The class RoutingSolver has eight data members. The environment, an instance of the class IloEnv, manages internal modeling issues. The model, an instance of the class IloModel, is a container for modeling objects such as variables and constraints. An instance of the class IloSolver is used to solve the problem expressed in the model. An instance of the class IloDispatcher organizes all the details of a routing problem, including routes, vehicles, visits, and costs. An instance of the class IloRoutingSolution stores the details of a solution to a routing problem. Three goals, instances of IloGoal, are used in the search for a solution. Goals are the mechanism by which Solver implements search strategies. For more information on goals, see the IBM ILOG Solver User's Manual.

The class RoutingSolver has three member functions, findFirstSolution, improveWithNhood, and printInformation, as well as a constructor. These member functions and constructor are explained in the following sections.