Zoo, Bus and Kids with the Modeling Assistant

AlainChabrier
2 min readFeb 9, 2021

--

The Zoo, Bus and Kids problem has been proposed by Alex Fleischer as a didactical example to illustrate the type of problems Decision Optimization can be used for.

300 kids need to travel to the London zoo. The school may rent 40 seats and 30 seats buses for $500 and $400 . How many buses of each size do you use to minimize cost?

He also used it to explain how models need to be formulated before an optimization engine can optimize them.

Example of OPL and Python / docplex formulations

Formulating Decision Optimization models requires to identify what are the decision variables, the objectives and the constraints. Objectives and constraints need to be expressed using some mathematical formulations. Even if these are most times simple formulas representing real life values, the need to understand how to formulate them and the time to learn the OPL language or docplex API may appears as a bottleneck.

In Cloud Pak for Data, Decision Optimization models can also be created using a Modeling Assistant available in the DO Experiment UI.

Starting from the following data, an optimization model can be created in a few minutes and without any particular optimization modeling skills.

id,seats,cost
"bus30",30,400
"bus40",40,500

The Modeling Assistant requires a particular domain to be selected for which some ontologies are defining the most common decision variables, constraints and objectives. User can map the domain concept to the data elements and start configuring the constraints and objectives using natural language.

See the end to end process from data to working model in the following video.

You might also look at this introduction to DO Experiment (previously known as model builder).

The resulting model is as simple as:

Select and allocate busObjectivesMinimize total cost of bus over all allocations Constraints(Implicit rule) Synchronize selection with bus allocations
total seats of bus over all allocations is greater than or equal to 300
All bus allocations must be integer
Final model

For more stories about AI and DO, follow me on Medium, Twitter or LinkedIn.

--

--

AlainChabrier

Former Decision Optimization Senior Technical Staff Member at IBM Opinions are my own and I do not work for any company anymore.