How to Optimize a Bakery?

Imagine the following situation: a bakery owner must deliver bread to 62 nearby shops using four vehicles. Every shop has different delivery conditions and has ordered a different quantity and type of assortment.

The cost of deliveries depends on how we designate the route. Let us assume that the maximum cost of fuel and the drivers’ work is PLN 500 and the minimum is PLN 250. The difference is PLN 250 per day over 300 days of the year. By planning vehicle routes well, we can save PLN 75,000 annually.

W-MOSZCZYNSKI-2021-4-43

How do we know the maximum and minimum cost of the daily routes?

Every shop has a different assortment and quantity of ordered products. The sum of the orders translates into the production plan. A bakery, like every plant, has certain known limitations in the area of production capacity. These include the daily working time of people and machines, machine efficiency, the quantities of raw materials and, finally, demand in the market that we supply.

Regardless of whether we produce profitable or unprofitable products, we consume the same limited economic resources in means of production and working time. Some products are manufactured at a loss. Other products with low profitability could be replaced with more profitable ones. How profitable the bakery will be depends on the structure of the assortment produced. If we can save PLN 75,000 annually on delivery logistics alone, how much more can we save by optimizing the production structure or product prices?

But how can we determine the bakery’s maximum daily profit? To answer this question, an innumerable number of scenarios and structures must be calculated. In practice, this cannot be calculated with a traditional spreadsheet.

An analysis may concern selected areas and may also have different levels of detail. The production of every individual product can be organized in various ways. There are many factors on which production cost depends. How often do we order raw materials? Is it worthwhile to build deep-freeze cold stores, or should dough be made every day? How should the assortment be planned in order to minimize raw-material costs? These are the numerous dilemmas faced by a bakery owner.

With specified labor resources, means of production and a specified market at their disposal, a bakery owner can theoretically organize the bakery in such a way that it generates the maximum profit possible. On the other hand, using conventional methods, achieving even the smallest optimization is practically impossible.

How, then, should the plant and its logistics and production spheres be optimized? How can we find out whether product prices have been set perfectly—that is, in the best possible way?

Is it possible to organize a bakery’s work optimally?

This is the point at which pieces of golden advice should appear: more profitable products should be manufactured, or routes should be designated in such a way that fuel consumption is as low as possible. Such advice is easy to give and more difficult to implement in practice. If we claim that more profitable products should be produced, we must realize that low profitability may result from poor production organization or simply from a price that is too low. Increasing the price, in turn, may reduce sales volume, causing production costs to rise. Every action produces an interaction that is difficult to predict within the complex organism of the enterprise. We could continue such academic considerations for a long time; all of this leads to the conclusion that the mutual relationships and conditions are too complicated for an ordinary manager. Even if someone succeeded in gathering all of this into a single whole, they would be unable to calculate the optimal production, logistics and sales settings.

Unfortunately, this conclusion is true. Organizing a complex enterprise such as a bakery is very difficult. In practice, the organization of a bakery’s work is built slowly through evolution. A new assortment is introduced and added to the production plan. New retail outlets appear and are added to the drivers’ route. Sometimes we modify something. Bakery work is too labor-intensive; there is no time to design production and logistics processes. If we change something in the intricate arrangement, an unpredictable event may occur: something may become blocked or fall apart. It is better not to touch anything. The evolutionary manner in which a bakery develops is usually very stable.

Unfortunately, the thing about evolution is that some species become extinct because they prove insufficiently adapted to the conditions in which they have come to exist. The same applies to bakeries.

There is, however, one difference: organisms cannot modify themselves genetically. Although bakeries were shaped in an evolutionary manner, at a certain point in their existence they can modify themselves.

In other words, a lumbering mammoth can turn into a predatory fox. Interestingly, such a transformation does not require any financial expenditure.

How should a bakery be modified?

An old saying asks: How do you eat a whale all at once? A whale cannot be eaten all at once. A whale has to be eaten one piece at a time.

The same applies to restructuring. A rapid, traditional restructuring can be carried out—expensive and stressful—but its outcome will be crude and impractical. Rapid restructuring of this kind is referred to as “restructuring by the chainsaw method.” In my opinion, this is quite an accurate expression. Restructuring of this kind consists in cutting away large portions of unprofitable assets and selling them off at scrap value. It is the annihilation of unprofitable types of activity. It is the sell-off of slow-moving current assets or the cutting away of large sales areas that do not display the expected profitability. In the short term, a mammoth slimmed down in this way can continue to exist, but it will never become a predatory Arctic fox.

The first step in optimization is to cut the whale into smaller pieces—that is, to separate out areas for optimization. Every area of activity requires a separate approach. Let us assume that we have decided to rebuild the delivery system. We must answer the question of what our objective is. We can minimize the risk of an accident, costs or delivery time. We can also try to maximize something, such as punctuality. Quite simply, we must have an optimization objective. We must formulate an objective function.

George Dantzig’s linear programming

