# A New Approach for Crop Rotation Problem in Farming 4.0

Bruno S. Miranda, Akebo Yamakami, Priscila Rampazzo

► To cite this version:

Bruno S. Miranda, Akebo Yamakami, Priscila Rampazzo. A New Approach for Crop Rotation Problem in Farming 4.0. 10th Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), May 2019, Costa de Caparica, Portugal. pp.99-111, 10.1007/978-3-030-17771-3_9. hal-02295231

HAL Id: hal-02295231

https://inria.hal.science/hal-02295231

Submitted on 24 Sep 2019

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A New Approach for Crop Rotation Problem in Farming 4.0

Bruno S. Miranda<fnref n="1" />, Akebo Yamakami<fnref n="1" /> and Priscila C. B. Rampazzo<fnref n="2" />

**Abstract.** Technology and innovations have long improved farming over the world and, as Industry 4.0 quickly spread, farmers have embraced high-level automation and data exchange, driving a transformation called Farming 4.0. Consequently, precise and even real-time field information have become easily accessible. Though, analyzing all this information requires great skills and tools, like mathematical knowledge and powerful computational algorithms to reach farmers expectations. This research explores the Crop Rotation Problem (CRP) and its relevance for the integration of Precision Agriculture (PA) and farm management. This paper presents a new mathematical approach for the CRP based on the nutrient balance and crop requirements, increasing the sustainable appealing of the problem. A real-encoded genetic algorithm (GA) was developed for optimization of the CRP. The results indicate good performance in mid and long-term crop scheduling.

**Keywords:** Crop Rotation Problem, Farming 4.0, Precision Agriculture, Genetic Algorithm, Farm Management.

## 1 Introduction

Technological advances have been widely shaped agriculture. Innovations in sensor devices and embedded systems have improved tillage and crop yields. Efficiency in resources management and autonomous data acquisition turned out to be essential among farmers. As Industry 4.0 thoughts have pushed ahead manufacturing units, agriculture also moves toward a transformation called Farming 4.0, or also referred to as Agriculture 4.0. In general, important developments in automation have been noticed, related to Precision Agriculture expansion [1] [2].

Precision agriculture (PA) follows from the integration of crop management and information technologies. The field measurement of crop requirements and the proper supply of these demands are promoted by PA and intend to improve crop production and resource consumption, approaching sustainable ideas and reducing environment impacts [3] [4].

<footnote n="1">¹ School of Electrical and Computer Engineering (FEEC-UNICAMP), Av. Albert Einstein, 400, 13083-852 Campinas, Brazil
miranda.bsm@live.com, akebo@dt.fee.unicamp.br</footnote>

<footnote n="2">² School of Applied Sciences (FCA-UNICAMP), R. Pedro Zaccaria, 1300, 13484-350 Limeira, Brazil
priscila.rampazzo@fca.unicamp.br</footnote>
Industry 4.0 relies on digital technologies, such as Big Data, Internet of Things (IoT) and Artificial Intelligence (AI), to enhance production systems and reach the highest level of cooperation and mobility. In agriculture, connectivity has been expanding allied with IoT and transforming the whole infrastructure. This trend has been noticed in farm equipment: connected tractors, spray devices with route optimization devices and other advanced machines, which are able to gather data and even share information with their manufactures for maintenance purposes [5].

Besides farm technologies stand as advanced as industrial applications, production planning remains a challenging task in agriculture. Aside from monoculture, scheduling crops in a large set of fields rely on market outcomes, weed, and pest control or weather forecasts. Searching for strict mathematical approaches remains quite unusual, relying much on the farmer expertise and short-term goals.

According to USDA, Latin American agricultural GDP growth ought to recover strength in a short-term period marked by recession and slow growth, which relates mainly to Brazil and Argentina economic instability [6]. Brazil is one of the greatest food producers in the world. Investments in agrarian researches and development are quite expressive, they reached 1.82% of Brazilian GDP in 2013 [7]. Therefore, agrarian researches present as much potential as industrial ones for Latin America economies.

This research paper acknowledges the importance of CRP in the Farming 4.0 developments. The proposed mathematical model for CRP bases on fertilization management techniques, such as nutrient budgets.

The main contribution of this paper relies on the relevance of the proposed model supporting farm management decisions. It achieves profitable solutions and evaluates the resource balance, providing valuable insights in the crop sequence.

To accomplish a broad range of CRP scenarios, optimization techniques ought to provide solutions for small and sizeable instances of the problem. The proposed evolutionary algorithm presents good results in the large instances where the deterministic method takes large amounts of time. The stochastic approach in this paper combined with the deterministic method ensures that the proposed model can assist agrobusiness management providing solutions for many scenarios.

