Blending problems

Describes examples in the CPLEX Studio distribution that involve blending several resources or materials to create other products corresponding to a demand.

Blending problems are a typical application of mixed integer-linear programming (MILP). They involve blending several resources or materials to create one or more products corresponding to a demand.

Mixed integer-linear programs are linear programs in which some variables are required to take integer values.

Such programs are solved using the same technology as integer programs. A branch-and-bound algorithm can exploit the linear relaxation; its branching procedure is applied only to the integer variables.

This section contains information on the following distributed examples:

A metal blending example

The metal blending example involves mixing some metals to form an alloy. The metal may come from several sources: in pure form, from raw materials, as scraps from previous mixes, or as ingots. The alloy must contain certain amounts of the various metals, as expressed by a production constraint specifying lower and upper bounds for the quantity of each metal in the alloy. Each source has a cost and the problem consists of blending from the sources while minimizing the cost and satisfying the production constraint. Similar problems arise in other domains, for example, the oil, paint, and food-processing industries.

To access this example, go to examples/opl/blending.

See also A blending problem in the Language User’s Manual.

Oil blending examples

An oil company manufactures different types of gasoline by blending different types of crude oil. Each type of gasoline must satisfy quality criteria with respect to its lead content and octane rating. The company must satisfy customer demand for each blend. It can purchase each type of crude oil outside or process it inside, with associated costs. The company has the option of advertising a type of gasoline, in which case the demand for this type increases in proportion to the amount spent. The problem consists of minimizing costs while satisfying demand and applying appropriate advertising.

The examples are:

  • The basic oil model: examples/opl/oil. This is accessed through the run configuration Default Configuration.

  • The oil project modified to demonstrate how to get data from and publish results to a spreadsheet: examples/opl/oil/oilSheet.mod. This is accessed through the run configuration Data from spreadsheet.

    See Spreadsheet Input/Output in the Language Reference Manual and The oil sheet example in IDE Tutorials.

A food blending example

The problem is to plan the blending of five kinds of oil, organized in two categories (two kinds of vegetable oils and three kinds of non vegetable oils) into batches of blended products over six months.

Some of the oil is already available in storage. There is an initial stock of oil of 500 tons of each raw type when planning begins. An equal stock should exist in storage at the end of the plan. Up to 1000 tons of each type of raw oil can be stored each month for later use. The price for storage of raw oils is 5 monetary units per ton. Refined oil cannot be stored. The blended product cannot be stored either.

The rest of the oil (that is, any not available in storage) must be bought in quantities to meet the blending requirements. The price of each kind of oil varies over the six-month period. The two categories of oil cannot be refined on the same production line.

There is a limit on how much oil of each category (vegetable or non vegetable) can be refined in a given month:

  • Not more than 200 tons of vegetable oil can be refined per month.

  • Not more than 250 tons of non vegetable oil can be refined per month.

There are constraints on the blending of oils:

  • The product cannot blend more than three oils.

  • When a given type of oil is blended into the product, at least 20 tons of that type must be used.

  • If either vegetable oil 1 (v1) or vegetable oil 2 (v2) is blended in the product, then non vegetable oil 3 (o3) must also be blended in that product.

The final product (refined and blended) sells for a known price: 150 monetary units per ton.

The aim of the six-month plan is to minimize production and storage costs while maximizing profit.

To access this example, go to: examples/opl/foodmanufact.

See also Tutorial: Using CPLEX logical constraints in the Language User’s Manual.