## 5 A Schema and Algorithm for Selection and Use of a Machine and Tractor Fleet
### A Heuristic Algorithm for Optimizing the Execution of the Set of Agricultural Works  
Note that the task of drawing up an optimal schedule of a complex of machine and tractor works is not trivial. It requires a deep understanding of the essence of the simulated process (object) and should take into account its individual features. Therefore, to search for the initial plan, it is impractical to use a greedy algorithm [21] as this involves making locally optimal decisions at each stage, assuming that the final solution will be optimal. Although today there is no universal criterion for assessing the applicability of a greedy algorithm for solving a specific problem, scientists have proved that it cannot contribute to finding a global extreme value in a set of optimization problems, e.g., in most scheduling problems. The desired algorithm may be iterative. At the first step of the algorithm, it is rather logical to use a tractor (combine harvester) that can perform the considered mechanized work at the least cost. However, as mentioned above, one cannot consider agricultural operations one by one and optimize for each of them separately since operations constitute an interconnected set of works. In addition, when attaching tractors to operations, it is impossible to take into account their hourly productivity. This indirectly affects not only the fulfillment of constraints, but also the value of the objective function. For example, an expensive (in the sense of the price of one hour of work) combine harvester can perform a specific agricultural operation, albeit at great cost, but faster than a cheap but low-productivity machine. As a result, the operations may require fewer units of this brand, which may reduce the total costs. Therefore, at the first step of the algorithm, for each tractor (\(j\)) and each mechanized work (\(i\)), it is necessary to determine the value (called the preference coefficient) for fixing a tractor brand for mechanized work. We denote the preference coefficient as \(k_{ij}\). Since when choosing the most suitable fixing option, we strive to minimize costs, it is clear that it should be directly proportional to the hourly productivity and inversely proportional to the price of one hour of a tractor (combine) operation: \(k_{ij}\sim p_{ij}/c_{ij}\). We next pay attention to the fact that for the convenience of presenting information, one can choose any unit of measurement in order to achieve the necessary scale. It should be emphasized that in the calculation process, it is impossible to take into account the units of measurement of quantities. They can be different for each operation (t/h, pcs/h, ha/h, etc. ), and this is of fundamental importance for the correct application of the developed algorithm. In order to ensure the compatibility of indicators in mathematical modeling, a normalization procedure is often used. In this case, the following equality may be used to determine the coefficients of respectability:  
\[k_{ij}=\frac{p_{ij}}{\overline{p_{i}}}:\frac{c_{ij}}{\overline{c_{i}}}\]  
To solve this problem heuristically, we propose the following iterative algorithm. Step 1. Based on the given initial data, a matrix \(\left\|k_{ij}\right\|\) of the preference coefficients is constructed. Step 2. Determine the maximum element of the constructed matrix \(\left\|k_{ij}\right\|\). Step 3. For the selected tractor brand and the selected operation, we set the maximum possible duration of the working shift. After that, we calculate the preliminary required number of units of equipment. To do this, we use the following formula:  
\[x_{i0j0}=\min\left\{\left[\frac{V_{i}^{(0)}}{D_{t}\cdot p_{i0j0}\cdot T_{\max}} \right]+1,\ L_{j}^{(0)}\right\} \tag{17}\]  
where the upper index corresponds to the number \(r\) of iterations (beginning from \(r=0\)). The meaning of the Formula (17) is to round the estimated number of tractors (combines) substantially.