Although it appears improbable and sounds like heresy, the approach of selecting an optimization objective and formulating an objective function was first proposed only in 1947, by George Dantzig—an analyst with the United States Air Force. Earlier researchers did not propose an optimization objective because they lacked the ability to calculate an algorithm that would be an objective function.1

How is this possible?

Let us assume that we have 40 retail outlets to which bread must be delivered—that is, we have one equation with forty unknowns. We should minimize this function, meaning that we should organize deliveries so that costs are minimal. Classical mathematics cannot solve such an equation. According to the theory taught in primary school, the number of unknowns must equal the number of equations. Here, we have one equation containing 40 unknowns.

Dantzig proposed a graphical method that made it possible to find extrema by excluding regions. This method created the possibility of calculating an objective function.

The American press reported: “Dantzig’s idea was to develop a mathematical model that would encompass all the variables of any production, planning or distribution scenario. With all the relevant data in place, the linear program calculates the most efficient and least expensive way of achieving the desired objective.”2 Dantzig’s method quickly found applications in industry. At the beginning of the 1950s, oil companies began using it on a large scale. As Dantzig explained to Computerworld: “They started with a simple problem: how to blend gasoline to obtain the appropriate flash point, appropriate viscosity and appropriate octane number, and attempted to do so in the least expensive way possible.”

This was the first commercial application of Dantzig’s method, now known as linear programming.

1 “Linear Programming,” George B. Dantzig, Department of Management Science and Engineering, Stanford University, Stanford, California 94305-4023.

2 “George Dantzig, 90; Created Linear Programming,” Los Angeles Times, 22 May 2005.

What is linear programming?

Linear programming is a subtle and considerably more effective alternative to restructuring carried out using the “chainsaw method.” Rapid restructuring is effective provided that investment expenditure follows it. A brutally slimmed-down company needs investment in order to survive the traumatic treatment. Not every bakery can afford such a luxury.

At the present stage in the development of management science, effective optimization cannot be carried out without applying Dantzig’s method.

For example, suppose that we want to assign 35 people optimally to 35 positions in a confectionery retail chain. Every employee and every shop has only one decision characteristic, such as a working-hours limit. In practice, such an assignment is made ad hoc—that is, spontaneously and “by eye.” In this way, we never arrive at the optimal value. We proceed suboptimally, meaning with an error that, over the course of a year, may prove to be a large amount of lost benefits.

If we wanted to arrive at the ideal assignment of employees to shops, regardless of the objective of that optimization, we would have to use Excel to check 1,225 solutions (35 times 35).

We would therefore have to spend several days at the computer, and that is with just one decision characteristic. What if we then added other characteristics, such as the distance between an employee’s home and workplace, psychological preferences in matching staff to individual shops, and days excluded from work for particular people? In this situation, even the latest classification and regression tools from machine learning, or neural networks from deep learning, are powerless.

Linear programming, meanwhile, solves this problem within a few minutes.

Why is linear programming not widely used?

Most universities of economics include practical exercises in linear-programming methods in their curricula. The problem is that these tasks are performed manually, using a pen and calculator. Solving the simplest task using matrix calculus is a nightmarish experience. To solve a simple optimization dilemma, laborious calculations had to be carried out for several hours. It often turned out at the end that a minor error in formulating the initial boundary conditions had made all the work pointless.

Most graduates of universities of economics remember linear programming as a trauma that they would like to avoid at all costs in their professional lives. Today, meanwhile, equations of this kind are solved using software. The work involved in obtaining the solution is therefore no longer a problem.

An optimization task now consists in formulating many simple mathematical equations and inequalities. Most software that solves problems of this kind is free; there are even special simplex calculators available online.

Formulating mathematical equations and inequalities is not so simple, however. This is another reason why linear programming is not very popular in Poland. People who work professionally with data and build algorithms and models are called data scientists. This is a new profession that emerged on the wave of mass computerization and the enormous growth in the quantity of data.

According to recently published data from Stack Overflow, approximately 70% of data scientists in Poland were formerly IT specialists—mostly programmers and database administrators—who had no previous practical experience in organization and management. Common tools used in data science do not require knowledge of econometrics, mathematics or statistics. Models are built automatically; knowledge of Python code is sufficient for effective work.

For such specialists, building mathematical formulas that reflect existing business processes is an abstraction that cannot be achieved. It appears that the only barrier to the use of optimization is precisely the problem of constructing mathematical equations and inequalities. This is not a difficult art, but it requires imagination and basic mathematical knowledge as well as a good knowledge of management.

Nevertheless, I believe that, in the near future, companies will emerge that will conduct ongoing optimization of business processes. In practice, these services will resemble the services of IT specialists, who visit an office from time to time to install something or check how a system is operating.

Work on the use of linear programming was originally conducted first by the state in the fields of military affairs and macroeconomics. Operations research found broad application in the logistics and supply of American forces fighting during the Second World War. Later, thanks to George Dantzig’s innovations, these methods began to be used by large industrial and logistics corporations. Thanks to the spread of this methodology and the now widespread availability of data, the method may also become widespread in small businesses such as bakeries and confectioneries.

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.


*