**1. Introduction**

Presently, production and logistics processes are commonly supported with production planning and control systems. These are used to support a range of operational activities from production planning to the detailed scheduling and execution of every operation [1–3]. However, it frequently happens that the implemented systems do not adequately cover the problem in a holistic manner. Classical hierarchical organization of the business and production managemen<sup>t</sup> [4] limits more detailed and tight coupling across the production levels. In practice, different activities of production are supported with separate information systems. Limited data and functional integration among them and additional specifics of the production processes require development and integration of tailor-made solutions.

A holistic view of the production problems become even more important when the environmental footprint of the production is in question. Plant-wide production supervision through data integration and analytics lead to processes that are more effective and consequently the resource demand is reduced. This can even be scaled up by data-sharing and active collaboration with the supply chain, in order to reduce erroneous delivery and consequent undesirable events at the manufacturer's premises such as

stoppage of assembly line [5]. On the other hand, evolution from linear business models to circular economy principles will impose novel problems and dilemmas, such as, for example, strategic planning on supply chain level [6] or remanufacturing pricing strategies [7]. All this requires manufacturers to efficiently schedule, manage and optimize resource consumption of their production processes.

The main motivation of the presented work is the problem faced by the steel-processing manufacturer, where specific requirements for the material requirements planning (MRP) could not be implemented by standard solutions, since the purchasing and planning activities are not supported with the same information system. Consequently, manual interactions are needed which are problematic due to the occurrence of human errors, which are inevitable in the case of more complex situations. In addition, in this way it is almost impossible to produce optimal solutions even for simple problems.

The problem and its specifications originate from steel-processing production, where many products with complex MRP structures are being produced. In principle, raw materials must be cut to satisfy the needs for the input material (intermediates) as defined with MRP. The main requirement of the addressed problem is to plan and optimize material requirements while ensuring that a group of work orders for one final product must be produced from the same batch of raw material. Additionally, it is desirable to limit the tardiness and to reduce the material leftover (small material leftovers lead to a scrap). A custom solution is needed that allows for holistic considerations of purchase and work orders. In practice, optimization systems that holistically address the problem and integrate planning and scheduling are needed, where more adopted solutions are based on mathematical models (e.g., [8]).

The addressed problem of material planning and optimization can be translated into a general bin-packing optimization problem, which has been studied since the early 1970s [9,10]. In the bin-packing problem (BPP), we have *m* items and *n* identical bins. The goal is to assign each item to one bin so that the total size of the items in each bin does not exceed the capacity of the bin and the number of bins used is minimized. Different variants of the problem continue to attract researchers' attention.

The bin-packing problem can be described as an integer optimization problem. Solving the problem is NP-hard and is usually done with custom heuristics. A detailed review of mathematical models and exact algorithms for bin-packing and cutting stock problems are given in [11]. Coffman et al. [12] present an overview of BPP approximation algorithms. However, advances in computer technology and available solver capabilities enables us to solve mid-sized practical problems [13].

The classical problem has been extended to various forms to mitigate many practical application problems. For a general survey see Wäscher et al. [14]. In manufacturing industries, such as in cutting steel, paper or textiles, a cutting stock problem formulation is used. Here, stock material must be cut into shorter lengths to meet demand while minimizing waste. The problems have an identical structure in common [14]. In this context, Carvalho [15] reviewed several linear programming (LP) formulations for the one-dimensional cutting stock and bin-packing problems.

A natural generalization of the classical bin-packing problem is to consider the problem with two or more dimensions. Lodi et al. [16] discussed mathematical models and survey classical approximation algorithms, heuristic and metaheuristic methods, and exact enumerative approaches for 2-D problems. Epstein et al. [17] studied the oriented multi-dimensional dynamic bin-packing problem for two, three, and multiple dimensions. A more general and realistic model considers bins of differing capacities [18]. Bin-packing problem and its variations are still widely studied [19,20]. Recently, Jansen and Kraft [21] presented a review of a variable bin-sized bin-packing problem and an improved approximation scheme to solve the problem.

