Model wizard examples
This directory contains the LP and MIP modeling examples that are shown in the IVE examples wizard. The model files are named
by optimization problem type. All models produce a graphical representation of results in SVG format.
|
| Assignment: simple LP problem, graphical representation of results
|
| |
|
| Type: |
Assignment |
| Rating: |
1 (simple) |
| Description: |
A set of projects is assigned to persons with the
objective to maximize the overall satisfaction.
A preference rating per person and project is given.
In this model formulation the solution to the LP problem
is integer, there is no need to define the decision
variables explicitly as binaries.
|
| File(s): |
assignment_graph.mos |
|
|
| Bin packing: simple MIP problem, random generation of data,
use of model parameters, setting Optimizer controls
|
| |
|
| Type: |
Bin packing |
| Rating: |
2 (easy-medium) |
| Description: |
A number of items of different sizes are to be put
into bins of different capacities. Item sizes and bin
capacities are randomly generated integers that lie in
the given intervals. We wish to minimize the total
number of bins used.
|
| File(s): |
binpacking_graph.mos |
|
|
| Blending ores: simple LP problem, formulation of blending constraints
|
| |
|
| Type: |
Blending |
| Rating: |
1 (simple) |
| Description: |
Several ores are blended to a final product that must
have a certain quality ('grade'). We wish to determine
the quantity of every ore to be used in the blend with
the objective to maximize the total profit (calculated
as sales revenues - raw material cost).
- simple LP problem
- data in model or input from file
- bounds on variables
|
| File(s): |
blending_graph.mos |
|
|
| Capital budgeting: simple MIP problem
|
| |
|
| Type: |
Capital budgeting |
| Rating: |
1 (simple) |
| Description: |
Among 8 projects under consideration we wish
to choose the most profitable ones. Each project
requires a capital investment and a commitment of
skilled personnel. The (discounted) return of each
project is known. The available capital and the
number of skilled personnel are limited.
|
| File(s): |
capbgt_graph.mos |
|
|
| Contract allocation: simple MIP problem, semi-continuous variables,
graphical representation of results
|
| |
|
| Type: |
Contract allocation |
| Rating: |
2 (easy-medium) |
| Description: |
A public utility, which is divided into six regional
districts, wishes to allocate ten power generation
contracts to its regions as cheaply as possible. The cost
per unit of power generated by each region for each
contract is known. If part of a contract is allocated to
a region then it must be at least as big as a certain
minimum size (5 units). For reliability reasons, no
contract may be placed exclusively with only one district.
Each district has a limited power generation capacity.
|
| File(s): |
contract_graph.mos |
| Data file(s): |
contract.dat |
|
|
| Cutting stock: MIP problem solved by column generation,
working with multiple problems, using 'sethidden',
setting Optimizer and Mosel control parameters
|
| |
|
| Type: |
Cutting stock |
| Rating: |
5 (difficult) |
| Description: |
A paper mill produces rolls of paper of a fixed width that
are subsequently cut into smaller rolls according to the
customer orders. The rolls can be cut into NWIDTHS different
sizes. The orders are given as demands for each width.
The objective of the paper mill is to satisfy the demand
with the smallest possible number of paper rolls in order
to minimize the losses.
Starting with just a basic set of cutting patterns a
column generation heuristic is employed to find more
profitable cutting patterns. This heuristic solves a
second optimization problem (a knapsack problem) that is
independent of the main, cutting stock problem.
|
| File(s): |
cutstock_graph.mos |
| Data file(s): |
cutstock.dat |
|
|
| Lot sizing: MIP problem, implementation of Branch-and-Cut and
Cut-and-Branch algorithms, definition of Optimizer callbacks,
Optimizer and Mosel parameter settings, 'case', 'procedure',
'function', time measurement
|
| |
|
| Type: |
Lot sizing |
| Rating: |
4 (medium-difficult) |
| Description: |
Economic lot sizing (ELS) considers production planning
over a given planning horizon. In every period, there is
a given demand for every product that must be satisfied by
the production in this period and by inventory carried over
from previous periods.
A set-up cost is associated with production in a period,
and the total production capacity per period is limited.
The unit production cost per product and time period is
given. There is no inventory or stock-holding cost.
The model implements a configurable cutting plane algorithm
for this problem.
|
| File(s): |
els_graph.mos |
| Data file(s): |
els.dat |
|
|
| Facility location: MIP problem, graphical solution representation,
re-solving with modified bounds, data input from file,
dynamic arrays for data and decision variables, use of
'exists', model cuts
|
| |
|
| Type: |
Facility location |
| Rating: |
3 (intermediate) |
| Description: |
There are a set of depot locations and a set of clients.
The cost of opening each depot, the depot capacities, and
the demand of each client is given. For all possible
delivery routes the unit shipping cost is given.
We wish to supply all the clients at the least cost.
The model is re-solved several times to study the effects
of forcing some depots open.
|
| File(s): |
facilityloc_graph.mos |
| Data file(s): |
facilityloc.dat |
|
|
| Portfolio optimization: small QP problem, solved repeatedly with modified
constraints, graphical representation of the results,
use of 'min' and 'max'
|
| |
|
| Type: |
Portfolio optimization(QP) |
| Rating: |
3 (intermediate) |
| Description: |
An investor is evaluating ten different securities ('shares').
He estimates the return on investment for a period of one
year. To spread the risk he wishes to invest at most
30% of the capital into any share. He further wishes
to invest at least half of his capital in North-American
shares and at most a third in high-risk shares. How should
the capital be divided among the shares to minimize the
risk whilst obtaining a certain target yield? The investor
adopts the Markowitz idea of getting estimates of the
variance/covariance matrix of estimated returns on the
securities.
|
| File(s): |
folioqp_graph.mos |
| Data file(s): |
folioqpgraph.dat |
|
|
| Knapsack: simple IP problem, formulation of knapsack constraints,
model parameters, function 'random'
|
| |
|
| Type: |
Knapsack |
| Rating: |
1 (simple) |
| Description: |
We wish to choose among items of different value and
weight those that result in the maximum total value for
a given weight limit.
|
| File(s): |
knapsack_graph.mos |
|
|
| Multi-period, multi-site production planning: LP or MIP problem, formulation of resource constraints and
material balance constraints, formatted solution printing, if-then-else, if-then-elif statements
|
| |
|
| Type: |
Production planning |
| Rating: |
3 (intermediate) |
| Description: |
The company Coco has two plants that can produce two types
of cocoa powder. The plant capacities are limited.
It is possible to store raw materials and finished product
from one time period to the next. Raw material prices,
sales revenues, and the maximum amount that may be sold
depend on the time period. Raw material storage capacity
is limited.
Storing product between time periods incurs storage costs.
Some product is held in stock at the beginning of the
planning period.
The objective function of maximizing the total profit is
to maximize the sales revenues, minus the cost of production,
buying raw material, and storing finished products and raw
material.
- problem formulation alterntives selected via a runtime parameter
- if-then, if-then-else, if-then-elif statements
|
| File(s): |
prodplan_graph.mos |
| Data file(s): |
prodplan.dat |
|
|
| Project planning with resource constraints: MIP problem, alternative formulation with SOS-1,
tricky formulation of resource use profiles and
calculation of benefits, graphical solution representation
|
| |
|
| Type: |
Project planning w/ constraints |
| Rating: |
3 (intermediate) |
| Description: |
Over the next 6 months we have three projects which can
be done. Each of these projects has a profile of manpower
requirements over its lifetime, and a benefit which accrues
each month when the project has been completed.
Our problem is to determine when each project is to start,
subject to the constraint that in no month can we try to
use more manpower than is available.
- simple MIP problem
- alternative formulation using binary variables or SOS-1
- if-then-else statement
|
| File(s): |
projplan_graph.mos |
|
|
| Purchasing with price breaks: MIP problem, modeling a piecewise linear function with SOS-2,
graphical representation of data
|
| |
|
| Type: |
Purchasing with price breaks |
| Rating: |
3 (intermediate) |
| Description: |
There are three suppliers of a good, and they have quoted
various prices for various quantities of product. We want
to buy at least total cost, yet not buy too much from any
one supplier. Each supplier offers decreasing prices for
increased lot size, in the form of incremental discounts.
We wish to buy 600 items in total.
- complex MIP model
- data input from file, including parameters for dimensioning
- splitting the declaration section to read first the parameters that are used to declare the data arrays
- using SOS-2
|
| File(s): |
purchase_graph.mos |
| Data file(s): |
purchase.dat |
|
|
| Transport: simple LP problem, using dynamic arrays for data and
decision variables, formatted output printing, inline 'if',
format of data files
|
| |
|
| Type: |
Transport |
| Rating: |
2 (easy-medium) |
| Description: |
A company produces the same product at different plants.
Every plant has a different production cost per unit and
a limited total capacity. The customers (grouped into
customer regions) may receive the product from different
production locations. The transport cost is proportional
to the distance between plants and customers, and the
capacity on every delivery route is limited. The objective
is to minimize the total cost, whilst satisfying the
demands of all customers.
|
| File(s): |
transport_graph.mos |
| Data file(s): |
transport.dat |
|
|
| TSP: MIP problem, loop over problem solving, TSP subtour
elimination algorithm;
procedure for generating additional constraints, recursive
subroutine calls, working with sets, 'forall-do',
'repeat-until', 'getsize', 'not', graphical representation
of solutions
|
| |
|
| Type: |
Symmetric TSP |
| Rating: |
5 (difficult) |
| Description: |
A flight tour starts from airport 1, visits all
the other airports and then comes back to the starting point.
The distances between the airports are symmetric. In which
order should the airports be visited to minimize the total
distance covered?
|
| File(s): |
tsp_graph.mos |
| Data file(s): |
tsp.dat |
|
|
| Set covering: MIP problem, modeling an equivalence; sparse data format,
graphical output representation, 'if-then-else'
|
| |
|
| Type: |
Covering |
| Rating: |
2 (easy-medium) |
| Description: |
A mobile phone operator decides to equip a currently
uncovered geographical zone. A budget is allocated to equip
this region. 7 locations are possible for the construction
of the transmitters. Every transmitter only covers a certain
number of communities. For every community the number of
inhabitants is known. Where should the transmitters be built
to cover the largest population with the given budget?
|
| File(s): |
covering_graph.mos |
| Data file(s): |
covering.dat |
|
|
| Single period product mix: Simple LP problem, single period production planning
|
| |
|
| Type: |
Single period product mix |
| Rating: |
1 (simple) |
| Description: |
A firm has 3 workshops, each working 40 hours per week, in
which it can produce two products. A unit of each product
requires a given number of hours in the workshops and a
given number of man hours. The hourly labor cost and the
unit sales prices are known. The objective is to determine
the most profitable operation.
|
| File(s): |
prodmix_graph.mos |
|
|
| Personnel requirement planning: simple MIP problem, formulation of balance constraints
using inline 'if'
|
| |
|
| Type: |
Personnel planning |
| Rating: |
2 (easy-medium) |
| Description: |
The requirements for construction workers at a construction
site during a period of six months are known. Transfers
from other sites to this one are possible on the first day
of every month and at the end of every month workers may
leave to other sites. Transfer, understaffing, and
overstaffing incur known costs per month per post.
Overtime work is limited to 25% of the hours worked
normally. The monthly arrivals and departures are limited.
Three workers are already present on site at the beginning
of the planning period and that three workers need to
remain on-site at the end. Which are the number of arrivals
and departures every month to minimize the total cost?
|
| File(s): |
persplan_graph.mos |
| Data file(s): |
persplan.dat |
|
|
| Matching flight crews: 2 MIP problems with different objectives, data preprocessing,
incremental definition of data array, encoding of arcs,
logical 'or' (cumulative version) and 'and', 'procedure'
for printing solution, 'forall-do', 'max', 'finalize',
graphical representation of results, 'sin', 'cos'
|
| |
|
| Type: |
Bipartite matching |
| Rating: |
4 (medium-difficult) |
| Description: |
The task is to form pilot/co-pilot pairs ('crews') for every
plane with a compatible language and a sufficiently good
knowledge of the aircraft type. In the first optimization
run we maximize the number of crews that fly. The
second objective is to determine the set of crews with
maximum total score (best matching pilot/co-pilot pairs).
|
| File(s): |
matching_graph.mos |
| Data file(s): |
matching.dat |
|
|
| Maximum flow in a telecom network: MIP problem, encoding of arcs, 'range', 'exists', 'create',
algorithm for printing paths, 'forall-do', 'while-do',
'round', graphical representation of results
|
| |
|
| Type: |
Maximum flow |
| Rating: |
3 (intermediate) |
| Description: |
We wish to test the reliability of a telecommunications
network that consists of eleven sites connected by
bidirectional lines for data transmission. The specifications
require that the two sites (nodes) 10 and 11 of the network
remain able to communicate even if any three other sites of
the network are destroyed.
|
| File(s): |
maxflow_graph.mos |
| Data file(s): |
maxflow.dat |
|
|
| Multi-commodity network flow: MIP problem, encoding of paths, 'finalize', 'getsize'
|
| |
|
| Type: |
Multi-commodity network flow |
| Rating: |
3 (intermediate) |
| Description: |
A private telephone company exploits a network between
five cities. At a given moment, the company is facing
a given set of demands for circuits (telephone calls).
The objective is to transmit as much as possible of the
demands and to indicate the corresponding routing, that is,
the access paths used.
|
| File(s): |
multicomflow_graph.mos |
| Data file(s): |
multicomflow.dat |
|
|
| Vehicle routing: MIP problem, formulation of constraints to eliminate
inadmissible subtours, definition of model cuts,
selection with '|', algorithm for printing the tours,
graphical solution representation
|
| |
|
| Type: |
Vehicle routing (VRP) |
| Rating: |
4 (medium-difficult) |
| Description: |
A transporter has to deliver heating oil from a refinery
to a certain number of clients. The distances between the
clients and the refinery and the demands in liters for
the different sites are given. The transport company uses
tankers with a capacity of 39000 liters for the deliveries.
Determine the tours for delivering to all clients that
minimize the total number of kilometers driven.
|
| File(s): |
vrp_graph.mos |
| Data file(s): |
vrp.dat |
|
|
| Minimum cost flow: MIP problem, formulation with extra nodes for modes of
transport; encoding of arcs, 'finalize', union of sets,
nodes labeled with strings, graphical solution representation
|
| |
|
| Type: |
Minimum cost flow |
| Rating: |
2 (easy-medium) |
| Description: |
A company needs to transport 180 tonnes of chemical products
stored in four depots to three recycling centers. The depots
contain 190 tonnes in total. Each depot only delivers to
certain centers, by road and/or by rail, at a given cost
per tonne. Transports by rail need to have at least 10 tonnes
and at most 50 tonnes for any single delivery.
How should the company transport the 180 tonnes of chemicals
to minimize the total cost of transport?
|
| File(s): |
mincostflow_graph.mos |
| Data file(s): |
mincostflow.dat |
|
|
| Line balancing: MIP problem, encoding of arcs, 'range', formulation of
sequencing constraints
|
| |
|
| Type: |
Line balancing |
| Rating: |
2 (easy-medium) |
| Description: |
A product is produced on an assembly lines with four
workstations. It is assembled in twelve operations between
which there are certain precedence constraints. The duration
of every task is given. We would like to distribute the
tasks among the workstations in order to balance the line to
obtain the shortest possible cycle time, that is, the total
time required for assembling the product. Every task needs
to be assigned to a single workstation that has to process
it without interruption. Every workstation deals with a
single operation at a time.
|
| File(s): |
linebal_graph.mos |
| Data file(s): |
linebal.dat |
|
|
| Minimum weight spanning tree: MIP problem, formulation of constraints to exclude subcycles,
graphical representation of results
|
| |
|
| Type: |
Minimum weight spanning tree |
| Rating: |
3 (intermediate) |
| Description: |
Six terminals located in different buildings need to be
connected. The cost of connecting two terminals is
proportional to the distance between them. Determine the
connections to install to minimize the total cost.
|
| File(s): |
spanningtree_graph.mos |
| Data file(s): |
spanningtree.dat |
|
|
| Flow-shop scheduling: MIP problem, alternative formulation using SOS1,
graphical solution representation
|
| |
|
| Type: |
Flow-shop scheduling |
| Rating: |
4 (medium-difficult) |
| Description: |
A workshop with three different machines produces six
types of pipes, for which the durations of the processing
steps are given. Every workpiece runs through the machines
in the same order. Once started, any operations must be
carried out without interruption, but the workpieces may
wait between the machines. Every machine only processes
one piece at a time. A workpiece may not overtake any
other by passing onto the following machine. Which is the
sequence of workpieces that minimizes the total time for
completing all pieces?
|
| File(s): |
flowshop_graph.mos |
| Data file(s): |
flowshop.dat |
|
|
| Job shop scheduling: MIP problem, formulating disjunctions (BigM);
'dynamic array', 'range', 'exists', 'forall-do',
graphical solution representation
|
| |
|
| Type: |
Job shop scheduling |
| Rating: |
3 (intermediate) |
| Description: |
A company has received an order for three types of
wallpapers. Every paper type is produced as a continuous
roll of paper that passes through several machines, each
printing a different color. The order in which the papers
are run through the machines depends on the design of the
paper. The processing times differ depending on the surface
that needs to be printed.
Knowing that every machine can only process one wallpaper
at a time and that a paper cannot be processed by several
machines simultaneously, how should the paper printing be
scheduled on the machines in order to finish the order as
early as possible?
|
| File(s): |
jobshop_graph.mos |
| Data file(s): |
jobshop.dat |
|
|
| Transshipment formulation of multi-period production planning: MIP problem, representation of multi-period production
as flow; encoding of arcs, 'exists', 'create', 'isodd',
'getlast', inline 'if'
|
| |
|
| Type: |
Production planning |
| Rating: |
3 (intermediate) |
| Description: |
A company wishes to plan the production of a product
for the next six weeks. The weekly demand is known for
the entire planning period. The production capacity and
the production and storage costs take different values
depending on the time period. Which is the production
plan that minimizes the total cost of production and
storage?
|
| File(s): |
transship_graph.mos |
| Data file(s): |
transship.dat |
|
|
| Set partitioning: MIP problem, algorithm for data preprocessing; file
inclusion, 3 nested/recursive procedures, working with
sets, 'if-then', 'forall-do', 'exists', 'finalize'
|
| |
|
| Type: |
Partitioning |
| Rating: |
4 (medium-difficult) |
| Description: |
In a country far away, the party of the duke Sark Mevo has
finally beaten the ruling coalition headed by the princess
Reguel Tekris. Mevo wishes to consolidate his position in
the capital, the fourteen quarters of which need to be
grouped to electoral districts. The forecast number of
favorable votes for Mevo and the total number of electors
per quarter are known. All electors must vote and the
winner needs to have the absolute majority. A valid
electoral district is formed by several adjacent quarters
and must have between 30,000 and 100,000 voters. Electoral
districts consisting of a single quarter are permitted if
it has at least 50,000 voters. Nevertheless, Mevo may not
decently define an electoral district solely with quarter
10, since this contains his residence.
Determine a partitioning into five electoral districts
that maximizes the number of seats for Mevo. Should this
cause any difficulties, try a partitioning into six
districts.
|
| File(s): |
partitioning_graph.mos |
| Data file(s): |
partition_calc.mos, partitioning.dat |
|
|
| Open shop scheduling: MIP problem, data preprocessing, algorithm for preemptive
scheduling that involves looping over optimization,
''Gantt chart'' printing and drawing
|
| |
|
| Type: |
Preemptive open shop |
| Rating: |
5 (difficult) |
| Description: |
A satellite routes the traffic from four transmitter
stations to four receiver stations. It has a switch that
allows any permutation (mode) between the four transmitters
and the four receivers. A valid schedule of transmissions
defines a sequence of permutations that routes all the
traffic of the given traffic matrix TRAF. An element of
TRAF may be fragmented, and appear in several modes of
the final decomposition. The objective is to find a
schedule with minimal total duration.
The solution algorithm solves an assignment problem for
every permutation.
|
| File(s): |
openshop_graph.mos |
| Data file(s): |
openshop.dat |
|
|
| Sequencing jobs on a single machine: MIP problem with 3 different objectives; 'procedure'
for solution printing, 'if-then'
|
| |
|
| Type: |
Sequencing jobs on a machine |
| Rating: |
3 (intermediate) |
| Description: |
A set of tasks (or jobs) is to be processed on a single
machine. The execution of tasks is non-preemptive (that is,
an operation may not be interrupted before its completion).
For every task its release date, due date, and duration are
given.
The model shows how to minimize the total processing time,
the average processing time, and the total tardiness (that
is, the amount of time by which the completion of jobs
exceeds their respective due dates).
|
| File(s): |
sequencing_graph.mos |
| Data file(s): |
sequencing.dat |
|
|
| Timetable for courses and teachers: MIP problem, many specific constraints, tricky (pseudo-)
objective function, 'finalize'
|
| |
|
|