Xpress Kalis Mosel User Guide examples
|
| Introductory example: constraint handling: Automated and explicit constraint posting
|
| |
|
| Type: |
Programming |
| Rating: |
1 (simple) |
| Description: |
Introductory example: scheduling meetings, stated using disequality constraints; default
enumeration.
- meeting.mos: basic version, stating disequality constraints
- meeting2.mos: Additional constraints, immediate posting of (unnamed) constraints
- meeting3.mos: Named constraints posted without control of result
- meeting4.mos: Explicit posting of constraints with 'cp_post' to retrieve the result
|
| File(s): |
meeting.mos, meeting2.mos, meeting3.mos, meeting4.mos |
|
|
| Basic modeling tasks: data input, optimization, enumeration: Data input from file, solving, branching strategy
|
| |
|
| Type: |
Scheduling |
| Rating: |
2 (easy-medium) |
| Description: |
Simple exam scheduling problem (formulated with disequality constraints) showing basic modeling tasks:
- data input from file - static arrays (i4exam_ka.mos)
- data input from file - dynamic arrays (i4exam2*_ka.mos)
- optimization (i4exam3_ka.mos)
- definition of a branching strategy over decision variables of type cpvar (i4exam4_ka.mos)
|
| File(s): |
i4exam_ka.mos, i4exam2_ka.mos, i4exam3_ka.mos, i4exam4_ka.mos |
| Data file(s): |
i4exam.dat, i4exam2.dat |
|
|
| Production of cane sugar: Linear, 'ocurrence', and 'element' constraints
|
| |
|
| Type: |
Assignment |
| Rating: |
2 (easy-medium) |
| Description: |
Production of cane sugar:
- linear, 'ocurrence', and 'element' constraints (a4sugar_ka.mos), branching strategy for variables,
- alternative formulation using 'distribute' constraints (a4sugar2_ka.mos).
|
| File(s): |
a4sugar_ka.mos, a4sugar2_ka.mos |
| Data file(s): |
a4sugar.dat |
|
|
| Sequencing jobs on a bottleneck machine: Linear, 'element', 'disjunctive' constraints
|
| |
|
| Type: |
Sequencing |
| Rating: |
2 (easy-medium) |
| Description: |
Sequencing jobs on a bottleneck machine: consecutive solving with 3 different objectives;
- linear and 'element' constraints; branching strategy for variables (b4seq_ka.mos).
- Alternative formulation using 'disjunctive' constraint, branching over variables and constraints (b4seq2_ka.mos).
- Third formulation as disjunctive scheduling / sequencing problem, modeled with task and resource objects (b4seq3_ka.mos).
|
| File(s): |
b4seq_ka.mos, b4seq2_ka.mos, b4seq3_ka.mos |
| Data file(s): |
b4seq.dat |
|
|
| Planning of paint production: Linear, 'element', 'implies', and 'all-different', 'element' ,'cycle' constraints
|
| |
|
| Type: |
Producion planning |
| Rating: |
|
| Description: |
Planning of paint production:
- linear, 'element', 'implies', and 'all-different' constraints (b5paint_ka.mos).
- Alternative formulation using 'disjunctive' and 2-dimensional 'element' constraints (b5paint2_ka.mos).
- Third model version (b5paint3_ka.mos) using 'cycle' constraint.
- Forth model formulation (b5paint4_ka.mos) as disjunctive scheduling problem with setup times, modeled with task and resource
objects, using 'equiv', 'element', 'maximum' constraints and defining an enumeration strategy based on tasks and variables.
|
| File(s): |
b5paint_ka.mos, b5paint2_ka.mos, b5paint3_ka.mos, b5paint4_ka.mos |
| Data file(s): |
b5paint.dat |
|
|
| Euler knight tour problem: 'all-different', generic binary, 'cycle' constraints
|
| |
|
| Type: |
Euler knight tour |
| Rating: |
3 (intermediate) |
| Description: |
Euler knight tour problem:
- 'all-different' and generic binary constraints; branching strategy for variables (eulerkn.mos).
- Alternative implementation using subtour elimination constraints with 'implies' (eulerkn2.mos).
- Third model formulation using a 'cycle' constraint in its simplest form (eulerkn3.mos) or with successor and predecessor variables
(eulerkn3b.mos).
|
| File(s): |
eulerkn.mos, eulerkn2.mos, eulerkn2_graph.mos, eulerkn3.mos, eulerkn3b.mos |
|
|
| Frequency assignment problem: 'abs', 'distance', and 'all-different' constraints; branching strategy, solution callback
|
| |
|
| Type: |
Frequency assignment |
| Rating: |
3 (intermediate) |
| Description: |
Frequency assignment problem: 'abs', 'distance', and 'all-different' constraints; branching strategy for variables; solution
callback; interrupting and restarting the search.
|
| File(s): |
freqasgn.mos, freqasgn_graph.mos |
|
|
| Choice of locations for income tax offices: Linear, 'element', 'occurrence', 'equiv' constraints; search strategy
|
| |
|
| Type: |
Covering problem |
| Rating: |
2 (easy-medium) |
| Description: |
Choice of locations for income tax offices: linear, 'element', 'occurrence', 'equiv' constraints; search strategy for variables. |
| File(s): |
j5tax_ka.mos |
| Data file(s): |
j5tax.dat |
|
|
| Non-linear constraints: Default bounds, cpfloatvar
|
| |
|
| Type: |
Programming |
| Rating: |
1 (simple) |
| Description: |
Defining non-linear constraints over discrete and continuous variables. |
| File(s): |
nonlinctr.mos |
|
|
| Personnel planning problem: 'all_different', 'implies', 'occurrence', and 'distribute' constraints
|
| |
|
| Type: |
Planning |
| Rating: |
2 (easy-medium) |
| Description: |
Personnel planning problem: 'all_different', 'implies', 'occurrence', and 'distribute' constraints; branching strategy for
variables.
|
| File(s): |
persplan.mos, persplan_graph.mos |
|
|
| Sudoku puzzle: retrieving status information through parameters: 'all-different' constraints, propagation algorithm, infeasibility conflict analysis
|
| |
|
| Type: |
Assignment |
| Rating: |
2 (easy-medium) |
| Description: |
Sudoku puzzle:
- 'all-different' constraints; retrieving status information through parameters (sudoku_ka.mos).
- Changing the propagation algorithm; time measures with "gettime" (sudoku2_ka.mos).
- Analyzing infeasibility (sudoku_conflict.mos).
|
| File(s): |
sudoku_ka.mos, sudoku2_ka.mos, sudoku_conflict.mos |
|
|
| Assigning workers to machines: heuristics and user-defined search: Linear, 'all-different', and 'element' constraints, solution heuristic
|
| |
|
| Type: |
Assignment |
| Rating: |
2 (easy-medium) |
| Description: |
Assigning workers to machines: linear, 'all-different', and 'element' constraints;
- branching strategy for variables; consecutive solving with 2 different objectives; heuristic solution algorithm without enumeration
(i1assign_ka.mos).
- User-defined search: definition of variable and value selection strategies (i1assign2_ka.mos).
|
| File(s): |
i1assign_ka.mos, i1assign2_ka.mos |
| Data file(s): |
i1assign.dat |
|
|
| Working with reversible numbers: Branching strategy, reversible numbers, branching callbacks
|
| |
|
| Type: |
Programming |
| Rating: |
2 (easy-medium) |
| Description: |
Tracing the values of reversible numbers during tree search
- Two model versions showing definition of callbacks via subroutine references or by name.
|
| File(s): |
tracereverse.mos, tracereverse2.mos |
|
|
| Scenes allocation problem: symmetry breaking: 'implies', 'distribute', 'maximum' constraints, symmetry breaking
|
| |
|
| Type: |
Assignment |
| Rating: |
2 (easy-medium) |
| Description: |
Assigning time slots for shooting movie scenes: 'implies', 'distribute', 'maximum' constraints; the model demonstrates the
impact of additional symmetry breaking constraints on the enumeration.
|
| File(s): |
scenesalloc.mos |
|
|
| Construction of a stadium: project planning: Scheduling with precedence constraints, task objects
|
| |
|
| Type: |
Project planning |
| Rating: |
2 (easy-medium) |
| Description: |
- Project planning problem modeled with linear constraints, demonstrating the effect of constraint propagation (b1stadium_ka.mos).
- Alternative formulation as scheduling problem with precedence constraints, modeled with task objects (b1stadium2_ka.mos).
|
| File(s): |
b1stadium_ka.mos, b1stadium2_ka.mos |
| Data file(s): |
b1stadium.dat |
|
|
| Backing up files: scheduling with cumulative resource constraints: Cumulative scheduling, task and resource objects
|
| |
|
| Type: |
Binpacking |
| Rating: |
2 (easy-medium) |
| Description: |
Binpacking problem modeled as cumulative scheduling problem.
- First formulation with 'cumulative' constraints, defining a search strategy for variables (d4backup2_ka.mos).
- Alternative formulation using task and resource objects; implementing a variable-based search strategy (d4backup3a_ka.mos
and d4backup3b_ka.mos)
- or using the default scheduling search (d4backup3_ka.mos).
- Model version d4backup3c_ka.mos shows how to change the propagation algorithm for resource constraints.
|
| File(s): |
d4backup2_ka.mos, d4backup3_ka.mos, d4backup3a_ka.mos, d4backup3b_ka.mos, d4backup3c_ka.mos |
| Data file(s): |
d4backup.dat |
|
|
| Job-shop scheduling: Task and resource objects, user search strategy
|
| |
|
| Type: |
Job-shop scheduling |
| Rating: |
3 (intermediate) |
| Description: |
Job-shop scheduling problem modeled with tasks and resources;
- using the default scheduling search (jobshop2.mos)
- or a user search strategy for tasks (jobshop2a.mos and jobshop2b.mos).
- Model version jobshop2c.mos shows how to change the propagation algorithm for resource constraints.
|
| File(s): |
jobshop2.mos, jobshop2a.mos, jobshop2b.mos, jobshop2c.mos |
| Data file(s): |
jobshop.dat |
|
|
| Renewable and non-renewable resources: Provision/requirement of resource, production/consumption of resource
|
| |
|
| Type: |
Resource-constrained scheduling |
| Rating: |
2 (easy-medium) |
| Description: |
Examples of the definition of resource constraints for renewable and non-renewable resources.
- Provision/requirement of a renewable resource modeled with task and resource objects (renewa.mos).
- Production/consumption of a non-renewable resource modeled with task and resource objects (renewb.mos). Alternative formulation
with a 'producer_consumer' constraint (renewb2.mos)
|
| File(s): |
renewa.mos, renewb.mos, renewb2.mos |
| Data file(s): |
renewa.dat, renewb.dat |
|
|
| Resource usage profiles: Resource idle times, 'resusage', alternative resources
|
| |
|
| Type: |
Scheduling |
| Rating: |
3 (intermediate) |
| Description: |
Special cases of resource constraints:
- residle.mos: Preemptive scheduling ('resource idle times');
definition of resource usage profiles.
- resprofile.mos: Scheduling with resource usage profiles;
'requires' constraints with sets of 'resusage'
- altresource.mos: Scheduling with resource choice; 'requires' constraints
with sets of 'resusage'
|
| File(s): |
residle.mos, resprofile.mos, resprofile_graph.mos, altresource.mos, altresource_graph.mos |
|
|
| Linear relaxations: alldifferent' constraint reformulated by linear relaxations, user-defined linear relaxations
|
| |
|
| Type: |
Knapsack |
| Rating: |
4 (medium-difficult) |
| Description: |
This set of examples requires Xpress Optimizerin addition to Xpress Kalis.
- knapsackalld.mos: Knapsack problem with 'alldifferent' constraint solved
by automatic linear relaxations
- knapsackalld2.mos: Configuring linear relaxations
- knapsackalld3a.mos: Selecting constraints for linear relaxations
- knapsackalld3b.mos: User-defined linear relaxations
|
| File(s): |
knapsackalld.mos, knapsackalld2.mos, knapsackalld3a.mos, knapsackalld3b.mos |
|
|
|