The subsection 1.1 presents a review about the CRP approaches in the literature. Section 2 establishes the relationship to industrial and service systems. Section 3 presents the proposed model and its details. The optimization techniques are discussed in Section 4 and the attained results in Section 5. The conclusion and further steps of this research presents in Section 6.

## 1.1 Discussion on Previous Works

The CRP has been extensively researched. Distinguished approaches and mathematical models have enriched widely the available literature. The complexity related to this NP-hard problem is the main reason for continuous innovation. Heuristic and metaheuristic approaches are quite common among applied techniques.

A review of the stochastic and deterministic methods applied to the CRP presented in [8] and pointed out that the deterministic approach has been successful in some specific models, though lacks in efficient over sizeable instances of the problem. Although there is no agreement among researches about the best method, evolutionary
and hybrid algorithms are promising, due to the high flexible structure of genetic algorithms.

Concerned about a large amount of consumed resources and the environmental impact of monoculture farming, the research presented in [9] discussed an optimization model for CRP, based on organic farming concepts. A new column generation algorithm combined with a greedy heuristic was developed and generated solution for this proposed model of the CRP.

The research presented in [10] analyzed hybrid metaheuristic algorithms in search of quality solutions for the CRP. Attaining feasibility presented to be a hard task on the proposed model, to overcome this hurdle, the initial population was generated by a heuristic procedure. The hybrid algorithms with local search and with Simulating Annealing presented good results in this related work.

Multi-objective approaches for the CRP are quite contemporary. A bi-objective approach presents in [11], it acknowledges that profitability and diversity of crop rotation are conflicted goals and provides a bi-objective model that explores both objectives.

## 2 Relationship to Industrial and Service Systems

Based on a vast area of expertise, Operational Research deals with problems regardless of the context in which they arise. Problems in which the objective is to determine, according to one criterion, the best choice within a set of alternatives. The development of the areas of engineering, computing, and economics has been characterized by the increasing use of optimization models as paradigms for representation and resolution of decision-making problems.

Scheduling Problems represent a class of significant decision-making problems in optimization. Numerous companies and service systems face problems regarding task sequencing, which can be caused by improper allocation of resources and poorly defined processes. The areas affected by these problems are diverse: industry, manufacturing, agriculture, process management, transportation, among others. We can optimize processes by performing task sequencing planning, which results in improved production flow control, meeting deadlines, and scheduling tasks to better utilize available resources.

Solutions of this type of problem are not obtained in closed forms. Instead, they are determined by algorithms: a sequence of procedures applied repeatedly to the problem until the best solution is obtained. According to the adopted formulation (fundamentally dependent on the parameters), we can solve the problem exactly in polynomial time, or even deal with NP-class problems. In these cases, it is necessary to abandon the search for an optimal solution to seek a quality solution, through heuristic procedures.

The present research aims to provide a valuable method to analyze information only acquired by the current state of interconnection between physical and cyber world, such as actual crop nutrient requirements. And, although the proposed methodology applies to agrarian management, the concepts of Industry 4.0 are embraced in this research. The perception of this work exceeds agricultural environment by the integration of planning, profit and production requirements.
### 3 Crop Rotation Problem

The proposed mathematical model for the CRP is described ahead and bases on mathematical approaches presented in [9] [10]. The nutrient balance concept presented in the model relates to researches in [12] [13] and bases on the surface nutrient budget idea.

* N: size of the crop set;

* N<sub>f</sub>: number of crop families;

* F<sub>p</sub>: the set of crops from the family p;

* M: number of periods;

* L: number of plots;

* area<sub>k</sub>: available tillage area of each plot k (acre);

* l<sub>i</sub>: profitability of crop 'i' ($);

* t<sub>i</sub>: crop 'i' production cycle, from planting date to the harvesting;

* p<sub>i</sub>: crop 'i' average production per acre;

* I<sub>i</sub>: crop planting interval {I<sub>i</sub><sup>1</sup>, ..., I<sub>i</sub><sup>n</sup>};

* D<sub>i</sub>: demand for crop 'i' (units / M periods);

* S<sub>k</sub>: adjacent plots of the plot k;

* F<sub>N<sub>ak</sub></sub>, F<sub>P<sub>ak</sub></sub>, F<sub>K<sub>ak</sub></sub>: Quantity of nitrogen, phosphorus and potassium fertilizer applied in the plot k over the interval α;

* R<sub>N<sub>i</sub></sub>, R<sub>P<sub>i</sub></sub>, R<sub>K<sub>i</sub></sub>: requirement of nitrogen, phosphorus and potassium per area unit for crop 'i';

