The dilemma of choice according to operational research theory. The case of the sale of bakery equipment

November 2021 | Przegląd Piekarski i Cukierniczy (Baking and Confectionery Review)

Data scientist in the bakery. The problem of choice according to operational research theory. The case of the sale of bakery equipment

Every person several times a day faces the dilemma of what to choose. Let us assume that we have to buy butter. We have a choice of three different kinds, at different prices. Let us call the sticks of butter: x₁, x₂, x₃. If we decide to buy one of the products, e.g. stick x₁, then the number of sticks of butter bought will be equal to one.

Mathematically we can write this as:

x₁ = 1, we bought 1 stick of butter 1
x₂ = 0, we bought 0 sticks of butter 2
x₃ = 0, we bought 0 sticks of butter 3.

Since we want to buy one stick of butter out of the three available, the choice equation will have the form below (1),

x₁ + x₂ + x₃ = 1  (1)

W-MOSZCZYNSKI ppic 11-21

We always take a decision on the basis of some criterion. In this case we take the decision on the basis of price. We want to choose the butter which has the lowest price. In such a case the objective function of our purchase will have the form of equation (2).

F(x₁,x₂,x₃) = 4.9x₁ + 5.2x₂ + 5.9x₃ → min  (2)

where:
the price of stick x₁ is 4.9 zł,
the price of stick x₂ is 5.2 zł,
the price of stick x₃ is 5.9 zł.

One also has to introduce sign constraints — one cannot buy less butter than zero, and no more than one. The quantity of purchases must be expressed as a real number. This can be written as the limiting condition (3).

x₁ = 1 or x₁ = 0
x₂ = 1 or x₂ = 0  (3)
x₃ = 1 or x₃ = 0

In this way, by creating equations and inequalities (1), (2) and (3), we have built an operational programming task.

The pre-sale of bakery machinery

A certain large bakery, as part of a modernisation process, decided to sell several machines, at a reduced price, to friendly cooperating partners and employees. It defined the price ranges at which it wanted to sell the equipment. Because of the bargain form of the sale, it was assumed that each bidder could buy one machine. Seven bidders applied, and each presented their prices.

The whole undertaking was entrusted to the accountant, who was to earn 10% of the value of the sale on the operation. He was therefore interested in selling the assets at the highest possible price. He decided to optimise the process so as to earn more.

Table 1. Price proposals for the purchase of machines

Offers Oven Exchanger Planetary mixer Spiral mixer Krajalnica (slicing machine)
Piekarnia Szamoty 19.0 th. zł 6.6 th. zł 2.3 th. zł 9.2 th. zł 5.0 th. zł
Piekarnia Morsk 17.3 th. zł 7.2 th. zł 2.1 th. zł 8.9 th. zł 5.1 th. zł
Pracownik 1 18.3 th. zł 7.8 th. zł 2.8 th. zł 8.5 th. zł 5.7 th. zł
Pracownik 2 18.1 th. zł 7.4 th. zł 2.4 th. zł 8.1 th. zł 4.8 th. zł
Piekarnia Krystyna 18.6 th. zł 8.6 th. zł 2.6 th. zł 8.9 th. zł 5.9 th. zł
Szkoła piekarnicza 18.0 th. zł 8.2 th. zł 3.1 th. zł 7.9 th. zł 5.6 th. zł
Piekarnia Falenty 19.3 th. zł 8.2 th. zł 3.5 th. zł 9.4 th. zł 6.7 th. zł

The prices proposed by the cooperating partners did not differ much from one another. The highest price for the planetary mixer (3.5 thousand zł) was to be paid by Piekarnia Falenty, and the lowest — Piekarnia Morsk (2.1 thousand zł). The difference between the lowest and the highest price therefore amounts to 1400 zł. However, Falenty also wanted to buy the oven at the highest price. If Falenty were to buy the mixer, they could not buy the oven. And after all, there are other pieces of equipment for which Falenty also wanted to pay the highest price. This is precisely the dilemma of choice. The goal is to configure the sale in such a way as to earn the most.

Formulating the constraining equations

Above all we have to write down that each contractor may buy only one piece of equipment. That is, the sum of the machines acquired by them must amount to 1. Equations (4–10) describe this condition mathematically. In the equations below, for example, x₁₄ denotes the purchase by Piekarnia Szamoty (the one denotes the first row in the table) of the spiral mixer (the four denotes the fourth column in Table 1). If x₁₄ = 0, this means that Piekarnia Szamoty will not buy the mixer, whereas when x₁₄ = 1, this means that the bakery makes the purchase.

x₁₁+x₁₂+x₁₃+x₁₄+x₁₅+x₁₆+x₁₇=1  (4)
x₂₁+x₂₂+x₂₃+x₂₄+x₂₅+x₂₆+x₂₇=1  (5)
x₃₁+x₃₂+x₃₃+x₃₄+x₃₅+x₃₆+x₃₇=1  (6)
x₄₁+x₄₂+x₄₃+x₄₄+x₄₅+x₄₆+x₄₇=1  (7)
x₅₁+x₅₂+x₅₃+x₅₄+x₅₅+x₅₆+x₅₇=1  (8)
x₆₁+x₆₂+x₆₃+x₆₄+x₆₅+x₆₆+x₆₇=1  (9)
x₇₁+x₇₂+x₇₃+x₇₄+x₇₅+x₇₆+x₇₇=1  (10)

One also has to take into account that a machine can be sold only once, which can be written as:

