Mosel solving examples
This directory contains a set of examples that
implement various solution heuristics using the more advanced
solving features of Mosel.
The subdirectory Data contains any input data files required by the
examples.
|
| Column generation for a cutting stock problem: Variable creation, using 'sethidden', working with multiple problems
|
| |
|
| Type: |
Cutting stock |
| Rating: |
4 (medium-difficult) |
| Description: |
- creating new variables and adding them to constraints and objective
- basis in- and output
- sorting and single knapsack algorithms
- repeat-until statement
- use of functions
- hiding / unhiding constraints
- resetting (deleting) constraints
The first version of this model (cutstk.mos) solves the
knapsack subproblem heuristically, the second version
(paper.mos) solves it as a second optimization problem,
hiding (blending out) the constraints of the main problem.
The third version defines the subproblem as a separate
problem with the same model, repeatedly creating new
problems (papersn.mos) or re-using/redefining the same
problem (papers.mos), that is:
- defining multiple problems within a model
- switching between problems
A fourth version (main model: paperp[r].mos, submodel:
knapsack[r].mos) shows how to implement the algorithm with
two separate models, illustrating the following features
of Mosel:
- working with multiple models
- executing a sequence of models
- passing data via shared memory
|
| File(s): |
cutstk.mos, papersn.mos |
|
|
| Cut generation for an economic lot-sizing (ELS) problem: Adding constraints and cuts, using the cut manager, run-time parameters
|
| |
|
| Type: |
Lot sizing |
| Rating: |
5 (difficult) |
| Description: |
This model implements various forms of cut-and-branch and branch-and-cut algorithms. In its simplest form (looping over LP
solving) it illustrates the following
features:
- adding new constraints and resolving the LP-problem (cut-and-branch)
- basis in- and output
- if statement
- repeat-until statement
- procedure
The model els.mos also implements a configurable cutting plane algorithm:
- defining the cut manager node callback function,
- defining and adding cuts during the MIP search (branch-and-cut), and
- using run-time parameters to configure the solution algorithm.
The version elsglobal.mos shows how to implement global cuts. And the model version elscb.mos defines additional callbacks
for extended logging and user stopping criteria based on the MIP gap.
Another implementation (main model: runels.mos, submodel:
elsp.mos) parallelizes the execution of several model
instances, showing the following features:
- parallel execution of submodels
- communication between different models (for bound updates on the objective function)
- sending and receiving events
- stopping submodels
The fourth implementation (main model: runelsd.mos, submodel: elsd.mos)
is an extension of the parallel version in which the solve of each submodels are
distributed to various computing nodes.
|
| File(s): |
els.mos |
| Data file(s): |
els.dat |
|
|
| Binary fixing heuristic for the Coco problem: Working with bases, saving and loading MIP solutions
|
| |
|
| Type: |
Production planning |
| Rating: |
3 (intermediate) |
| Description: |
- changing bounds on variables
- basis in- and output
- setting Optimizer parameters
- saving and loading MIP solutions (file fixbvls.mos)
|
| File(s): |
fixbv.mos, fixbvls.mos |
|
|
| Branch-and-Price for the Generalized Assignment Problem: Working with submodels, record data structures
|
| |
|
| Type: |
Generalized Assignment Problem |
| Rating: |
5 (difficult) |
| Description: |
The model implements a branch-and-price algorithm that
solves a disaggregated formulation of
the Generalized Assignment Problem (GAP) where columns
represent feasible assignments of batches
to machines. Column generation is applied at every node of the
branch-and-bound tree. The branching algorithm is completely
implemented in Mosel, and the optimizer is used only to solve
the LP relaxation at each node.
The model implementation shows the following
features of Mosel:
- user type definitions for data structures (records)
- concurrent solving of a set of
subproblems coordinated via events and exchanging data
(including data with user type) via shared memory
Data instances for this problem are generated by
executing the model genGapDataD.mos. The branch-and-price
algorithm is started by running the main model GAPbp3.mos.
This model triggers the solving of the submodels
(file GAPsubDP.mos).
The present implementation of branch-and-price can be
extended by the definition
of a heuristic that will be called at every node of the
branching tree (subroutine 'heuristic') and it can also
be configured to use other branching variable choice
strategies.
|
| File(s): |
GAPbp3.mos, GAPsubDP.mos (submodel), genGapDataD.mos |
| Data file(s): |
Dtestx5_30_1.dat |
|
|
| Pre-emptive and Archimedian goal programming: Changing constraint type, redefining the objective
|
| |
|
| Type: |
Goal Programming |
| Rating: |
3 (intermediate) |
| Description: |
goalctr.mos: goal programming using constraints
- (un)hiding constraints
- adding and deleting constraint terms
- getting solution information
- case statement
- use of procedures
goalobj.mos: goal programming using objective functions
- changing constraint type
- changing the objective function
goalobjmo.mos: same as goalobj.mos, using multi-objective solving functionality
|
| File(s): |
goalctr.mos, goalobj.mos, goalobjmo.mos |
|
|
| Using multi-objective solving: Multiple objectives, configuration of objectives
|
| |
|
| Type: |
Goal Programming |
| Rating: |
3 (intermediate) |
| Description: |
lexgoalprog.mos: lexicographic goal programming for solving a small production planning
example
- configuration of multiple objectives via 'objconfig' constructors in list form
- list combining 'mpvar' and 'linctr' types
- detailed status check via XPRS_SOLVESTATUS and XPRS_SOLSTATUS
markowitzmo.mos: Markowitz portfolio optimization, multi-objective quadratic programming example
- list combining 'nlctr' and 'linctr' types
- display of the optimal frontier as SVG graph
multiobjknapsack.mos: Knapsack problem with two objectives
- configuration of multiple objectives in array structure using priorities
- multi-objective logging settings
|
| File(s): |
lexgoalprog.mos, markowitzmo.mos, multiobjknapsack.mos |
|
|
| Successive linear programming (SLP) model for a financial planning problem: Redefinition of constraints
|
| |
|
| Type: |
Nonlinear problem |
| Rating: |
4 (medium-difficult) |
| Description: |
- modifying constraint coefficients
- while statement
- basis in- and output and problem reloading
- setting/accessing optimiser parameters
- procedure
|
| File(s): |
recurse.mos |
|
|
| Output formatting for a transportation model: Dynamic arrays for data and decision variables, formatting output
|
| |
|
| Type: |
Transportation problem |
| Rating: |
2 (easy-medium) |
| Description: |
- small LP problem
- generate a nice printed output
- using dynamic arrays for representing sparse data structures
- reading several data arrays from a single data file
|
| File(s): |
transprt.mos |
| Data file(s): |
transprt.dat |
|
|
| Solving an optimization problem via nlsolv: Using module nlsolv
|
| |
|
| Type: |
QCQP problem |
| Rating: |
2 (easy-medium) |
| Description: |
- solver choice and solver configuration via nlsolv parameters
- problem statement
- solving and solution retrieval via nlsolv
- checking NL problem status
|
| File(s): |
catenary_nl.mos |
|
|
|