* F<sub>min</sub>, F<sub>max</sub>: Fertilization limits;

* c<sub>N</sub>, c<sub>P</sub>, c<sub>K</sub>: fertilization costs ($ / unit);

* β: sequence crop restriction factor;

* θ: interval of fertilization balance.

$$ \max \sum_{i=1}^{N} \sum_{j=1}^{M} \sum_{k=1}^{L} \text{area}_k \cdot l_i \cdot p_i \cdot x_{ijk} - \sum_{\alpha \in \Omega} \sum_{k=1}^{L} F_{N_{ak}} \cdot c_N + F_{P_{ak}} \cdot c_P + F_{K_{ak}} \cdot c_K \quad (1) $$

$$ s.a. \quad \sum_{i \in F_p} \sum_{r=0}^{t_{i-1}} \sum_{v \in S_k} x_{i(j-r)v} \le L \cdot \left( 1 - \sum_{i \in F_p} \sum_{r=0}^{t_{i-1}} x_{i(j-r)v} \right), \quad p = 1, \dots, N_f, \quad j = 1, \dots, M, \quad k = 1, \dots, L \quad (2) $$

$$ \sum_{i \in F_p} \sum_{r=0}^{t_{i+\beta}} \sum_{v \in S_k} x_{i(j-r)k} \le 1, \quad p = 1, \dots, N_f, \quad j = 1, \dots, M, \quad k = 1, \dots, L \quad (3) $$

$$ \sum_{i=1}^{N} \sum_{r=0}^{t_{i-1}} x_{i(j-r)k} \le 1, \quad j = 1, \dots, M, \quad k = 1, \dots, L \quad (4) $$

$$ F_{N_{ak}} - \sum_{i=1}^{N} \sum_{j=1+(\alpha-1)\theta}^{\alpha\theta} x_{ijk} \cdot \text{area}_k \cdot R_{N_i} \ge 0, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (5) $$

$$ F_{P_{ak}} - \sum_{i=1}^{N} \sum_{j=1+(\alpha-1)\theta}^{\alpha\theta} x_{ijk} \cdot \text{area}_k \cdot R_{P_i} \ge 0, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (6) $$

$$ F_{K_{ak}} - \sum_{i=1}^{N} \sum_{j=1+(\alpha-1)\theta}^{\alpha\theta} x_{ijk} \cdot \text{area}_k \cdot R_{K_i} \ge 0, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (7) $$

$$ \sum_{j=1}^{M} \sum_{k=1}^{L} \text{area}_k \cdot p_i \cdot x_{ijk} \ge D_i, \quad i = 1, \dots, N \quad (8) $$

$$ \sum_{k=1}^{L} \sum_{j \in I_k} x_{ijk} = 0, \quad i = 1, \dots, N \quad (9) $$

$$ x_{ijk} \in \{0,1\}, \quad i = 1, \dots, N, \quad j = 1, \dots, M, \quad k = 1, \dots, L \quad (10) $$

$$ F_{N_{ak}} = \{F_{N_{ak}} \in R^+ \mid F_{max} \ge F_{min}\}, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (11) $$

$$ F_{P_{ak}} = \{F_{P_{ak}} \in R^+ \mid F_{max} \ge F_{min}\}, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (12) $$

$$ F_{K_{ak}} = \{F_{K_{ak}} \in R^+ \mid F_{max} \ge F_{min}\}, \quad k = 1, \dots, L, \quad \alpha \in \Omega \quad (13) $$

$$ \Omega = \{\alpha \in N^* | \alpha \cdot \theta \le M, \theta \in N^*\} \quad (14) $$
The objective function presented in eq. 1 evaluates crop schedule profits and fertilization costs. Besides crop budgets already cover fertilization costs, the objective function also incurs these costs to minimize the number of consumed resources.

The constraint set in eq. 2 prevents adjacent areas to hold the same crop family scheduled in the same period and the constraint set in eq. 3 ensures that crops from the same family shall not be scheduled in sequence on each crop field.

The constraint set in eq. 4 prevents scheduling more than one crop in the same period, in other words, it is a spatial restriction. Fertilization balances are established in equations 5, 6 and 7, following the concept of surface nutrient budget. The production requirements for each crop are evaluated by the constraint set in eq. 8. The constraint set in eq. 9 ensures that crop scheduling happens just in the proper planting period, denying allocation outside this window. The decision variables $x_{ijk}$ are Boolean type and each one represents the schedule of the crop “i” in the period “j” on the field “k” and the fertilization variables ($F_{N_{\alpha k}}$, $F_{P_{\alpha k}}$ and $F_{K_{\alpha k}}$) are real values.

In order to enlighten the mathematical model and its constraints, a sample solution of the CRP is presented in Table 1.

