6 | | According to Google, "[https://developers.google.com/optimization/ OR-Tools] is an open source software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming." OR-Tools are available for C++, Python, Java and .NET, the latter API can be used in HeuristicLab. |
| 6 | According to Google, "[https://developers.google.com/optimization/ OR-Tools] is an open source software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming." OR-Tools is available for C++, Python, Java and .NET, the latter API can be used in HeuristicLab. |
19 | | OR-Tools contains a [https://developers.google.com/optimization/reference/linear_solver/linear_solver/ linear solver wrapper] that can be used to define a MIP model once and solve it with a range of MIP solvers. Some solvers are already built into OR-Tools (BOP, Cbc, Clp, Glop) but for most solvers OR-Tools have to be built from source code, this version then has a dependency on the external solver. HeurisicLab includes a custom version of OR-Tools that allows users to simply install additional solvers without depending on them. Download the solvers here, they are free for academic use: |
| 19 | OR-Tools contains a [https://developers.google.com/optimization/reference/linear_solver/linear_solver/ linear solver wrapper] that can be used to define a MIP model once and solve it with a range of MIP solvers. Some solvers are already built into OR-Tools (BOP, Cbc, Clp, Glop) but for most solvers OR-Tools have to be built from source code, this version then has a dependency on the external solver. HeuristicLab includes a custom version of OR-Tools that allows users to simply install additional solvers without depending on them. Download the solvers here, they are free for academic use: |
25 | | Make sure that the solver you install is added to the environment variable `Path` and the `LibraryName` property of the solver in the Algorithm view is set to the correct name of the solver DLL (e.g. `cplex1280.dll` for version 12.8.0 of CPLEX). The default values for the solver DLLs can be set in the configuration file of HeuristicLab. Note that most solvers offer to change the `ProblemType` property to `LinearProgramming`, the solver then solves the linear programming relaxation of your model (all integer constraints are removed). |
26 | | |
27 | | [[Image(MixedIntegerLinearProgramming.png)]] |
28 | | |
29 | | For a general introduction to MIP and a simple model implemented using the linear solver wrapper, see https://developers.google.com/optimization/mip/integer_opt. For further examples demonstrating more advanced usage of the linear solver wrapper using the C# API, see https://github.com/google/or-tools/tree/master/examples/dotnet. |
30 | | |
31 | | The `HeuristicLab.ExactOptimization` plugin provides a GUI for MIP, just create a new ''Mixed-Integer Linear Programming (LP, MIP)'' algorithm, found under ''Algorithms'', ''Exact''. You can either load your model from a file (MPS, Google OR-Tools Protocol Buffers files) or define your model using C# and directly accessing the linear solver wrapper. The [#DefininaMIPModel next section] shows the implementation of a [#KnapsackProblemKSP Knapsack Problem (KSP)] and a [#TravelingSalesmanProblemTSP Traveling Salesman Problem (TSP)]. |
| 25 | For a general introduction to MIP and a simple model implementation using the linear solver wrapper, see https://developers.google.com/optimization/mip/integer_opt. For further examples demonstrating more advanced usage of the linear solver wrapper using the C# API, see https://github.com/google/or-tools/tree/master/examples/dotnet. |
| 26 | |
| 27 | The `HeuristicLab.ExactOptimization` plugin provides a GUI for MIP, just create a new ''Mixed-Integer Linear Programming (LP, MIP)'' algorithm, found under ''Algorithms'', ''Exact''. In the ''Problem'' tab, you can either load your model from a file (MPS, Google OR-Tools Protocol Buffers files) or define your model in C# by directly accessing the linear solver wrapper. The [#DefiningaMIPModel next section] shows the implementation of a [#KnapsackProblemKSP Knapsack Problem (KSP)] and a [#TravelingSalesmanProblemTSP Traveling Salesman Problem (TSP)]. Furthermore, have a look at the [#SettingtheSolverParameters solver parameters] you can set in the ''Algorithm'' tab. |
| 209 | |
| 210 | === Setting the Solver Parameters === |
| 211 | |
| 212 | In the ''Algorithm'' tab of a ''Mixed-Integer Linear Programming (LP, MIP)'' algorithm, there are several parameters that are passed to the solvers. The most important parameter is the `LinearSolver` parameter, which lets you choose a solver. Note that all supported solvers are listed, even if they are not installed. Make sure that the additional solvers you install are added to the environment variable `Path` and the `LibraryName` parameter of the solver is set to the correct name of the solver DLL (e.g. `cplex1280.dll` for version 12.8.0 of CPLEX). The defaults for the solver DLLs can be set in the configuration file of HeuristicLab. |
| 213 | |
| 214 | [[Image(MixedIntegerLinearProgramming.png)]] |
| 215 | |
| 216 | The solver is terminated, once the time limit (parameter `TimeLimit`, set to `00:00:00` for unlimited runtime) is reached or the relative gap (between the best objective value and the bound) drops below the tolerance (parameter `RelativeGapTolerance`). Most solvers offer to change the `ProblemType` parameter to `LinearProgramming`, the solver then solves the linear programming relaxation of your model (all integer constraints are removed). |
| 217 | |
| 218 | To get intermediate results, use the parameter `QualityUpdateInterval`. Once the interval elapses, the solver is interrupted, the current solution is synchronized to the ''Results'' tab and the solver is resumed. To disable this behavior (and the slowdowns it causes), set the parameter to `00:00:00`. |
| 219 | |
| 220 | The parameter `SolverSpecificParameters` allows the user to set further parameters in the solver specific parameter file format. Have a look at the parameters supported by the solver you choose first, there are links in the comments. Note that the parameters you directly set in the user interface (`TimeLimit`, `RelativeGapTolerance` and the parameters for advanced usage that are hidden by default `Presolve`, `Scaling`, `PrimalTolerance` and `DualTolerance`) override the solver specific parameters. |