Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 6, No. 2, 2023 63 Optimization of Food Distribution System Based on Dynamic Planning Model Xunyang Li 1, Jin Chen 2, * 1 School of Finance, Anhui University of Finance and Economics, Bengbu, Anhui, China 2 School of Accountancy, Anhui University of Finance and Economics, Bengbu, Anhui, China * Corresponding author: Jin Chen (Email: 1730607338@qq.com) Abstract: Based on the data of per capita annual income, food production per hectare, and per capita consumption of consumers in different countries, this paper first establishes a dynamic planning model, starting from three indicators, namely, regional transportation time, purchasing capacity and actual demand, and using MATLAB, establishes a visual image to derive the changes of satisfaction, profitability, environment, and efficiency in the next ten years. In order to determine the priority of the four indicators, a hierarchical analysis model is established on the basis of the dynamic planning model to derive the calculated weights of each indicator. In order to verify the adaptability of the model, the model is applied to the developed country Britain and the developing country China, respectively, and the dynamic planning model is confirmed again according to the information returned by the visualization image, which illustrates the scalability of the model to the food distribution system in different countries and regions. Keywords: Food Distribution System; Dynamic Programming Model; Hierarchical Analysis Approach. 1. Introduction The instability and insecurity of the global food system and the inability of the food supply to meet the needs of individual countries and regions are realities [1], and 821 million people worldwide suffer from hunger. The current food distribution system also causes greenhouse gas emissions, fresh water consumption and other problems. This paper establishes a dynamic planning model and hierarchical analysis method to optimize the food distribution system, and creates a sustainable and efficient food distribution system of practical significance. 2. Description of Research Hypotheses and Variables 2.1. Research Hypothesis The study in this paper is based on the following assumptions: (1) The data obtained are perfectly correct. (2) Only disasters caused by pollution resulting from food production are considered. (3) People's subjective emotions do not affect the quantity and rate of food production. For example, there will be no strikes, lockouts, etc. (4) The impact of the environment on food production and transportation production can be accurately quantified. (5) The population of each region remains constant, as does the demand for food. (6) All food has been distributed. (7) Relationships between elements in the same level of the hierarchical analysis are equal and independent of each other. (8) The weights in a hierarchical analysis can be measured in a certain way and can be relatively accurate. 2.2. Description of Variables The variables applied in this study are as follows: total amount of food (M), total number of districts (N), length of time (T), factors of sustainability (β), satisfaction level (μ), operational efficiency (e), net profit (W), transportation time for each district (t0), sum of t0 (t), purchasing capacity (c), actual demand for each district (n), factors of food transportation (α), food allocated to each district quantity (x), transportation cost per unit of time (θ), environmental impact of production methods (k), impact of production methods on production (p), and cost per unit of food (m). 3. Dynamic Planning Models 3.1. Establishment of Dynamic Programming Model Dynamic programming is a branch of mathematical planning and an important branch of operations research. In 1951, state mathematician R. Bellman and others proposed optimization principles for solving multi-stage decision problems. Since then, dynamic programming was created. So far, dynamic programming has been widely used in the fields of economic management, enterprise management, engineering technology and optimization and control, and has achieved remarkable results [2]. We need to create a model of the food system to reimagine and reprioritize our food system. Create this system requires considering the composition of the current food system in context. A review of the literature and data shows that the current food system can be considered to be composed of the main subsystems of food production, processing, distribution, and consumption and other subsidiary subsystems [3], so the corresponding food system model can be established through this. First, we consider the point in time. Suppose there are M units of food that need to be allocated to N regions, and for each region, allocating i units of food, there is a corresponding benefit function F(i) that corresponds to it respectively. By adjusting the distribution scheme, the optimal distribution can be found and the maximum benefit can be obtained. Based on the background characteristics of the food distribution system, we find that the factors to be considered are environmental factors, efficiency, profitability and distribution fairness. For these factors, we can supplement the modeling framework 64 established above. We assume that the environmental factor is β, which corresponds to the following equation: β β k (1) Where, β0 is the initial environmental factor with a value of 1; k is the environmental impact caused by current food production, which ranges from -0.1 to 0.1. T is the year. For the fairness of distribution, we use the sum of satisfaction of each region as an evaluation criterion. We assume that its sign is μ. For any region, we assume that it has three attributes, i.e., distribution time t0, food demand n, and real purchasing power c. In addition, we assume that the amount of food allocated to each region is x, which is given by the following equation: . (2) Where, t0 is based on 1, i.e., it can be delivered in one day; and the actual purchasing capacity c is also based on 1, where 1 is just the ability to purchase, and greater than 1 indicates that people are willing to consume more money to spend on food. Taking reality into account, it is easy to see that for a region, the more food that is delivered, the higher the purchasing power, the shorter the delivery time, and the higher the corresponding satisfaction. Therefore, we put x in the numerator divided by n, which is used to reflect whether the delivered food meets the demand of the region; we put t in the denominator, where the shorter the time, the higher the satisfaction; and finally multiply it by c to get the formula. μ is the satisfaction of a certain region. In order to get the satisfaction of all regions, we need a new formula as follows: μ ∑ (3) It is worth noting that the distribution time for each location is not static, it is related to the magnitude of the transportation factor α and the environmental factor β, which is given by the following equation: t (4) The base value of α is also assumed to be 1. We set the weights of transportation and environmental factors on delivery time to 0.5. When both α and β are 1, t equals t0. Next, we consider the efficiency of food distribution. In a broad sense, efficiency is the effect divided by the time. In our model, efficiency can be expressed as the total annual production divided by the distribution time at each location multiplied by the amount of food distributed. We use the symbol e for this. The formula is as follows: ∑ (5) Where, ti denotes the actual distribution time in each region, xi denotes the amount of food distributed in each region. Finally, analyze the profit factor. Common sense suggests that the magnitude of net profit is related to expenses and benefits. The formula expressed in terms of W is as follows: W x. c x.m θ. t (6) Where, θ is the transportation cost per unit of time, which is assumed to be a constant and multiplied by the transportation time as the total transportation cost, and m is the production cost per unit of food, which includes the food raw materials and the labor required for food processing. w is also the net profit of each region, which needs to be summed up to the total net profit. In explaining environmental factors, we mentioned that the food system can influence the environment. However, the environment in turn can affect the food system. In equation (4), environmental factors affect the distribution time of food. Applied to reality, disasters such as mudslides and acid rain that may be caused by food production can affect transportation. In addition, the environment also affects food production. For example, bad weather can affect rice growth and reduce production. From this, we establish a formula for the amount of production M on the environment: M 1 (7) Where, p is the impact of innovations in production methods, with base 0. It is assumed that technological innovations in production are not necessarily linked to the environment. As p increases, β may not decrease; M0 is the base production. This equation implies that, over time, annual food production varies with the impact of innovations in production methods and changes in environmental factors. After the modeling framework is built, there is a specific problem; food distribution is not a simple allocation of resources; people in each region have a minimum standard of food needs, which cannot be based on evaluation indicators such as overall satisfaction and profitability. Distribute food to specific regions. Similarly, we cannot allocate most of the food to that region, because a large food allocation to a particular region is associated with a high increase in satisfaction. Therefore, we added upper and lower limits to the amount of food to be allocated to each region, with the minimum not to be less than half of the food demand in a particular region and the maximum not to be higher than 1.5 times of the food demand in a particular region, and thus the model was initially established. The evaluation indicators are summarized in a table, as shown in Table 1: Table 1. Summary of evaluation indicators Name (of a thing) Formulas Note Level of satisfaction (μ) 2 1 1 M=∑ Profit (W) net profit Environment (β) Changing with the passage of time Efficiency (e) 1 ∑ Once the model is established, it can be used to solve practical problems. For governments around the world, the only factors that should be considered in the food system are, for the time being, the impact on the environment, the satisfaction of the people and their own profitability, which we believe are the only three aspects to be taken into account. For the optimization of fairness and sustainability, the distribution scheme of the masses and the environmental factors are optimized in the model we built. In terms of practical factors, food is the basic condition for human survival. If the distribution is more equitable, people will not have to go hungry, then the credibility of the government will increase and the people will be happier. That is, satisfaction as an evaluation indicator increases; when sustainability is 65 combined with reality, it is not difficult to find that the external environment affects all aspects of the food system, including food production and food transportation [4]. As far as these issues are concerned, dynamic programming algorithms can be better. Combining the model and analyzing the actual situation, the problem is simplified to the following form: M units of food are allocated to N regions, and each region is allocated at least half of the current demand, but not more than 1.5 times. It is assumed that the satisfaction of each region is mainly related to the amount of food allocated, and how the allocation of food is solved to find the optimal solution. For this multi-stage decision process to find the optimal decision problem, we can first understand the distribution of N regions as N stages, each stage allocates a certain amount of food to a region. The model is described as follows [5]: (1) The stage variable d represents region d, d=1,2,3,.... .N. (2) The decision variable ud represents the food provided to region d. (3) The state variable can be used to allocate food to each zone in the current and future phases, sd=∑ = 1,2,3,...N. (4) The indicator function for stage d is the satisfaction of region d, i.e., equation (2). Suppose V(sd ,d) is the distribution of surplus food sd to the remaining d,d+1,d+2,... ,N regions to obtain the maximum profit, and suppose L(ud ,d) denotes the satisfaction of the region after receiving d units of food ud . Based on the above model, we can use the inverse order method to recursively solve. The basic equation is: , , 1, 1 , 1, … ,2,1 (8) , , (9) 3.2. Solving Dynamic Programming Models First, in order to test the validity of this model, we designed a set of test data: M 30, N 4, T 10 k 0.01, p 0.01,m 0.3 α 1, 1, θ 1.2 (10) The three attributes of the four regions are obtained as shown in the table below: Table 2. Test data (regional attributes) Region Transportation time/t 0 Purchasing power Actual requirement A 1.5 0.8 10 B 1.1 1 8 C 0.8 1 7 D 0.7 1.1 6 After programming and plotting, we get the following figure: Next we adjust k to 0.01, at which point the graph drawn is the exact opposite of it. Analyzing the causal relationship between the variables, we can get the following conclusions: when satisfaction with food distribution increases, fairness increases and the profitability of the food system increases; if sustainable development, i.e., the improvement of factors and environmental factors, the efficiency of food distribution increases, which ultimately leads to an increase in efficiency and a higher level of satisfaction of the people. Figure 1. Chart of changes in satisfaction over the next ten years Figure 2. Change in profitability over the next ten years Figure 3. Map of environmental changes over the next decade Figure 4. Chart of efficiency changes over the next decade The difference between a system optimized in terms of equity and sustainable development and the current system lies in the different priorities of the distribution schemes and systems, which can have a direct impact on people's satisfaction. Most of the food distribution in today's world is 66 controlled by businessmen, who are profit-oriented, so they mostly prioritize profit and efficiency, and are less concerned with people's satisfaction and the environment. The environment is mainly represented in the model. The optimization of sustainable development will improve the environmental factors, which will directly affect the production and transportation of food and indirectly affect people's satisfaction, profitability and efficiency, thus improving them all. 4. Hierarchical Model of the Food Distribution System 4.1. Establishment of the Model The Analytic Hierarchy Process (AHP) is an operations research theory that solves a range of problems related to decision making. The method divides the problem to be solved into three levels, namely the objective level, the indicator level and the program level. Next, qualitative and quantitative analyses are carried out on this basis [6] The model is constructed as shown in Figure 5: Figure 5. Hierarchical model of the food distribution system After constructing the hierarchical model, we need to compare the factors in the middle tier with the scenarios in the lowest tier. We can use aij to denote the comparison results of factor i and factor j relative to the factors in the previous tier. aij is a quantitative value that indicates the relative importance, and the quantitative value can be expressed in a nine-foot scale. Table 3. Nine-foot scale method Comparison of factor i and factor j quantitative value equally important 1 It's kind of important. 3 critical 5 very important 7 extremely important 9 The middle value of two adjacent judgments 2,4,6,8 in contrast Comparison of the importance of factor i and factor j Aij = 1/Aij Using the nine-scale method, a judgment matrix of the following form can be constructed: ⋯ ⋯ ⋮ ⋮ ⋱ ⋮ ⋯ (11) When constructing a judgment matrix according to the nine-scale method, the five conditions listed in the following equation must also be satisfied to maintain the consistency of the matrix, and the elements of the matrix are greater than 0, while the main diagonal is 1 There should be multiple relationships between each column and each row. 0 1 (12) 4.2. Solving the Model By reviewing the data on the relevant factors in recent years, we can use the information in the following four tables to roughly represent the data in the judgment matrix that needs to be constructed: Table 4. Judgment Matrix for Target and Indexing Layers Optimal Food Distribution System (A) level of satisfaction serve (in some capacity) net profit level of satisfaction 1 2 5 serve (in some capacity) 1/2 1 2 net profit 1/5 1/2 1 Table 5. Satisfaction and Program Level Judgment Matrix Satisfaction (C1) Best satisfaction Optimal efficiency Optimal profitability Best satisfaction 1 7 2 Optimal efficiency 1/7 1 1/3 Optimal profitability 1/2 3 1 Table 6. Judgment Matrix for Efficiency and Program Levels Validity (C2) Best satisfaction Optimal efficiency Optimal profitability Best satisfaction 1 1/6 1 Optimal efficiency 6 1 6 Optimal profitability 1 1/6 1 Four judgment matrices can be obtained using the matrices in the four tables above: 67 Table 7. Net Profit and Program Level Judgment Matrix Net profit (C3) Best satisfaction Optimal efficiency Optimal profitability Best satisfaction 1 1 1/2 Optimal efficiency 1 1 1/3 Optimal profitability 2 3 1 1 2 5 1 2 1 2 1 5 1 2 1 1 1 7 2 1 7 1 1 3 1 2 3 1 2 1 1 6 1 6 1 6 1 1 6 1 3 1 1 1 2 1 1 1 3 2 3 1 Initial processing of the judgment matrix using the eig function in Matlab yields the eigenvectors of the judgment matrix and the column vectors consisting of the eigenvalues of the matrix to form a diagonal matrix, and the eigenvectors of the largest eigenvalues are normalized. (13) Normalizing the eigenvectors according to this formula, i.e., summing a column vector by rows and then dividing that vector by the sum of each row, achieves the normalization of the eigenvector with the largest eigenvalue. We end up with a column vector between 0 and 1 as follows: , , ⋯ , (14) Find the maximum eigenvalue, and since they are all column vectors after multiplication, the expression can be expressed as: (15) The maximum eigenvalue of the matrix can be found according to the above equation. The main idea is to use the judgment matrix A and the normalized maximum eigenvalue corresponding to the eigenvector w for matrix multiplication, and then the result and w for bitwise division, at this time, a vector will be obtained, which the data on the vector to sum the average of the maximum eigenvalue of the matrix can be obtained. Consistency test for judgment matrices. The constructed matrix satisfies the strict equation (12), then it is a consistency matrix, consistency matrix does not need to perform consistency test, otherwise it is a non-consistency matrix, for consistency matrix needs to be tested to verify the correctness of the results. Consistency index CI: (16) The CI value is calculated from the maximum eigenvalue λmax and the order n of the judgment matrix. When CI=0, it means that the judgment matrix is perfectly consistent. the larger the value of CI, the worse the consistency of the judgment matrix. Consistency test RI. The value of RI becomes the average random consistency index and its value can be obtained by checking the following table [7]: Consistency ratio CR: (17) Table 8. Mean random consistency index RI sequences 1 2 3 4 5 6 7 RI value 0 0 0.52 0.89 1.12 1.26 1.36 sequences 8 9 10 11 12 13 14 RI value 1.41 1.46 0.94 0.52 1.54 1.56 1.58 The results of the CR test are as follows: 0.1 0.1 (18) When, CR=0, we consider that the judgment matrix has full consistency; when CR<0.1, the judgment matrix can be considered to have satisfactory consistency; when CR≥0.1, the judgment matrix needs to be adjusted to modify or discard elements. Finally, the combined weight of the unit on the target layer is calculated and the program is evaluated. Assume that the weight vectors of the target and indicator layers are: , … (19) Assume that the weight vectors for the program and indicator layers are: , , … (20) The final weights of the programs can be expressed as follows: (21) By calculating the above process, we can get the maximum eigenvalue and its corresponding eigenvector, value CI, value RI. Table 9. Results of the evaluation of relevant parameters variant values 0.5954 0.2764 0.1283 0.6153 0.0925 0.2922 0.1250 0.7500 0.1250 0.2402 0.2098 0.5499 3.0055 3.0026 3.0000 3.0183 The Value of CI 0.0028 0.0013 0 0.0091 CR value 0.0053 0.0025 0 0.0176 From this, the weights of the three options at the program level can be calculated: 0.4294 0.2977 0.2715 (22) Visualize it using MATLAB: Figure 6. AHP-based solution analysis 68 5. Application of the Models We support our conclusions by applying the models developed to a developed country and a developing country respectively. The developed country chosen is the United Kingdom and the developing country is China, and six cities in each are chosen as test areas. For the developing country, we ranked the transportation capacity of its six cities, their actual demand based on their total population, and their purchasing power based on their annual per capita income, resulting in the table below: Table 10. Data for developing countries City name t 0 C n A 0.9 1.5 6 B 0.9 1.4 5 C 0.7 1.2 14 D 0.8 1.15 4 E 0.75 1.1 28 F 0.75 1 20 For China, production and environment are synchronized in conjunction with current Chinese policies, then set the corresponding k and p and use MATLAB to calculate its satisfaction, efficiency, environment and profitability for the next ten years. The results are shown in Figure7: Figure 7. Line graph of changes in evaluation indicators for developing countries over the next decade The overall trend of the image is consistent with the test data. When environmental factors and factors of production are increased simultaneously, all indicators improve, but focusing on environmental improvements reduces profitability and satisfaction. This supports the conclusions we reached earlier. For developed countries, the six cities are also ranked in terms of their transportation capacity, with actual demand based on total population and purchasing power based on annual per capita income. The table is shown below: Table 11. Developed country data City name t 0 C n A 0.7 1.2 51 B 0.75 0.96 12 C 0.8 0.96 13 D 0.9 1.08 6 E 1 0.7 4 F 1.2 0.65 3 Considering the real situation in the UK, we set p=0.005, k=--0.0005 and calculate the change over the next ten years. The MATLAB image is shown below: Figure 8. Line graph of changes in evaluation indicators in developed countries over the next decade In this graph, we find that although k < 0, k is not very small. Profitability, efficiency and satisfaction are still rising for a short period of time, and then we stretch the time and find that it's 19 years old. Profitability starts to fall, and for almost 100 years, efficiency and satisfaction are down from the first year, as shown in the graph below: Figure 9. Line graph of changes in evaluation indicators in developed countries over the next 100 years It is not difficult to conclude that sacrificing the environment for productivity can indeed be profitable in the short term, but in the long term it will not only have an indelible impact on the environment, but will also reduce final profits and allocative efficiency. Crowd satisfaction will also decline. Therefore, this practice is not desirable. 69 References [1] TANG Lixia, ZHAO Wenjie, LI Xiaoyun. Deep logic analysis of global food security evaluation system [J]. Journal of Huazhong Agricultural University (Social Science Edition), 2020(5): 151-159, 175-176. [2] Guo H, Wang LG. Review and reference of foreign food system research[J]. Journal of Natural Resources, 2018, 33(06): 992-1002. [3] Robert S. Lawrence. Addressing the challenges of food safety and sustainable food systems (in English) [A]. Beijing Forum. Beijing Forum (2006) Civilization Harmony and Co-Prosperity - The Civilization Progress of Humanistic Thought: Papers or Abstracts of the Population Sub-Forum on "Population and Regional Development" (below)[C]. Beijing Forum: Beijing Forum Office, Peking University, 2006: 11. [4] Dong Fei. Dynamic planning method for resource allocation problem[J]. Journal of Cary College, 2015, 33(03): 19-21. [5] Wu QF. Dynamic planning method for resource allocation problem[J]. Journal of Huaibei Coal Teachers College (Natural Science Edition), 2008(02): 32-34. [6] Shu Xiaozhen. Application of Improved Hierarchical Analysis in Travel Mode Selection[J]. Journal of Mianyang Normal College, 2021, 40(02): 6-9. [7] Wang Y, Wang Daoping, Liu Guangli. Research and realization of comprehensive grain price analysis system[J]. China Management Information Technology, 2011, 14(22): 37-41.