<table><caption>**Table 1.** A crop schedule solution attained by the proposed model for the CRP. The left side presents the crop schedule in a 24 periods interval (each period corresponds to a 15-day interval). The right side presents the related families to the sequence.</caption><thead><tr><th rowspan="2">Periods</th><th colspan="3">CROPS</th><th colspan="3">FAMILIES</th></tr><tr><th>Plot 1</th><th>Plot 2</th><th>Plot 3</th><th>Plot 1</th><th>Plot 2</th><th>Plot 3</th></tr></thead><tbody><tr><td>1</td><td rowspan="3">Cabbage for Fresh Market</td><td rowspan="3">Strawberries for Fresh Market, Spring</td><td>Leaf Lettuce for Fresh Market, Winter</td><td rowspan="3">Mustard</td><td rowspan="3">Rose</td><td>Lettuce</td></tr><tr><td>2</td><td>***</td><td>***</td></tr><tr><td>3</td><td>***</td><td>***</td></tr><tr><td>4</td><td rowspan="7">Carrots for Fresh Market, Summer</td><td rowspan="3">Leaf Lettuce for Fresh Market, Summer</td><td>Strawberries for Fresh Market, Summer</td><td rowspan="3">Carrot</td><td rowspan="3">Lettuce</td><td>Rose</td></tr><tr><td>5</td><td>***</td><td>***</td></tr><tr><td>6</td><td>***</td><td>***</td></tr><tr><td>7</td><td rowspan="3">Tomato for Fresh Market, Summer</td><td>***</td><td>***</td><td rowspan="3">Nightshade</td><td>***</td><td>***</td></tr><tr><td>8</td><td>***</td><td>***</td><td>***</td><td>***</td></tr><tr><td>9</td><td>***</td><td>***</td><td>***</td><td>***</td></tr><tr><td>10</td><td rowspan="14">Spinach for Fresh Market, Fall</td><td rowspan="3">***</td><td>Watermelons for Fresh Market, Summer</td><td rowspan="3">Beet</td><td rowspan="3">***</td><td>Cucurbit</td></tr><tr><td>11</td><td>***</td><td>***</td><td>***</td></tr><tr><td>12</td><td>***</td><td>***</td><td>***</td></tr><tr><td>13</td><td>***</td><td>***</td><td>***</td></tr><tr><td>14</td><td>***</td><td>***</td><td>***</td></tr><tr><td>15</td><td>***</td><td>***</td><td>***</td></tr><tr><td>16</td><td>***</td><td>***</td><td>***</td></tr><tr><td>17</td><td>***</td><td>***</td><td>***</td></tr><tr><td>18</td><td>***</td><td>***</td><td>***</td></tr><tr><td>19</td><td rowspan="3">Cabbage for Fresh Market</td><td>Carrots for Fresh Market, Winter</td><td>Leaf Lettuce for Fresh Market, Winter</td><td rowspan="3">Mustard</td><td rowspan="3">Carrot</td><td>Lettuce</td></tr><tr><td>20</td><td>***</td><td>***</td><td>***</td></tr><tr><td>21</td><td>***</td><td>***</td><td>***</td></tr><tr><td>22</td><td>***</td><td>***</td><td>***</td><td>***</td><td>***</td><td>***</td></tr><tr><td>23</td><td>***</td><td>***</td><td>***</td><td>Lily</td><td>Rose</td><td>Lily</td></tr><tr><td>24</td><td>Spring Onions for Fresh Market</td><td>Strawberries for Fresh Market, Spring</td><td>Spring Onions for Fresh Market</td><td></td><td></td><td></td></tr></tbody></table>
The constraint set in eq. 2 prevents the same family in adjacent crops. This can be verified in the sample solution in Table 1, according to the adjacent plots presented in Table 2.

<table><caption>**Table 2.** The adjacency among plots for this solution presents on the left side. Each row represents adjacent plots from the row index. Additionally, the right side shows each plot area.</caption><thead><tr><th colspan="4">Adjacent plot matrix</th><th rowspan="2">Field area (acre)</th></tr><tr><th></th><th>Plot 1</th><th>Plot 2</th><th>Plot 3</th></tr></thead><tbody><tr><th>Plot 1</th><td></td><td></td><td></td><td>1</td></tr><tr><th>Plot 2</th><td></td><td></td><td></td><td>1.5</td></tr><tr><th>Plot 3</th><td></td><td></td><td></td><td>0.8</td></tr></tbody></table>

Table 3 shows that the crops from the same family can be scheduled again in the same plot after a period defined by $\beta$, which satisfy the constraint set in eq. 3.

