Where to find the CP examples

Describes where, in the CPLEX Studio distribution, to find the OPL examples illustrating the use of constraint programming.

Note:

The examples used in this documentation are designed to illustrate the features of the product. They should not be viewed as recommended methods or approaches for these problems.

All examples of OPL CP models are in

<Install_dir>/opl/examples/opl

Within that directory, the names of examples that demonstrate aspects of CP scheduling are all prefixed with sched_.

More CP optimization problems expressed as OPL models are available in

<Install_dir>/opl/examples/opl/models

and described in OPL model library.

The following table presents an overview of the constraint programming examples.

  • The Problem column lists the types of problems.

  • The Features column points out interesting CP features or issues that OPL, as a modeling language, addresses in these examples.

  • The Project Location column indicates the directory that contains the corresponding project, model, and data files.

  • The Model Name column provides direct links to the model files displayed in HTML format.

Table 1. Constraint programming and CP scheduling examples
Problem Features Project Location Model Name
Using OPL CP Problems How to develop, run and debug OPL CP models in the CPLEX Studio IDE examples/opl/color color.mod
Syntax Examples

Float expressions;

Element constraint syntax

examples/opl/euler

examples/opl/floatexpr

examples/opl/quadassign

examples/opl/talent

euler.mod

floatexpr.mod

quadassign.mod

talent.mod

Search Examples Use of CP parameters, predefined search phases examples/opl/vellino

vellino.mod

vellinochooseBin.mod

vellinocommon.mod

vellinogenBin.mod

Combinatorial Examples Sample uses of CP to solve common real world problems

examples/opl/models/Car

examples/opl/config

examples/opl/PPP

examples/opl/sports

examples/opl/steelmill

examples/opl/teambuilding

examples/opl/timetabling

carseq.mod

config.mod

PPP.mod

sports.mod

steelmill.mod

teambuilding.mod

timetabling.mod

Scheduling Examples Sample uses of CP to solve scheduling problems

examples/opl/sched_alloc

examples/opl/sched_bridge

examples/opl/sched_bridgebr

examples/opl/sched_calendar

examples/opl/sched_cumul

examples/opl/sched_flowshop

examples/opl/sched_intro

examples/opl/sched_jobshop

examples/opl/sched_jobshopflex

examples/opl/sched_learning_effect

examples/opl/sched_openshop

examples/opl/sched_optional

examples/opl/sched_pflowshop

examples/opl/sched_rcpsp

examples/opl/sched_rcpspmm

examples/opl/sched_sequence

examples/opl/sched_setup

examples/opl/sched_shipload

examples/opl/sched_square

examples/opl/sched_state

examples/opl/sched_tcost

examples/opl/sched_time

examples/opl/sched_trolley1

examples/opl/sched_trolley2

sched_alloc.mod

sched_bridge.mod

sched_bridgebr.mod

sched_calendar.mod

sched_cumul.mod

sched_flowshop.mod

sched_intro.mod

sched_jobshop.mod

sched_jobshopflex.mod

sched_learning_effect.mod

sched_openshop.mod

sched_optional.mod

sched_pflowshop.mod

sched_rcpsp.mod

sched_rcpspmm.mod

sched_sequence.mod

sched_setup.mod

sched_shipload.mod

sched_square.mod

sched_state.mod

sched_tcost.mod

sched_time.mod

sched_trolley1.mod

sched_trolley2.mod

The following table contains a synoptic view in which the CP examples are sorted by type. Each table entry provides a link to a description of each type of problem.