Community Home Xpress Home Contact Us
FICO
Xpress banner
FICO Xpress Examples Repository

There are a number of examples available demonstrating some of the functionality of the FICO Xpress optimization suite.

A large percentage of these examples are browsable online. Click on the examples browser below to start browsing the available material.
If you wish to run the examples we recommend you download the examples set as a single archive file: for
Windows or for Unix.

The examples featured in our publication "Applications of optimization with Xpress-MP"
are available to download here. Constraint Programming versions of some of the
examples are available to download here.


Search for

  1. Xpress-BCL library examples
    1. Examples in C
      1. Chess - Composing constraints and solving
      2. Workshop - Printing variables
      3. Contract - Semi-continuous variables, predefined constraint functions, combine BCL with Xpress-Optimizer
      4. Chgprobs - Working with multiple models
      5. Setops - Index sets
      6. Workshop - Ranging information
      7. Burglar - Use of index sets in a knapsack model
      8. Coco - A full production planning example
      9. Delivery - Data input from file; infeasibility analysis
      10. Purchase - Definition of SOS-2
      11. Infeas - User error handling and output redirection
      12. Portfolio - Quadratic Programming with discrete variables
      13. Cutstk - Column generation for a cutting stock problem.
      14. Els - An economic lot-sizing problem solved by cut-and-branch and branch-and-cut heuristics
      15. Fixbv - A binary fixing heuristic
      16. Recurse - A successive linear programming model
      17. MT2 - Solving two problems in parallel in a thread-safe environment
      18. GoalObj - Archimedian and pre-emptive goal programming using objective functions
      19. UG - Examples from 'BCL User Guide and Reference Manual'
      20. Folio - Examples from 'Getting Started'
    2. Examples in C++
      1. Chess - Composing constraints and solving
      2. Workshop - Printing variables
      3. Contract - Semi-continuous variables, combine BCL with Xpress-Optimizer
      4. Chgprobs - Working with multiple models
      5. Setops - Index sets
      6. Workshop - Ranging information
      7. Burglar - Use of index sets in a knapsack model
      8. Coco - A full production planning example
      9. Delivery - Data input from file; infeasibility analysis
      10. Purchase - A complex MIP problem with SOS-2
      11. Portfolio - Quadratic Programming with discrete variables
      12. Cutstk - Column generation for a cutting stock problem.
      13. Els - An economic lot-sizing problem solved by cut-and-branch and branch-and-cut heuristics
      14. Fixbv - A binary fixing heuristic
      15. Recurse - A successive linear programming model
      16. GoalObj - Archimedian and pre-emptive goal programming using objective functions
      17. UG - Examples from 'BCL User Guide and Reference Manual'
      18. Folio - Examples from 'Getting Started'
    3. Examples in C#
      1. Chess - Composing constraints and solving
      2. Workshop - Printing variables
      3. Contract - Semi-continuous variables, predefined constraint functions
      4. Chgprobs - Working with multiple models
      5. Setops - Index sets
      6. Workshop - Ranging information
      7. Burglar - Use of index sets in a knapsack model
      8. Coco - A full production planning example
      9. Delivery - Data input from file, and "Views"
      10. Purchase - Definition of SOS-2
      11. Portfolio - Quadratic Programming with discrete variables
      12. Cutstk - Column generation for a cutting stock problem.
      13. Els - An economic lot-sizing problem solved by cut-and-branch and branch-and-cut heuristics
      14. Fixbv - A binary fixing heuristic
      15. Recurse - A successive linear programming model
      16. GoalObj - Archimedian and pre-emptive goal programming using objective functions
      17. UG - Examples from 'BCL User Guide and Reference Manual'
      18. Folio - Examples from 'Getting Started'
    4. Examples in Java
      1. Chess - Composing constraints and solving
      2. Workshop - Printing variables
      3. Contract - Semi-continuous variables, combine BCL with Xpress-Optimizer
      4. Chgprobs - Working with multiple models
      5. Setops - Index sets
      6. Workshop - Ranging information
      7. Burglar - Use of index sets in a knapsack model
      8. Coco - A full production planning example
      9. Delivery - Data input from file; infeasibility analysis
      10. Purchase - Definition of SOS-2
      11. Infeas - User error handling and output redirection
      12. Portfolio - Quadratic Programming with discrete variables
      13. Cutstk - Column generation for a cutting stock problem.
      14. Els - An economic lot-sizing problem solved by cut-and-branch and branch-and-cut heuristics
      15. Fixbv - A binary fixing heuristic
      16. Recurse - A successive linear programming model
      17. GoalObj - Archimedian and pre-emptive goal programming using objective functions
      18. UG - Examples from 'BCL User Guide and Reference Manual'
      19. Folio - Examples from 'Getting Started'
    5. Examples in VB/VBA
      1. VB examples Chess, Jobs, Setops and QP12
      2. Folio - Examples from 'Getting Started'
  2. Xpress-Mosel examples
    1. Modeling
      1. Chess - A tiny production planning problem; solution analysis
      2. Burglar - The 'Burglar Bill' knapsack model
      3. Blend - A model for mineral blending
      4. Coco - The Coco productional planning problem
      5. Firestns - A set-covering model for emergency service provision
      6. Lcsp - A labour constrained scheduling problem
      7. Setops - Basic set operations
      8. Pplan - A project planning problem
      9. Purchase - A model for optimal purchasing with price-breaks
      10. Folio - Examples from 'Getting started'
      11. Delivery - Infeasibility analysis with IIS
    2. Examples from 'Applications of optimization'
      1. Mining and process industries
      2. Scheduling problems
      3. Planning problems
      4. Loading and cutting problems
      5. Ground transport
      6. Air transport
      7. Telecommunication problems
      8. Economics and finance
      9. Timetabling and personnel planning
      10. Local authorities and public services
    3. Programming
      1. Find the largest common divisor of two integer numbers
      2. Find the smallest and the largest value in a set of integers
      3. Calculate all perfect numbers up to a given upper bound
      4. Find all prime numbers up to a given bound using the Sieve of Eratosthenes
      5. Read two tables and a set from a data file
      6. Sort an array of numbers into numerical order using Shell's method
      7. Sort an array of numbers into numerical order using Quicksort
      8. Subroutines
      9. Lists: initialization, enumeration, operators, access functions
      10. Constructing a Eulerian circuit: working with lists
      11. Defining and initializing records
      12. Working with records: definition of a network
      13. User type definition
      14. Writing packages: definition of constant symbols, subroutines, and types
      15. Defining a package to handle binary trees
      16. Working with the types 'date' and 'time'
    4. Solving techniques
      1. Column generation for a cutting stock problem
      2. Cut generation for an economic lot-sizing (ELS) problem
      3. Cut-and-branch and branch-and-cut
      4. Binary fixing heuristic for the Coco problem
      5. Pre-emptive and Archimedian goal programming using constraints
      6. Archimedian and pre-emptive goal programming using objective functions
      7. Successive linear programming (SLP) model for a financial planning problem
      8. Simple transportation model: output formatting
      9. Dantzig-Wolfe decomposition for the Coco problem
      10. Benders decomposition
      11. Branch-and-Price for the Generalized Assignment Problem
      12. Working with multiple models: submodels, coordination, communication, and parallelization
      13. Solving a jobshop production planning: loading solver with an initial solution and parallel computation
      14. Solving the TSP problem by a series of optimization subproblems.
      15. Hybrid MIP-CP problem solving: sequential solving
      16. Hybrid MIP-CP problem solving: concurrent solving
      17. Constructing and loading MIP start solutions for the traveling salesman problem (TSP)
    5. Data handling ( ODBC/SQL, sparse data, IO drivers, Spreadsheets )
      1. ODBC: Reading data from spreadsheets and databases
      2. Reading sparse data from text files, spreadsheets and databases, and from memory
      3. Data output to text files, spreadsheets and databases, and to memory
      4. Dense vs. sparse data format
      5. Writing out solution values to text files, spreadsheets or databases
      6. Spreadsheets and databases: working with multiple data tables and arrays
      7. Formulation of SQL (selection) statements
      8. Reading and writing records and lists
      9. Reading and writing external types: dates and time
      10. Reading and writing spreadsheets
      11. Reading 3-dimensional arrays
    6. Distributed calculation and remote invocation
      1. Reading and writing data using the bin: format
      2. Implementing a file manager
      3. Approximating PI number
      4. Calculating prime numbers
    7. C Library examples
      1. Compiling a model file into a BIM file
      2. Working with models and accessing dynamic libraries
      3. Using sets in Mosel
      4. Using lists in Mosel
      5. Using arrays in Mosel
      6. Using arrays with index sets
      7. Using records in Mosel
      8. Accessing problems and solution information
      9. Interrupting a running model using Ctrl-C
      10. Display model parameters/symbols
      11. Display dso module details
      12. I/O drivers
      13. Debugger API
      14. UG - Embedding examples from 'Mosel User Guide'
      15. Folio - Embedding examples from 'Getting Started'
      16. Performing simple statistics with solutions of several models runs
      17. Bi-directional data exchange between host application and Mosel model (using static modules or I/O drivers)
    8. Java Library examples
      1. Working with models and accessing dynamic libraries
      2. Using sets in Mosel
      3. Using lists in Mosel
      4. Using arrays with index sets
      5. Using records in Mosel
      6. Accessing problems and solution information
      7. Display model parameters/symbols
      8. Display dso module details
      9. IO drivers
      10. Debugger API
      11. UG - Embedding examples from 'Mosel User Guide'
      12. Folio - Examples from 'Getting Started'
    9. VB Library examples
      1. Launching Mosel from Excel using VBA
      2. Start/stopping Mosel from Excel and capturing output
      3. UG - Embedding examples from 'Mosel User Guide'
      4. Folio - Embedding examples from 'Getting Started'
    10. C#.NET Library examples
      1. Working with models and accessing dynamic libraries
      2. Using sets in Mosel
      3. Using arrays with index sets
      4. Accessing problems and solution information
      5. Display model parameters/symbols
      6. Display dso module details
      7. IO drivers
    11. VB.NET Library examples
      1. Working with models and accessing dynamic libraries
      2. Using sets in Mosel
      3. Using arrays with index sets
      4. Accessing problems and solution information
      5. Display model parameters/symbols
      6. Display dso module details
      7. IO drivers
    12. Writing modules
      1. Definition of constants of different types
      2. Definition of a procedure for getting solution values into an array
      3. Definition of complex numbers and operators to work with them
      4. Definition of type "task" and subroutines for accessing it
      5. Definition of type "date" and subroutines for accessing it
      6. Definition of three new types and operators to work with them
      7. Declaring a static module
      8. Using the 'zlib' library to provide IO driver 'compress' functionality
      9. Module implementing driver 'toC' to save the compilation result to a C file
      10. How best to debug a module
    13. Misc. ( looping over optimization runs, use of 'exists', parameters, debugging and profiling )
      1. Looping over optimization runs (within a model, batch executions, and multiple models/submodel
      2. Resetting different types of runtime parameters
      3. Runtime parameters: communicating with the Optimizer
      4. Parameters: tolerances
      5. Parameters: number printing format
      6. Using 'exists' for loops over sparse arrays
      7. Conditional creation of decision variables
      8. Using the model return value for error handling in applications
      9. Using the debugger and profiler
      10. Checking memory usage
    14. Puzzles and Recreational Mathematics
      1. Sudoku (CP model and XAD application)
      2. Futoshiki (CP and MIP models and XAD application)
      3. Fantasy OR: Sangraal (CP and MIP models)
      4. Fiveleaper (MIP model and graphics in IVE)
      5. Puzzles and pastimes from the book `Programmation Lineaire'
  3. Xpress-Optimizer examples
    1. Calling the library from C
      1. A DepthFirst Branching Algorithm
      2. Branching rule branching on the most violated Integer/Binary
      3. Apply a binary fixing heuristic to an unpresolved MIP problem
      4. Perform objective function parametrics on a global problem
      5. Perform RHS parametrics on a global problem
      6. Apply a primal heuristic to a knapsack problem
      7. Apply an integer fixing heuristic to a MIP problem
      8. Load LP directly into Optimizer and modify it by adding an extra constraint
      9. Show how to save/access a postsolved solution in memory
      10. Loading MIP solutions into the Optimizer
      11. Solve LP, displaying the initial and optimal tableau
      12. Modify problem: add an extra variable within an additional constraint.
    2. Calling the library from Java
      1. Demonstrates setting up and using callbacks
    3. Calling the library from VB
      1. VB versions for some of the C example set
    4. Calling the library from C#.NET
      1. Apply a binary fixing heuristic to an unpresolved MIP problem
      2. Apply a primal heuristic to a knapsack problem
      3. Load LP directly into Optimizer and modify it by adding an extra constraint
      4. Show how to save/access a postsolved solution in memory
      5. User branching with branching callbacks
    5. Calling the library from VB.NET
      1. Apply a binary fixing heuristic to an unpresolved MIP problem
      2. Apply a primal heuristic to a knapsack problem
      3. Load LP directly into Optimizer and modify it by adding an extra constraint
      4. Show how to save/access a postsolved solution in memory
      5. User branching with branching callbacks
    6. Calling the library from Salford Fortran
      1. Apply a binary fixing heuristic to an unpresolved MIP problem
      2. Load LP directly into Optimizer and modify it by adding an extra constraint
      3. Apply an integer fixing heuristic to a MIP problem
      4. Modify problem: add an extra variable within an additional constraint.
      5. Calling Xpress-MP from a Fortran90 module.
  4. Xpress-IVE examples
    1. Graphing examples
      1. Displays a fractal tree by drawing two branches recursively
      2. Draws a triangle-shaped fractal using recursivity
      3. Plots parametrics on the reserve capacity
      4. Shows three possible ways of drawing a graph
      5. Simulates a Gantt chart by using arrows and labels
      6. Draws the minimum spanning tree for arbitrarily large set of random points
      7. Draws supply routes
      8. Enhanced TSP example shows the intermediary and final routes
  5. Xpress-SLP examples
    1. Modeling
      1. Basic Polygon model
      2. Polygon with Mosel single-valued user function
      3. Polygon with Mosel multi-valued user function
      4. Polygon, with Excel spreadsheet function
      5. Polygon, with Excel macro function
      6. Polygon, with Excel macro multi-valued function
    2. C library examples
      1. Basic Polygon model
      2. Basic ploygon model but using XSLPccoef() to load coefficient structures
      3. Polygon with initial values
      4. Polygon, with internal C user function
      5. Polygon, with internal C user function and XV
      6. Polygon, with C user function in a DLL and XV
    3. VB
      1. Basic Polygon model
      2. Polygon with initial values
      3. Polygon, with internal VB user function
      4. Polygon, with internal VB user function and XV
    4. COM
      1. User defined function in COM object
    5. Fortran
      1. Polygon1
    6. Console
      1. Demo
      2. Integer
  6. Xpress-Application Developer
    1. XAD Examples
      1. Simple dialog with text box
      2. Interaction with a checkbox
      3. The canvas object
      4. Drag and drop with mouse events
      5. Interaction between UI objects
      6. Multilist and editor objects
      7. Professional example
      8. GUI with optimization
      9. Interactive bin packing example
      10. Progress bar
      11. Interactive facility location problem
      12. Portfolio optimization
      13. Enhanced interactive TSP example with route animation
  7. Xpress-Kalis
    1. Xpress-Kalis features
      1. Generic binary constraints.
      2. All-different constraint: solving an assignment problem
      3. 'abs' and 'distance' constraints.
      4. 'distribute' and 'occurrence' constraints
      5. One- and two-dimensional 'element' constraints.
      6. Implication and equivalence constraints.
      7. Conjunctions and disjunctions (logical 'and' and 'or').
      8. 'cycle' constraint: formulating a TSP problem.
      9. 'cumulative' and 'disjunctive' constraints for scheduling and planning problems.
      10. 'producer_consumer' constraints: solving a resource-constrained project scheduling problem.
      11. Minimum and maximum constraints.
      12. Defining, posting and propagating linear constraints.
      13. Non-linear constraints over real-valued decision variables
      14. Branching strategies
      15. Use of callbacks to output the search tree
    2. Xpress-Kalis User Guide examples
      1. Introductory example: scheduling meetings
      2. Basic modeling tasks: data input, optimization, enumeration
      3. Production of cane sugar
      4. Sequencing jobs on a bottleneck machine
      5. Planning of paint production
      6. Euler knight tour problem
      7. Frequency assignment problem
      8. Choice of locations for income tax offices
      9. Constraint handling
      10. Non-linear constraints
      11. Personnel planning problem
      12. Sudoku puzzle: retrieving status information through parameters
      13. Assigning workers to machines: heuristics and user-defined search
      14. Construction of a stadium: project planning
      15. Backing up files: scheduling with cumulative resource constraints
      16. Job-shop scheduling
      17. Renewable and non-renewable resources
    3. Xpress-Kalis application examples
      1. Project scheduling problem with disjunctive resource constraints
      2. Solving the classical job-shop scheduling problem
      3. Frequency Assignment Problem with Polarity
  8. Xpress-NonLinear examples
    1. Modeling nonlinear problems with Mosel
      1. Locate airport while minimizing average distance
      2. Maximise discount at a bookstore
      3. NonLinear objective with integer decision variables
      4. Polygon construction under constraints
      5. NonLinear objective with integer decision variables
      6. Moon landing
      7. Minimum surface between boundaries
      8. Static load balancing in a computer network
      9. Portfolio optimization
      10. Locating electron on a conducting sphere
      11. Trafic equilibrium
      12. Determine chain shape
      13. Facility location
      14. Approximation of a function
      15. Modeling hand glider trajectory
    2. NonLinear problems from the NLP User's guide
      1. Demonstrating the effects of convexity
      2. Demonstrating the cost of numerical derivatives
      3. Demonstrating the presence of locally optimal solutions, and the role of initial points
      4. example for dual multipliers for non-linear problems
      5. Demonstrating non-connected feasible regions and initial points
      6. Demonstrating the need for penalty feasiblity breakers
      7. Demonstrating the role of multipliers
      8. demonstrates the solver sensitibility to errors introduced by numerical derivatives
      9. Demonstrating the type of solutions returned by solvers
      10. Demonstrating behaviour of problems with unbounded first order approximations
      11. Demonstrating local optimality and the role of placeholders
    3. Calling the library from C
      1. Polygon