<table><caption>**Table 3.** Partial view of the previous sample solution. It shows how the problem fits the constraint set.</caption><thead><tr><th rowspan="2">Periods</th><th colspan="2">CROPS</th><th rowspan="2">FAMILIES<br>Plot 1</th></tr><tr><th>Plot 1</th><th>Plot 2</th></tr></thead><tbody><tr><td>1</td><td rowspan="5">Cabbage for Fresh Market</td><td rowspan="5"></td><td rowspan="5">Mustard</td></tr><tr><td>2</td></tr><tr><td>3</td></tr><tr><td>4</td></tr><tr><td>5</td></tr><tr><td>6</td><td rowspan="2">β</td><td rowspan="2"></td></tr><tr><td>...</td></tr><tr><td>17</td><td rowspan="5">Cabbage for Fresh Market</td><td rowspan="5"></td><td rowspan="5">Mustard</td></tr><tr><td>18</td></tr><tr><td>19</td></tr><tr><td>20</td></tr><tr><td>21</td></tr><tr><td>22</td><td>***</td><td>***</td></tr><tr><td>23</td><td rowspan="2">Spring Onions for Fresh Market</td><td rowspan="2"></td><td rowspan="2">Lily</td></tr><tr><td>24</td></tr></tbody></table>

Nutrient constraints in eq. 5, 6 and 7 are quite intuitive and rely on supplying the required inputs from the scheduled crops on the interval $\theta$ in each plot “k”. Reaching production requirements follows from constraint set in eq. 8 and scheduling in the proper planting period from eq. 9. The fertilization inputs and the attained production from sample solution are not presented for assumption of easy understandability.

The presented CRP model requires data about the crop features and the market. Usual planting dates were gathered from [14], average prices and production statistics based on [15]. Crop budget for the established profitability were mainly taken from [16] and, in some cases, updated with production and average prices from [15]. The crop nutrient requirements were acknowledged from [17].
# 4 Methodology

Evolutionary algorithms are computational procedures for solving problems, resulting from the iterative application of heuristic techniques, which makes these algorithms capable of promoting the search for a solution in a huge space of possibilities, in a very flexible way [18]. Evolutionary Algorithms work with a population formed by a set of individuals. The coding of the individuals (representation of possible solutions to the problem) is the most important step of the algorithm. The adaptation function allows assigning each element of the search space (individual) a value that is used as a measure of performance. In optimization problems, this function incorporates all aspects of the objective function. During the generations, this population is evaluated. The most suitable ones tend to be selected and can undergo modifications in their characteristics through crossover and mutation operators, generating descendants; finally, the more adapted go to the next generation, resulting in individuals getting more fit, while others tend to disappear.

Some characteristics of these methods deserve to be highlighted: flexibility, generality, ability to escape from great locations, ability to deal with complex problems for which it is not possible or difficult to obtain a detailed description, as well as being less susceptible to form or continuity [19] [20] [21].

For the development of the approach proposed in this work, we chose the Genetic Algorithm (GA) [22], because it is a classic method, one of the first Evolutionary Algorithms proposed in the literature and easily adapted to any problem, besides being extensively applied in the different areas of engineering. The functionalities of the algorithm proposed in this work were implemented with the concern of respecting the physical and operational characteristics of the problem. The coding technique and the main operators to approach this work are described ahead.

## 4.1 Encoding and Decoding

The binary decision variables in the CRP might appear rather suitable for binary encoded genetic algorithms, but evaluations showed that performance decreases on mid-term and long-term planning. Also, the binary GA requires hybrid approaches to improve performance [9] [10]. The proposed GA based on the real encoding technique presented ahead.

The left side of Fig. 3 presents the data structure which holds all the feasible combinations of crop, period and plot. The right side presents a chromosome that holds two memory positions, one has a real number and the second one is an integer index related to the previous data structure.
<table><caption>**Table 4.** Real-encoded information in the GA. The left side presents a support data structure with all the possible crop allocations and the right side shows the chromosome filled with floating numbers.</caption><thead><tr><th>Index</th><th>Crop</th><th>Period</th><th>Plot</th></tr></thead><tbody><tr><td>1</td><td>1</td><td>17</td><td>1</td></tr><tr><td>2</td><td>1</td><td>18</td><td>1</td></tr><tr><td>3</td><td>1</td><td>19</td><td>1</td></tr><tr><td>4</td><td>1</td><td>20</td><td>1</td></tr><tr><td>5</td><td>1</td><td>17</td><td>2</td></tr><tr><td>6</td><td>1</td><td>18</td><td>2</td></tr><tr><td>7</td><td>1</td><td>19</td><td>2</td></tr><tr><td>8</td><td>1</td><td>20</td><td>2</td></tr></tbody></table>

