Sample models and notebooks for Decision Optimization

Several examples are presented in this documentation as tutorials and many samples are provided for IBM Cloud Pak for Data.

Decision Optimization GitHub DO-samples

See Decision Optimization GitHub for a repository of samples for use with IBM Cloud Pak for Data. For Decision Optimization experiment UI samples, see the following section Decision Optimization experiment UI samples. This repository also contains Jupyter notebook samples that can be imported into Cloud Pak for Data. See Jupyter notebooks.

Examples described in this documentation

The following table lists example models that are described in this documentation, and that show you how to use Decision Optimization.

Table 1. Decision Optimization documentation examples
  Examples

Learn how to ...

See

Create scheduling models by using the Modeling Assistant

House Construction example

  • Create, edit, and solve a planning and scheduling model with the Modeling Assistant
  • Create and examine different scenarios

Solving a model using the Modeling Assistant

Create Python optimization models by using the Decision Optimization experiment UI

Diet example

  • Create and solve a Python model that is generated from an existing scenario
  • Create and examine a new scenario

Solving a Python DOcplex model

Multiple scenarios example

  • Create a Python model from a Python notebook imported into Decision Optimization and solve it
  • Generate multiple scenarios from a Python notebook by using randomized data

Working with multiple scenarios

Create or import DOcplex Python notebooks

Decision Optimization notebook examples

  • Download a notebook and add it to a project
  • Run a notebook

Running Decision Optimization notebooks

Decision Optimization experiment samples (Modeling Assistant, Python, OPL)

The following table lists the Decision Optimization samples that are provided in DO-samples in the Decision Optimization GitHub. All these assets use the Decision Optimization experiment UI and contain data.

Note: To create and run Optimization models, you must associate a deployment space with your experiment. This space can be created or selected when you first create a new Decision Optimization experiment: click Create a deployment space, enter a name for your deployment space, and click Create. For existing models, you can also create or select a space in the Overview information pane.
To use these samples:
  1. Download and extract all the DO-samples on to your computer. You can also download just the one sample, but in this case, do not extract it.
  2. Create a project in IBM Cloud Pak for Data. Select Create an empty project, enter a project name, and click Create.
  3. On the Assets tab of your project, click New asset.
  4. Select Decision Optimization experiment in the Graphical builders section.
  5. Click From file >Add file in the New Decision Optimization experiment window that opens.
  6. Browse to the Model_Builder folder in your downloaded DO-samples. Select the relevant product and version subfolder. Choose your sample .zip file and click Open. Alternatively drag the sample into the window.
  7. Choose a deployment space from the drop-down menu (or create one) and click Create.
  8. Click Create.

    A Decision Optimization model is created with the same name as the sample.

Table 2. Decision Optimization Models
Models for Decision Optimization Problem type Model type
BridgeScheduling Scheduling Modeling Assistant
Diet Blending Python
DietLP Blending LP (CPLEX)
EnvironmentAndExtension Using an environment with an extension that contains a library file and YAML code. Python
HouseConstructionScheduling Scheduling with assignment Modeling Assistant
MarketingCampaignAssignment Resource Assignment (Scenarios 1 - 4)

Selection and Allocation (Scenario 4 - Selection)

Modeling Assistant
Multifiles Using a model with multiple files. Python and LP
PastaProduction Production OPL
PortfolioAllocation Selection & Allocation Modeling Assistant
ShiftAssignment Resource Assignment with custom decisions and a custom constraint Modeling Assistant
StaffPlanning Multi-Scenario Planning

(to be used with CopyAndSolveScenarios.ipynb)

Python
SupplyDemandPlanning Supply & Demand Planning Modeling Assistant
TalentCPO Movie scheduling CPO (CP Optimizer)

Jupyter notebook samples

Jupyter notebooks are also provided in the Decision Optimization GitHub that do not use the experiment UI. To use these Python notebook samples :
  1. Download and extract all the DO-samples on to your computer. You can also download just one sample.
  2. Create a project in IBM Cloud Pak for Data.
  3. On the Assets tab of your project, click New asset.
  4. Select Jupyter notebook editor in the Code editors section.
  5. Select the From file tab in the New Notebook pane that opens.
  6. Name your notebook, click Drag and drop files or upload and browse to the notebook in the jupyter folder. Select the relevant product and version subfolder in your downloaded DO-samples.
  7. Click Create. The notebook is added to your project.