x₁₁+x₂₁+x₃₁+x₄₁+x₅₁+x₆₁+x₇₁≤1  (11)
x₁₂+x₂₂+x₃₂+x₄₂+x₅₂+x₆₂+x₇₂≤1  (12)
x₁₃+x₂₃+x₃₃+x₄₃+x₅₃+x₆₃+x₇₃≤1  (13)
x₁₄+x₂₄+x₃₄+x₄₄+x₅₄+x₆₄+x₇₄≤1  (14)
x₁₅+x₂₅+x₃₅+x₄₅+x₅₅+x₆₅+x₇₅≤1  (15)
x₁₆+x₂₆+x₃₆+x₄₆+x₅₆+x₆₆+x₇₆≤1  (16)
x₁₇+x₂₇+x₃₇+x₄₇+x₅₇+x₆₇+x₇₇≤1  (17)

For example, x₅₃ = 1 means that Piekarnia Krystyna (row 5) bought the planetary mixer (column 3).

These laboriously written-out formulas can be written as a simple formula, in which I is the set of equipment and J is the set of contractors.

1 ≥ Σⱼ xᵢⱼ ≥ 0 … ∀i ∈ I, j ∈ J
xᵢⱼ ∈ Z⁺ … ∀i ∈ I, j ∈ J

In the equations more columns appeared than are recorded in Table 1. In formulating the constraining equations and the objective function equation it is essential to maintain the condition that the number of contractors and the number of pieces of equipment should be the same. So x₆₇ = 1 means that the bakery school (row 6 in the table) buys equipment 7 — that is, something which does not exist, that is, it will buy nothing.

The objective function

It must be admitted that formulating equations (4–17) was very simple. Unfortunately, writing down the objective function in the choice problem is much more difficult.

F(xᵢⱼ) = (19.0 × x₁₁) + (6.6 × x₁₂) + (2.3 × x₁₃) + (9.2 × x₁₄) + (5.0 × x₁₅) + (0 × x₁₆) + (0 × x₁₇)
+ (17.3 × x₂₁) + (7.2 × x₂₂) + (2.1 × x₂₃) + (8.9 × x₂₄) + (5.1 × x₂₅) + (0 × x₂₆) + (0 × x₂₇)
+ (18.3 × x₃₁) + (7.8 × x₃₂) + (2.8 × x₃₃) + (8.5 × x₃₄) + (5.7 × x₃₅) + (0 × x₃₆) + (0 × x₃₇)
+ (18.1 × x₄₁) + (7.4 × x₄₂) + (2.4 × x₄₃) + (8.1 × x₄₄) + (4.8 × x₄₅) + (0 × x₄₆) + (0 × x₄₇)
+ (18.6 × x₅₁) + (8.6 × x₅₂) + (2.6 × x₅₃) + (8.9 × x₅₄) + (5.9 × x₅₅) + (0 × x₅₆) + (0 × x₅₇)
+ (18.0 × x₆₁) + (8.2 × x₆₂) + (3.1 × x₆₃) + (7.9 × x₆₄) + (5.6 × x₆₅) + (0 × x₆₆) + (0 × x₆₇)
+ (19.3 × x₇₁) + (8.2 × x₇₂) + (3.5 × x₇₃) + (9.4 × x₇₄) + (6.7 × x₇₅) + (0 × x₇₆) + (0 × x₇₇) → max  (18)

The numbers in the objective function are the prices proposed by the contractors. So, for example, the value (19.0 × x₁₁) means that Piekarnia Szamoty will buy the oven for the sum of 19 thousand zł.

This extremely labour-intensive formula for the objective function (18) can easily be replaced by a simple formulation, where c denotes the price offered, and x denotes a transaction of value 0 or 1.

Σᵢ∈I,ⱼ∈J (cᵢⱼ × xᵢⱼ) → min

The result of the algorithm

In order to obtain the result of the algorithm, one has to enter into the simplex calculator the objective function (18) and the constraining equations (4–17). One must also not forget about the sign constraints. The number of pieces of equipment purchased may amount only to 1 or 0. Simplex calculators are available online on the internet. In this case we have a large number of formulas to enter. Fortunately this is the only difficulty in obtaining the answer. The table below shows the optimal solution of the task.

Table 2. The result of the competition for the purchase of machines

Offers Oven Exchanger Planetary mixer Spiral mixer Krajalnica
Piekarnia Szamoty 9.2 th. zł
Piekarnia Morsk
Pracownik 1 5.7 th. zł
Pracownik 2
Piekarnia Krystyna 8.6 th. zł
Szkoła piekarnicza 3.1 th. zł
Piekarnia Falenty 19.3 th. zł

Piekarnia Morsk and Pracownik 2 did not win any of the pieces of equipment in this configuration.

The total revenue from the sale of the equipment amounted to 45,900 zł, of which the accountant earned 459 zł. What would have happened if the accountant had indicated the companies which gave the highest prices for the equipment? Preliminary estimates indicate that, depending on the order of sale, the bakery would always have obtained lower revenues — from 400 to as much as 700 zł.

Wojciech Moszczyński
(in collaboration with Ewa Moszczyńska)

Wojciech Moszczyński — graduate of the Department of Econometrics and Statistics of Nicolaus Copernicus University in Toruń; specialist in econometrics, finance, data science, and management accounting. He specializes in the optimization of production and logistics processes. He conducts research in the area of the development and application of artificial intelligence. For years he has been engaged in the popularization of machine learning and data science in business environments.

Bądź pierwszy, który skomentuje ten wpis!

Dodaj komentarz

Twój adres email nie zostanie opublikowany.


*