<table><thead><tr><th>Chromossome</th><th>Index</th></tr></thead><tbody><tr><td>0.3527983</td><td>1</td></tr><tr><td>0.8572196</td><td>2</td></tr><tr><td>0.0049846</td><td>3</td></tr><tr><td>0.4896225</td><td>4</td></tr><tr><td>0.4130837</td><td>5</td></tr><tr><td>0.3991828</td><td>6</td></tr><tr><td>0.1883861</td><td>7</td></tr><tr><td>0.3622583</td><td>8</td></tr></tbody></table>

Decoding process initializes with sorting the chromosome according to the real numbers. The highest priority returns an index that represents the first crop to be allocated, then the process continuous until there are no more possible allocations.

<table><caption>**Table 5.** Decoding process. The chromosome is sorted according to the floating values. The second column of the chromosome holds the index related to the support data structure. Decoding follows down this priority list until there is no more availability in the schedule.</caption><thead><tr><th>Index</th><th>Crop</th><th>Period</th><th>Plot</th></tr></thead><tbody><tr><td>2</td><td>1</td><td>18</td><td>1</td></tr><tr><td>4</td><td>1</td><td>20</td><td>1</td></tr><tr><td>5</td><td>1</td><td>17</td><td>2</td></tr><tr><td>6</td><td>1</td><td>18</td><td>2</td></tr><tr><td>8</td><td>1</td><td>20</td><td>2</td></tr><tr><td>1</td><td>1</td><td>17</td><td>1</td></tr><tr><td>7</td><td>1</td><td>19</td><td>2</td></tr><tr><td>3</td><td>1</td><td>19</td><td>1</td></tr></tbody></table>

<table><thead><tr><th>Chromossome</th><th>Index</th></tr></thead><tbody><tr><td>0.8572196</td><td>2</td></tr><tr><td>0.4896225</td><td>4</td></tr><tr><td>0.4130837</td><td>5</td></tr><tr><td>0.3991828</td><td>6</td></tr><tr><td>0.3622583</td><td>8</td></tr><tr><td>0.3527983</td><td>1</td></tr><tr><td>0.1883861</td><td>7</td></tr><tr><td>0.0049846</td><td>3</td></tr></tbody></table>

<table><thead><tr><th>Period</th><th>Plot 1</th></tr></thead><tbody><tr><td>17</td><td></td></tr><tr><td>18</td><td>1</td></tr><tr><td>19</td><td>1</td></tr><tr><td>20</td><td>1</td></tr><tr><td>21</td><td>1</td></tr><tr><td>22</td><td></td></tr><tr><td>23</td><td></td></tr></tbody></table>

The fertilization variables have direct correspondence to the chromosome values, apart from the schedule priority list and without requiring any decode technique.

## 4.2 Genetic Operators

The presented GA uses the tournament selection as a technique to sort out individuals from the population. Tournaments happens with “k” random selected individuals; the winner is the highest fitness among them and shall be placed in the mating pool, which will generate a new offspring.

The tested crossover and mutation operators are presented in [23] [24]. A brief description of Laplace Crossover technique and Power Mutation follows ahead.

* Laplace Crossover:

1) Random numbers: $u_i, r_i \in [0,1]$

2) $\beta_i = \begin{cases} a - b \cdot \log(u_i), & r_i \le 0.5 \\ a + b \cdot \log(u_i), & r_i > 0.5 \end{cases} \rightarrow \begin{cases} y_i^1 = x_i^1 + \beta_i |x_i^1 - x_i^2| \\ y_i^2 = x_i^2 + \beta_i |x_i^1 - x_i^2| \end{cases}$
* Power Mutation:

1) Random number: $s_1, r \in [0,1]$

2) $s = s_1^p, t = \frac{\bar{x}-x^l}{x^u-\bar{x}} \rightarrow x = \begin{cases} \bar{x}-s \cdot (\bar{x}-x^l), & t < r \\ \bar{x}+s \cdot (x^u-\bar{x}), & t \ge r \end{cases}$

## 4.3 Overview of the Proposed Genetic Algorithm

A random procedure generates the initial population. At first, the current population is the same as the initial population. Then, the genetic operators (selection, crossover and mutation) produce the so-called new population. The mixed population combines the current population and the new population, sorting individuals according to their fitness. Individuals with high fitness among the mixed population are selected to fill the current population and compose the next generation. The code was developed in C language to reach high efficiency. Fig. 1 summarizes the characteristics of the GA.

<figure><img src="image_2.png" /><figcaption>Fig. 1. A flowchart presents the proposed genetic algorithm structure.</figcaption></figure>