A bin-packing formulation is also often used to formally represent problems where time must be considered to be well (e.g., scheduling). A simple case is where a task's durations are represented by items and a job's due dates with bin sizes. Advanced solutions use the due date as an additional constraint factor. Another solution is to soften the due date constraint, which can be violated but penalized proportionally with the delay. In this context, Reinertsen and Vossen [22] have proposed optimization models and solution procedures that solve the cutting stock problem when orders have due dates. The objective in their model is to minimize scrap and tardiness. Recently, Arbib and Marinelli [23] considered a problem, where each item representing a job must be assigned to a minimum number of bins (resources). Additionally, each item is due by a particular date, so minimal tardiness is also being optimized.

The problem we are targeting arises from the steel-processing production process, where specific constraints must be considered. In this kind of industry even small improvements in the production operation can result in large monetary savings [24]. In our case raw materials are ordered and delivered in batches. Depending on the raw material delivery time, there are some minor variations in the visual properties of the raw material. This may result in a final product that is produced of materials with different properties causing unwanted, additional, repair costs. Therefore, a solution is needed that supports the production planner with decisions on how to cut the available raw materials and how to plan new purchase orders in order to obtain production material as to realize work orders, i.e., final products. The plan must consider various constraints such as the quantity, due dates, single material batch constraints, etc. To support the production planner in dealing with this problem, various generalizations of the classical BPP formulation are proposed. The problem can be designated as an one-dimensional multiple bin-size bin-packing problem (MBSBPP) using the topology of Wäscher et al. [14]. A simple bin-packing problem (BPP) formulation using variable bin sizes and strict time constraints is used when the raw material is available on time. For the case when some of the purchase orders are late, we propose using an upgraded Reinertsen's optimization model [22]. Soft constraints are introduced into the linear integer problem as proposed in a work of Srikumar [25]. Main contribution of the article is the formulation of specific optimization problem for the problem where group of work orders for one product have to be produced from the same batch of raw material as one batch of raw material consists of several material stocks, which have in common several immeasurable characteristics. Moreover, the problem had to consider the availability of the materials, order deadlines and must minimize the scrap. This is done through introduction of a custom formulation of the bin-packaging problem with constraints that groups the items and bins in a way that assures a consistent final product, while respecting other constraints as well.

In the next section, the general problem formulation is developed step-by-step. Whole or part of the formulation can be used depending on the problem at hand. A model description of the classical bin-packing problem is extended with variable bin sizes, due date constraints, and grouping of bins and items. In Section 3, two case studies are presented that illustrate the practical implementation of the proposed method. Finally, developed methodology and results are discussed in Section 4.

#### **2. Materials and Methods**

The problem of material requirements planning can be formalized as a bin-packing problem, which can be solved using a mixed-integer linear program (MILP). In this section, we describe how a basic BPP can be extended to include constraints such as variable bin and item sizes, time limitations, and the fact that only a group of bins can be used to produce one group of items.

#### *2.1. Mathematical Notations*

For a consistent discussion, we first define symbolic notation that is consistently used across different mathematical models:




### *2.2. Problem Description*

In the classical BPP, we are dealing with a set *I* of *m* items, each with its size *si* that has to be assigned to a set *B* of *n* identical bins with capacity *c*. The number of used bins must be minimized, where the sum of item sizes in one bin does not exceed the bin capacity. The problem can be described as an integer optimization problem, as shown in Equation (1).

