Problem solving for emergency dispatch and structural optimization of parcels in the e-commerce logistics network [detailed explanation of thought data code]

Question C: E-commerce logistics network package emergency dispatch and structural optimization

(Share on CSDN as soon as the competition questions come out, at the bottom of the article)
The latest progress is in the card at the bottom of the article , add to get the idea data code paper: 2023 13th MathorCup Exchange

The e-commerce logistics network is composed of logistics sites (receiving warehouses, sorting centers, sales departments, etc.) and transportation lines between logistics sites, as shown in Figure 1. Affected by holidays and promotional activities such as "Double Eleven" and "618", the order volume of e-commerce users will fluctuate significantly, and when emergencies such as epidemics and earthquakes lead to temporary or permanent suspension of logistics venues, the handling The packages will be urgently diverted to other logistics sites. These factors will affect the number of packages transported by each route and the number of packages processed by each logistics site.

image-20230413094010133

If the number of packages (hereinafter referred to as cargo volume) in each logistics site and route can be predicted, managers will be able to arrange transportation, sorting and other plans in advance, thereby reducing operating costs and improving operational efficiency. In particular, when some sites are temporarily or permanently out of service, designing a logistics network adjustment plan based on the forecast results and the processing capacity of each logistics site and the transportation capacity of the line will greatly reduce the impact of the outage of the logistics site on the logistics network. Ensure the normal operation of the logistics network.

Attachment 1 gives data on the volume of goods transferred between different logistics venues in a certain logistics network from 2021-01-01 to 2022-12-31. The logistics network has 81 logistics venues and 1049 routes. The lines are directional, for example, the line DC1→DC2 and the line DC2→DC1 are considered as two lines. It is assumed that the processing capacity of each logistics site and the upper limit of the transportation capacity of each route are the maximum historical cargo volume. Based on the above background, ask your team to complete the following questions:

problem solving ideas

Question 1: Establish a forecasting model for the cargo volume of the line, predict the daily cargo volume of each line from 2023-01-01 to 2023-01-31, and give the lines DC14→DC10, DC20→DC35 in the submitted paper , DC25→DC62 prediction results.

Establish a prediction model for the cargo volume of the line, predict the daily cargo volume of each line from 2023-01-01 to 2023-01-31, and give the lines DC14→DC10, DC20→DC35, DC25→ in the submitted paper Prediction results for DC62.

The steps to establish a forecasting model for line cargo volume are as follows:

  1. Data preprocessing: For each route and each logistics site, calculate the average value, variance and other statistics of its historical cargo volume, and fill in missing values.
  2. Feature engineering: According to the time series data of historical cargo volume, relevant features are extracted, such as trend, periodicity, holiday influence, etc.
  3. Model selection: Choose a model suitable for time series forecasting, such as ARIMA, SARIMA, Prophet, etc.
  4. Model Training: Train the model using historical data and tune the model based on its performance.
  5. Model prediction: For each line and each logistics site, use the trained model to make predictions, and calculate the confidence interval of the prediction results.

data preprocessing

It can be seen that some of the mathematics in Appendix 1 are missing or zero. In order to deal with missing data, typical methods include interpolation and deletion . The interpolation method uses a substitute value to make up for missing values, while the deletion method directly ignores missing values.

Note: Because of the large amount of data in this question, we strongly recommend using Python for data processing (of course Matlab is also available)

import pandas as pd
 # python的第三方库
 data = pd.read_csv(data_file)
 # 修改为文件目录
 inputs = data.iloc[:]
 # 使用平均进行插值(均是数值缺失)
 inputs = inputs.fillna(inputs.mean())
 print(inputs)
 # 也可以删除缺失行
 n, m = data.shape
 for i in range(m):
     for j in range(n):
         if pd.isnull(data.iloc[j][i]):
             data.drop(j)
             break

Convert data to stationary data

Then organize the volume data in Annex 1 according to the daily form of each line, and convert the time series data into stationary data for time series modeling. code show as below

import pandas as pd
 import numpy as np
 from statsmodels.tsa.stattools import adfuller
 # 读入数据
 data = pd.read_csv('附件1.csv')
 # 将数据按照每条线路每天的形式进行整理
 data = data.pivot_table(index='日期', columns=['起点', '终点'], values='货量')
 # 将数据转换为 stationary 数据
 def make_stationary(ts):
     rolmean = ts.rolling(window=7).mean() # 滑动平均
     rolstd = ts.rolling(window=7).std() # 滑动标准差
     # 计算差分序列
     ts_diff = ts - rolmean
     ts_diff.dropna(inplace=True)
     # 检查差分序列是否 stationary
     dftest = adfuller(ts_diff, autolag='AIC')
     print('ADF检验统计量: ', dftest[0])
     print('p-value: ', dftest[1])
     print('滞后阶数: ', dftest[2])
     print('观察数: ', dftest[3])
     print('拒绝原假设的最小 p-value: ', dftest[4]['1%'])
     return ts_diff
 data_diff = make_stationary(data['DC3']['DC10'])  # 以 DC3→DC10 为例进行差分操作

Question 2: If the logistics site DC5 starts to shut down on 2023-01-01, please establish a mathematical model based on the prediction in Question 1, and allocate the cargo volume of the relevant lines of DC5 to other lines so that all packages can flow as normally as possible, and Make the number of lines whose volume changes before and after the shutdown of DC5 as few as possible, and keep the workload of each line as balanced as possible. If there are some days and part of the volume of goods that are not normally circulated, your diversion plan should also make the daily cumulative total of parcels that fail to circulate normally during the period from 2023-01-01 to 2023-01-31 as small as possible. In case of normal circulation, please give the number of lines whose cargo volume changes due to the shutdown of DC5 and the network load situation; when normal circulation is not possible, please give the number of lines whose cargo volume changes due to the shutdown of DC5, and the cargo that cannot be circulated normally. volume and network load.

To be perfected

Question 3: In Question 2, if the closed logistics site is DC9, and dynamic adjustments to the logistics network structure are allowed (daily adjustments can be made), the adjustment measures are closing or opening new routes, excluding new logistics sites , assuming that the upper limit of the transport capacity of the newly opened line is the maximum value of the transport capacity of the existing line. Please allocate the cargo volume of DC9-related lines to other lines, so that all packages can flow as normal as possible, and make the number of lines with changes in cargo volume before and after DC9 shut down as small as possible, and keep the workload of each line as balanced as possible. If there is a transfer plan that does not meet the requirements on some dates, your diversion plan should also make the cumulative daily total of parcels that cannot be transferred normally during the period from 2023-01-01 to 2023-01-31 as small as possible. In case of normal circulation, please give the number of lines whose cargo volume changes due to the shutdown of DC9 and the network load situation; when normal circulation is not possible, please give the number of lines whose cargo volume has changed due to the shutdown of DC9, and the cargo that cannot be circulated normally. traffic and network load; at the same time, please give the daily line increase or decrease.

To be perfected

Question 4: According to Annex 1, please evaluate the importance of different logistics sites and routes in the network; in order to improve network performance, if you plan to add new logistics sites and routes, combined with the prediction results of Question 1, discuss and analyze the new logistics sites Which new lines should be added between the existing logistics sites, how should the processing capacity of the new logistics sites and the transportation capacity of the new lines be set? Considering the randomness of the prediction results, please further explore the robustness of the network you built.

To be perfected

bottom

Guess you like

Origin blog.csdn.net/weixin_57198749/article/details/130123113