The coding and decoding generate solutions which already fit constraint set in eq. 2, 3, 4 and 9, decreasing infeasibility workarounds. To increase performance, there is a penalty method applied to the nutrient balance constraints.

## 5 Discussion on Results

The proposed model has been evaluated by a deterministic approach and by the presented GA. Glop linear solver, which is a powerful linear optimization solver developed by Google, handled the deterministic evaluations. According to Table 2, achieving exact solutions requires exhaustive computational time even in mid-term planning.

Performance of the GA was tested with 48 periods and with 72 periods in comparison with the Glop solver results. In each case, the GA ran 20 times to attain the presented results, this stochastic procedure requires several executions to validate its proper performance. The initialization process generates 1000 random individuals. Each further generation has 400 new individuals. The current population and the new
population generate the mixed population, which is sorted out based on fitness and the best individuals from this population shall be inserted in the current population.

Crossover and mutation probability are 1.00 and 0.15, respectively. The total number of generations is 300. These parameters were selected after tuning and provided the best results for the tested instances.

This research presents the proposed model as potential tool for farm management. In order to ensure the reliability of this mathematical approach, there should be optimization strategies able to manage sizeable instances of the CRP. The proposed GA and the deterministic approach are complementary techniques in this work. The first one turned out to be quite suitable for the large data analyzes, whereas the exact searches may seem extremely high-cost alternatives.

The results in table 6 and table 7 analyzes the proposed GA in terms of repeatability and stability, which are very important to ensure that the solution attained in the large instances are reasonable. Although the computational time required by the GA exceeds Glop's one, the performance of the Glop solver is undoubtedly better in the small-size problems, besides GA provides sub-optimal solutions, and so, the proposed evolutionary approach is designed to work together with deterministic methods.

<table><caption>**Table 6.** Results from executions in a 60-crop database over 48 periods (2-year schedule) and 7 plots.</caption><thead><tr><th></th><th>Fitness ($)</th><th>Gap %</th><th>Execution Time (s)</th></tr></thead><tbody><tr><td>Optimum (Glop Solver)</td><td>463960.0</td><td>-</td><td>4589</td></tr><tr><td>Maximum Fitness(GA)</td><td>434067.1</td><td>6.44%</td><td>685</td></tr><tr><td>Minimum Fitness(GA)</td><td>386763.4</td><td>16.64%</td><td>610</td></tr><tr><td>Average Fitness (GA)</td><td>400880.4</td><td>13.60%</td><td>639</td></tr></tbody></table>

<table><caption>**Table 7.** Results from executions in a 60-crop database over 72 periods (3-year schedule) and 7 plots.</caption><thead><tr><th></th><th>Fitness ($)</th><th>Gap %</th><th>Execution Time (s)</th></tr></thead><tbody><tr><td>Optimum (Glop Solver)</td><td>695087.0</td><td>-</td><td>34637</td></tr><tr><td>Maximum Fitness (GA)</td><td>631495.7</td><td>9.15%</td><td>1009</td></tr><tr><td>Minimum Fitness (GA)</td><td>563338.5</td><td>18.95%</td><td>1006</td></tr><tr><td>Average Fitness (GA)</td><td>587355.9</td><td>15.50%</td><td>1007</td></tr></tbody></table>

## 6 Conclusion

The proposed mathematical approach for the CRP enlightens agriculturally sustainable appeal without turning back on profits as the main goal of the problem. The developed algorithm achieved prospect results in a reasonable computational time and provided quality solutions for the large instances of the CRP.

This research acknowledges the potential for further developments related to CRP in sustainability and multi-objective approaches. Field crop information will increase fast and become more reliable due to observation and monitoring techniques which are driven by Precision Agriculture. Consequently, crop nutrient balance holds an important role in further developments.
The real-encoding technique presents to be very powerful in the long-term analyzes of the CRP, avoiding exceeding computational time related to the infeasibility workarounds. Establishing the relationship between crop scheduling and nutrient balance in the same model is the main contribution of this research and requires several agricultural cases to acknowledge the extent of this approach on the farm management.

Based on the presented results, the proposed mathematical model is reliable and provides quality solutions through the deterministic approach or the proposed GA, each according to the data complexity. The proposed approach for this scheduling problem and the characteristics of the GA presented, such as the real-encoding technique, could suit many applications in the Industry 4.0.

## References

1. Braun, A.-T., Colangelo, E., Steckel, T.: Farming in the Era of Industrie 4.0. 51st CIRP Conference on Manufacturing System, pp. 979--984. (2018)

2. Pereira, A., Romero, F.: A review of the meanings and the implications of the Industry 4.0 concept. Manufacturing Engineering Society International Conference 2017, pp. 1206--1214. (2017)