$$\begin{aligned} z\_1 &:& \quad \min \sum\_{j=1}^n y\_j\\ \text{s.t. } & \sum\_{i=1}^m s\_i \cdot x\_{ij} \le c \cdot y\_{j'} j = 1 \dots n\\ & \sum\_{i=1}^m x\_{ij} = 1, j = 1 \dots n\\ & y\_j \in \{0, 1\}\\ & x\_{ij} \in \{0, 1\}, \end{aligned} \tag{1}$$

where *yj* and *xij* are binary decision variables

$$y\_j = \begin{cases} 1 & \text{if } \text{bin } j \text{ is used} \\ 0 & \text{otherwise,} \end{cases}$$

$$x\_{ij} = \begin{cases} 1 & \text{if item } i \text{ is assigned to bin } j \\ 0 & \text{otherwise.} \end{cases}$$

Decision variable *xij* can be represented as a matrix, depicted in Figure 1.

The first constraint from Equation (1) guarantees that the sum of item sizes assigned to bin *Bj* does not exceed its capacity, *c*. The second constraint assures that one item is assigned only to one bin.

**Figure 1.** Decision variable *xij* in basic BPP.

#### *2.3. Variable Bin Sizes*

There are situations where bin sizes are not identical. Variable bin sizes are denoted as *cj* in our work. A set of items can be assigned to bin *Bj* if the total volume of these items does not exceed the capacity of a bin *cj*. For this reason, the first constraint in Equation (1) should be rewritten as given in Equation (2).

$$\sum\_{i=1}^{m} s\_i \cdot x\_{ij} \le c\_j \cdot y\_{j\prime} j = 1 \dots n \tag{2}$$

The best way to use a bin is to fill it fully, i.e., there is no leftover space. In case of unique bin capacities, the criterion described in Equation (1) minimizes the number of used bins together with the non-assigned capacity of used bin(s)—leftovers. However, this is usually not the case when we have bins of different capacities. In that case, the optimization criteria must be defined as given with Equation (3), where the sum of leftovers of all used bins is being minimized.

$$z\_2 \colon \min \sum\_{j=1}^n (c\_j \cdot y\_j - \sum\_{i=1}^m s\_i \cdot x\_{ij}) \tag{3}$$

#### *2.4. Time Extension*

To take into account the time limitations, the problem needs to be additionally extended. The optimization problem needs to consider the situations where bin *Bj* has to be available before the due date of an item *Ii*, which is to be scheduled in *Bj*. The item *Ii* is therefore defined with a tuple of two elements (*si*, *di*), where *di* is its due date. Similarly, bin *Bj* is defined as (*cj*, *aj*), where *aj* is its delivery time. We sugges<sup>t</sup> two solutions: (i) considering hard (strict) time constraints, where *Bj* must be available before the due date of *Ii* (*di aj*) and (ii) considering soft time constraints, where delivery dates are allowed to exceed due dates, but this is penalized within the objective function.

The solution where due date violations are not allowed is achieved with the addition of the following constraint to our optimization problem:

$$a\_j \cdot x\_{ij} \le d\_i \quad i = 1 \dots m, j = 1 \dots n. \tag{4}$$

In practice, the due date constraint violation is commonly allowed, but penalized. In this case, we must consider a slightly different problem formulation. The due date constraint must be considered

to be a soft constraint. For this reason, we need to first introduce additional tardiness criteria (*gij*), which is used to soften the constraint from Equation (4):

$$\begin{array}{cc} \mathbf{g}\_{ij} = \begin{cases} a\_j - d\_i & a\_j > d\_{i\prime} \\ 0 & \text{otherwise} \end{cases} \end{array} \tag{5}$$

If the hard constraint is violated, *gij* evaluates the time for which bin *Bj* is late for item *Ii*. When there is no delivery time violation, *gij* should be 0. Using this, we can extend our criterion function, where we allow that bin *Bj* can be late. In this way, tardiness is being minimized in addition to leftovers.

$$\begin{aligned} \vert \;z\_3: \text{min} \quad &w\_1 \cdot \sum\_{j=1}^{n} (c\_j \cdot y\_j - \sum\_{i=1}^{m} s\_i \cdot x\_{ij}) + \\ &+ w\_2 \cdot \sum\_{j=1}^{n} \sum\_{i=1}^{m} \mathcal{g}\_{ij} \cdot x\_{ij} \end{aligned} \tag{6}$$

As we are dealing here with a multi-objective problem, the weighting of parameters *w*1 and *w*2 is introduced, which is used to adjust the importance of leftovers and tardiness criteria. Parameter settings are application-dependent.

#### *2.5. Grouping of Items/Bins*

Furthermore, we are targeting the problem of when a group of items can be assigned to only one single group of bins. This implies additional constraints to our optimization problem.

We assume that we have a set *F<sup>I</sup>* of |*F<sup>I</sup>*| item groups and set *F<sup>B</sup>* of |*F<sup>B</sup>*| bin groups. Item *Ii* is therefore extended to triple (*si*, *di*, *FIk* ), where *FIk* ∈ *F<sup>I</sup>* denotes the group to which item *Ii* belongs and bin *Bj* is defined with (*cj*, *aj*, *FBl* ), where *FBl* ∈ *F<sup>B</sup>* denotes the bin group to which bin *Bj* belongs. The *k*-th item group consists of |*FIk* | items and *l*-th bin group consists of |*FBl* | bins.

Figure 2 illustrates the example where we have three item groups and two bin groups. Items from one group must be assigned to the bins that are grouped within one bin group. One solution to the problem from the observed example is illustrated in Figure 3. Here items from *FI*1 and *FI*2 are assigned to the bins from bin group *FB*1 , and items from *FI*3 to a bin from bin group *FB*2 . White rectangles indicate the leftovers.

**Figure 2.** Item and bin groups.

**Figure 3.** Item and bin groups. Acceptable solution: *FI*1 , *FI*2 ∈ *FB*1 and *FI*3 ∈ *FB*2 .

Without loss of the generality, we can assume that the decision variable *xij* is organized in a matrix, where items and bins from the same group are given next to each other, as illustrated in Figure 4. Sub-matrices, marked in the figure, indicate all possible group assignments, i.e., combinations of item and bin groups. The items that form *k*-th item group can be assigned to any of the bins from *l*-th bin group only if the sum of *xij* is equal to the size of item group *FIk* . Here *i* designates all items from *k*-th item group and *j* all bins from *l*-th bin group. This can be formally represented by adding the equality constraints (Equation (7)) to our optimization problem from Equation (1).

**Figure 4.** Decision variable *xij* - item and bin groups.

$$\sum\_{i=i\_{F,k}}^{i\_{F,k}+|F\_k^I|-1} \sum\_{j=j\_{F,l}}^{i\_{F,l}-1} \mathbf{x}\_{ij} = |F\_k^I| \cdot \zeta\_{I,k\prime} \tag{7}$$

where *k* = 1. . . |*F<sup>I</sup>*| and *l* = 1. . . |*F<sup>B</sup>*|.

Here *iF*,*<sup>k</sup>* determines the sequence number of the first item in the *k*-th group of items and is evaluated as:

$$i\_{F,k} = \begin{cases} 1 & \text{if } k = 1\\ 1 + \sum\_{p=1}^{F\_k^I - 1} |F\_p^I| & \text{if } k = 2, \dots |F^I| \end{cases} \tag{8}$$

*jF*,*<sup>l</sup>* is the sequence number of the first bin in the *l*-th group of bins, evaluated as:

$$j\_{F,l} = \begin{cases} 1 & \text{if } l = 1\\ 1 + \sum\_{q=1}^{F\_l^B - 1} |F\_q^B| & \text{if } l = 2, \dots |F^B| \end{cases} \tag{9}$$

Indicator *ζ<sup>l</sup>*,*<sup>k</sup>* gives information if the combination of bin and item group is used, i.e., it takes a value of 0 or 1. It is defined as a sum of values from submatrix *xij*, where the submatrix is defined for all bins from *l*-th group and only the first item from *k*-th group. The indicator is implemented as given with Equation (10).

$$\mathcal{Z}\_{l,k} = \sum\_{j=j\_{F,l}}^{j\_{F,l}+|F\_l^{\mathcal{S}}|-1} \mathbf{x}\_{i\_{F,k}j} \tag{10}$$

As equality constraints reduce the solution space, the consideration of item and bin grouping constraints actually reduces the complexity of the problem.
