Solving the problem

When the the problem is built (i.e. is compiled without any errors), it can be solved automatically by the dedicated solver embedded in the DEPS Studio environment.

How the solver works

The solver is a native mix domain Constraint Programming solver. It can perform calculations on continuous domains, integer intervals, enumerated integers, enumerated decimals and pseudo-Boolean domains. The solver’s objective is to find one, several or all solutions to the problem posed, necessarily satisfying all the properties posted in the models. The solutions obtained are mathematically guaranteed that is to say that any solution given by the solver are admissible. So, if the solver doesn’t return any solutions, it means there is none. In addition, the solver can perform optimization if an objective was set inside the problem.

Further information and references are available in this paper.

Setting the solver options

Several options can be set before the problem is solved.

  • Basic settings

The basic settings are available via the Options item of the Solve menu (Menu > Solve > Options).

../_images/GeneralSolverOptions60.png

On the General tab appears:

  • The max computation time in minutes and seconds. It can be set until the 99.99 value. This is a time out. If the solver process does not give a solution before this value the solver is interrupted.

  • The max number of solutions. It can be set until the 999 value. It represents the upper bound of the number of solutions that can generated by the solver.

  • The store results checkbox. If the box is checked, the results given by the solver will be automatically stored in several files with several file formats. In that case the name of the files can be set too.

  • The Show/NoShow Solutions (or the ShowNoShow Expr) checkbox can be unchecked if the user wants to avoid the details of the solutions (or expr) in the Messages window of DEPS Studio.

To validate all choices, the user must use the Apply button.

  • Advanced settings

Other tabs are available for advanced users that are familiar with Constraint Programming on mix domains. Generally speaking, beginners are encouraged to keep the default values set in these tabs.

../_images/PropagationSolverOptions60.png

With the Propagation tab, the user can choose the appropriate propagation method. The Hull consistency is the only method available with the DEPS Studio freeware edition :

../_images/ExplorationSolverOptions60.png

On the Exploration tab appears:

  • The Splitting strategy checkbox. This is used for precisiong the way the solver proceeds to split the domains of teh variables. One way is to recursively split the same domain until one property is not satisfied. The other way is to split the domains variable after variable until a property is not satisfied.

  • The Subdomains checkbox. Domains can be split in two parts starting by the left part (LR) or by the right part (RR) or three parts starting by the center (CLR, CRL).

  • The Selection strategy checkbox. It allows the user to precise the variable instanciation order:

    • Most constraint starts with the most constraint variable that is to say the one within the highest number of properties.

    • Discrete first starts with the discrete variables first.

    • Only discrete trys to instanciate the whole discrete variables first

    • large domain first trys to instanciate thaevariables that have the largest domain.

    • short domain first trys to instanciate the variables that have the shortest domain.

    • User oriented works with the schedule menu. Not available in the DEPS STudio freeware edition.

    • As declared trys to instanciate the variables in the order they are declared in the model of the problem.

../_images/PrecisionSolverOptions60.png

On the Precision tab appears:

  • The Spilting precision value. In DEPS Studio, if the domain of a variable is a finite domain (integer interval, integer value enumeration or decimal value enumeration), the result of the solving process gives a value inside the finite domain. If the domain of a variable is a continuous interval, the result of the solving gives a domain whose size is less than or equal to its spiliting precision.

  • The Type checkbox. The previous Spliting precision can be absolute when it represents the absolute value of the sisze of the resulting continuous interval or relative.

  • The Equality precision value. It allows the user to relax the equality property in inequality property. As an example let’s assume that expr1 and expr2 represents two algebraïc expressions. If the property expr1 = expr2 is posted somewhere in the problem, it will be transformed to |expr1 - expr2| < epsilon where epsilon is the equality precision value. If this value is equal to 0, no relaxation will be applied on equality properties.

  • The Minimizing precision value. It allows the user to adjust the value of precision around the optimal value in case of minimization of an objective specified with the keyword obj in the model of the problem.

To validate all choices, the user must use the Apply button.

Running the solver

All solver results can be viewed in the Results panel. The first column represents the variable names of the problem, preserving its structure. For each variable, the second column shows the results generated by the solver, and the last column shows the cutting accuracy if the variable domain is a continuous domain. For each variable, the cutting accuracy can be changed via this panel and validate with the Apply button.

../_images/ResultsVariables50.png

The same decomposition can be consulted for named expressions (expr) as follow.

../_images/ResultsExpr50.png

The solver can be invoked in several ways:

  • Narrowing:

../_images/NarrowingVar.png

The use of Narrowing (Menu Solve > Narrowing) allows us to restrict the domains of the variables and expr of the problem to just what is necessary. The user is sure that if at least one solution exists, then it lies within the domains returned after narrowing. In other words, outside the returned domains, we can be sure that no solution exists. If the narrowing returns a no solution message, that means that we have the guaranty that the problem has no solution.

../_images/Narrowing2.png

  • First Solution:

The use of the first solution item (Menu Solve > Firts Solution) allows the user to generate a first solution for the problem.

For each variable of the problem:

  • If its domain is a continuous interval, the result is a domain whose size is less than or equal to its spiliting precision.

  • It its domain is a finite domain (integer interval, integer value enumeration or decimal value enumeration), the result is a value inside the finite domain.

../_images/FirstSolution.png

  • Next Solution:

At each time after a first solution generation we use the next solution item (Menu Solve > next solution) the solver will generate a new solution to the problem.

  • All solutions:

The All Solutions item (Menu Solve > All Solutions) can be used directly after compiling the problem. It generates the whole set of solutions for a given problem.

  • Minimize:

If an objective (obj) has been set when defining the problem, the value of this objective can be minimized using the Minimize (Menu Solve > Minimize) item.

  • Reset solver:

By using the Reset Solver (Menu Solve > Reset Solver) item, variables, expr and solver state are reset, allowing the solver to be restarted from its initial state.

Note

The solver computation process can be interrupted in realtime by using the Interrupt button of the Results panel. In this case, for restarting a solving process, the user has to use the Reset Solver item of the Solving menu before.

Dealing with the results

As soon as the store results box of the General tab of the Options item of the Solving menu is checked, the results of teh computtations made by the solver are automatically saved in several files. That allows the user to do postprocessing on the results by using other software.

Three files are automatically generated in the Results directory of the DEPS Project.

  • A .log file that stores the whole informations of the Messages window of DEPS Studio in a text format file.

  • A .csv file that stores the solutions generated by the solver in a csv flat format file readable with the Excel spreadsheet software.

  • A .json file that stores the solutions generated by the solver in a Json format file. Each solution is structured as a dictionnary, thus preserving the structure of the problem. This file can be parsed with any json parser in any programming language.