3. Pandey, G., Weber, R. J., KUMAR, R.: Agricultural Cyber-Physical System: In-Situ Soil Moisture and Salinity Estimation by Dielectric Mixing. IEEE Access, vol. 6, pp. 43179--43191. (2018)

4. Far, S. T., Rezaei-Moghaddam, K.: Impacts of the precision agricultural technologies in Iran: An analysis experts' perception & their determinants. Information Processing in Agriculture, vol. 5, pp. 173--184. (2018)

5. Bonneau, V., Copigneaux, B., Probst, L., Pedersen, B.: Industry 4.0 in agriculture: Focus on IoT aspects. European Commission, Digital Transformation Monitor. https://ec.europa.eu/growth/tools-databases/dem/monitor/content/industry-40-agriculture-focus-iot-aspects

6. United States Department of Agriculture (USDA).: USDA Agricultural Projections to 2027. https://www.usda.gov/oce/commodity/projections/USDA_Agricultural_Projections_t o_2027.pdf

7. Empresa Brasileira de Pesquisa Agropecuária (Embrapa), https://www.embrapa.br/busca-de-noticias/-/noticia/13128392/brasil-lidera-investimentos-em-pesquisa-agricola-na-america-latina

8. Memmah, M., Lescourret, F., Yao, X., Lavigne, C.: Metaheuristics for agricultural land use optimization. A review. Agronomy for Sustainable Development, vol. 365, pp. 975--998. (2015)

9. Santos, L. M. R., Michelon, P., Arenales, M. N., Santos, R. H. S.: Crop rotation scheduling with adjacency constraints. Annals of Operations Research, vol. 190, pp. 165--180. (2008)

10. Aliano, A., Florentino, H, Pato, M.: Metaheuristics for a crop rotation problem. International Journal of Metaheuristics, vol. 3 (2014)

11. Aliano, A., Florentino, H, Pato, M.: Metodologias de escalarizações para o problema de rotação de culturas biobjetivo. Proceeding Series of the Brazilian Society of Applied and Computational Mathematics, vol. 6 (2018)

12. Watson, C., Bengtsson, H., Ebbesvik, M., Løes, A.K., Myrbeck, Å., Salomon, E., Schroder, J., Stockdale, E.: A review of farm-scale nutrient budgets for organic farms
as a tool for management of soil fertility. Soil Use and Management, vol. 18, pp. 264-273. (2002)

13. Berry, P., Stockdale, E., Sylvester-Bradley, R., Philipps, L., Smith, K., Lord, E., Watson, C., Fortune, S.: N, P and K budgets for crop rotations on nine organic farms in the UK. Soil Use and Management, vol. 19, pp. 112--118. (2003)

14. United States Department of Agriculture (USDA).: Vegetables Usual Planting and Harvesting Dates. USDA, 2007, https://naldc.nal.usda.gov/download/CAT30992961/PDF

15. United States Department of Agriculture (USDA).: Vegetables 2017 Summary. USDA, 2017, https://www.nass.usda.gov/Publications/Todays_Reports/reports/vegean17.pdf

16. Oregon State University: Oregon Agricultural Enterprise Budgets, http://arec.oregonstate.edu/oaeb/

17. Mohler, C. L., Johnson, S. E.: Crop rotation on organic farms: a planning manual. Natural Resource, Agriculture, and Engineering Service. Ithaca (2009)

18. Knowles, J., Corne, D., Deb, K.: Multiobjective Problem Solving from Nature: From Concepts to Applications. Springer-Verlag, Berlin (2008)

19. Bäck, T., Fogel, D. B., Michalewicz, Z.: Evolutionary Computation 1: Basic Algorithms and Operators. Institute of Physics Publishing. Bristol (2000)

20. Bäck, T., Fogel, D. B., Michalewicz, Z.: Evolutionary Computation 1:2 Advanced Algorithms and Operators. Institute of Physics Publishing. Bristol (2000)

21. Coello, C. A. C.: Evolutionary Multiobjective Optimization: Current and Future Challenges. Advances in Soft Computing. Springer, London (2003)

22. Michalewicz, Z.: Genetic Algorithms + Data Structures = Evolution Programs. Springer-Verlag. Berlin (1996)

23. Deep, K., Singh, K. P., Kansal, M., Mohan, C.: A new crossover operator for real coded algorithms. Applied Mathematics and Computation, pp. 895--911 (2007)

24. Deep, K., Singh, K. P., Kansal, M., Mohan, C.: A real coded genetic algorithm for solving integer and mixed integer optimization problems. Applied Mathematics and Computation, pp. 505--518 (2009)