Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 11, No. 1, 2025 73 Optimization of Crop Planting Strategies Based on Monte Carlo Simulation and Greedy Algorithm Qisen Wang †, *, Junhan Hou †, Zihe Zhong † Chinese Academy of Finance and Development, Central University of Finance and Economics, Beijing, China * Corresponding author: Qisen Wang (Email: qisenwang2024@163.com) † These authors also contributed equally to this work Abstract: Based on Monte Carlo simulation and greedy algorithm, this paper explores the optimization scheme of crop planting under different conditions. First, for the planting scheme under stable market conditions, this paper establishes an objective planning model to optimize the planting plan from 2024 to 2030 by maximizing the annual planting revenue and combining the constraints of various economic indicators. Further, considering that part of the crop may be stagnant or sold at a discounted price, this paper explores the impacts of different sales scenarios on the planting strategy. Then, for the planting strategy under uncertainty, this paper uses Monte Carlo simulation and time series regression analysis to predict various economic parameters of crops, and based on this prediction result, the greedy algorithm is applied to optimize the planting plan. Finally, the planting scheme is further optimized by considering the complementarity and substitutability between crops and combining the correlation between the indicators of crops. Keywords: Goal Programming Model; Monte Carlo Simulation; Time Series Regression; Greedy Algorithm; Pearson Correlation Coefficient. 1. Introduction The aim of this paper is to develop crop planting scenarios for the period from 2024 to 2030 by building a goal planning model and combining various computer algorithms [1]. First, for the planting strategy under stable conditions, a goal-based planning model [2] is used to analyze the scenarios of crop stagnation and price reduction sales more than market demand. Second, considering the market fluctuation factors, Monte Carlo simulation [3] and time series regression [4] are used to predict various economic indicators and establish an optimization model under uncertainty conditions. Finally, the complementarity and substitutability between crops were explored, and Pearson correlation coefficient [5] analysis was applied to optimize the planting strategy. The above model is solved by greedy algorithm [6]. This paper not only provides a scientific basis for crop cultivation in the countryside, but also provides effective decision support for realizing sustainable development. 2. Exploration of Planting Programs In this section, it is assumed that the sales volume, planting cost, and sales price of crops remain stable relative to the data in 2023, so the corresponding parameter values in 2024~2030 follow the relevant statistics in 2023. This section carries out the analysis of the optimal planting scheme in two cases, and two different treatments are carried out for the portion of crop production exceeding the expected sales volume in each of the two cases: (1) Situation 1: The portion that exceeds the expected sales volume is stagnant and all of it cannot be sold resulting in wastage. (2) Situation 2: The portion more than the expected sales volume is sold at a 50% discount from the 2023 price. 2.1. Establishment of Planting Optimization Model under Situation 1 Stable Environment Under the background of situation 1, the profit maximization is taken as the optimization objective, and constraints such as plot area constraints and non-repeatable continuous planting are set to establish the objective planning model. 2.1.1. Objective Function In the context of Case 1, the part of planting production that exceeds the expected sales volume is stagnant and cannot be sold resulting in waste. So, the objective function to maximize the annual planting profit is established as follows: (1) First, a total of 54 plots are recoded as . denotes the planting season, for a biannual crop, planting in the first season is , and planting in the second season is ; for ease of expression, a single-season crop is treated as if it were planted in the first season, so that , and crop maturity constraints restrict planting not to be done in the second season ( ). denotes the crop type. The year is denoted by , with a value of 0 for 74 in 2023, 1 for in 2024, and so on up to 2030, so . Second, denotes the area (in acres) of crop planted on plot in the th quarter of year ; denotes the acre yield (in tons/acre) of crop planted on plot ; denotes the unit cost (in dollars/acre) of crop planted on plot ; and denotes the (expected) unit selling price (in dollars/pound) of crop . In addition, since in Case 1, the excess of production over expected sales will not be sold, define as the amount of crop that will be held back in Year , which is calculated by the following formula: (2) is the expected sales volume for crop , calculated to be consistent from year to year. 2.1.2. Constraints Crop numbers 1 to 16 correspond to grain crops, of which crop number 16 is rice; crop numbers 17 to 37 correspond to vegetable crops, of which crops numbers 35, 36, and 37 are cabbage, white radish, and carrot, respectively; and crop numbers 38 to 41 correspond to edible fungi crops. (1) Plot Size Constraints In actual production, the total area of crops planted on each plot cannot exceed the area of the plot itself. Therefore, the following constraints are placed on the crop planting area on each plot: (3) In the above equation, is the area of plot . In particular, the parameter , which indicates the season, is introduced in to adapt to the fact that plots in watered land and greenhouses can be planted in two seasons a year and to improve the accuracy of the constraints. (2) Maturity Constraints Flat and dry land, terraced land and hillside land can only grow one crop season per year. Combining with the previous agreement on parameter , the constraints are carried out as follows to restrict that these three types of cultivated land cannot be planted for a second season: (4) Meanwhile, watered land can grow a single season of rice or two seasons of vegetables per year. Here, a 0-1 variable is introduced to indicate whether rice is planted on the plot in the th season of the rd year, which is 1 if it is, and 0 if it is not, and so the restriction that only a single season of rice planting can be planted on the watered land can be made as a constraint that no rice can be planted in the second season, and the formula is expressed as follows: (5) (6) In addition, combining the ideas of 0-1 variables and plot area constraints, the constraint on ripening of watered land can be expressed as follows: (7) No constraints are needed for both ordinary and intelligent greenhouses since they can grow two seasons per year, while the parameter takes the values of 1 and 2. (3) Suitable Crop Constraints Different types of plots have different types of crops suitable for planting due to soil conditions, topographic features and other reasons. Therefore, it is necessary to set constraints on crop types for each type of plot. In the following corresponds to the set of flat and dry land, terraced land, hillside land, watered land, ordinary greenhouse, and smart greenhouse plots, respectively. Flat dry land, terraced land, and hillside land: (8) Watered land: (9) (10) 75 Ordinary greenhouses: (11) Smart greenhouses: (12) (4) Non-repeatable Continuous Cropping Constraint To avoid recropping situation, a non-recropping constraint has to be introduced in the model, i.e., for all crops there is: (13) (14) (5) Legume Crop Planting Constraint First, a 0-1 variable is defined to indicate whether legumes are planted on plot in the th season of year , with a value of 1 for yes and 0 for no planting: (15) Each plot should be planted with legume crop at least once in three years, for this requirement make the constraint equation is expressed as follows: (16) (6) Minimum Planting Area Constraint The minimum planting area constraints for grain, vegetable, and edible mushroom crops are set to 13 acres, 0.3 acres, and 0.6 acres, respectively. (17) (18) (19) 2.2. Modeling of Crop Optimization in a Situation 2 Stable Environment In the context of situation 2, the portion of the crop yield that exceeds the expected sales volume needs to be treated differently from situation 1, except for this difference, the constraints remain the same as in situation 1. For this reason, we only need to modify the method of calculating the annual profit of planting based on the objective planning model of Case 1 and redefine the objective function, to construct the planting plan optimization model for situation 2. Situation 2 stipulates that if the production of a certain crop exceeds its expected sales volume, the excess will be sold at 50% of the sales price in 2023, so the objective equation is adjusted as follows: (20) That is, adding to the situation 1 objective function the revenue generated by production more than expected sales . 3. Uncertainty Analysis Changes in the expected sales volume, planting cost, mu yield and sales price of various crops are introduced in this section, and the uncertainty and fluctuation of the parameters in the optimization model need to be considered. Therefore, the corresponding parameter values from 2024 to 2030 need to be predicted based on the actual data in 2023, and this paper will complete the prediction process in segments through Monte Carlo simulation and time series regression model. 3.1. Establishment and Solution of Parameter Value Forecasting Model 3.1.1. Definition of Expected Parameters (1) Redefinition of Expected Sales Volume The expected sales volume of wheat and corn in the next few years shows a growing trend, with an average annual 76 growth rate between 5% and 10%, while the expected sales volume of other crops in each year in the future will have an increase or decrease change of about 5% relative to 2023. Therefore, the expected sales volume for crop in year needs to be redefined as follows: (21) (22) Where denotes the proportionate change in expected sales of crop in year 3, as predicted by the Monte Carlo simulation or time-series regression methods described below; still denotes the year, with a value of corresponding to 0 in 2023, 1 in 2024, and so on up to a value of 7 in 2030, with . are the expected sales of the crop in 2023, with also the total production of that crop in that year, with a definite value. (2) Definition of Expected Acreage The acreage yield of a crop tends to vary by ±10% per year, depending on climate, pests and diseases, and other factors in different years. Therefore, the expected acre yields of crop on plot in year is defined as follows: (23) Where represents the percentage change in the expected acreage yield of the crop in year relative to the previous year. (3) Definition of Expected Planting Costs Influenced by the market environment, the inputs of seeds, fertilizers and labor in agricultural production increase year by year, and the planting costs of all crops increase by about 5% per year. Therefore, the expected planting cost of crop in year on plot is defined as follows: (24) Where represents the percentage change in the expected cost of planting crop in year relative to the previous year. In this paper, the value of is set between 4.9% and 5.1%. (4) Redefinition of Expected Unit Sales Price Redefine the expected unit sales price for crop in year as follows: (25) Where represents the percentage change in the expected unit price of crop in year relative to the previous year. 3.1.2. Monte Carlo Simulation Projections for Two Years of Data 2024, 2025 Monte Carlo simulation prediction procedure: (1) Define the target variables , , etc., according to the above procedure. (2) Generate many random samples within the interval of values of each variable , , etc. (3) Perform simulation experiments using these random samples and calculate the results of the experiments, i.e., the values of the target variables. (4) Statistical analysis of the results of the simulation experiment and calculation of the average value according to the formula. (5) Use the average value as the predicted value of the target variable for prediction. (26) Where is the predicted value, is the number of random samples, and is the result from the th random sample simulation. 3.1.3. Time Series Regression Forecasting 2026~2030 Five Years of Data Time series regression model forecasting operation steps: (1) collect the real values of each parameter in 2023 and the predicted values in 2024 and 2025 as historical data. (2) Train the time series model based on the historical data to capture the trend and seasonality of the parameters. (3) Use the trained model to predict the parameter values for the next 5 years. 77 3.1.4. Modeling of Planting Optimization under Uncertainty (27) Where , , , correspond to the expected sales volume, expected acre yield, expected planting cost, and expected selling unit price of crop in year , respectively. denotes the expected stagnant sales volume of crop in year , which is defined in this model: (28) 3.2. Solution and Verification of Optimization Models Greedy algorithm is an algorithmic strategy that makes a local optimal solution in each step of selection, expecting that the global optimal solution can be obtained eventually through these local optimal choices. In solving the optimal planting solution for each plot in this section, the overall optimal planting solution is further solved. The implementation process is as follows: (1) Data initialization: keep the constraints unchanged, the objective function written to the data simulated by combining Monte Carlo algorithm and time series. (2) Calculate net profit: for each plot, using the objective function, calculate its net profit. (3) Allocating crop acreage: Ensure that, as far as possible, plots are allocated to high-yield crops and that land resources are fully utilized. (4) Substitute constraints. (5) Iteration: Repeat the above for the years 2025 to 2030. In addition, the results are plotted on a point map for verification, as shown in Figure 1, after about 200 iterations stabilized, the model is valid. Figure 1. Algorithm Iteration Process Point Plot Verification 4. Alternativity and Relevance Analysis This section further considers the substitutability and complementarity between crops, as well as the correlation between the expected sales volume and sales price and planting cost, and optimizes the original objective planning model to solve the planting scheme that maximizes the profit. 4.1. Crop Substitutability Assessment Model 4.1.1. Definition of Model Parameters For the analysis of substitutability between the two crops should be comprehensively considered the expected sales volume, mu yield, planting costs and sales price of four indicators of the degree of similarity, so the crop in 2023 ~ 2030 the average of the above four indicators as a model parameter, defined as follows: (1) Crop Average Expected Sales Volume : (29) Where is the expected sales volume of crop in year . (2) Crop Average Expected Yield Per Acre : (30) Where is the expected acreage yield on plot for crop in year ; indicates on how many plots crop was planted in year . (3) Crop Average Expected Cost of Cultivation : (31) Where is the expected cost of planting Crop on Plot in Year ; and indicates on how many plots crop was planted in year . (4) Crop Average Expected Selling Unit Price : (32) 78 Where is the expected sales volume of crop in year . 4.1.2. Evaluation Modeling Based on the above parameter definitions, the substitutability index between crop and Crop is given to be calculated as follows (33) Among them, and other equations are used to measure the degree of proximity between the two crops in terms of sales volume, mu yield, planting costs and sales unit price, all of which are negative indicators distributed on , the closer to 0 means the higher the degree of proximity; are the weights of the four proximity indicators accounted for in the assessment model. The crop substitutability index is also a negative indicator with a range of , i.e., the smaller the value, the more significant the substitutability between the two crops. 4.1.3. Determination of Index Weights For the value of , this paper selects the entropy weight method to solve, the results are shown in Table 1 below: Table 1. Indicator weights of substitutability assessment model Standard Weights Sales volume proximity 0.249 Proximity of acreage 0.261 Proximity of planting costs 0.243 Proximity of unit sales price 0.247 As can be seen from Table 1 above, the weights of the four indicators are comparable, all accounting for about 0.25, indicating that the importance of the four-parameter proximity is similar for the substitutability index between the two crops. 4.2. Models for Assessing Integrated Crop Complementarity Firstly, to consider the complementarities brought about by crop rotation and joint cropping, the crop rotation complementarity index and the joint cropping complementarity index are defined as follows: (34) (35) It is easy to know that both complementarity indices are positive indices within the range of , i.e., the larger the value, the more significant the complementarity between the two crops. Then, considering the two complementarities, the composite complementarity index between crop and crop is defined and calculated as follows: (36) Where is the weight of the two complementarity indices, respectively. 4.3. Correlation Analysis of Expected Sales Volume with Planting Cost and Sales Price This section considers the correlation between the expected sales volume of each type of crop and the planting cost and sales price, so this paper chooses to use the Pearson correlation coefficient method to analyze the above correlation. First, all crops are divided into five categories: grain (beans), grain, vegetables (beans), vegetables, edible fungi, and the data of expected sales volume, planting cost, and sales price of each category of crops are organized and their mean values are sought. And then the correlation analysis of the above three indicators for each category of crops is carried out separately. (37) The output correlation analysis results are partially shown in Figure 2 below. From the results: in the correlation between sales volume and sales price, the correlation of edible fungus crops is more significant, indicating that its sales price has a certain impact on sales volume; the correlation of this item is low for two crops of grain (beans) and vegetables (beans). The correlation between sales volume and planting cost was not significant for all five crops. 5. Conclusion In this study, crop planting strategies were optimized for a village based on Monte Carlo simulation and greedy algorithm. First, a practical planting plan is proposed to 79 maximize economic benefits by establishing an objective planning model that combines different scenarios of stable conditions and market fluctuations. The study shows that the optimization model effectively allocates cropland resources under stable conditions in response to stagnant sales and discounts that exceed the expected sales volume. Figure 2. Heat map of correlation coefficient Secondly, under the consideration of market fluctuation, Monte Carlo simulation and time series regression analysis were utilized to predict the sales volume and mu yield in the next few years, which provided a scientific basis for the dynamic adjustment of planting strategies. The planting scheme under uncertain conditions was further optimized through the application of greedy algorithm. In addition, the study explored the complementarity and substitutability between crops, and analyzed the relationship between sales volume, price and cost using the Pearson correlation coefficient method, which provided data support for the development of better planting strategies. References [1] Zhang Juankang. Discussion on scientific planting and pest control technology of crops[J]. Hebei Agriculture,2024, (11): 74-75. [2] LI Mo, Guo Ping. Research on multi-objective modeling of planting structure based on two-layer fractional planning[J]. Journal of Agricultural Machinery,2014,45(09):168-174+130. [3] Deng Shuo. Practical exploration of Monte Carlo method in cultivating students' computational thinking[J]. China Modern Education Equipment,2024, (16):45-48. DOI: 10. 13492/ j. cnki. cmee. 2024.16.014. [4] Yang Yue Tao. Time series modeling research on the impact of minimum purchase price on grain planting area[J]. Xueyuan, 2016, (36):123-125+141. [5] Zhao Yuanshang, Lin Weifang. Research on typical scenarios based on Pearson correlation coefficient fusion density peak and entropy weight method[J]. China Electric Power, 2023, 56 (05): 193-202. [6] Meng Xiangchao. Research on production decision-making of facility agriculture production units based on greedy algorithm [D]. Nanjing Agricultural University,2016.