**LocalSolver** www.localsolver.com is an innovative mathematical programming solver developed and maintained by the company Innovation 24. LocalSolver finds high-quality solutions for **large-scale mixed-variable non-convex optimization problems**. Based on a unique hybrid neighborhood search approach, it combines local search techniques, constraint propagation and inference techniques, linear and mixed-integer programming techniques, as well as nonlinear programming techniques.

LocalSolver works on the **algebraic representation** of the model. As such, most common GAMS functions are supported, including logical operators. However, GAMS extrinsic functions cannot be used together with LocalSolver. Also special-ordered-set variables are currently not supported.

LocalSolver requires **all variables to have finite bounds**. Currently, the GAMS/LocalSolver link sets missing variable bounds to ±1e10, but the user is invited to provide proper bounds. However, no bounds should be set for variables that can be aggregate out by the solver link (aggrvars option).

LocalSolver is usually not able to prove infeasibility of the problem or global optimality of a solution and thus **continues the search until interrupted by a limit** (iterlim, reslim) or the user (Ctrl+C) or when found a solution with value equal or better of the dualbound option. It is thus important to set an iteration limit or a time limit that is appropriate to the model.

# The License

Starting with LocalSolver 7.5, Innovation 24 requires the user to install a machine-specific LocalSolver license on their machine. Having LocalSolver as part of the GAMS license is not sufficient anymore. Further, users that have a GAMS/LocalSolver link license need to provide a separate LocalSolver license.

Users that bought a GAMS/LocalSolver license can obtain a machine-specific LocalSolver license by, first, executing the tool `lskeygen`

that is part of the GAMS distribution. This will give an output like the following:

LocalSolver 7.5 (MacOS64, build 20171117) Copyright (C) 2017 Innovation 24, Aix-Marseille University, CNRS. All rights reserved. See LocalSolver Terms and Conditions for details. Hardware signature : 170EEAC5C295E6A2

Please send this output and your GAMS license to the GAMS sales & marketing department (sales). They will contact Innovation 24 to get a hardware-specific LocalSolver license for you and send this license back to you. Please do so with any machine on which you expect to run GAMS/LocalSolver. @gam s.com

Users with a GAMS/LocalSolver link license should contact Innovation 24 directly to obtain a LocalSolver license.

Next, the LocalSolver license file (`license.dat`

) needs to be places on the machine so that it can be found by LocalSolver. By default, LocalSolver looks for its license file in 3 different locations in the following order:

- In the file specified by the environment variable LS_LICENSE_PATH.
- In the current directory, that is the directory from where GAMS is spawned. If a file
`license.dat`

exists in this directory, it is used as default license. - In
`/opt/localsolver_X_Y/license.dat`

on Linux and Mac OS X and`C:\localsolver_X_Y\license.dat`

on Windows.

Alternatively, it is currently still possible to use LocalSolver 7.0 with GAMS. To do so, change the solver to LOCALSOLVER70. For this use case, a GAMS/LocalSolver license is sufficient.

# Using GAMS/LocalSolver

The following statement can be used inside your GAMS program to specify using LocalSolver:

Option MIP = LocalSolver; { or MIQCP or MINLP or ... }

The above statement should appear before the `solve`

statement. If LocalSolver was specified as the default solver during GAMS installation, the above statement is not necessary.

Alternatively, LocalSolver 7.0 can be used by specifying

Option MIP = LocalSolver70; { or MIQCP or MINLP or ... }

The following GAMS options are used by GAMS/LocalSolver: iterlim, reslim, and threads.

Additionally, a GAMS/LocalSolver run can be customized by a using a solver options file. With the following example, one disables the automated *aggregation of variables* in the GAMS/LocalSolver link and sets the seed for the random number generator in LocalSolver to 42:

aggrvars 0 seed 42

The following options can be set:

## Hierarchical Optimization of Multiple Objective Functions

If the option hierarchicalobj is enabled, then the objective function in the GAMS model is interpreted as a specification of the priorities for an hierarchical optimization.

That is, assume the GAMS objective function is

\[ \sum_{i=1}^p c_i x_i \]

If hierarchicalobj is enabled, the GAMS/LocalSolver link will request LocalSolver to optimize each of the \(x_i\) variables in a hierarchical way. The highest priority will be given to a variable with largest value for \(|c_i|\), the 2nd highest priority to a variable with 2nd largest absolute coefficient value, etc. Further, if \(c_i\) is negative, then the optimization direction for \(x_i\) will be flipped (w.r.t. the objective sense specified in the GAMS solve statement).

Note, that GAMS will still report the value of the objective function \( \sum_{i=1}^p c_i x_i \) in the GAMS listing file and model attribute.

### Example

Let's assume we have 3 hierarchical objective functions,

o1 =e= ... o2 =e= ... o3 =e= ...

Assume we want to first minimize o1, secondly maximize o2, and thirdly minimize o3. To do this with GAMS/LocalSolver, you have to build a "weighted" combined objective and using the weights and the sign of the weight to determine the order and the direction:

o =e= 1000*o1 - 200*o2 + 50*o1; solve m minimizing o using mip;

or

o =e= -1000*o1 + 200*o2 - 50*o3; solve m maximizing o using mip;

# Output

When LocalSolver tries to find good solutions, it prints a number of statistics to the log. Next to the number of infeasible expressions or the objective value, these are

`mov`

: the number of moves performed,`inf`

: the percentage of infeasible moves,`acc`

: the percentage of accepted moves,`imp`

: the number of improving moves.