This is EasyLocalpp: a C++ Object-Oriented framework aimed at easing the development of Local Search algorithms.
Copyright (C) 2001–2008 Andrea Schaerf, Luca Di Gaspero.
The abstract classes that compose the framework specify and implement the invariant part of the algorithm, and are meant to be specialized by concrete classes that supply the problem-dependent part. The framework provides the full control structures of the algorithms, and the user has only to write the problem-specific code. Furthermore, the framework comes out with some tools that simplify the analysis of the algorithms.
The architecture of EasyLocalpp provides a principled modularization for the solution of combinatorial problems by local search, and helps the user by deriving a neat conceptual scheme of the application. It also supports the design of combinations of basic techniques and/or neighborhood structures.
The core of EasyLocalpp is composed of a set of cooperating classes that take care of different aspects of local search. The user's application is obtained by writing derived classes for a selected subset of the framework ones. Such user-defined classes contain only the specific problem description, but no control information for the algorithm. In fact, the relationships between classes, and their interactions by mutual method invocation, are completely dealt with by the framework.
The classes in the framework are split in five categories, depending on the role they play in a local search algorithm. We have identified the following sets of classes:
- Data classes: store the basic data of the algorithm. They encode the States of the search space, the Moves, and the Input/Output data. These classes have only data members and no methods, except for those accessing their own data. They have no computing capabilities and, generally, no links to other classes.
- Helpers perform actions related to some specific aspects of the search, such as the generation of an initial random state or the exploration of the neighborhood of a given state. Helpers do not have their own internal data, but they work on the internal state of the SearchEngines that invoke them, and interact with them through function parameters.
- SearchEngines are the algorithmic core of the framework. They are responsible for performing a run of a local search technique, starting from an initial state and leading to a final one. Each engine has many data objects that represent the state of the search (current state, best state, current move, number of iterations, ...), and it maintains links to all the helpers, which are invoked for performing specific tasks on its own data. Example of search engines are randomwalk firstimprovement and simulatedannealing.
- Solvers control the search by generating the initial solutions, and deciding how, and in which sequence, searchengines have to be activated. In addition, they communicate with the external environment, by getting the input and delivering the output. They are linked to one or more searchengines (for simple or composite search, respectively) and to some of the helpers.
Other components of EasyLocalpp are:
- Observers are a set of classes for inspecting the behavior of the local search algorithm. They are listeners to the local search events and they output the progress of the local search to an output stream.
- Testers represent a simple predefined interface of the user program. They can be used to help the developers in debugging their code, adjusting the techniques, and tuning the parameters. The testers are not used anymore whenever the program is embedded in a larger application, or if the users develop an ad hoc interface for their programs.
- Utils are a set of utility classes that provide a set of miscellaneous services.
- Unit Testing components provide a set of basic automatic checks for the user developed classes.