IBM ILOG Solver User's Manual > Evolutionary Algorithms > Introduction and Basic Concepts > Features of the library > Solutions and solution pools

When Solver is used in the standard manner, via tree search, little consideration is given to multiple solutions unless these are the progression of improving solutions found during a tree search process. Since these solutions do not need to co-exist (you are normally only interested in the best solution found), then the use of a solution object is not normally necessary; the state of Solver's constrained variables provide a solution without the need for additional information.

By contrast, solution objects have a central and fundamental role when engaging in genetic or evolutionary search processes as a number of solutions have to co-exist. Thus, in the EA Framework, extensive use is made of the IloSolution class (see the IBM ILOG Solver Reference Manual) which can represent a solution in its entirety. Objects of type IloSolution form the basis of communication between the basic elements of the framework.

In order to make it easier for you to manipulate populations, or groups of solutions, the class IloSolutionPool is provided. This class is nothing more than a bag of solutions, although some additional facilities make it easier for you to get the best and worst members, sort the pool and iterate over it. Objects of type IloSolutionPool are the principal form of communication between the various types of genetic operators available. Typically, a genetic operator will receive a solution pool, which in traditional genetic algorithm terminology might be termed the parents, and will generate another pool of solutions that would traditionally be termed the offspring. Despite the fact that the IloSolutionPool class plays all roles (as well as that of the role of the population), it is quite normal to use the terms "population," "parents," and "offspring" depending on the exact role of the pool.

The following code shows a simple manipulation of a solution pool:

IloSolutionPool pool(env);
IloSolution s1(env, "SOLUTION 1"), s2(env, "SOLUTION 2");
pool.add(s1);
pool.add(s2);
for (IloSolutionPool::Iterator it(pool); it.ok(); ++it)
  env.out() << *it << endl;
pool.remove(s1);
env.out() << pool << endl;
pool.end();