FICO Xpress Optimization Examples Repository
 FICO Optimization Community FICO Xpress Optimization Home

Hybrid MIP-CP problem solving: sequential solving

Description
The idea of this example is to use a Constraint Programming (CP) model to preprocess data for an LP problem. The constraint propagation performed by the CP solver tightens the bounds on certain decision variables.
• solving a sequence of CP subproblems
• data exchange between several models via shared memory
Further explanation of this example: Xpress Whitepaper 'Hybrid MIP/CP solving', Section 'Using CP propagation as preprocessor'. The example problem, namely planning the construction of a stadium, is described in the book 'Applications of optimization with Xpress-MP'.

Source Files
By clicking on a file name, a preview is opened at the bottom of this page.

Data Files

(!****************************************************************
CP example problems
===================


(See "Applications of optimization with Xpress-MP",
Section 7.1 Construction of a stadium)

(c) 2008 Fair Isaac Corporation
author: S. Heipcke, March 2005, rev. Dec. 2010
*****************************************************************!)
uses "kalis"

declarations
N = 19                              ! Number of tasks in the project
! (last = fictitious end task)
ARC: dynamic array(range,range) of integer  ! Matrix of the adjacency graph
HORIZON : integer                   ! Time horizon

bestend: integer
end-declarations

DUR ARC
end-initializations

0 <= start(j); start(j) <= HORIZON
end-do

forall(i, j in TASKS | exists(ARC(i, j))) do
Prec(i,j):= start(i) + DUR(i) <= start(j)
if not cp_post(Prec(i,j)) then
writeln("Posting precedence ", i, "-", j, " failed")
exit(1)
end-if
end-do

! Since there are no side-constraints, the earliest possible completion
! time is the earliest start of the fictitiuous task N
bestend:= getlb(start(N))
start(N) <= bestend
writeln("Earliest possible completion time: ", bestend)

! For tasks on the critical path the start/completion times have been fixed
! by setting the bound on the last task. For all other tasks the range of
! possible start/completion times gets displayed.
forall(j in TASKS) writeln(j, ": ", start(j))

end-model

`